/* ==========================================================================
   Wan Amirul Syazwan: portfolio styles
   Colours are defined once as tokens below; dark mode just swaps them.
   ========================================================================== */

:root {
  /* light theme */
  --bg: #f7f8f6;
  --bg-tint: #eef3f2;
  --surface: #ffffff;
  --ink: #10222c;          /* main text */
  --ink-2: #3d525c;        /* secondary text */
  --ink-3: #5f727b;        /* muted (meets 4.5:1 on --bg) */
  --line: #d9e2e1;
  --navy: #0b2a3a;
  --teal: #0e6b70;         /* primary brand */
  --teal-soft: #dcecea;
  --accent: #c2571f;       /* single warm accent */
  --accent-soft: #fbe9de;
  --focus: #c2571f;
  --shadow: 0 1px 2px rgba(11, 42, 58, .06), 0 6px 24px rgba(11, 42, 58, .06);
  --motif: #0e6b70;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1820;
    --bg-tint: #0e2029;
    --surface: #122630;
    --ink: #e4eef0;
    --ink-2: #b4c6cb;
    --ink-3: #8fa5ac;
    --line: #22404c;
    --navy: #e4eef0;
    --teal: #5cc2bd;
    --teal-soft: #143a3e;
    --accent: #f0955d;
    --accent-soft: #3a2518;
    --focus: #f0955d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
    --motif: #5cc2bd;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1820;
  --bg-tint: #0e2029;
  --surface: #122630;
  --ink: #e4eef0;
  --ink-2: #b4c6cb;
  --ink-3: #8fa5ac;
  --line: #22404c;
  --navy: #e4eef0;
  --teal: #5cc2bd;
  --teal-soft: #143a3e;
  --accent: #f0955d;
  --accent-soft: #3a2518;
  --focus: #f0955d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
  --motif: #5cc2bd;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--teal); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-serif); color: var(--navy); line-height: 1.15; margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
i, em { font-style: italic; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
.label { font: 500 .75rem/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 .5rem; }

/* ---------- icons & buttons ---------- */
svg[viewBox="0 0 24 24"] { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.fill { fill: currentColor; stroke: none; }

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: 44px; padding: .6rem 1.1rem;
  border-radius: 999px; border: 1px solid transparent;
  font: 500 .95rem/1.2 var(--font-sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--teal); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #06171d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #06171d; } }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-lg { min-height: 52px; padding: .8rem 1.4rem; font-size: 1.02rem; }
.btn-note { font: 500 .7rem/1 var(--font-mono); opacity: .75; letter-spacing: .05em; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none; transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--teal); color: var(--teal); }

.chip-btn {
  font: 500 .8rem/1 var(--font-sans); color: var(--ink-2);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  min-height: 36px; padding: .45rem .85rem; cursor: pointer;
}
.chip-btn:hover { border-color: var(--teal); color: var(--teal); }
.chip-btn[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--surface); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 1rem; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); margin-right: auto; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: var(--navy); color: var(--bg); font: 600 .9rem/1 var(--font-serif); letter-spacing: .02em;
}
.brand-name { font: 600 1rem/1.2 var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-nav ul { display: flex; gap: .15rem; }
.site-nav a {
  display: block; padding: .5rem .6rem; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: .92rem; font-weight: 500;
}
.site-nav a:hover { color: var(--teal); background: var(--teal-soft); }
.site-nav a.active { color: var(--teal); }
.header-actions { display: flex; gap: .5rem; }
.nav-toggle { display: none; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

@media (max-width: 1060px) {
  .nav-toggle { display: inline-grid; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: .5rem var(--gutter) 1rem; }
  .site-nav a { padding: .8rem .5rem; font-size: 1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav li:last-child a { border-bottom: 0; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 9vw, 112px) 0 clamp(56px, 9vw, 104px); }
.hero-motif { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--motif); opacity: .5; pointer-events: none; max-width: none; }
.hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.eyebrow { font: 500 .8rem/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: .09em; color: var(--teal); margin-bottom: 1.1rem; }
.hero h1 { font-size: clamp(2.5rem, 6.2vw, 4.4rem); font-weight: 700; letter-spacing: -.02em; margin-bottom: 1.1rem; }
.tagline { font: 400 clamp(1.15rem, 2.2vw, 1.45rem)/1.5 var(--font-serif); color: var(--ink-2); max-width: 34ch; margin-bottom: 1.2rem; }
.hero-meta { display: flex; align-items: center; gap: .4rem; color: var(--ink-3); font-size: .95rem; margin-bottom: 2rem; }
.hero-meta svg { width: 18px; height: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.hero-photo { margin: 0; justify-self: center; position: relative; width: min(100%, 320px); }
.hero-photo::before {
  content: ""; position: absolute; inset: -14px -14px 14px 14px; border-radius: 28px;
  border: 1.5px solid var(--teal); opacity: .45;
}
.hero-photo img { position: relative; width: 100%; height: auto; aspect-ratio: 800 / 907; object-fit: cover; border-radius: 22px; box-shadow: var(--shadow); background: var(--surface); }

@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-motif { opacity: .22; }
  .hero-photo { order: -1; width: 148px; justify-self: start; }
  .hero-photo::before { inset: -8px -8px 8px 8px; border-radius: 22px; }
  .hero-photo img { border-radius: 18px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
}

.noscript-note { padding: 1rem var(--gutter); background: var(--accent-soft); border-radius: var(--radius-sm); margin-bottom: 1rem; }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-tint { background: var(--bg-tint); }
.section-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 44px); }
.section-kicker { font: 500 .8rem/1 var(--font-mono); color: var(--accent); margin: 0; letter-spacing: .06em; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); }
.section-link { margin-left: auto; font-weight: 500; font-size: .95rem; text-decoration: none; }
.sub-h { font-size: 1.35rem; margin: clamp(40px, 6vw, 64px) 0 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 56px); align-items: start; }
.bio p { font-size: clamp(1.05rem, 1.6vw, 1.18rem); line-height: 1.75; color: var(--ink); max-width: 62ch; }
.bio p:first-child::first-letter { font-family: var(--font-serif); }
.glance { padding: 1.4rem 1.5rem; }
.glance dl { margin: 0; display: grid; gap: 1rem; }
.glance dt { font: 500 .72rem/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: .2rem; }
.glance dd { margin: 0; font-size: .98rem; color: var(--ink); line-height: 1.5; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- timelines (education + experience) ---------- */
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 2.1rem 2.25rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: .45rem; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--teal);
}
.section-tint .tl-item::before { background: var(--bg-tint); }
.tl-item.current::before { background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.tl-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem 1.25rem; align-items: baseline; }
.tl-title { font: 600 1.08rem/1.4 var(--font-sans); color: var(--ink); margin: 0; }
.tl-dates { font: 500 .8rem/1.4 var(--font-mono); color: var(--ink-3); white-space: nowrap; }
.tl-org { color: var(--ink-2); margin: .15rem 0 0; font-size: .98rem; }
.tl-note { display: inline-block; margin-top: .4rem; font: 500 .78rem/1 var(--font-mono); color: var(--teal); background: var(--teal-soft); padding: .3rem .5rem; border-radius: 6px; }
.tl-points { margin-top: .7rem; display: grid; gap: .35rem; max-width: 70ch; }
.tl-points li { position: relative; padding-left: 1.1rem; color: var(--ink-2); font-size: .98rem; }
.tl-points li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); opacity: .8; }
.timeline-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; }
.timeline-compact::before { display: none; }
.timeline-compact .tl-item { padding-bottom: 1.6rem; }
@media (max-width: 640px) {
  .timeline-compact { grid-template-columns: 1fr; }
  .tl-head { grid-template-columns: 1fr; }
  .tl-dates { order: -1; }
}

