/* ============================================================
   Massimo Ianni — refined Apple-glass × engineer-terminal
   ============================================================ */
:root {
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --accent-a: #0A84FF;
  --accent-b: #5E5CE6;
  --grad: linear-gradient(120deg, #0A84FF 0%, #5E5CE6 100%);
  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Dark (default) ---- */
[data-theme="dark"] {
  --bg: #07070f;
  --ink: rgba(255,255,255,0.96);
  --ink-2: rgba(255,255,255,0.74);
  --ink-3: rgba(255,255,255,0.55);
  --hair: rgba(255,255,255,0.12);
  --hair-2: rgba(255,255,255,0.07);
  --glass: rgba(14,14,28,0.42);
  --glass-hover: rgba(20,20,38,0.55);
  --glass-brd: rgba(255,255,255,0.13);
  --veil: linear-gradient(180deg, rgba(6,6,14,0.58) 0%, rgba(6,6,14,0.40) 26%, rgba(6,6,14,0.48) 56%, rgba(6,6,14,0.82) 100%), radial-gradient(120% 80% at 50% -10%, rgba(94,92,230,0.12), transparent 55%);
  --chip: rgba(255,255,255,0.06);
  --shadow: 0 18px 50px -20px rgba(0,0,0,0.7);
}

/* ---- Light ---- */
[data-theme="light"] {
  --bg: #eef3fb;
  --ink: rgba(8,12,28,0.94);
  --ink-2: rgba(12,18,40,0.74);
  --ink-3: rgba(12,18,40,0.68);
  --hair: rgba(10,20,50,0.14);
  --hair-2: rgba(10,20,50,0.08);
  --glass: rgba(255,255,255,0.62);
  --glass-hover: rgba(255,255,255,0.8);
  --glass-brd: rgba(255,255,255,0.7);
  --veil: linear-gradient(180deg, rgba(238,243,251,0.55) 0%, rgba(238,243,251,0.32) 28%, rgba(238,243,251,0.46) 58%, rgba(238,243,251,0.86) 100%), radial-gradient(120% 80% at 50% -10%, rgba(10,132,255,0.10), transparent 55%);
  --chip: rgba(255,255,255,0.6);
  --shadow: 0 18px 50px -24px rgba(20,40,90,0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background 0.6s var(--ease), color 0.6s var(--ease);
}

a { color: inherit; text-decoration: none; }

/* ---- Background ---- */
#wave-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; display: block;
}
.bg-veil {
  position: fixed; inset: 0; z-index: 1;
  background: var(--veil);
  pointer-events: none;
}
main, .island-group, .theme-toggle, .progress-bar { position: relative; z-index: 2; }

/* ---- Scroll progress ---- */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--grad);
  z-index: 50;
  box-shadow: 0 0 14px rgba(94,92,230,0.6);
}

/* ─── GATE ─── */
.gate-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity 0.5s ease;
}
.gate-overlay.gate-unlocking { opacity: 0; pointer-events: none; }
.gate-overlay.gate-gone { display: none; }
.gate-card {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 40px 36px; border-radius: 24px;
  background: var(--glass); backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 0.5px solid var(--glass-brd);
  /* specular top-edge highlight + soft inner base + grounding shadow — matches .glass / .dynamic-island */
  box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.5),
    inset 0 -10px 24px -18px rgba(255,255,255,0.18),
    var(--shadow);
  width: min(320px, 88vw);
}
[data-theme="dark"] .gate-card { box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.22),
    inset 0 -12px 28px -20px rgba(255,255,255,0.10),
    var(--shadow); }
