/* ==========================================================================
   Alexandre BREDILLOT — portfolio homepage
   Self-contained stylesheet for index.html (travel pages keep style.css +
   portfolio-extra.css). Dark "data" theme, #2A1FFF brand accent.
   ========================================================================== */

:root {
  --ink: 255, 255, 255;          /* rgb triplet for translucent lines/surfaces */
  --bg: #05060c;
  --bg-2: #080a16;
  --surface: rgba(var(--ink), 0.03);
  --surface-2: rgba(var(--ink), 0.055);
  --border: rgba(var(--ink), 0.08);
  --border-strong: rgba(var(--ink), 0.16);
  --text: #eef0ff;
  --text-2: #b4b8d6;
  --muted: #8b90b5;
  --accent: #2a1fff;
  --accent-2: #8c85ff;
  --accent-3: #c9c5ff;
  --live: #34d399;
  --radius: 22px;
  --radius-sm: 12px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 88px;

  --btn-bg: #ffffff;
  --btn-fg: #070818;
  --glass: rgba(9, 10, 22, 0.72);
  --panel: #0b0c1a;
  --panel-2: rgba(8, 9, 20, 0.92);
  --inset: rgba(3, 4, 12, 0.35);
  --art: #07081a;
  --art-2: #061114;
  --art-3: #120d05;
  --overlay: rgba(3, 4, 10, 0.6);
  --shadow: rgba(0, 0, 0, 0.8);
  --live-text: #a7f3d0;
  --toast-bg: rgba(8, 20, 18, 0.92);
  --toast-fg: #d1fae5;
  --grad-name: linear-gradient(100deg, #ffffff 0%, #dcd9ff 28%, #8c85ff 58%, #5a6bff 78%, #c9c5ff 100%);
  --grad-title: linear-gradient(180deg, #ffffff 30%, #a9acd0 100%);
  --grad-stat: linear-gradient(135deg, #ffffff 20%, #a8a2ff 100%);
  --grad-contact: linear-gradient(100deg, #ffffff 10%, #c9c5ff 50%, #6c63ff 100%);
  --glow-a: rgba(42, 31, 255, 0.26);
  --glow-b: rgba(108, 99, 255, 0.12);
  --contact-glow: rgba(42, 31, 255, 0.35);
  color-scheme: dark;
}

/* Light theme — follows the visitor's system setting */
@media (prefers-color-scheme: light) {
  :root {
    --ink: 16, 18, 48;
    --bg: #f7f7fb;
    --bg-2: #ffffff;
    --border: rgba(var(--ink), 0.1);
    --border-strong: rgba(var(--ink), 0.18);
    --text: #0b0c1a;
    --text-2: #3d4166;
    --muted: #5b6088;
    --accent-2: #4338ff;
    --accent-3: #2f24e6;
    --live: #10b981;
    --btn-bg: #0b0c1a;
    --btn-fg: #ffffff;
    --glass: rgba(255, 255, 255, 0.78);
    --panel: #ffffff;
    --panel-2: #ffffff;
    --inset: rgba(42, 31, 255, 0.025);
    --art: #f1f0ff;
    --art-2: #ecfbf7;
    --art-3: #fff8ea;
    --overlay: rgba(20, 22, 50, 0.28);
    --shadow: rgba(20, 22, 60, 0.18);
    --live-text: #047857;
    --toast-bg: #ecfdf5;
    --toast-fg: #065f46;
    --grad-name: linear-gradient(100deg, #0b0c1a 0%, #2a1fff 45%, #6c63ff 75%, #2a1fff 100%);
    --grad-title: linear-gradient(180deg, #0b0c1a 30%, #4a4f7a 100%);
    --grad-stat: linear-gradient(135deg, #0b0c1a 10%, #2a1fff 100%);
    --grad-contact: linear-gradient(100deg, #0b0c1a 10%, #2a1fff 55%, #6c63ff 100%);
    --glow-a: rgba(42, 31, 255, 0.12);
    --glow-b: rgba(108, 99, 255, 0.08);
    --contact-glow: rgba(42, 31, 255, 0.12);
    color-scheme: light;
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--nav-h);
  scrollbar-gutter: stable;
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
strong, b { font-weight: 600; color: var(--text); }
kbd { font-family: var(--font-mono); }
::selection { background: rgba(140, 133, 255, 0.4); }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease-out);
}
.skip-link:focus { transform: none; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.ico { width: 18px; height: 18px; flex: none; }
.ico-lg { width: 26px; height: 26px; }

/* ---------- Ambient layers ---------- */
body::before {
  /* film grain */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
@media (max-width: 700px) { body::before { display: none; } }

.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 640px; height: 640px;
  margin: -320px 0 0 -320px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background: radial-gradient(circle, rgba(66, 54, 255, 0.13) 0%, rgba(66, 54, 255, 0.05) 35%, transparent 65%);
  transition: opacity 0.6s ease;
  will-change: transform;
}
.cursor-glow.is-on { opacity: 1; }

.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 120;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--accent), var(--accent-2), #7dd3fc);
  box-shadow: 0 0 12px rgba(140, 133, 255, 0.8);
}

main { position: relative; z-index: 1; }

/* ---------- Pulse dot ---------- */
.pulse {
  position: relative;
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--live);
  flex: none;
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.7; }
  80%, 100% { transform: scale(3); opacity: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  height: 52px;
  padding: 0 1.45rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform 0.35s var(--ease-out), background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.35s ease, color 0.3s ease;
}
.btn .ico { transition: transform 0.35s var(--ease-out); }
.btn:hover .ico-arrow { transform: translateX(4px); }
.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: 0 0 0 1px rgba(var(--ink), 0.4), 0 12px 40px -12px rgba(140, 133, 255, 0.9);
}
.btn-primary:hover {
  box-shadow: 0 0 0 1px var(--btn-bg), 0 18px 60px -12px rgba(140, 133, 255, 1);
}
.btn-ghost {
  background: rgba(var(--ink), 0.04);
  border: 1px solid var(--border-strong);
  color: var(--text);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  background: rgba(var(--ink), 0.09);
  border-color: rgba(var(--ink), 0.32);
}
.btn-link { color: var(--text-2); padding: 0 0.6rem; }
.btn-link:hover { color: var(--text); }
.btn-sm { height: 42px; padding: 0 1.1rem; font-size: 0.875rem; }
.btn-sm .ico { width: 16px; height: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

/* ==========================================================================
   Navigation
   ========================================================================== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px var(--gutter) 0;
  pointer-events: none;
}
.nav-inner {
  pointer-events: auto;
  position: relative;
  max-width: calc(var(--container) + 24px);
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 10px 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.site-nav.is-scrolled .nav-inner,
.site-nav.is-open .nav-inner {
  background: var(--glass);
  border-color: var(--border);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 16px 50px -20px var(--shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
.brand-name b { font-weight: 700; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}
.nav-links a {
  position: relative;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.25s ease, background-color 0.25s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(var(--ink), 0.05); }
.nav-links a.is-active { color: var(--text); background: rgba(140, 133, 255, 0.16); }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

.lang-toggle {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(var(--ink), 0.03);
}
.lang-opt {
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.lang-opt:hover { color: var(--text); }
.lang-opt.active { background: var(--btn-bg); color: var(--btn-fg); }

.cmd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 34px;
  padding: 0 0.55rem 0 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(var(--ink), 0.03);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.cmd-trigger:hover { color: var(--text); border-color: var(--border-strong); background: rgba(var(--ink), 0.07); }
.cmd-trigger .ico { width: 15px; height: 15px; }
.cmd-key {
  font-size: 0.7rem;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: rgba(var(--ink), 0.05);
  color: var(--text-2);
}

.nav-toggle {
  display: none;
  position: relative;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(var(--ink), 0.04);
}
.nav-toggle span {
  position: absolute;
  left: 12px; right: 12px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.4s var(--ease-out), top 0.4s var(--ease-out);
}
.nav-toggle span:first-child { top: 16px; }
.nav-toggle span:last-child { top: 24px; }
.site-nav.is-open .nav-toggle span:first-child { top: 20px; transform: rotate(45deg); }
.site-nav.is-open .nav-toggle span:last-child { top: 20px; transform: rotate(-45deg); }

@media (max-width: 1080px) {
  .nav-links a { padding: 0.5rem 0.6rem; font-size: 0.86rem; }
}
@media (max-width: 980px) {
  .nav-toggle { display: inline-block; }
  .cmd-trigger { display: none; }
  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.6rem;
    border-radius: 22px;
    border: 1px solid var(--border);
    /* solid: a nested backdrop-filter can't see past the blurred nav pill */
    background: var(--panel);
    box-shadow: 0 30px 60px -20px var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.3s ease, transform 0.4s var(--ease-out), visibility 0.3s;
  }
  .site-nav.is-open .nav-links { opacity: 1; visibility: visible; transform: none; }
  .nav-links a { padding: 0.85rem 1rem; font-size: 1rem; border-radius: 14px; }
}
@media (max-width: 420px) {
  .brand-name { font-size: 0.92rem; }
  .brand-name b { display: block; }
  .brand-name { line-height: 1.1; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 130px 0 150px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(900px 520px at 8% 0%, var(--glow-a), transparent 62%),
    radial-gradient(700px 480px at 100% 30%, var(--glow-b), transparent 60%);
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 180px;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
  z-index: -1;
}
.hero-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  -webkit-mask-image: linear-gradient(180deg, transparent 8%, #000 46%), linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.75) 35%, #000 62%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, transparent 8%, #000 46%), linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.75) 35%, #000 62%);
  mask-composite: intersect;
}
@media (max-width: 640px) {
  .hero-field {
    -webkit-mask-image: linear-gradient(180deg, transparent 30%, #000 70%);
    mask-image: linear-gradient(180deg, transparent 30%, #000 70%);
  }
}
.hero-inner { position: relative; }

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.9rem 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 500;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.hero-status .ico { width: 15px; height: 15px; transition: transform 0.35s var(--ease-out); }
.hero-status:hover { color: var(--text); border-color: rgba(140, 133, 255, 0.55); }
.hero-status:hover .ico { transform: translateX(3px); }

.hero-name {
  margin: 1.6rem 0 1.8rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.3rem, 11.2vw, 9.4rem);
  line-height: 0.88;
  letter-spacing: -0.05em;
}
.hero-name .line { display: block; overflow: hidden; padding: 0 0.04em 0.07em 0; margin-bottom: -0.07em; }
.hero-name .line > span { display: inline-block; }
.hero-name .grad {
  background: var(--grad-name);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 900px;
}
.rotator {
  display: block;
  min-height: 1.25em;
  color: var(--accent-3);
  font-family: var(--font-display);
}
.rotator::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 0.95em;
  margin-left: 0.12em;
  vertical-align: -0.1em;
  background: var(--accent-2);
  animation: caret 1.1s steps(1) infinite;
}
.rotator .glyph { color: var(--accent-2); opacity: 0.7; font-family: var(--font-mono); }
@keyframes caret { 50% { opacity: 0; } }

.hero-desc {
  margin-top: 1.3rem;
  max-width: 640px;
  color: var(--text-2);
  font-size: clamp(1rem, 1.3vw, 1.08rem);
  line-height: 1.7;
}

.hero-cta {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.hero-social { display: flex; gap: 0.5rem; margin-left: 0.4rem; }
.hero-social a {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease, transform 0.35s var(--ease-out);
}
.hero-social a:hover { color: var(--text); border-color: rgba(140, 133, 255, 0.6); background: rgba(140, 133, 255, 0.12); transform: translateY(-3px); }

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s ease;
}
.hero-scroll:hover { color: var(--text); }
.hero-scroll i {
  position: relative;
  width: 1px;
  height: 46px;
  overflow: hidden;
  background: rgba(var(--ink), 0.12);
}
.hero-scroll i::after {
  content: "";
  position: absolute;
  left: 0; top: -40%;
  width: 100%; height: 40%;
  background: linear-gradient(180deg, transparent, var(--accent-3));
  animation: scroll-line 2.2s var(--ease-out) infinite;
}
@keyframes scroll-line { to { top: 110%; } }

/* entrance choreography */
.hero-name .line > span { animation: rise 1.25s var(--ease-out) both; }
.hero-name .line:nth-child(1) > span { animation-delay: 0.1s; }
.hero-name .line:nth-child(2) > span { animation-delay: 0.22s; }
.hero-name .grad { animation: rise 1.25s var(--ease-out) 0.22s both, shimmer 9s ease-in-out 1.5s infinite; }
.hero-status { animation: fade-up 1s var(--ease-out) 0.05s both; }
.hero-lead { animation: fade-up 1s var(--ease-out) 0.45s both; }
.hero-desc { animation: fade-up 1s var(--ease-out) 0.58s both; }
.hero-cta { animation: fade-up 1s var(--ease-out) 0.7s both; }
.hero-scroll { animation: fade-in 1.2s ease 1.2s both; }
.hero-field { animation: fade-in 2.4s ease 0.2s both; }
@keyframes rise { from { transform: translateY(110%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

@media (max-width: 640px) {
  .hero { padding: 120px 0 120px; align-items: flex-end; }
  .hero-name { margin: 1.3rem 0 1.4rem; }
  .hero-social { margin-left: 0; width: 100%; }
  .hero-cta .btn { flex: 1 1 auto; }
  .hero-scroll { display: none; }
}
@media (max-width: 380px) {
  .hero-name { font-size: 3rem; }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  position: relative;
  padding: clamp(4.5rem, 9vw, 7rem) 0;
}
.section + .section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--container), calc(100% - 2 * var(--gutter)));
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}
.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); max-width: 880px; }
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.section-kicker .idx { color: var(--muted); }
.section-kicker .idx::after { content: "/"; margin-left: 0.8rem; color: var(--border-strong); }
.section-kicker::after {
  content: "";
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-2), transparent);
}
.section-title {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.9rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
  background: var(--grad-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  padding-bottom: 0.06em;
}

/* ---------- Reveal (JS adds .is-in) ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  /* gentle mode: keep the fade, drop the slide */
  .js [data-reveal] { transform: none; transition: opacity 0.9s ease; transition-delay: var(--d, 0s); }
}