/* ---------- research ---------- */
.thesis { max-width: 900px; margin-bottom: clamp(32px, 5vw, 48px); padding-left: 1.25rem; border-left: 3px solid var(--accent); }
.thesis-title { font: 500 clamp(1.15rem, 2vw, 1.4rem)/1.5 var(--font-serif); color: var(--navy); margin: 0; }

.pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; counter-reset: step; margin-bottom: clamp(32px, 5vw, 48px); }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.2rem 1.4rem; box-shadow: var(--shadow); }
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 2.2rem; right: -1rem; width: 1rem; height: 2px; background: var(--teal);
}
.step:not(:last-child)::before {
  content: ""; position: absolute; top: calc(2.2rem - 4px); right: calc(-1rem - 1px); width: 0; height: 0; z-index: 1;
  border-left: 7px solid var(--teal); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.step-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.step-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); }
.step-icon svg { width: 24px; height: 24px; }
.step-n { font: 500 .75rem/1 var(--font-mono); color: var(--ink-3); }
.step-kind { font: 500 .7rem/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 .3rem; }
.step h3 { font: 600 1.05rem/1.3 var(--font-sans); color: var(--ink); margin-bottom: .45rem; }
.step p:last-child { margin: 0; font-size: .93rem; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 900px) {
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(2)::after, .step:nth-child(2)::before { display: none; }
}
@media (max-width: 560px) {
  .pipeline { grid-template-columns: 1fr; gap: 1.25rem; }
  .step:not(:last-child)::after { top: auto; bottom: -1.25rem; right: auto; left: 2.55rem; width: 2px; height: 1.25rem; display: block; }
  .step:not(:last-child)::before { top: auto; bottom: calc(-1.25rem - 1px); right: auto; left: calc(2.55rem - 4px); display: block;
    border-top: 7px solid var(--teal); border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 0; }
}