.gate-logo {
  width: 56px; height: 56px; border-radius: 16px; flex: none;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 20px; font-weight: 600; letter-spacing: 0.05em;
  background: linear-gradient(135deg, #0A84FF, #5E5CE6);
  color: #fff;
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.5), 0 4px 12px -4px rgba(94,92,230,0.7);
}
.gate-hint { font-size: 13px; color: var(--ink-2); margin: 0; }
.gate-form { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.gate-input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.07); border: 0.5px solid var(--glass-brd);
  color: var(--ink); font-size: 15px; font-family: var(--sans); outline: none;
  transition: border-color 0.2s;
}
[data-theme="light"] .gate-input { background: rgba(0,0,0,0.04); }
.gate-input:focus { border-color: rgba(255,255,255,0.3); }
[data-theme="light"] .gate-input:focus { border-color: rgba(0,0,0,0.3); }
.gate-submit {
  width: 100%; padding: 11px; border-radius: 12px; border: none;
  background: rgba(255,255,255,0.12); color: var(--ink);
  font-size: 14px; font-weight: 500; cursor: pointer; font-family: var(--sans);
  transition: background 0.2s;
}
[data-theme="light"] .gate-submit { background: rgba(0,0,0,0.07); }
.gate-submit:hover { background: rgba(255,255,255,0.22); }
[data-theme="light"] .gate-submit:hover { background: rgba(0,0,0,0.13); }
.gate-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.gate-error { font-size: 12px; color: #ff6b6b; min-height: 16px; margin: 0; text-align: center; }
.gate-hidden { visibility: hidden; pointer-events: none; }
/* ─────────────── */

/* ============================================================
   Dynamic Island — Liquid Glass (macOS 26 Tahoe)
   ============================================================ */
.island-group {
  position: fixed; top: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 60;
}
/* Springy, fluid morph — the Tahoe feel comes from over-shoot easing */
:root { --island-spring: cubic-bezier(0.34, 1.42, 0.4, 1); }
/* the whole group rises as it expands, so the top edge moves outward too */
.island-group { transition: top 0.48s var(--ease); }
.island-group[data-state="expanded"] { top: 8px; }

.dynamic-island {
  position: relative;
  font-family: var(--sans);
  /* Liquid Glass material: deep translucent body, heavy blur + brightening */
  background:
    linear-gradient(180deg, rgba(34,34,46,0.62), rgba(10,10,18,0.74));
  backdrop-filter: blur(28px) saturate(190%) brightness(1.18);
  -webkit-backdrop-filter: blur(28px) saturate(190%) brightness(1.18);
  border: 0.5px solid rgba(255,255,255,0.18);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  display: flex; flex-direction: column;
  width: max-content; max-width: min(92vw, 340px); height: 34px;
  padding: 0 16px;
  white-space: nowrap;
  transform-origin: top center;
  justify-content: center;
  /* specular top edge + grounding shadow — the hallmark of Liquid Glass */
  box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.55),
    inset 0 -1px 1px rgba(255,255,255,0.06),
    inset 0 0 0 0.5px rgba(255,255,255,0.05),
    0 1px 1px rgba(0,0,0,0.3),
    0 12px 34px -10px rgba(0,0,0,0.66);
  transition:
    width 0.46s var(--ease), height 0.46s var(--ease),
    border-radius 0.46s var(--ease), padding 0.46s var(--ease),
    background 0.46s var(--ease), box-shadow 0.46s var(--ease);
}
.dynamic-island:hover { box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.7),
    inset 0 -1px 1px rgba(255,255,255,0.08),
    inset 0 0 0 0.5px rgba(255,255,255,0.07),
    0 1px 1px rgba(0,0,0,0.3),
    0 16px 40px -10px rgba(0,0,0,0.72); }
.dynamic-island:focus-visible {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}

/* refractive specular sheen that sweeps occasionally */
.island-spec {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -30%, rgba(255,255,255,0.22), transparent 60%),
    linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.10) 46%, rgba(255,255,255,0.02) 56%, transparent 64%);
  background-size: 100% 100%, 220% 100%;
  background-position: 0 0, -60% 0;
  mix-blend-mode: screen;
  animation: islandSheen 7s var(--ease) 2s infinite;
}
@keyframes islandSheen {
  0%, 72% { background-position: 0 0, -60% 0; }
  86%, 100% { background-position: 0 0, 160% 0; }
}

