/* ==========================================================================
   ANTONO - personal technology ecosystem
   Token layer first, components second. Everything themes off [data-theme].
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --background: 218 25% 8%;
  --foreground: 190 32% 94%;
  --border: 205 20% 20%;
  --muted: 205 15% 55%;
  --accent: 170 68% 54%;
  --accent-ink: 170 68% 64%;
  --panel: 218 22% 12%;
  --glow-a: rgba(34, 211, 238, 0.12);
  --glow-b: rgba(74, 222, 128, 0.10);

  /* --- Type scale -----------------------------------------------------------
     One ramp instead of ad-hoc sizes. Steps are named by role, not by number,
     so "this is a label" survives a future resize of the whole ramp. */
  --text-2xs: 0.6875rem;   /* 11px - mono keys, tags, counters */
  --text-xs: 0.75rem;      /* 12px - eyebrows, meta, field labels */
  --text-sm: 0.8125rem;    /* 13px - dense body, card meta */
  --text-base: 0.9375rem;  /* 15px - secondary body copy */
  --text-md: 1rem;         /* 16px - body */
  --text-lg: 1.0625rem;    /* 17px - lede, card titles */
  --text-xl: 1.1875rem;    /* 19px - feature titles */
  --text-2xl: clamp(1.5rem, 2.4vw, 1.875rem);
  --text-3xl: clamp(1.85rem, 4.2vw, 2.6rem);
  --text-display: clamp(2.7rem, 10.5vw, 4.6rem);

  /* Tracking tightens as type grows: large text needs negative tracking to
     look even, small caps-y labels need positive tracking to stay legible. */
  --track-display: -0.03em;
  --track-title: -0.018em;
  --track-body: 0;
  --track-label: 0.14em;
  --track-mono: 0.05em;

  /* --- Space scale: 4px base ---------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  --radius: 0.7rem;
  --radius-sm: 0.5rem;
  --radius-lg: 1rem;
  --shell: 80rem;
  --gutter: clamp(1rem, 4vw, 2rem);

  --font-display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* --- Depth: three levels, each two shadows (contact + ambient) -----------
     A single hard shadow reads as a flat drop; pairing a tight contact shadow
     with a wide ambient one is what makes a surface look lifted. */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px -4px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.35), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
  --shadow-3: 0 4px 10px rgba(0, 0, 0, 0.4), 0 28px 60px -28px rgba(0, 0, 0, 0.85);
  --shadow-card: var(--shadow-2);
  /* Top-edge light catch: sells a surface as a physical plane facing the light. */
  --inset-hi: inset 0 1px 0 hsl(var(--foreground) / 0.06);

  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --background: 195 45% 96%;
  --foreground: 210 30% 12%;
  --border: 200 24% 78%;
  --muted: 205 15% 40%;
  --accent: 174 68% 38%;
  --accent-ink: 174 74% 25%;
  --panel: 0 0% 100%;
  --glow-a: rgba(20, 184, 166, 0.16);
  --glow-b: rgba(14, 165, 233, 0.12);
  --shadow-1: 0 1px 2px rgba(15, 40, 60, 0.06), 0 2px 8px -4px rgba(15, 40, 60, 0.10);
  --shadow-2: 0 2px 4px rgba(15, 40, 60, 0.05), 0 14px 30px -18px rgba(15, 40, 60, 0.28);
  --shadow-3: 0 4px 10px rgba(15, 40, 60, 0.07), 0 30px 60px -30px rgba(15, 40, 60, 0.32);
  --shadow-card: var(--shadow-2);
  /* On a light canvas the light comes from above too, but a white inset line is
     invisible on white - use a faint shadow-side line instead. */
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color-scheme: light;
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 12%, var(--glow-a), transparent 28rem),
    radial-gradient(circle at 80% 4%, var(--glow-b), transparent 25rem),
    hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: var(--track-title); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