/* ---------- Card surface + spotlight ---------- */
.tile, .tl-card, .project-feature, .project-card, .edu-card, .skill-card, .contact-link, .project-more {
  position: relative;
  isolation: isolate;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(var(--ink), 0.045), rgba(var(--ink), 0.012));
}
.spot::before,
.spot::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.spot::before {
  z-index: -1;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 0%), rgba(140, 133, 255, 0.13), transparent 42%);
}
.spot::after {
  padding: 1px;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(190, 186, 255, 0.7), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.spot:hover::before, .spot:hover::after { opacity: 1; }

/* ---------- Chips & tags ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(var(--ink), 0.03);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 500;
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease, transform 0.3s var(--ease-out);
}
.chip:hover { border-color: rgba(140, 133, 255, 0.55); background: rgba(140, 133, 255, 0.1); transform: translateY(-2px); }
.chip-soft { border-color: rgba(140, 133, 255, 0.25); background: rgba(140, 133, 255, 0.08); color: var(--accent-3); }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-row li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 0.28rem 0.6rem;
  border-radius: 7px;
  color: var(--accent-3);
  background: rgba(140, 133, 255, 0.08);
  border: 1px solid rgba(140, 133, 255, 0.18);
}

/* ==========================================================================
   01 — About (bento)
   ========================================================================== */
.bento {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "sum sum now now"
    "sum sum s1  s2"
    "s3  s4  bey bey";
}
.bento > :nth-child(1) { grid-area: sum; }
.bento > :nth-child(2) { grid-area: now; }
.bento > :nth-child(3) { grid-area: s1; }
.bento > :nth-child(4) { grid-area: s2; }
.bento > :nth-child(5) { grid-area: s3; }
.bento > :nth-child(6) { grid-area: s4; }
.bento > :nth-child(7) { grid-area: bey; }

.tile { padding: clamp(1.4rem, 2.4vw, 2rem); overflow: hidden; }
.tile-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.tile-summary {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(42, 31, 255, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(var(--ink), 0.05), rgba(var(--ink), 0.012));
}
.summary-text {
  margin-top: 1.2rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.7vw, 1.42rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: var(--text);
}
.tile-foot {
  margin-top: auto;
  padding-top: 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-2);
  font-size: 0.92rem;
}
.tile-foot .ico { color: var(--accent-2); }