.island-collapsed {
  display: flex; align-items: center; gap: 9px;
  white-space: nowrap;
  transition: opacity 0.18s ease;
}
.island-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 9px #30d158, 0 0 2px #fff inset;
  flex: none;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }
.island-text {
  font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis;
}
.island-chev {
  display: grid; place-items: center; margin-left: 1px;
  color: rgba(255,255,255,0.42);
  transition: transform 0.5s var(--island-spring), color 0.2s ease;
}
.dynamic-island:hover .island-chev { color: rgba(255,255,255,0.7); }

.island-expanded {
  display: none;
  flex-direction: column; gap: 11px;
  text-align: left;
  width: 100%;
  padding: 2px;
}
.island-card-head { display: flex; align-items: center; gap: 11px; }
.island-mono {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  background: linear-gradient(135deg, #0A84FF, #5E5CE6);
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.5), 0 4px 12px -4px rgba(94,92,230,0.7);
}
.island-id { display: flex; flex-direction: column; gap: 1px; margin-right: auto; }
.island-name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.island-meta { font-size: 11px; color: rgba(255,255,255,0.5); font-family: var(--mono); letter-spacing: 0.03em; }
.island-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500; color: #5fe48a;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(48,209,88,0.14);
  border: 0.5px solid rgba(48,209,88,0.32);
  flex-shrink: 0; max-width: 120px; overflow: hidden;
}
.island-status .island-dot { animation: none; }
#island-status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.island-role {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: 13px;
  background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.12);
}
.island-role-title { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.island-role-co { font-size: 11.5px; color: rgba(255,255,255,0.55); }
.island-focus { font-size: 11.5px; color: rgba(255,255,255,0.62); line-height: 1.5; padding: 0 2px; }
.island-actions { display: flex; gap: 7px; margin-top: 2px; }
.island-btn {
  font-size: 12px; font-weight: 500;
  padding: 8px 13px; border-radius: 11px;
  background: rgba(255,255,255,0.09);
  border: 0.5px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.18);
  transition: background 0.2s ease, transform 0.2s var(--ease);
}
.island-btn:hover { background: rgba(255,255,255,0.18); transform: translateY(-1px); }
.island-btn-primary {
  background: linear-gradient(135deg, #0A84FF, #5E5CE6);
  border-color: transparent;
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.4), 0 4px 12px -5px rgba(94,92,230,0.8);
}
.island-btn-primary:hover { background: linear-gradient(135deg, #1f90ff, #6f6df0); }

.island-group[data-state="expanded"] .dynamic-island {
  width: min(344px, 92vw); height: auto; border-radius: 28px;
  padding: 14px 16px 15px;
  justify-content: flex-start;
  white-space: normal;
}
.island-group[data-state="expanded"] .island-collapsed { display: none; }
.island-group[data-state="expanded"] .island-expanded { display: flex; }
.island-group[data-state="expanded"] .island-spec { animation: none; opacity: 0.7; }

.island-stagger-1, .island-stagger-2, .island-stagger-3, .island-stagger-4 { opacity: 0; transform: translateY(7px); }
.island-group[data-state="expanded"] .island-stagger-1 { animation: islandIn 0.42s var(--ease) 0.08s forwards; }
.island-group[data-state="expanded"] .island-stagger-2 { animation: islandIn 0.42s var(--ease) 0.14s forwards; }
.island-group[data-state="expanded"] .island-stagger-3 { animation: islandIn 0.42s var(--ease) 0.20s forwards; }
.island-group[data-state="expanded"] .island-stagger-4 { animation: islandIn 0.42s var(--ease) 0.26s forwards; }
@keyframes islandIn { to { opacity: 1; transform: translateY(0); } }

/* ---- Theme toggle ---- */
.theme-toggle {
  position: fixed; top: 16px; right: 18px; z-index: 60;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-brd);
  color: var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 15px;
  transition: transform 0.3s var(--ease), background 0.3s ease;
}
.theme-toggle:hover { transform: rotate(18deg) scale(1.06); }
.tt-icon { grid-area: 1/1; transition: opacity 0.3s ease, transform 0.4s var(--ease); }
[data-theme="dark"] .tt-sun  { opacity: 0; transform: scale(0.4) rotate(-40deg); }
[data-theme="dark"] .tt-moon { opacity: 1; }
[data-theme="light"] .tt-moon { opacity: 0; transform: scale(0.4) rotate(40deg); }
[data-theme="light"] .tt-sun  { opacity: 1; }

/* ============================================================
   Layout
   ============================================================ */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
section { padding: 120px 0; }
section#about { padding-top: 60px; }

.section-label {
  font-family: var(--mono);
  font-size: 12.5px; letter-spacing: 0.16em;
  color: var(--ink-3); text-transform: uppercase;
  margin-bottom: 22px;
}
.section-title {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 48px; line-height: 1.08;
}
.grad {
  background: var(--grad);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: gradflow 9s ease-in-out infinite alternate;
}
@keyframes gradflow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 80px 28px 60px;
  position: relative;
}
.hero-inner { max-width: 840px; will-change: transform, opacity; text-shadow: 0 1px 30px rgba(0,0,0,0.35); }
[data-theme="light"] .hero-inner { text-shadow: 0 1px 24px rgba(255,255,255,0.5); }
.hero-kicker {
  font-family: var(--mono);
  font-size: 13px; letter-spacing: 0.22em;
  color: var(--ink-2);
  margin-bottom: 26px;
  display: inline-flex; align-items: center; gap: 8px;
}
.blink { color: var(--accent-a); animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.15;} }