/* Headings are usually short and never want an orphaned last word; long body
   copy reads better without a ragged final line. `pretty` is the stronger hint
   but is not everywhere yet, so both are declared. */
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

::selection { background: hsl(var(--accent) / 0.3); color: hsl(var(--foreground)); }

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

/* The header is sticky, so an in-page jump would otherwise land with the
   heading tucked underneath it. Every scroll target claims the header's
   height (plus a little air) as clearance. */
:target,
[id] { scroll-margin-top: 5.5rem; }

/* Briefly flag whichever section was just jumped to, so the jump is legible
   rather than just a silent repositioning. */
@keyframes target-flash {
  from { background-color: hsl(var(--accent) / 0.09); }
  to { background-color: transparent; }
}
:target { animation: target-flash 1.6s var(--ease-out) both; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }

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

/* ---------- 3. Atmosphere ---------- */
.atmosphere { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(hsl(var(--foreground) / 0.035) 1px, transparent 0),
    linear-gradient(90deg, hsl(var(--foreground) / 0.025) 1px, transparent 0);
  background-size: 46px 46px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 72%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 72%);
}

.atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0, hsl(var(--accent) / 0.07) 46%, transparent 68%);
}

/* Film grain. Flat gradients band badly on cheap panels, and a little noise
   reads as "photographed surface" rather than "CSS gradient". It is a data URI
   so it costs no request, and `mix-blend-mode: overlay` keeps it from washing
   out the type. Kept very low opacity on purpose - it should be felt, not seen. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: no-preference) {
  /* A very slow drift keeps the grain from looking like a printed overlay. */
  .grain { animation: grain-shift 8s steps(6) infinite; }
}

@keyframes grain-shift {
  0%, 100% { transform: translate(0, 0); }
  16% { transform: translate(-2%, 1%); }
  33% { transform: translate(1%, -2%); }
  50% { transform: translate(-1%, 2%); }
  66% { transform: translate(2%, 1%); }
  83% { transform: translate(-2%, -1%); }
}

.page { position: relative; z-index: 1; }