.structure { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); overflow: hidden; }
.structure-viewer { position: relative; min-height: 380px; background: radial-gradient(ellipse at 50% 40%, var(--surface), var(--bg-tint)); border-right: 1px solid var(--line); }
.structure-viewer canvas { border-radius: 0; }
.viewer-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .8rem; color: var(--ink-3); font-size: .92rem; text-align: center; padding: 1rem; }
.viewer-shield {
  position: absolute; inset: 0; z-index: 5; width: 100%; border: 0; cursor: pointer;
  background: transparent; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 14px;
  font: 500 .8rem/1 var(--font-sans); color: var(--ink-2);
}
.viewer-shield::before {
  content: attr(data-label); padding: .5rem .8rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.viewer-placeholder img { max-height: 320px; width: auto; max-width: 100%; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--teal); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.structure-text { padding: 1.6rem 1.6rem 1.7rem; align-self: center; }
.structure-text p { color: var(--ink-2); }
.structure-text .hint { font-size: .88rem; color: var(--ink-3); }
.viewer-controls { display: flex; flex-wrap: wrap; gap: .45rem; }
@media (max-width: 860px) {
  .structure { grid-template-columns: 1fr; }
  .structure-viewer { min-height: 320px; border-right: 0; border-bottom: 1px solid var(--line); }
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.mini-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.25rem 1.3rem; display: flex; flex-direction: column; gap: .4rem; }
.mini-card h3, .mini-card h4 { font: 600 1rem/1.35 var(--font-sans); color: var(--ink); margin: 0; letter-spacing: 0; }
.mini-card p { margin: 0; color: var(--ink-2); font-size: .94rem; line-height: 1.55; }
.mini-card .meta { font: 500 .75rem/1.3 var(--font-mono); color: var(--ink-3); }
.badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: .35rem;
  font: 500 .7rem/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  padding: .35rem .55rem; border-radius: 999px; background: var(--teal-soft); color: var(--teal);
}
.badge-ongoing { background: var(--accent-soft); color: var(--accent); }
.badge-ongoing::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- publications ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 clamp(28px, 4vw, 40px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.stats > div { padding: 1.1rem 1.3rem; display: flex; flex-direction: column-reverse; gap: .2rem; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats dt { font-size: .85rem; color: var(--ink-3); line-height: 1.3; }
.stats dd { margin: 0; font: 600 clamp(1.8rem, 4vw, 2.4rem)/1 var(--font-serif); color: var(--teal); }

.pub-list { display: grid; gap: 1rem; }
.pub { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1.25rem; padding: 1.4rem 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pub-year { font: 600 1.15rem/1.3 var(--font-serif); color: var(--ink-3); }
.pub-title { font: 600 1.08rem/1.45 var(--font-sans); color: var(--ink); margin: 0 0 .4rem; }
.pub-authors { font-size: .93rem; color: var(--ink-2); margin: 0 0 .25rem; }
.pub-authors strong { color: var(--ink); font-weight: 600; }
.pub-venue { font-size: .93rem; color: var(--ink-3); margin: 0 0 .8rem; }
.pub-venue em { color: var(--ink-2); }
.pub-actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.pub-actions a.chip-btn { text-decoration: none; display: inline-flex; align-items: center; }
.pub-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.pub-todo { font: 500 .75rem/1 var(--font-mono); color: var(--accent); }
.data-error { padding: 1rem 1.2rem; border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--ink-3); font-size: .95rem; }
@media (max-width: 640px) {
  .pub { grid-template-columns: 1fr; gap: .4rem; padding: 1.15rem 1.15rem 1.25rem; }
  .stats > div { padding: .9rem .8rem; }
  .stats dt { font-size: .78rem; }
}

/* ---------- skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.skill-group { padding: 1.5rem; }
.skill-group h3 { font: 600 1.1rem/1.3 var(--font-sans); color: var(--ink); margin-bottom: 1rem; display: flex; align-items: center; gap: .6rem; }
.skill-group h3 svg { color: var(--teal); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { font-size: .9rem; line-height: 1.2; padding: .45rem .75rem; border-radius: 999px; background: var(--bg-tint); color: var(--ink); border: 1px solid var(--line); }
@media (max-width: 760px) { .skills-grid { grid-template-columns: 1fr; } }

/* ---------- talks ---------- */
.talk-list { display: grid; }
.talk { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.25rem; padding: 1.3rem 0; border-top: 1px solid var(--line); }
.talk:last-child { border-bottom: 1px solid var(--line); }
.talk-when { font: 500 .82rem/1.6 var(--font-mono); color: var(--ink-3); }
.talk-title { font: 500 1.05rem/1.45 var(--font-serif); color: var(--ink); margin: 0 0 .35rem; }
.talk-event { font-size: .93rem; color: var(--ink-2); margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.talk .badge { flex: none; }
.talk-detail { font-size: .86rem; color: var(--ink-3); margin: .3rem 0 0; }
.badge-poster { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 640px) { .talk { grid-template-columns: 1fr; gap: .3rem; } }

/* ---------- training ---------- */
.card-grid-compact { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card-grid-compact .mini-card { padding: 1.05rem 1.15rem 1.15rem; }
.mini-card .kind-row { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }

/* ---------- contact ---------- */
.contact { background: var(--navy); color: var(--bg); }
.contact .section-head h2 { color: var(--bg); }
.contact .section-kicker { color: var(--accent); }
.contact-lead { font: 400 clamp(1.1rem, 2vw, 1.35rem)/1.55 var(--font-serif); max-width: 52ch; margin-bottom: 2rem; opacity: .92; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.6rem; }
.contact .btn-primary { background: var(--accent); color: #fff; }
.contact .btn-primary:hover { background: var(--bg); color: var(--navy); }
.contact .btn-ghost { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.contact .btn-ghost:hover { border-color: var(--bg); color: var(--bg); }
.contact-note { opacity: .75; font-size: .95rem; margin: 0; }
.contact :focus-visible { outline-color: var(--accent); }
:root[data-theme="dark"] .contact { background: #06121a; color: var(--ink); }
:root[data-theme="dark"] .contact .section-head h2 { color: var(--ink); }
:root[data-theme="dark"] .contact .btn-ghost { color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] .contact .btn-primary { color: #1a0d05; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .contact { background: #06121a; color: var(--ink); }
  :root:not([data-theme="light"]) .contact .section-head h2 { color: var(--ink); }
  :root:not([data-theme="light"]) .contact .btn-ghost { color: var(--ink); border-color: var(--line); }
  :root:not([data-theme="light"]) .contact .btn-primary { color: #1a0d05; }
}
@media (max-width: 560px) { .contact-actions .btn { flex: 1 1 calc(50% - .75rem); justify-content: center; } .contact-actions .btn-lg { flex-basis: 100%; } }

/* ---------- footer & toast ---------- */
.site-footer { padding: 1.6rem 0 2rem; border-top: 1px solid var(--line); font-size: .88rem; color: var(--ink-3); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }
.footer-inner p { margin: 0; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 80;
  background: var(--navy); color: var(--bg); padding: .7rem 1.1rem; border-radius: 999px; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: var(--shadow); max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media print {
  .site-header, .hero-motif, .structure, .toast, .theme-toggle { display: none !important; }
  .section, .hero { padding: 24px 0; }
  .reveal { opacity: 1; transform: none; }
}