.hero-name {
  font-size: clamp(56px, 11vw, 132px);
  font-weight: 700; letter-spacing: -0.045em;
  line-height: 0.95;
  margin-bottom: 30px;
}
.hero-name .word {
  display: inline-block;
  transition: opacity 0.9s var(--ease), filter 0.9s var(--ease), transform 0.9s var(--ease);
}
.hero-name .word:nth-child(2) { transition-delay: 0.13s; }
html.preload .hero-name .word { opacity: 0; filter: blur(14px); transform: translateY(0.25em); }

.hero-tagline {
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 500; letter-spacing: -0.01em;
  line-height: 1.32; color: var(--ink);
  max-width: 720px; margin: 0 auto 20px;
  transition: opacity 0.8s var(--ease) 0.34s, transform 0.8s var(--ease) 0.34s;
}
.hero-sub {
  font-size: clamp(15px, 1.7vw, 18px);
  color: var(--ink-2); max-width: 600px; margin: 0 auto;
  transition: opacity 0.8s var(--ease) 0.46s, transform 0.8s var(--ease) 0.46s;
}

.hero-stats {
  display: flex; gap: clamp(16px, 3vw, 28px); align-items: center;
  justify-content: center; flex-wrap: wrap;
  margin: 44px 0 38px;
  transition: opacity 0.8s var(--ease) 0.58s, transform 0.8s var(--ease) 0.58s;
}
html.preload .hero-tagline, html.preload .hero-sub,
html.preload .hero-stats, html.preload .hero-cta, html.preload .scroll-cue {
  opacity: 0; transform: translateY(18px);
}
.hero-pill {
  font-family: var(--mono); font-size: clamp(12px, 1.4vw, 14px);
  letter-spacing: 0.04em; color: var(--ink-2);
  white-space: nowrap;
}
.hero-pill-div { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-b); opacity: 0.7; flex: none; }