.tile-now .now-org {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.tile-now .now-org span { color: var(--accent-2); font-weight: 500; }
.now-body { margin-top: 0.7rem; color: var(--text-2); font-size: 0.97rem; line-height: 1.6; max-width: 520px; }

.tile-stat { display: flex; flex-direction: column; gap: 1.2rem; min-height: 190px; }
.tile-stat .stat-label { margin-top: auto; }
.tile-stat .stat-mini + .stat-label, .tile-stat .stat-flags + .stat-label { margin-top: 0; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 3.8vw, 3.3rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  background: var(--grad-stat);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.stat-label { color: var(--text-2); font-size: 0.9rem; line-height: 1.5; }
.stat-mini { display: flex; gap: 4px; height: 8px; margin-top: auto; }
.stat-mini span {
  flex: var(--f) 1 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #2a1fff, #8c85ff);
  transform-origin: 0 50%;
}
.stat-mini span:nth-child(2) { opacity: 0.72; }
.stat-mini span:nth-child(3) { opacity: 0.5; }
.stat-mini span:nth-child(4) { opacity: 0.34; }
.stat-flags { display: flex; gap: 0.5rem; margin-top: auto; font-size: 1.5rem; line-height: 1; }
.stat-flags span { filter: saturate(0.9); }
.js .stat-mini span { transform: scaleX(0); transition: transform 1.2s var(--ease-out) 0.3s; }
.js .is-in .stat-mini span { transform: none; }
.js .stat-flags span { opacity: 0; transform: translateY(8px); transition: opacity 0.6s ease, transform 0.6s var(--ease-out); }
.js .is-in .stat-flags span { opacity: 1; transform: none; }
.js .is-in .stat-flags span:nth-child(2) { transition-delay: 0.08s; }
.js .is-in .stat-flags span:nth-child(3) { transition-delay: 0.16s; }
.js .is-in .stat-flags span:nth-child(4) { transition-delay: 0.24s; }

.tile-beyond {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: inherit;
  transition: border-color 0.3s ease, transform 0.5s var(--ease-out);
}
.tile-beyond:hover { border-color: rgba(140, 133, 255, 0.35); }
.beyond-copy { flex: 1; min-width: 0; }
.beyond-title {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.beyond-title .ico { width: 20px; height: 20px; color: var(--accent-2); transition: transform 0.4s var(--ease-out); }
.tile-beyond:hover .beyond-title .ico { transform: translate(3px, -3px); }
.beyond-body { margin: 0.4rem 0 1rem; color: var(--text-2); font-size: 0.93rem; }
.orb { width: 150px; height: 150px; flex: none; margin-right: -0.5rem; }
.orb-m { transform-origin: 100px 100px; }
.orb-m1 { animation: meridian 7s linear infinite; }
.orb-m2 { animation: meridian 7s linear -2.33s infinite; }
.orb-m3 { animation: meridian 7s linear -4.66s infinite; }
.orb-pins circle { animation: pin-blink 3s ease-in-out infinite; }
.orb-pins circle:nth-child(2) { animation-delay: -1s; }
.orb-pins circle:nth-child(3) { animation-delay: -2s; }
@keyframes meridian { from { transform: scaleX(1); } 50% { transform: scaleX(0.02); } to { transform: scaleX(-1); } }
@keyframes pin-blink { 50% { opacity: 0.25; } }

@media (max-width: 980px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "sum sum"
      "now now"
      "s1  s2"
      "s3  s4"
      "bey bey";
  }
}
@media (max-width: 520px) {
  .bento { gap: 12px; }
  .tile-stat { min-height: 0; padding: 1.2rem; }
  .stat-num { font-size: 2rem; }
  .stat-label { font-size: 0.82rem; }
  .orb { display: none; }
}

/* ==========================================================================
   02 — Experience (timeline)
   ========================================================================== */
.timeline { --rail: 232px; position: relative; }
.timeline-track {
  position: absolute;
  top: 12px; bottom: 12px;
  left: var(--rail);
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: rgba(var(--ink), 0.07);
}
.timeline-fill {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  transform-origin: 0 0;
  transform: scaleY(var(--progress, 0));
  background: linear-gradient(180deg, #a8a2ff, #2a1fff);
  box-shadow: 0 0 14px rgba(140, 133, 255, 0.8);
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: calc(var(--rail) - 40px) 1fr;
  column-gap: 80px;
  padding-bottom: 22px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-date {
  padding-top: 1.75rem;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tl-node {
  position: absolute;
  top: 1.85rem;
  left: var(--rail);
  width: 15px; height: 15px;
  margin-left: -7.5px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid rgba(var(--ink), 0.22);
  transition: border-color 0.5s ease, background-color 0.5s ease, box-shadow 0.5s ease, transform 0.5s var(--ease-out);
}
.tl-item.is-passed .tl-node {
  border-color: var(--accent-3);
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(42, 31, 255, 0.18), 0 0 20px rgba(140, 133, 255, 0.9);
  transform: scale(1.1);
}
.tl-card { padding: clamp(1.3rem, 2.4vw, 1.9rem); transition: border-color 0.35s ease, transform 0.5s var(--ease-out); }
.tl-card:hover { border-color: rgba(var(--ink), 0.14); }
.tl-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; }
.org-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px; height: 52px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  border: 1px solid rgba(var(--ink), 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 24px -12px var(--shadow);
}
.mark-loreal { background: linear-gradient(135deg, #2a2a2e, #0c0c0f); color: #e9cf95; }
.mark-lbp { background: linear-gradient(135deg, #2743c9, #10227a); color: #ffd84d; }
.mark-sienna { background: linear-gradient(135deg, #8b3f2c, #481b10); color: #ffd8c7; }
.mark-easy { background: linear-gradient(135deg, #0f7a70, #06463a); color: #c6f6ea; }
.mark-army { background: linear-gradient(135deg, #4b5632, #212914); color: #dfe8bf; }
.tl-title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw, 1.38rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.tl-role { margin-top: 0.25rem; color: var(--accent-3); font-size: 0.95rem; }
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.4rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  vertical-align: 0.2em;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--live-text);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.badge-live .pulse { width: 6px; height: 6px; }
.badge-muted { color: var(--text-2); background: rgba(var(--ink), 0.05); border-color: var(--border-strong); }

.tl-points li, .edu-points li {
  position: relative;
  padding-left: 1.2rem;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.65;
}
.tl-points li + li, .edu-points li + li { margin-top: 0.55rem; }
.tl-points li::before, .edu-points li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.72em;
  width: 7px; height: 1.5px;
  border-radius: 1px;
  background: var(--accent-2);
}
.tl-points.is-collapsed > li:nth-child(n + 4) { display: none; }
.tl-points > li.is-new { animation: fade-up 0.6s var(--ease-out) both; }
.tl-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  padding: 0.35rem 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent-2);
  transition: color 0.2s ease;
}
.tl-more:hover { color: var(--accent-3); }
.tl-more::after {
  content: "";
  width: 7px; height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.3s var(--ease-out);
}
.tl-more[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.tl-card .tag-row { margin-top: 1.2rem; }
.tl-manager { margin-top: 1rem; font-size: 0.8rem; color: var(--muted); }

@media (max-width: 860px) {
  .timeline { --rail: 7px; }
  .tl-item { grid-template-columns: 1fr; padding-left: 36px; padding-bottom: 28px; }
  .tl-date { padding-top: 0; text-align: left; margin-bottom: 0.7rem; }
  .tl-node { top: 0.15rem; }
}
@media (max-width: 520px) {
  .tl-head { flex-direction: column; gap: 0.8rem; }
  .org-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 0.78rem; }
  .badge-live { margin: 0.4rem 0 0; display: flex; width: max-content; }
}

/* ==========================================================================
   03 — Projects
   ========================================================================== */
.project-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  overflow: hidden;
  background:
    radial-gradient(700px 380px at 100% 0%, rgba(42, 31, 255, 0.2), transparent 70%),
    linear-gradient(180deg, rgba(var(--ink), 0.05), rgba(var(--ink), 0.012));
}
.pf-body { padding: clamp(1.5rem, 3.2vw, 2.8rem); display: flex; flex-direction: column; gap: 1.2rem; }
.pf-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.pf-kicker .ico { width: 16px; height: 16px; }
.pf-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.3rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.pf-desc { color: var(--text-2); font-size: 0.97rem; line-height: 1.7; }
.pf-desc strong { color: var(--accent-3); }
.pf-body .btn-row { margin-top: 0.4rem; }

.pf-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  border-left: 1px solid var(--border);
  background:
    linear-gradient(rgba(var(--ink), 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(var(--ink), 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--inset);
}
.pf-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--border);
}
.pf-stats > div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  background: var(--panel-2);
}
.pf-stats dt { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.pf-stats .stat-num { font-size: clamp(1.6rem, 2.4vw, 2.1rem); }

.pipeline-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.pipeline-steps { position: relative; display: grid; gap: 0.7rem; }
.pipeline-steps::before {
  content: "";
  position: absolute;
  left: 17px; top: 18px; bottom: 18px;
  width: 1px;
  background: linear-gradient(180deg, rgba(140, 133, 255, 0.6), rgba(140, 133, 255, 0.1));
}
.pipeline-steps::after {
  content: "";
  position: absolute;
  left: 15px; top: 14px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px 3px rgba(168, 162, 255, 0.9);
  opacity: 0;
}
.is-in .pipeline-steps::after { animation: packet 4.5s ease-in-out 0.6s infinite; }
@keyframes packet {
  0% { top: 14px; opacity: 0; }
  8% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: calc(100% - 18px); opacity: 0; }
}
.pipeline-steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.92rem;
  color: var(--text);
}
.step-n {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 35px; height: 35px;
  flex: none;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-3);
  background: var(--panel);
  border: 1px solid rgba(140, 133, 255, 0.35);
}

.project-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.project-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.project-grid > div { display: flex; }
.project-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  transition: transform 0.6s var(--ease-out), border-color 0.35s ease;
  will-change: transform;
}
.project-card:hover { border-color: rgba(var(--ink), 0.14); }
.pc-art {
  position: relative;
  height: 170px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(rgba(var(--ink), 0.03) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(var(--ink), 0.03) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(420px 200px at 70% 0%, rgba(42, 31, 255, 0.28), transparent 70%),
    var(--art);
}
.pc-art-health {
  background:
    linear-gradient(rgba(var(--ink), 0.03) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(var(--ink), 0.03) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(420px 200px at 20% 0%, rgba(45, 212, 191, 0.2), transparent 70%),
    var(--art-2);
}
.pc-art-folio {
  background:
    linear-gradient(rgba(var(--ink), 0.03) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(var(--ink), 0.03) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(420px 200px at 50% 0%, rgba(251, 191, 36, 0.18), transparent 70%),
    var(--art-3);
}
.pc-art-news {
  background:
    linear-gradient(rgba(var(--ink), 0.03) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(var(--ink), 0.03) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(420px 200px at 80% 0%, rgba(244, 114, 182, 0.18), transparent 70%),
    var(--art);
}
.paper { width: 100%; height: 100%; }
.paper .pp-sheet { fill: rgba(var(--ink), 0.04); stroke: rgba(var(--ink), 0.14); }
.paper .pp-mast { fill: rgba(var(--ink), 0.55); }
.paper .pp-rule { stroke: rgba(var(--ink), 0.3); stroke-width: 1.2; }
.paper .pp-img { fill: rgba(244, 114, 182, 0.35); }
.paper .pp-lines { fill: none; stroke: rgba(var(--ink), 0.22); stroke-width: 3; stroke-linecap: round; }
.js .paper .pp-sheet { transform: translateY(14px); opacity: 0; transition: transform 1s var(--ease-out), opacity 0.6s ease; }
.js .is-in .paper .pp-sheet { transform: none; opacity: 1; }
.js .paper .pp-lines path { stroke-dasharray: 600; stroke-dashoffset: 600; transition: stroke-dashoffset 1.8s var(--ease-out) 0.4s; }
.js .is-in .paper .pp-lines path { stroke-dashoffset: 0; }
.gauges { width: 100%; height: 100%; }
.gauges .g-track { fill: none; stroke: rgba(var(--ink), 0.08); stroke-width: 9; stroke-linecap: round; }
.gauges .g-arc { fill: none; stroke: url(#gauge-grad); stroke-width: 9; stroke-linecap: round; opacity: 0.85; }
.gauges .needle {
  stroke: var(--text);
  stroke-width: 2.5;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: rotate(var(--a));
}
.gauges .g-hub { fill: var(--text); }
.js .gauges .needle { transform: rotate(-90deg); transition: transform 1.8s var(--ease-out) 0.3s; }
.js .is-in .gauges .needle { transform: rotate(var(--a)); }
.js .is-in .gauges .gauge:nth-child(3) .needle { transition-delay: 0.45s; }
.js .is-in .gauges .gauge:nth-child(4) .needle { transition-delay: 0.6s; }
.candles { width: 100%; height: 100%; }
.candles .wick { stroke-width: 1.2; }
.candles .up { fill: #8c85ff; stroke: #8c85ff; }
.candles .down { fill: transparent; stroke: rgba(201, 197, 255, 0.55); }
.candles .trend { fill: none; stroke: var(--accent-3); stroke-width: 1.6; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(140, 133, 255, 0.9)); }
.candles .area { fill: url(#candle-area); }
.candles .c {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.js .candles .c { transform: scaleY(0); opacity: 0; transition: transform 0.7s var(--ease-out), opacity 0.4s ease; transition-delay: var(--cd, 0s); }
.js .is-in .candles .c { transform: none; opacity: 1; }
.js .candles .trend { stroke-dasharray: var(--len, 1200); stroke-dashoffset: var(--len, 1200); transition: stroke-dashoffset 2.2s var(--ease-out) 0.3s; }
.js .is-in .candles .trend { stroke-dashoffset: 0; }
.bars {
  position: absolute;
  inset: 26px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.bars span {
  position: relative;
  display: block;
  height: 14px;
  border-radius: 7px;
  background: rgba(var(--ink), 0.05);
  overflow: hidden;
}
.bars span::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-origin: 0 50%;
  transform: scaleX(var(--w));
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.25), #5eead4);
  box-shadow: 0 0 16px rgba(94, 234, 212, 0.35);
}
.js .bars span::after { transform: scaleX(0); transition: transform 1.4s var(--ease-out); }
.js .bars span:nth-child(2)::after { transition-delay: 0.1s; }
.js .bars span:nth-child(3)::after { transition-delay: 0.2s; }
.js .bars span:nth-child(4)::after { transition-delay: 0.3s; }
.js .bars span:nth-child(5)::after { transition-delay: 0.4s; }
.js .is-in .bars span::after { transform: scaleX(var(--w)); }
.pc-body { flex: 1; display: flex; flex-direction: column; gap: 1rem; padding: clamp(1.3rem, 2.4vw, 1.9rem); }
.pc-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.9vw, 1.45rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.pc-desc { color: var(--text-2); font-size: 0.94rem; line-height: 1.68; }
.pc-body .btn-row { margin-top: auto; padding-top: 0.4rem; }

.project-more {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: clamp(1.3rem, 2.6vw, 2rem) clamp(1.3rem, 2.8vw, 2.2rem);
  border-style: dashed;
  border-color: rgba(140, 133, 255, 0.28);
  background: rgba(140, 133, 255, 0.03);
}
.project-more-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.015em; }
.project-more-body { margin-top: 0.3rem; color: var(--text-2); font-size: 0.93rem; max-width: 620px; }

@media (max-width: 980px) {
  .project-feature { grid-template-columns: 1fr; }
  .pf-visual { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 760px) {
  .project-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   04 — Education
   ========================================================================== */
.edu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.edu-card { padding: clamp(1.4rem, 2.6vw, 2.2rem); }
.edu-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.edu-icon {
  display: grid;
  place-items: center;
  width: 50px; height: 50px;
  border-radius: 14px;
  color: var(--accent-3);
  background: rgba(140, 133, 255, 0.1);
  border: 1px solid rgba(140, 133, 255, 0.25);
}
.edu-icon .ico { width: 24px; height: 24px; }
.edu-period {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}
.edu-school {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.edu-degree { margin-top: 0.4rem; color: var(--accent-3); font-weight: 500; }
.edu-desc { margin: 1rem 0 1.3rem; color: var(--text-2); font-size: 0.95rem; }
.edu-points li { font-size: 0.92rem; }
@media (max-width: 860px) { .edu-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   05 — Skills
   ========================================================================== */
.skills-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.skills-grid > :last-child { grid-column: 1 / -1; }
.skills-row { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; }
.skill-card { padding: clamp(1.3rem, 2.4vw, 1.9rem); }
.skill-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.2rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.skill-title .ico { width: 20px; height: 20px; color: var(--accent-2); }

.lang-list { display: grid; gap: 1.1rem; }
.lang-line { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.lang-name { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 600; }
.lang-flag { font-size: 1.15rem; line-height: 1; }
.lang-level { color: var(--text-2); font-size: 0.88rem; text-align: right; }
.lang-note { display: block; margin-top: 0.4rem; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--muted); }
.meter {
  display: block;
  margin-top: 0.55rem;
  height: 6px;
  border-radius: 3px;
  background: rgba(var(--ink), 0.06);
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transform-origin: 0 50%;
  transform: scaleX(var(--lvl));
  background: linear-gradient(90deg, #2a1fff, #a8a2ff);
  box-shadow: 0 0 10px rgba(140, 133, 255, 0.6);
}
.js .meter span { transform: scaleX(0); transition: transform 1.4s var(--ease-out) 0.2s; }
.js .is-in .meter span { transform: scaleX(var(--lvl)); }

.cert-list { display: grid; gap: 0.6rem; }
.cert {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(var(--ink), 0.02);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}
.cert:hover { border-color: rgba(var(--ink), 0.14); }
.cert summary {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  border-radius: 14px;
}
.cert summary::-webkit-details-marker { display: none; }
.cert summary::after {
  content: "";
  margin-left: 0.2rem;
  width: 7px; height: 7px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.3s var(--ease-out);
}
.cert[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.cert[open] { border-color: rgba(140, 133, 255, 0.3); background: rgba(140, 133, 255, 0.04); }
.cert-issuer { font-weight: 600; }
.cert-count {
  margin-left: auto;
  min-width: 28px;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-3);
  background: rgba(140, 133, 255, 0.12);
}
.cert ul { padding: 0 1rem 0.9rem; display: grid; gap: 0.1rem; }
.cert ul li {
  padding: 0.42rem 0 0.42rem 1.2rem;
  position: relative;
  color: var(--text-2);
  font-size: 0.9rem;
  border-top: 1px solid rgba(var(--ink), 0.05);
}
.cert ul li::before {
  content: "";
  position: absolute;
  left: 0.1rem; top: 1.05em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
}
.cert[open] ul { animation: fade-up 0.5s var(--ease-out) both; }
.cert-single { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem 1rem; padding: 0.85rem 1rem; }
.cert-item { color: var(--text-2); font-size: 0.9rem; }
.cert-year { margin-left: 0.35rem; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }

.interests { margin-top: 2.5rem; }

@media (max-width: 980px) {
  .skills-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .skills-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   06 — Contact
   ========================================================================== */
.contact { overflow: hidden; }
.contact::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -320px;
  width: 1100px;
  height: 640px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--contact-glow), transparent);
  pointer-events: none;
  z-index: -1;
}
.contact .section-head { margin-bottom: 1.2rem; }
.contact-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 8.2rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.05em;
  background: var(--grad-contact);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  padding-bottom: 0.08em;
}
.contact-lead { margin-top: 1.4rem; max-width: 640px; color: var(--text-2); font-size: 1.1rem; }
.email-row {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.2rem;
}
.email-big {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.6vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text);
  word-break: break-all;
}
.email-big::before,
.email-big::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  border-radius: 2px;
}
.email-big::before { background: rgba(140, 133, 255, 0.25); }
.email-big::after {
  background: linear-gradient(90deg, var(--accent), var(--accent-2), #7dd3fc);
  transform-origin: 100% 50%;
  transform: scaleX(0);
  transition: transform 0.6s var(--ease-out);
}
.email-big:hover::after { transform-origin: 0 50%; transform: scaleX(1); }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 40px;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(var(--ink), 0.04);
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 600;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.copy-btn:hover { color: var(--text); border-color: rgba(var(--ink), 0.3); }
.copy-btn .ico { width: 16px; height: 16px; }
.copy-btn .ico-check { display: none; color: var(--live); }
.copy-btn.is-copied { border-color: rgba(52, 211, 153, 0.5); color: var(--live-text); }
.copy-btn.is-copied .ico-copy { display: none; }
.copy-btn.is-copied .ico-check { display: block; }
.contact-note { margin-top: 1rem; color: var(--muted); font-size: 0.92rem; }

.contact-links {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 1.4rem;
  transition: border-color 0.3s ease, transform 0.5s var(--ease-out);
}
.contact-link:hover { border-color: rgba(140, 133, 255, 0.35); }
.contact-link > .ico-lg { color: var(--accent-3); }
.cl-text { display: flex; flex-direction: column; min-width: 0; }
.cl-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cl-value { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-arrow { margin-left: auto; color: var(--muted); transition: transform 0.4s var(--ease-out), color 0.3s ease; }
.contact-link:hover .cl-arrow { color: var(--text); transform: translate(3px, -3px); }
@media (max-width: 860px) { .contact-links { grid-template-columns: 1fr; } }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin-top: calc(-1 * clamp(4.5rem, 9vw, 7rem) + 2.5rem);
  padding-bottom: 2.5rem;
}
.footer-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-copy { color: var(--muted); font-size: 0.85rem; }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.86rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.footer-links a:hover { color: var(--text); background: rgba(var(--ink), 0.05); }
.footer-links .ico { width: 16px; height: 16px; }
.to-top { border: 1px solid var(--border); }
.to-top .ico { transition: transform 0.35s var(--ease-out); }
.to-top:hover .ico { transform: translateY(-3px); }

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 160;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: var(--toast-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--toast-fg);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 20px 50px -20px var(--shadow);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.5s var(--ease-out);
}
.toast:empty { display: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Command palette (built by home.js)
   ========================================================================== */
.cmd {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: min(16vh, 140px) 16px 16px;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
/* visibility flips instantly on open so the input can take focus right away */
.cmd.is-open { opacity: 1; visibility: visible; transition: opacity 0.25s ease, visibility 0s; }
.cmd-panel {
  width: min(640px, 100%);
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  box-shadow: 0 40px 100px -30px var(--shadow), 0 0 0 1px rgba(140, 133, 255, 0.08), 0 0 80px -30px rgba(42, 31, 255, 0.6);
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.4s var(--ease-out);
}
.cmd.is-open .cmd-panel { transform: none; }
.cmd-search { display: flex; align-items: center; gap: 0.75rem; padding: 0 1.1rem; border-bottom: 1px solid var(--border); }
.cmd-search .ico { color: var(--muted); }
.cmd-input {
  flex: 1;
  height: 58px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.02rem;
}
.cmd-input::placeholder { color: var(--muted); }
.cmd-esc { font-size: 0.68rem; padding: 0.15rem 0.45rem; border-radius: 6px; border: 1px solid var(--border-strong); color: var(--muted); }
.cmd-list { overflow-y: auto; padding: 0.5rem; }
.cmd-group {
  padding: 0.7rem 0.75rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  color: var(--text-2);
  cursor: pointer;
  font-size: 0.95rem;
}
.cmd-item .ico { width: 17px; height: 17px; color: var(--muted); }
.cmd-item[aria-selected="true"] { background: rgba(140, 133, 255, 0.14); color: var(--text); }
.cmd-item[aria-selected="true"] .ico { color: var(--accent-3); }
.cmd-item .cmd-go { margin-left: auto; opacity: 0; font-size: 0.8rem; }
.cmd-item[aria-selected="true"] .cmd-go { opacity: 1; }
.cmd-empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.cmd-foot {
  display: flex;
  gap: 1.2rem;
  padding: 0.7rem 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--muted);
}
.cmd-foot kbd { font-size: 0.68rem; padding: 0.1rem 0.35rem; margin-right: 0.3rem; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--text-2); }
html.cmd-lock { overflow: hidden; }

/* ==========================================================================
   Reduced motion — calm everything down
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  /* "Reduce motion" (macOS/iOS/Windows setting): keep fades, count-ups and
     ambient effects, replace large sliding movement with simple fades */
  .hero-name .line > span, .hero-name .grad { animation-name: fade-in; }
  .hero-name .grad { animation: fade-in 1.25s ease 0.22s both, shimmer 9s ease-in-out 1.5s infinite; }
  .hero-status, .hero-lead, .hero-desc, .hero-cta { animation-name: fade-in; }
  .cert[open] ul, .tl-points > li.is-new { animation-name: fade-in; }
}

/* Light theme: surfaces (kept after the base card rules so they win) */
@media (prefers-color-scheme: light) {
  /* crisp white cards with a soft lift instead of translucent tints */
  .tile, .tl-card, .project-card, .edu-card, .skill-card, .contact-link {
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 18, 48, 0.04), 0 10px 30px -18px rgba(16, 18, 48, 0.18);
  }
  .tile-summary, .project-feature {
    background: radial-gradient(600px 300px at 0% 0%, rgba(42, 31, 255, 0.08), transparent 70%), #ffffff;
    box-shadow: 0 1px 2px rgba(16, 18, 48, 0.04), 0 10px 30px -18px rgba(16, 18, 48, 0.18);
  }
  .project-more { background: rgba(42, 31, 255, 0.03); }
}

@media print {
  body::before, .cursor-glow, .scroll-progress, .site-nav, .hero-field, .hero-scroll, .toast { display: none !important; }
  body, html { background: #fff; color: #000; }
}