/* ---------- 4. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid hsl(var(--border) / 0.7);
  background: hsl(var(--background) / 0.82);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 4rem;
  flex-wrap: wrap;
  padding-block: 0.5rem;
}

.brand { display: inline-flex; align-items: center; gap: 0.7rem; min-width: 0; }

.brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid hsl(var(--accent) / 0.35);
  border-radius: var(--radius-sm);
  background: hsl(var(--accent) / 0.1);
  color: hsl(var(--accent-ink));
  overflow: hidden;
}

.brand__mark svg { width: 1.05rem; height: 1.05rem; position: relative; z-index: 1; }

.brand__mark::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 120deg, #2dd4bf, #38bdf8, #a78bfa, #f59e0b, #2dd4bf);
  opacity: 0.35;
  filter: blur(12px);
  transition: opacity 0.35s var(--ease);
}

.brand:hover .brand__mark::after { opacity: 0.7; }

.brand__name { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
.brand:hover .brand__name { color: hsl(var(--accent-ink)); }

.nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: hsl(var(--muted));
  font-size: var(--text-base);
  font-weight: 500;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.nav__link svg { width: 0.9rem; height: 0.9rem; }

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: hsl(var(--foreground));
  border-color: hsl(var(--border) / 0.7);
  background: hsl(var(--foreground) / 0.05);
}

.nav__link[aria-current="page"] { color: hsl(var(--accent-ink)); }

.header-tools { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid hsl(var(--accent) / 0.35);
  border-radius: var(--radius-sm);
  background: hsl(var(--background) / 0.7);
  color: hsl(var(--accent-ink));
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.icon-btn svg { width: 1.05rem; height: 1.05rem; position: relative; z-index: 1; }

.icon-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(from 120deg, #2dd4bf, #38bdf8, #a78bfa, #f59e0b, #2dd4bf);
  opacity: 0.4;
  filter: blur(9px);
  transition: opacity 0.3s;
}

.icon-btn::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 5px;
  background: hsl(var(--background) / 0.92);
}

.icon-btn:hover { border-color: hsl(var(--accent) / 0.75); box-shadow: 0 0 34px hsl(var(--accent) / 0.22); }
.icon-btn:hover::before { opacity: 0.75; }

.lang-select {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.5rem;
  padding-inline: 0.7rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background: hsl(var(--background) / 0.4);
  color: hsl(var(--muted));
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
}

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-grid; }
  .nav {
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease), padding 0.35s var(--ease);
  }
  .nav[data-open="true"] { max-height: 24rem; padding-block: 0.5rem; }
  .nav__link { justify-content: flex-start; }
  .brand__name { display: none; }
}

/* ---------- 5. Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  height: 2.85rem;
  padding-inline: 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  overflow: hidden;
  transition: transform 0.2s var(--ease), background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.btn svg { width: 1rem; height: 1rem; }
.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: hsl(var(--accent));
  color: hsl(200 40% 8%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 34px -16px hsl(var(--accent) / 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn--primary:hover { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 44px -16px hsl(var(--accent) / 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.45); }

.btn--ghost { border-color: hsl(var(--border)); background: hsl(var(--foreground) / 0.05); color: hsl(var(--foreground)); }
.btn--ghost:hover { background: hsl(var(--foreground) / 0.1); border-color: hsl(var(--accent) / 0.5); }

.btn--quiet {
  border-color: hsl(var(--accent) / 0.3);
  background: linear-gradient(135deg, hsl(var(--accent) / 0.13), hsl(var(--foreground) / 0.03));
  color: hsl(var(--accent-ink));
}

.btn--quiet:hover { border-color: hsl(var(--accent) / 0.65); box-shadow: 0 0 34px hsl(var(--accent) / 0.16); }
.btn--block { width: 100%; }

/* ---------- 6. Hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid hsl(var(--border) / 0.7); }

.hero__halo {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 18%, rgba(45, 212, 191, 0.12), transparent 24rem),
    radial-gradient(circle at 88% 28%, rgba(56, 189, 248, 0.10), transparent 22rem);
}

.hero__topline {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  z-index: 0;
  background: linear-gradient(90deg, transparent, hsl(var(--accent) / 0.6), transparent);
}

.hero__plaques { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }

.plaque {
  position: absolute;
  display: inline-flex;
  align-items: center;
  max-width: min(38rem, 46vw);
  padding: 0.48rem 0.75rem;
  border: 1px solid hsl(var(--accent) / 0.1);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, hsl(var(--foreground) / 0.034), hsl(var(--accent) / 0.024)), hsl(var(--background) / 0.14);
  color: hsl(var(--foreground) / 0.18);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  animation: plaque-drift 42s ease-in-out infinite alternate;
}

.plaque[data-plaque="1"] { top: clamp(4.5rem, 7vw, 6.4rem); left: 5vw; opacity: 0.38; transform: rotate(-3deg); }
.plaque[data-plaque="2"] { top: clamp(6rem, 8.8vw, 8rem); left: 31vw; max-width: min(32rem, 38vw); color: hsl(var(--accent) / 0.2); font-size: var(--text-xs); opacity: 0.26; transform: rotate(-2deg); animation-duration: 56s; }
.plaque[data-plaque="3"] { top: clamp(5rem, 7.4vw, 6.7rem); right: 6vw; max-width: min(30rem, 34vw); opacity: 0.24; transform: rotate(-4deg); animation-duration: 64s; }
.plaque[data-plaque="4"] { right: 24vw; bottom: clamp(5.25rem, 8vw, 7rem); max-width: min(25rem, 30vw); color: hsl(var(--foreground) / 0.13); font-size: var(--text-2xs); opacity: 0.18; transform: rotate(-3deg); animation-duration: 70s; }
.plaque[data-plaque="5"] { bottom: clamp(3rem, 5vw, 4.5rem); left: 8vw; max-width: min(34rem, 42vw); color: hsl(var(--accent) / 0.18); opacity: 0.42; transform: rotate(-3deg); animation-duration: 58s; }
.plaque[data-plaque="6"] { right: 9vw; bottom: clamp(1rem, 2.6vw, 2.3rem); max-width: min(38rem, 48vw); color: hsl(var(--foreground) / 0.16); opacity: 0.34; transform: rotate(-4deg); animation-duration: 66s; }

@keyframes plaque-drift {
  from { translate: 0 0; }
  to { translate: 1.4rem -0.9rem; }
}

.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding-block: clamp(3rem, 8vw, 7rem);
}

@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: minmax(0, 1.08fr) minmax(20rem, 0.92fr); min-height: 40rem; }
}

.hero__copy { position: relative; max-width: 46rem; min-width: 0; }

/* Hero arrival: one orchestrated sequence on load rather than scattered
   micro-animations. Each block starts slightly after the one above it, which
   reads as the page assembling itself. */