.hero-cta {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  transition: opacity 0.8s var(--ease) 0.7s, transform 0.8s var(--ease) 0.7s;
}
.btn {
  font-size: 15px; font-weight: 500;
  padding: 13px 26px; border-radius: 14px;
  transition: transform 0.25s var(--ease), background 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid transparent;
}
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 10px 30px -10px rgba(94,92,230,0.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(94,92,230,0.75); }
.btn-ghost {
  background: var(--glass); color: var(--ink);
  border-color: var(--glass-brd);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.btn-ghost:hover { transform: translateY(-2px); background: var(--glass-hover); }

/* ---- Credentials "Show all" toggle — animated ring + count + chevron ---- */
@property --ctangle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.cert-toggle {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 9px 9px 17px; border-radius: 999px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: 0.01em; color: var(--ink);
  background: var(--glass);
  border: 1px solid transparent;
  backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  cursor: pointer; overflow: hidden; white-space: nowrap;
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.22);
  transition: transform 0.32s var(--island-spring, cubic-bezier(.34,1.42,.4,1)), box-shadow 0.32s var(--ease);
}
.cert-toggle > * { position: relative; z-index: 1; }
/* rotating gradient ring */
.cert-toggle::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.25px;
  background: conic-gradient(from var(--ctangle), transparent 0 38%, var(--accent-a) 47%, var(--accent-b) 53%, transparent 62% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: ctSpin 4.5s linear infinite;
  z-index: 0; opacity: 0.85;
}
@keyframes ctSpin { to { --ctangle: 360deg; } }
/* shine sweep on hover */
.cert-toggle::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,0.28) 48%, transparent 60%);
  background-size: 220% 100%; background-position: -65% 0;
  transition: background-position 0.75s var(--ease);
  mix-blend-mode: screen; z-index: 0;
}
.cert-toggle:hover { transform: translateY(-2px); box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.3), 0 16px 34px -14px rgba(94,92,230,0.6); }
.cert-toggle:hover::after { background-position: 165% 0; }
.cert-toggle:active { transform: translateY(0) scale(0.97); }
.cert-toggle-count {
  display: inline-grid; place-items: center; min-width: 23px; height: 23px; padding: 0 7px;
  border-radius: 999px; font-family: var(--mono); font-size: 12px; font-weight: 600; color: #fff;
  background: var(--grad);
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.45), 0 4px 12px -5px rgba(94,92,230,0.85);
}
.cert-toggle-chev {
  display: grid; place-items: center; width: 21px; height: 21px;
  border-radius: 50%; color: var(--ink-2);
  background: rgba(255,255,255,0.06);
  transition: transform 0.5s var(--island-spring, cubic-bezier(.34,1.42,.4,1)), color 0.3s ease, background 0.3s ease;
}
.cert-toggle[aria-expanded="true"] .cert-toggle-chev { transform: rotate(180deg); color: var(--accent-b); background: rgba(94,92,230,0.16); }
/* tactile click pulse */
.cert-toggle.clicked .cert-toggle-count { animation: ctCountPop 0.46s var(--island-spring, cubic-bezier(.34,1.42,.4,1)); }
@keyframes ctCountPop {
  0% { transform: scale(1); }
  38% { transform: scale(1.28); box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.5), 0 6px 18px -5px rgba(94,92,230,1); }
  100% { transform: scale(1); }
}
.cert-toggle.clicked::before { animation: ctSpin 4.5s linear infinite, ctFlash 0.5s var(--ease); }
@keyframes ctFlash { 0% { opacity: 0.85; } 35% { opacity: 1; filter: brightness(1.7); } 100% { opacity: 0.85; filter: none; } }
@media (prefers-reduced-motion: reduce) {
  .cert-toggle::before { animation: none; }
}

.scroll-cue {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: opacity 1s var(--ease) 0.9s;
}
html.preload .scroll-cue { opacity: 0; transform: translateX(-50%) translateY(18px); }
.scroll-cue-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; color: var(--ink-3); }
.scroll-cue-track {
  width: 22px; height: 34px; border-radius: 12px;
  border: 1.5px solid var(--hair); position: relative;
}
.scroll-cue-dot {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent-a);
  animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { 0%{opacity:0; top:6px;} 30%{opacity:1;} 70%{opacity:1; top:20px;} 100%{opacity:0; top:22px;} }

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
.reveal { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; filter: blur(0); }