@media (prefers-reduced-motion: no-preference) {
  /* No `opacity: 0` on the element itself - the backwards fill from `both`
     already hides it during the delay, so content stays visible if the
     animation never runs. */
  .hero__copy > * {
    animation: hero-rise 0.85s var(--ease-out) both;
  }
  .hero__copy > *:nth-child(1) { animation-delay: 0.05s; }
  .hero__copy > *:nth-child(2) { animation-delay: 0.14s; }
  .hero__copy > *:nth-child(3) { animation-delay: 0.23s; }
  .hero__copy > *:nth-child(4) { animation-delay: 0.32s; }
  .hero__copy > *:nth-child(5) { animation-delay: 0.41s; }
  .hero__copy > *:nth-child(6) { animation-delay: 0.5s; }
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.wordmark {
  font-size: var(--text-display);
  font-weight: 700;
  letter-spacing: var(--track-display);
  line-height: 0.95;
  margin: 0;
  white-space: nowrap;
}

.wordmark__letter {
  position: relative;
  display: inline-block;
  color: transparent;
  background: linear-gradient(135deg, hsl(var(--foreground)) 0, hsl(172 70% 88%) 32%, hsl(172 78% 72%) 52%, hsl(var(--accent)) 76%, hsl(var(--foreground)) 100%);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(45, 212, 191, 0.1));
  animation: letter-breathe 7.5s var(--ease) infinite;
}

.wordmark__letter::after {
  content: "";
  position: absolute;
  right: 0.08em; bottom: 0.08em; left: 0.08em;
  height: 0.055em;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.68), rgba(226, 246, 255, 0.82), transparent);
  filter: blur(0.018em);
  opacity: 0.34;
  transform: scaleX(0.72);
  animation: letter-underline 7.5s var(--ease) infinite;
}

@keyframes letter-breathe {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes letter-underline {
  0%, 100% { transform: scaleX(0.72); opacity: 0.34; }
  50% { transform: scaleX(1); opacity: 0.6; }
}

.hero__signal { margin-top: 1.4rem; }

.hero__signal-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: hsl(var(--foreground) / 0.85);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
}

.signal-dot {
  position: relative;
  flex: 0 0 auto;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: hsl(var(--accent));
  box-shadow: 0 0 0 0.35rem hsl(var(--accent) / 0.12), 0 0 24px hsl(var(--accent) / 0.42);
  animation: dot-pulse 2.4s ease-in-out infinite;
}

.signal-dot::after {
  content: "";
  position: absolute;
  inset: -0.48rem;
  border: 1px solid hsl(var(--accent) / 0.35);
  border-radius: inherit;
  animation: dot-ring 2.4s ease-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0.35rem hsl(var(--accent) / 0.12), 0 0 24px hsl(var(--accent) / 0.42); }
  50% { box-shadow: 0 0 0 0.55rem hsl(var(--accent) / 0.08), 0 0 34px hsl(var(--accent) / 0.6); }
}