/* word reveal for about lead */
.about-lead {
  font-size: clamp(22px, 3.2vw, 38px);
  font-weight: 500; letter-spacing: -0.02em;
  line-height: 1.4; max-width: 920px;
}
.about-lead .w { display: inline-block; opacity: 0.24; transition: opacity 0.5s var(--ease); }
.about-lead .w.lit { opacity: 1; }

/* ============================================================
   Glass card — Liquid Glass (macOS 26 Tahoe)
   ============================================================ */
.glass {
  position: relative;
  background: var(--glass);
  border: 0.5px solid var(--glass-brd);
  border-radius: 20px;
  backdrop-filter: blur(26px) saturate(175%) brightness(1.06);
  -webkit-backdrop-filter: blur(26px) saturate(175%) brightness(1.06);
  /* specular top-edge highlight + soft inner base + grounding shadow */
  box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.5),
    inset 0 -10px 24px -18px rgba(255,255,255,0.18),
    var(--shadow);
}
[data-theme="dark"] .glass { box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.22),
    inset 0 -12px 28px -20px rgba(255,255,255,0.10),
    var(--shadow); }
/* pointer-tracked specular glow — the liquid-glass highlight follows the cursor */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; z-index: 0;
  opacity: 0; transition: opacity 0.45s var(--ease);
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255,255,255,0.14), rgba(94,92,230,0.06) 38%, transparent 62%);
  mix-blend-mode: screen;
}
[data-theme="light"] .glass::before {
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
    rgba(10,132,255,0.12), rgba(94,92,230,0.05) 40%, transparent 64%);
  mix-blend-mode: normal;
}
.glass:hover::before { opacity: 1; }
.glass > * { position: relative; z-index: 1; }

/* ============================================================
   Experience timeline
   ============================================================ */
.xp-timeline { position: relative; padding-left: 34px; }
.xp-line {
  position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: var(--hair-2); border-radius: 2px; overflow: hidden;
}
.xp-line-fill {
  position: absolute; top: 0; left: 0; width: 100%; height: 0%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(94,92,230,0.5);
}
.xp-item { position: relative; padding: 0 0 56px; }
.xp-item:last-child { padding-bottom: 0; }
.xp-node {
  position: absolute; left: -34px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent-b);
  box-shadow: 0 0 0 4px rgba(94,92,230,0.10);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.xp-item.in .xp-node { background: var(--accent-b); box-shadow: 0 0 16px rgba(94,92,230,0.7), 0 0 0 4px rgba(94,92,230,0.12); }
.xp-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 18px; flex-wrap: wrap; margin-bottom: 16px;
}
.xp-company { font-size: clamp(19px, 2.2vw, 24px); font-weight: 600; letter-spacing: -0.01em; }
.xp-role { font-size: 15px; color: var(--accent-a); font-weight: 500; margin-top: 3px; }
[data-theme="light"] .xp-role { color: #0a6fe0; }
.xp-date {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--ink-3); white-space: nowrap; padding-top: 4px;
}
.xp-highlights { list-style: none; display: grid; gap: 10px; margin-bottom: 18px; }
.xp-highlights li {
  position: relative; padding-left: 20px;
  font-size: 15px; color: var(--ink-2); line-height: 1.55;
  text-wrap: pretty;
}
.xp-highlights li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-b); opacity: 0.7;
}
.xp-highlights strong { color: var(--ink); font-weight: 600; }
.xp-compact-note { font-size: 15px; color: var(--ink-2); line-height: 1.55; margin-bottom: 16px; max-width: 720px; text-wrap: pretty; }
.xp-compact-note strong { color: var(--ink); font-weight: 600; }