@keyframes dot-ring {
  0% { opacity: 0.8; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.45); }
}

.hero__lede { margin-top: 1.1rem; max-width: 34rem; color: hsl(var(--muted)); font-size: var(--text-lg); }
.hero__roles { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.4rem; }

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--foreground) / 0.04);
  color: hsl(var(--muted));
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}

.role-chip svg { width: 0.85rem; height: 0.85rem; color: hsl(var(--accent-ink)); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.9rem; }

.hero__cue {
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  margin-top: 1.6rem;
  padding: 0.42rem 0.9rem;
  border: 1px solid hsl(var(--accent) / 0.28);
  border-radius: 999px;
  background: linear-gradient(135deg, hsl(var(--accent) / 0.13), hsl(var(--foreground) / 0.035)), hsl(var(--background) / 0.56);
  color: hsl(var(--accent-ink));
  font-size: var(--text-sm);
  font-weight: 600;
  backdrop-filter: blur(12px);
  transition: border-color 0.25s, transform 0.25s var(--ease);
}

.hero__cue:hover { border-color: hsl(var(--accent) / 0.7); transform: translateY(2px); }

.hero__panel {
  position: relative;
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, hsl(var(--panel) / 0.9), hsl(var(--background) / 0.75));
  box-shadow: var(--shadow-3), var(--inset-hi);
  overflow: hidden;
}

.hero__panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(circle at 20% 0%, hsl(var(--accent) / 0.22), transparent 18rem);
  pointer-events: none;
}

.portrait {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 20%, hsl(var(--accent) / 0.18), transparent 12rem),
    repeating-linear-gradient(135deg, hsl(var(--foreground) / 0.03) 0 2px, transparent 2px 9px),
    hsl(var(--background) / 0.6);
  overflow: hidden;
}

.portrait__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  filter: saturate(0.92) contrast(1.03);
}

.portrait__scan {
  position: absolute;
  inset-inline: 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, hsl(var(--accent) / 0.14), transparent);
  animation: scan 6.5s linear infinite;
}

@keyframes scan {
  0% { translate: 0 -120%; }
  100% { translate: 0 420%; }
}

.panel-rows { display: grid; gap: 0.6rem; }

.panel-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed hsl(var(--border) / 0.8);
  font-size: var(--text-base);
}

.panel-row:last-child { border-bottom: 0; padding-bottom: 0; }
.panel-row dt { color: hsl(var(--muted)); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: var(--track-mono); text-transform: uppercase; }
.panel-row dd { margin: 0; text-align: right; font-weight: 600; }

/* ---------- 7. Sections ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4rem); }

.section__head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; max-width: none; flex-wrap: wrap; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  color: hsl(var(--accent-ink));
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.eyebrow::before { content: ""; width: 1.6rem; height: 1px; background: hsl(var(--accent) / 0.7); }

.section__title { font-size: var(--text-3xl); letter-spacing: var(--track-title); }
.section__lede { margin-top: 0.9rem; color: hsl(var(--muted)); }

/* ---------- 8. Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.75rem; }

.stat {
  position: relative;
  padding: 1.1rem 1.15rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--panel) / 0.65);
  box-shadow: var(--shadow-1), var(--inset-hi);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}

.stat::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, hsl(var(--accent) / 0.85), transparent);
  transform: scaleX(0.25);
  transition: transform 0.4s var(--ease);
}

.stat:hover { border-color: hsl(var(--accent) / 0.45); transform: translateY(-3px); box-shadow: var(--shadow-2), var(--inset-hi); }
.stat:hover::after { transform: scaleX(1); }

.stat__value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; line-height: 1; letter-spacing: var(--track-display); font-variant-numeric: tabular-nums; }
.stat__label { margin-top: 0.4rem; color: hsl(var(--muted)); font-size: var(--text-sm); letter-spacing: 0.03em; }

/* ---------- 9. Cards ---------- */
.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.4rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--panel) / 0.7);
  box-shadow: var(--shadow-card), var(--inset-hi);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), hsl(var(--accent) / 0.22), transparent 12rem),
    linear-gradient(120deg, transparent, hsl(var(--foreground) / 0.05), transparent);
  opacity: 0;
  transition: opacity 0.28s;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  border-color: hsl(var(--accent) / 0.5);
  box-shadow: var(--shadow-3), var(--inset-hi), 0 0 0 1px hsl(var(--accent) / 0.12);
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }

.card__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }

.card__icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: 0 0 auto;
  border: 1px solid hsl(var(--accent) / 0.3);
  border-radius: var(--radius-sm);
  background: hsl(var(--accent) / 0.1);
  color: hsl(var(--accent-ink));
}

.card__icon svg { width: 1.15rem; height: 1.15rem; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--foreground) / 0.04);
  color: hsl(var(--muted));
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag--accent { border-color: hsl(var(--accent) / 0.4); background: hsl(var(--accent) / 0.1); color: hsl(var(--accent-ink)); }

.card__title { font-size: var(--text-xl); }
.card__slug { margin-top: 0.3rem; color: hsl(var(--muted)); font-family: var(--font-mono); font-size: var(--text-xs); }
.card__text { margin-top: 0.7rem; color: hsl(var(--muted)); font-size: var(--text-base); }

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid hsl(var(--border) / 0.7);
  color: hsl(var(--muted));
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.04em;
}

.card__meta b { color: hsl(var(--accent-ink)); font-weight: 600; }

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 1.1rem;
  color: hsl(var(--accent-ink));
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
}

.card__link svg { width: 0.9rem; height: 0.9rem; transition: transform 0.25s var(--ease); }
.card:hover .card__link svg { transform: translateX(4px); }

.cat-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: linear-gradient(160deg, hsl(var(--panel) / 0.75), hsl(var(--background) / 0.6));
  transition: transform 0.25s var(--ease), border-color 0.25s;
}

.cat-card:hover { transform: translateY(-3px); border-color: hsl(var(--accent) / 0.5); }
.cat-card__key { color: hsl(var(--accent-ink)); font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: 0.08em; }
.cat-card__title { font-size: var(--text-md); }
.cat-card__count { color: hsl(var(--muted)); font-size: var(--text-sm); }

/* ---------- 10. Feed ---------- */
.feed { display: grid; gap: 0.85rem; }

.feed-item {
  position: relative;
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--panel) / 0.6);
  box-shadow: var(--shadow-1);
  transition: border-color 0.25s, transform 0.25s var(--ease), background 0.25s, box-shadow 0.25s;
}

.feed-item:hover { border-color: hsl(var(--accent) / 0.5); transform: translateX(4px); background: hsl(var(--panel) / 0.85); box-shadow: var(--shadow-2); }

.feed-item__date { color: hsl(var(--muted)); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.04em; }
.feed-item__body { min-width: 0; }
.feed-item__title { font-size: var(--text-lg); }
.feed-item__text { margin-top: 0.45rem; color: hsl(var(--muted)); font-size: var(--text-base); }
.feed-item__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }

@media (max-width: 640px) {
  .feed-item { grid-template-columns: 1fr; gap: 0.6rem; }
}

/* ---------- 11. Footer ---------- */
.site-footer {
  position: relative;
  margin-top: 2rem;
  padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem;
  border-top: 1px solid hsl(var(--border) / 0.7);
  background: linear-gradient(180deg, hsl(var(--background) / 0.4), hsl(var(--panel) / 0.55));
}

.footer__grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.footer__title { font-size: var(--text-sm); font-family: var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: hsl(var(--accent-ink)); }
.footer__list { display: grid; gap: 0.5rem; margin-top: 1rem; }
.footer__list a { color: hsl(var(--muted)); font-size: var(--text-base); transition: color 0.2s; }
.footer__list a:hover { color: hsl(var(--foreground)); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid hsl(var(--border) / 0.6);
  color: hsl(var(--muted));
  font-size: var(--text-sm);
}

.socials { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.socials a {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  color: hsl(var(--muted));
  transition: color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}

.socials a:hover { color: hsl(var(--accent-ink)); border-color: hsl(var(--accent) / 0.6); transform: translateY(-2px); }
.socials svg { width: 1rem; height: 1rem; }

/* ---------- 12. Page hero ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid hsl(var(--border) / 0.7);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.page-hero__inner { position: relative; z-index: 1; }
.page-hero h1 { font-size: var(--text-3xl); letter-spacing: var(--track-title); }
.page-hero p { margin-top: 0.9rem; max-width: 42rem; color: hsl(var(--muted)); }

.crumbs { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.1rem; color: hsl(var(--muted)); font-family: var(--font-mono); font-size: var(--text-xs); }
.crumbs a:hover { color: hsl(var(--accent-ink)); }

/* ---------- 13. Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1.75rem; }

.chip {
  padding: 0.42rem 0.85rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--foreground) / 0.03);
  color: hsl(var(--muted));
  font-size: var(--text-sm);
  transition: all 0.22s;
}

.chip:hover { color: hsl(var(--foreground)); border-color: hsl(var(--accent) / 0.5); }
.chip[aria-pressed="true"] { border-color: hsl(var(--accent) / 0.6); background: hsl(var(--accent) / 0.12); color: hsl(var(--accent-ink)); }

.field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 15rem;
  min-width: 0;
  padding: 0.55rem 0.85rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background: hsl(var(--background) / 0.6);
  color: hsl(var(--muted));
}

.field svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.field input { flex: 1; min-width: 0; border: 0; background: none; color: hsl(var(--foreground)); font: inherit; outline: none; }
.field:focus-within { border-color: hsl(var(--accent) / 0.6); }

.empty { padding: 3rem 1.5rem; border: 1px dashed hsl(var(--border)); border-radius: var(--radius); color: hsl(var(--muted)); text-align: center; }

/* ---------- 14. Resume ---------- */
.timeline { position: relative; display: grid; gap: 1.25rem; padding-left: 1.5rem; }
.timeline::before { content: ""; position: absolute; left: 0.35rem; top: 0.4rem; bottom: 0.4rem; width: 1px; background: linear-gradient(180deg, hsl(var(--accent) / 0.7), hsl(var(--border))); }

.timeline__item { position: relative; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0.45rem;
  width: 0.72rem;
  height: 0.72rem;
  border: 2px solid hsl(var(--accent));
  border-radius: 999px;
  background: hsl(var(--background));
  box-shadow: 0 0 0 0.25rem hsl(var(--accent) / 0.12);
}

.timeline__period { color: hsl(var(--accent-ink)); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; }
.timeline__role { margin-top: 0.25rem; font-size: var(--text-lg); }
.timeline__org { color: hsl(var(--muted)); font-size: var(--text-base); }
.timeline__desc { margin-top: 0.55rem; color: hsl(var(--muted)); font-size: var(--text-base); }

.skill-list { display: grid; gap: 1rem; }
.skill__head { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--text-sm); }
.skill__head span:last-child { color: hsl(var(--muted)); font-family: var(--font-mono); font-size: var(--text-xs); }
.skill__bar { margin-top: 0.45rem; height: 0.4rem; border-radius: 999px; background: hsl(var(--foreground) / 0.07); overflow: hidden; }
.skill__fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, hsl(var(--accent) / 0.55), hsl(var(--accent))); transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease); }
.is-visible .skill__fill { transform: scaleX(var(--level, 0.5)); }