/* grouped roles under one company (KPMG) */
.xp-role-lead { margin-bottom: 18px; }
.xp-subrole {
  position: relative;
  padding: 14px 0 4px 16px;
  margin-bottom: 14px;
}
/* static rail + gradient fill that draws on scroll — mirrors the outer timeline */
.xp-subrole::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--hair-2); border-radius: 2px;
}
.xp-subrole::after {
  content: ""; position: absolute; left: 0; top: 0; width: 2px;
  height: var(--subfill, 0%); border-radius: 2px;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(94,92,230,0.55);
  transition: height 0.12s linear;
}
.xp-subrole .xp-head { margin-bottom: 10px; }
.xp-subrole-title { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.xp-subrole .xp-highlights { margin-bottom: 4px; }

.xp-skills { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.02em;
  padding: 5px 11px; border-radius: 8px;
  background: var(--chip); border: 1px solid var(--hair-2);
  color: var(--ink-2);
}

/* ============================================================
   Skills
   ============================================================ */
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(208px, 1fr));
  gap: 18px; margin-bottom: 24px;
}
.skill-col { padding: 26px 26px 28px; }
.mono-h {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent-a); margin-bottom: 16px;
}
[data-theme="light"] .mono-h { color: #0a6fe0; }
.skill-list { list-style: none; display: grid; gap: 11px; }
.skill-list li {
  font-size: 15px; color: var(--ink); position: relative; padding-left: 18px;
  line-height: 1.4;
}
.skill-list li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-b); opacity: 0.75;
}
.qualities { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.chip {
  font-size: 14px; padding: 9px 16px; border-radius: 999px;
  background: var(--chip); border: 1px solid var(--hair);
  color: var(--ink-2);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}

/* ============================================================
   Certifications
   ============================================================ */
.cert-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 44px; }
.cert-head .section-title { margin-bottom: 0; }
.cert-head .section-label { margin-bottom: 14px; }
.cert-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.cert-card {
  padding: 22px 22px 20px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 138px;
  transition: transform 0.3s var(--ease), background 0.3s ease, border-color 0.3s ease;
}
.cert-card:hover { transform: translateY(-4px); background: var(--glass-hover); border-color: var(--accent-b); }
.cert-issuer { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-a); }
[data-theme="light"] .cert-issuer { color: #0a6fe0; }
.cert-title { font-size: 16px; font-weight: 600; line-height: 1.32; letter-spacing: -0.01em; margin-top: auto; }
.cert-date { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }

/* top-3 award winners — subtle accent ring + glow */
.cert-card-hero {
  border-color: rgba(94,92,230,0.4);
  box-shadow:
    inset 0 0.5px 0 rgba(255,255,255,0.3),
    0 0 0 0.5px rgba(94,92,230,0.25),
    0 18px 44px -22px rgba(94,92,230,0.55);
}
.cert-card-hero::after {
  content: "★"; position: absolute; top: 16px; right: 18px;
  font-size: 12px; color: var(--accent-b); opacity: 0.85;
}
.cert-card-hero .cert-title { padding-right: 18px; }
/* cards without a public verify link — informational, not clickable */
.cert-card-flat { cursor: default; }
.cert-card-flat:hover { transform: none; border-color: var(--glass-brd); background: var(--glass); }

.marquee {
  margin-top: 30px; overflow: hidden;
  border-top: 1px solid var(--hair-2); border-bottom: 1px solid var(--hair-2);
  padding: 16px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex; gap: 44px; width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee-track span {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em;
  color: var(--ink-3); white-space: nowrap;
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* featured award cards (top 3) */
.cert-featured { margin-bottom: 18px; }

/* moving credential rail (right → left) */
.cert-marquee {
  margin-top: 4px; overflow: hidden;
  padding: 6px 0 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.cert-marquee-track {
  display: flex; gap: 16px; width: max-content;
  animation: certmarq 64s linear infinite;
}
.cert-marquee:hover .cert-marquee-track { animation-play-state: paused; }
@keyframes certmarq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.cert-marquee-track .cert-card {
  width: 252px; flex: none; min-height: 122px;
  opacity: 1; transform: none; filter: none;
}
.cert-marquee-track .cert-card:hover { transform: translateY(-4px); }
/* expanded: freeze the rail into a static, readable grid with a staggered pop-in */
.cert-marquee.is-static {
  overflow: visible; -webkit-mask-image: none; mask-image: none;
}
.cert-marquee.is-static .cert-marquee-track {
  animation: none !important; width: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px;
}
.cert-marquee.is-static .cert-marquee-track .cert-card {
  width: auto;
  animation: certPop 0.62s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 0.045s);
}
@keyframes certPop {
  0%   { opacity: 0; transform: translateY(22px) scale(0.92); filter: blur(7px); }
  60%  { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
/* collapsing back — reverse cascade out (bottom-up), then return to the rail */
.cert-marquee.is-static.is-closing .cert-marquee-track .cert-card {
  animation: certPopOut 0.44s var(--ease) forwards;
  animation-delay: calc((var(--n, 15) - 1 - var(--i, 0)) * 0.032s);
}
@keyframes certPopOut {
  0%   { opacity: 1; transform: none; filter: blur(0); }
  100% { opacity: 0; transform: translateY(16px) scale(0.9); filter: blur(6px); }
}
.cert-marquee.is-static .cert-marquee-track [aria-hidden="true"] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .cert-marquee { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .cert-marquee-track { animation-name: none !important; flex-wrap: wrap; width: auto; justify-content: center; }
  .cert-marquee-track .cert-card { width: auto; flex: 1 1 240px; min-width: 220px; max-width: 320px; }
}

/* ============================================================
   Education
   ============================================================ */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.edu-card { padding: 26px; display: flex; flex-direction: column; gap: 7px; }
.edu-inst { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.edu-degree { font-size: 14px; color: var(--ink-2); }
.edu-date { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.edu-notes { list-style: none; display: grid; gap: 6px; margin-top: 10px; }
.edu-notes li {
  font-size: 13.5px; color: var(--ink-2); padding-left: 16px; position: relative;
}
.edu-notes li::before { content: "✦"; position: absolute; left: 0; color: var(--accent-b); font-size: 10px; top: 3px; }

/* ============================================================
   Contact
   ============================================================ */
#contact { padding-bottom: 90px; }
.contact-card { padding: clamp(40px, 6vw, 72px); text-align: center; }
.contact-card .section-label { margin-bottom: 18px; }
.contact-headline {
  font-size: clamp(30px, 5vw, 56px); font-weight: 600; letter-spacing: -0.03em;
  line-height: 1.04; margin-bottom: 34px;
}
.contact-email {
  display: inline-block;
  font-size: clamp(20px, 3vw, 30px); font-weight: 500;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 36px;
  border-bottom: 1px solid transparent;
  transition: opacity 0.2s ease;
}
.contact-email:hover { opacity: 0.8; }
.contact-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.contact-link {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  padding: 16px 24px; border-radius: 14px;
  background: var(--chip); border: 1px solid var(--hair);
  min-width: 200px;
  transition: transform 0.25s var(--ease), background 0.25s ease, border-color 0.25s ease;
}
.contact-link:hover { transform: translateY(-3px); border-color: var(--accent-b); background: var(--glass-hover); }
.cl-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.cl-handle { font-size: 15px; font-weight: 500; color: var(--ink); }

.footer { padding: 40px 0 60px; text-align: center; border-top: 1px solid var(--hair-2); }
.mono-foot { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-3); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  section { padding: 84px 0; }
  .skills-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .xp-head { flex-direction: column; gap: 6px; }
  .xp-date { padding-top: 0; }
  .island-text { font-size: 12px; }
  .hero-stats { gap: 28px; }
  .dynamic-island { max-width: calc(100vw - 112px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-delay: 0s !important; transition-duration: 0.001s !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  .hero-name .word, .hero-tagline, .hero-sub, .hero-stats, .hero-cta, .scroll-cue { opacity: 1; }
  .about-lead .w { opacity: 1; }
  .grad { animation: none; }
  .glass::before { display: none; }
}