.stack-groups { display: grid; gap: 1rem; }
.stack-group { padding: 1.1rem 1.2rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--panel) / 0.6); }
.stack-group h3 { font-size: var(--text-md); }
.stack-group ul { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.75rem; }
.stack-group li { padding: 0.22rem 0.6rem; border: 1px solid hsl(var(--border)); border-radius: 999px; color: hsl(var(--muted)); font-family: var(--font-mono); font-size: var(--text-xs); }

/* ---------- 15. Contacts ---------- */
.contact-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--panel) / 0.65);
  transition: transform 0.25s var(--ease), border-color 0.25s;
}

.contact-card:hover { transform: translateY(-3px); border-color: hsl(var(--accent) / 0.5); }
.contact-card__icon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: 0 0 auto; border: 1px solid hsl(var(--accent) / 0.3); border-radius: var(--radius-sm); background: hsl(var(--accent) / 0.1); color: hsl(var(--accent-ink)); }
.contact-card__icon svg { width: 1.05rem; height: 1.05rem; }
.contact-card__label { color: hsl(var(--muted)); font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: 0.1em; text-transform: uppercase; }
.contact-card__value { font-size: var(--text-base); word-break: break-word; }

.form { display: grid; gap: 0.9rem; }
.form label { display: grid; gap: 0.35rem; font-size: var(--text-sm); color: hsl(var(--muted)); }
.form input,
.form textarea {
  padding: 0.7rem 0.85rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background: hsl(var(--background) / 0.6);
  color: hsl(var(--foreground));
  font: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form input:focus,
.form textarea:focus { border-color: hsl(var(--accent) / 0.65); }
.form textarea { min-height: 8rem; resize: vertical; }
.form__note { color: hsl(var(--muted)); font-size: var(--text-sm); }

/* ---------- 16. Search dialog ---------- */
.dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 12vh 1rem 1rem;
  background: hsl(var(--background) / 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  /* On close, hold `visibility: visible` for the length of the fade so the
     panel animates out; on open (below) flip it with no delay. A plain
     `transition: visibility .25s` would keep it hidden on open, which makes
     the search input unfocusable. */
  transition: opacity 0.25s, visibility 0s 0.25s;
}

.dialog[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s, visibility 0s;
}

.dialog__panel {
  width: min(40rem, 100%);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--panel) / 0.98);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.28s var(--ease);
}

.dialog[data-open="true"] .dialog__panel { transform: none; }
.dialog__input-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1rem; border-bottom: 1px solid hsl(var(--border)); }
.dialog__input-row svg { width: 1.05rem; height: 1.05rem; color: hsl(var(--accent-ink)); }
.dialog__input-row input { flex: 1; border: 0; background: none; color: hsl(var(--foreground)); font: inherit; outline: none; }
.dialog__results { max-height: 22rem; overflow-y: auto; padding: 0.5rem; display: grid; gap: 0.15rem; }

.result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: hsl(var(--muted));
  font-size: var(--text-base);
}

.result:hover, .result[data-active="true"] { background: hsl(var(--accent) / 0.12); color: hsl(var(--foreground)); }
.result svg { width: 0.95rem; height: 0.95rem; color: hsl(var(--accent-ink)); flex: 0 0 auto; }
.result span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result small { margin-left: auto; color: hsl(var(--muted)); font-family: var(--font-mono); font-size: var(--text-2xs); }

/* ---------- 17. Reveal & motion ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .skill__fill { transform: scaleX(var(--level, 0.5)); }
}

/* ---------- 18. Utilities ---------- */
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.stack-sm { display: grid; gap: 0.5rem; }
.divider { height: 1px; background: hsl(var(--border) / 0.7); border: 0; margin-block: 2.5rem; }
.muted { color: hsl(var(--muted)); }
.mono { font-family: var(--font-mono); }
