/* ------------------------------------------------------------------
   alejandrobujan.com — liquid glass
   Layout: a floating glass dock over an animated Bay-light aurora;
   content rides in a 1120px column of layered glass panels.
   ------------------------------------------------------------------ */

:root {
  /* palette — graphite, dark by default; light only when the visitor picks it */
  --bg: #000000;
  --bg-2: #1c1c1e;
  --fg: #f5f5f7;
  --fg-2: #a1a1a6;
  --fg-3: #86868b;
  --accent: #f5f5f7;
  --accent-ink: #1d1d1f;
  --accent-soft: rgba(245, 245, 247, 0.12);
  --aurora-1: #2c2a2e;
  --aurora-2: #27282f;
  --aurora-3: #232a2e;
  --aurora-4: #2a2a2a;
  --aurora-alpha: 0.55;

  /* glass material */
  --hero-fill-a: 0.07; --hero-edge-a: 0.18; --hero-edge-rgb: 255, 255, 255;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --float-fill: rgba(28, 28, 30, 0.86);
  --glass-solid: rgba(26, 26, 29, 0.80);
  --glass-solid-strong: rgba(42, 42, 46, 0.86);
  --glass-edge: rgba(255, 255, 255, 0.18);
  --glass-edge-2: rgba(255, 255, 255, 0.06);
  --glass-spec: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 28px 70px -28px rgba(0, 0, 0, 0.75);
  --hairline: rgba(255, 255, 255, 0.08);
  --grain-opacity: 0.07;

  /* type */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, "Helvetica Neue", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Geist Mono", Menlo, monospace;

  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --col: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-2: #ffffff;
  --fg: #1d1d1f;
  --fg-2: #6e6e73;
  --fg-3: #86868b;
  --accent: #1d1d1f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(29, 29, 31, 0.08);
  --aurora-1: #e9e4dd;
  --aurora-2: #e2e2ea;
  --aurora-3: #dde4ea;
  --aurora-4: #ececec;
  --aurora-alpha: 0.85;
  --hero-fill-a: 0.5; --hero-edge-a: 0.9; --hero-edge-rgb: 29, 29, 31;
  --glass: rgba(255, 255, 255, 0.5);
  --glass-strong: rgba(255, 255, 255, 0.74);
  --float-fill: rgba(255, 255, 255, 0.86);
  --glass-solid: rgba(255, 255, 255, 0.82);
  --glass-solid-strong: rgba(255, 255, 255, 0.94);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --glass-edge-2: rgba(29, 29, 31, 0.07);
  --glass-spec: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 20px 50px -22px rgba(29, 29, 31, 0.22);
  --hairline: rgba(29, 29, 31, 0.08);
  --grain-opacity: 0.035;
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); text-wrap: balance; letter-spacing: -0.02em; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- ambient background ---------- */
#aurora {
  position: fixed; inset: 0; width: 100%; height: 100%; height: 100lvh;
  z-index: -2; pointer-events: none;
}
#net {
  position: fixed; inset: 0; width: 100%; height: 100%; height: 100lvh;
  z-index: -1; pointer-events: none;
  --net-node: rgba(245, 245, 247, 0.55);
  --net-line: 245, 245, 247;
}
:root[data-theme="light"] #net { --net-node: rgba(29, 29, 31, 0.5); --net-line: 29, 29, 31; }
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: var(--grain-opacity);
  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='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
  mix-blend-mode: screen;
}
:root[data-theme="light"] .grain { mix-blend-mode: multiply; }

/* ---------- glass material ---------- */
.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(1.7);
  backdrop-filter: blur(28px) saturate(1.7);
  border-radius: var(--r, var(--radius-lg));
  box-shadow:
    inset 0 1px 0 var(--glass-edge),
    inset 0 -1px 0 var(--glass-edge-2),
    inset 1px 0 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px var(--glass-edge-2),
    var(--glass-shadow);
  isolation: isolate;
}
.glass::before {
  /* specular rim: a soft light sweep across the top-left edge */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background:
    linear-gradient(135deg, var(--glass-spec) 0%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 62%, rgba(255, 255, 255, 0.10) 100%);
  opacity: 0.8;
}
.glass::after {
  /* pointer-tracking highlight, like light moving through a lens */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, -20%), var(--glass-spec), transparent 62%);
  opacity: 0; transition: opacity 0.5s var(--ease-spring);
}
.glass:hover::after, .glass:focus-within::after { opacity: 0.9; }
.glass > * { position: relative; z-index: 1; }
.glass-strong { background: var(--glass-strong); }

/* ---------- shell ---------- */
.wrap {
  max-width: var(--col);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: 0;
}
main { display: flex; flex-direction: column; gap: clamp(60px, 8vw, 104px); padding-block: 0 84px; }

/* dock */
.dock {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  z-index: 50;
  --r: 999px;
  padding: 6px;
  display: flex; align-items: center; gap: 2px;
  max-width: calc(100vw - 24px);
}
.dock-nav { display: flex; align-items: center; gap: 2px; position: relative; }
.dock-ind {
  position: absolute; top: 0; height: 100%; left: 0; width: 0;
  border-radius: 999px; background: var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 4px 14px -6px rgba(13, 18, 32, 0.35);
  opacity: 0; transition: left 0.55s var(--ease-spring), width 0.55s var(--ease-spring), opacity 0.3s;
  z-index: 0;
}
.dock-nav a, .dock-btn {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--fg-2);
  white-space: nowrap; transition: color 0.25s;
}
.dock-nav a:hover, .dock-nav a.active { color: var(--fg); }
.dock-nav a .short { display: none; }
.dock-sep { width: 1px; height: 20px; background: var(--hairline); margin-inline: 4px; }
.dock-btn { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.dock-btn svg { width: 18px; height: 18px; }
.dock-btn .sun { display: none; }
:root[data-theme="light"] .dock-btn .sun { display: block; }
:root[data-theme="light"] .dock-btn .moon { display: none; }

/* scroll hint: floating pill at the bottom edge, only while the hero is still a card */
.scroll-hint {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  z-index: 50; --r: 999px;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 15px 10px 18px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fg-2); cursor: pointer;
  opacity: calc(1 - var(--hero-p, 0) * 4);
  transform: translate(-50%, calc(var(--hero-p, 0) * 48px));
  visibility: hidden;
  transition: opacity 0.35s ease, transform 0.45s var(--ease-spring), color 0.25s, visibility 0s linear 0.45s;
}
.hint-on .scroll-hint { visibility: visible; transition: opacity 0.35s ease, transform 0.45s var(--ease-spring), color 0.25s, visibility 0s; }
.scroll-hint:hover { color: var(--fg); transform: translate(-50%, calc(var(--hero-p, 0) * 48px - 2px)); }
.scroll-hint:active { transform: translate(-50%, calc(var(--hero-p, 0) * 48px)) scale(0.97); }
.scroll-hint svg { width: 16px; height: 24px; color: var(--fg); flex: none; overflow: visible; }
.scroll-hint .wheel { animation: wheel 2.1s cubic-bezier(0.45, 0, 0.2, 1) infinite; }
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  55% { transform: translateY(7px); opacity: 0; }
  56% { transform: translateY(0); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.intro-on .scroll-hint { opacity: 0; }
.intro-on.landing .scroll-hint { opacity: 1; transition: opacity calc(0.8s * var(--k, 1)) ease calc(0.7s * var(--k, 1)); }

/* ---------- hero ---------- */
.hero {
  --p: 0; /* 0 = glass card at the top of the page, 1 = open layout after scrolling */
  --card-pad: clamp(22px, 4vw, 44px);
  margin-top: clamp(84px, 14vw, 150px);
  padding: calc(var(--card-pad) * (1 - var(--p)));
  border-radius: var(--radius-xl);
  display: grid; grid-template-columns: 1.08fr 0.92fr; gap: clamp(28px, 5vw, 72px);
  align-items: center;
  position: relative;
  background: rgba(255, 255, 255, calc(var(--hero-fill-a) * (1 - var(--p))));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, calc(var(--hero-edge-a) * (1 - var(--p)))),
    0 0 0 1px rgba(var(--hero-edge-rgb), calc(0.08 * (1 - var(--p)))),
    0 28px 70px -28px rgba(0, 0, 0, calc(0.6 * (1 - var(--p))));
}
@media (min-width: 961px) { .hero.is-card { -webkit-backdrop-filter: blur(28px) saturate(1.7); backdrop-filter: blur(28px) saturate(1.7); } }
.hero::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, var(--glass-spec) 0%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 62%, rgba(255, 255, 255, 0.10) 100%);
  opacity: calc(0.8 * (1 - var(--p)));
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-2);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hero h1 {
  margin-top: 18px;
  font-size: clamp(46px, 8.2vw, 104px);
  font-weight: 700; line-height: 1.0; letter-spacing: -0.035em;
  font-optical-sizing: auto;
}
.hero h1 .hi { display: block; font-weight: 500; font-size: 0.42em; letter-spacing: -0.01em; color: var(--fg-2); margin-bottom: 0.25em; }
.hero h1 .first, .hero h1 .last { display: block; }
.hero .role {
  margin-top: 22px; font-size: clamp(18px, 2.2vw, 22px); color: var(--fg-2); max-width: none;
  font-weight: 450;
}
.hero .role strong { color: var(--fg); font-weight: 600; }
.hero .role .part { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.chip {
  --r: 999px;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 14px 9px 12px; font-size: 13.5px; font-weight: 500; color: var(--fg);
  transition: transform 0.35s var(--ease-spring);
}
.chip:hover { transform: translateY(-2px); }
.chip.glass { background: var(--float-fill); -webkit-backdrop-filter: none; backdrop-filter: none; }
.chip.glass::after { display: none; }
.chip svg { width: 16px; height: 16px; color: var(--fg-2); flex: none; }
.chip .mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-2); }
.chip .clock { font-variant-numeric: tabular-nums; }
.btn {
  --r: 999px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s;
}
.btn-accent {
  color: var(--accent-ink);
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 92%, white) 0%, var(--accent) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 10px 24px -10px color-mix(in oklab, var(--accent) 60%, transparent);
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 16px 30px -12px color-mix(in oklab, var(--accent) 70%, transparent); }
.btn svg { width: 16px; height: 16px; }

.hero-visual { position: relative; perspective: 1400px; }
.portrait {
  --r: var(--radius-xl);
  padding: 12px;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-spring);
  will-change: transform;
}
.portrait img {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: cover;
  border-radius: calc(var(--radius-xl) - 12px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.float {
  --r: 18px;
  position: absolute; z-index: 3;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 10px;
  transform: translateZ(60px);
  font-size: 13.5px; line-height: 1.25;
}
.float img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; }
.float { background: var(--float-fill); }
.float b { display: block; font-weight: 600; color: var(--fg); }
.float span { color: var(--fg); opacity: 0.72; font-size: 12.5px; }
.float-1 { left: -8%; top: 12%; animation: bob 7s ease-in-out infinite; }
.float-2 { right: -6%; top: 76%; animation: bob 8s ease-in-out -2s infinite; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

/* ---------- intro (home only): dark stage, "Hello I'm", the name, then it lands in the hero ---------- */
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; pointer-events: none; --k: 1; }
.intro-bg { position: absolute; inset: 0; background: var(--bg); transition: opacity calc(1.1s * var(--k)) ease; }
.intro-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(55% 45% at 50% 55%, rgba(255, 255, 255, 0.05), transparent 70%); }
.intro.landing .intro-bg { opacity: 0; }
.intro-h1 {
  position: relative; margin: 0; padding-inline: var(--gutter);
  font-family: var(--font-display); font-weight: 700; line-height: 1.0; letter-spacing: -0.035em; font-optical-sizing: auto; color: var(--fg);
  font-size: calc(clamp(46px, 8.2vw, 104px) * 1.18);
  transform-origin: top left; will-change: transform;
}
.intro-h1 .hi { display: block; font-weight: 500; font-size: 0.42em; letter-spacing: -0.01em; color: var(--fg-2); margin-bottom: 0.25em;
  opacity: 0; transform: translateY(0.6em); filter: blur(8px);
  transition: opacity calc(0.9s * var(--k)) var(--ease-spring), transform calc(0.9s * var(--k)) var(--ease-spring), filter calc(0.9s * var(--k)) ease; }
.intro.p1 .intro-h1 .hi { opacity: 1; transform: none; filter: none; }
.intro-h1 .first, .intro-h1 .last {
  display: block; opacity: 0; transform: translateY(0.45em); filter: blur(14px); clip-path: inset(-10% -5% 100% -5%);
  transition: opacity calc(1s * var(--k)) var(--ease-spring), transform calc(1s * var(--k)) var(--ease-spring), filter calc(1s * var(--k)) ease, clip-path calc(1s * var(--k)) var(--ease-spring), background-position calc(1.1s * var(--k)) cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(105deg, var(--fg) 38%, #fff 50%, var(--fg) 62%); background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.intro-h1 .last { transition-delay: calc(0.14s * var(--k)); }
.intro.p2 .intro-h1 .first, .intro.p2 .intro-h1 .last { opacity: 1; transform: none; filter: none; clip-path: inset(-10% -5% -25% -5%); }
.intro.p3 .intro-h1 .first, .intro.p3 .intro-h1 .last { background-position: 0% 0; }
.intro.p3 .intro-h1 .last { transition-delay: calc(0.1s * var(--k)); }
/* page hidden while the intro runs; hero and dock fade in as the name lands */
.intro-on { overflow: hidden; }
.intro-on .hero, .intro-on main > :not(.hero), .intro-on footer { opacity: 0; }
.intro-on .dock { opacity: 0; transform: translate(-50%, -16px); }
.intro-on .hero h1 { opacity: 0; }
.intro-done .hero h1 { transition: opacity 0.25s ease; }
.intro.out .intro-h1 { transition: opacity 0.25s ease; opacity: 0; }
.intro-on.landing .hero, .intro-on.landing main > :not(.hero), .intro-on.landing footer { opacity: 1; transition: opacity calc(1s * var(--k, 1)) ease calc(0.2s * var(--k, 1)); }
.intro-on.landing .dock { opacity: 1; transform: translate(-50%, 0); transition: opacity calc(0.8s * var(--k, 1)) ease calc(0.5s * var(--k, 1)), transform calc(0.8s * var(--k, 1)) var(--ease-spring) calc(0.5s * var(--k, 1)); }
@media (prefers-reduced-motion: reduce) { .intro { display: none; } .intro-on .hero, .intro-on .dock, .intro-on main > :not(.hero), .intro-on footer, .intro-on .hero h1 { opacity: 1; transform: none; } }

/* ---------- sections ---------- */
.section { scroll-margin-top: 90px; }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: clamp(18px, 2.5vw, 28px);
  padding-bottom: 14px; border-bottom: 1px solid var(--hairline);
}
.sec-head h2 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 700; letter-spacing: -0.03em; font-optical-sizing: auto; }
.sec-head .meta { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-3); letter-spacing: 0.04em; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* about */
.about { --r: var(--radius-xl); padding: 12px; display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: clamp(20px, 3vw, 40px); align-items: center; }
.about-photo { border-radius: calc(var(--radius-xl) - 12px); overflow: hidden; aspect-ratio: 1; box-shadow: inset 0 0 0 1px var(--glass-edge-2); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease-spring); }
.about:hover .about-photo img { transform: scale(1.03); }
.about p { padding: 16px clamp(16px, 3vw, 36px) 16px 0; }
.about p { font-size: clamp(20px, 2.2vw, 27px); line-height: 1.4; font-family: var(--font-display); font-weight: 500; letter-spacing: -0.015em; max-width: none; }
.about p em { font-style: normal; color: var(--accent); }

/* holographic foil on a word (pointer-driven on desktop, slow drift on touch) */
.holo {
  --hx: 50%; --hy: 50%;
  display: inline-block; font-weight: 650; color: transparent; -webkit-text-fill-color: transparent;
  background-image:
    radial-gradient(farthest-corner circle at var(--hx) var(--hy), rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.35) 28%, rgba(255, 255, 255, 0) 60%),
    repeating-linear-gradient(-33deg, #f5f5f7 0%, #8e8e94 7%, #ffffff 14%, #5c5c62 21%, #d6d6db 28%, #7a7a80 35%, #f5f5f7 42%);
  background-size: 220% 220%, 160% 160%;
  background-position: var(--hx) var(--hy), calc(var(--hx) * 1.6) calc(var(--hy) * 1.6);
  -webkit-background-clip: text; background-clip: text;
  filter: brightness(1.08) contrast(1.05);
  transition: background-position 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.holo.name { display: block; font-weight: inherit; }
.holo-link { display: inline-flex; align-items: baseline; gap: 0.08em; text-decoration: none; }
.holo-link .mini-arrow { width: 0.5em; height: 0.5em; align-self: flex-start; margin-top: 0.18em; color: var(--fg-3); transition: transform 0.3s var(--ease-spring), color 0.3s; }
.holo-link:hover .mini-arrow { transform: translate(2px, -2px); color: var(--fg); }
:root[data-theme="light"] .holo {
  background-image:
    radial-gradient(farthest-corner circle at var(--hx) var(--hy), rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.2) 28%, rgba(255, 255, 255, 0) 60%),
    repeating-linear-gradient(-33deg, #3a3a3f 0%, #9a9aa0 7%, #1d1d1f 14%, #b8b8be 21%, #4a4a50 28%, #86868b 35%, #3a3a3f 42%);
}
@media (hover: none) {
  .holo { animation: holo-drift 7s ease-in-out infinite alternate; transition: none; }
}
@keyframes holo-drift {
  0% { background-position: 20% 30%, 10% 40%; }
  50% { background-position: 70% 60%, 90% 70%; }
  100% { background-position: 35% 85%, 40% 120%; }
}

/* timelines */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 32px); align-items: start; }
.timeline { --r: var(--radius-xl); padding: 10px; }
.tl-row {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center;
  padding: 16px 16px; border-radius: 20px;
  transition: background 0.3s;
}
.tl-row + .tl-row { position: relative; }
.tl-row + .tl-row::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 1px; background: var(--hairline); }
.tl-row:hover { background: var(--glass-strong); }
.tl-row:hover + .tl-row::before, .tl-row:has(+ .tl-row:hover)::before { opacity: 0; }
.logo-tile {
  width: 52px; height: 52px; border-radius: 15px; overflow: hidden;
  background: #fff; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(13, 18, 32, 0.08), 0 6px 14px -8px rgba(13, 18, 32, 0.35);
}
.logo-tile img { width: 100%; height: 100%; object-fit: cover; }
.tl-row h3 { font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; font-family: var(--font-body); }
.tl-row .sub { color: var(--fg-2); font-size: 14.5px; margin-top: 2px; }
.tl-row .date { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-3); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-row .date .now { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 500; }
.tl-row .date .view { display: flex; justify-content: flex-end; margin-top: 6px; }
.tl-row .date .now::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 5px var(--accent-soft); } }
.tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--fg-2); background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--hairline); vertical-align: middle; }

/* expandable rows (Experience / Education) */
.tl-row { row-gap: 0; position: relative; }
.tl-row.expandable { cursor: pointer; user-select: none; }
.tl-row.expandable .date { padding-right: 24px; }
.tl-row .desc { grid-column: 2 / -1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s var(--ease-spring); }
.tl-row .desc > p { min-height: 0; overflow: hidden; color: var(--fg-2); font-size: 14.5px; line-height: 1.55; max-width: 62ch; }
.tl-row.open .desc > p { padding-top: 10px; }
.tl-row.open .desc { grid-template-rows: 1fr; }
.tl-row .chev { position: absolute; right: 14px; top: 34px; width: 16px; height: 16px; color: var(--fg-3); transition: transform 0.4s var(--ease-spring); }
.tl-row.open .chev { transform: rotate(180deg); }
.tl-row.expandable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 20px; }

/* recognition */
.awards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.award {
  --r: var(--radius-lg);
  padding: 22px; display: flex; flex-direction: column; gap: 14px; min-height: 230px;
  transition: transform 0.45s var(--ease-spring);
}
.award:hover { transform: translateY(-4px); }
.award .top { display: flex; align-items: center; justify-content: space-between; }
.award .year { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.award .laurel { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.award .laurel svg { width: 16px; height: 16px; }
.award .badges { display: flex; align-items: center; gap: 8px; }
.award .org-logo { width: 30px; height: 30px; border-radius: 10px; object-fit: cover; box-shadow: inset 0 0 0 1px var(--hairline), 0 4px 10px -6px rgba(0, 0, 0, 0.5); }
.award h3 { font-size: 19px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
.award .org { color: var(--fg-2); font-size: 13.5px; line-height: 1.4; }
.award .view { margin-top: auto; }
.award .view-row { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.award .view-row .view { margin-top: 0; }
.view {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--accent);
}
.view svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease-spring); }
.view:hover svg { transform: translate(2px, -2px); }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.more {
  --r: var(--radius-lg);
  padding: 24px 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: transform 0.45s var(--ease-spring);
}
.more:hover { transform: translateY(-3px); }
.more h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.more .n { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-3); margin-top: 4px; }
.more .arrow { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; transition: transform 0.4s var(--ease-spring); }
.more:hover .arrow { transform: rotate(-45deg); }
.more .arrow svg { width: 18px; height: 18px; }

/* tech marquee */
.marquee { --r: var(--radius-xl); padding: 26px 0; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee .track { display: flex; gap: 14px; width: max-content; animation: scroll 74s linear infinite; padding-inline: 7px; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }
.tech {
  --r: 20px;
  width: 116px; padding: 16px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: transform 0.4s var(--ease-spring);
}
.tech:hover { transform: translateY(-4px) scale(1.03); }
.tech img { width: 42px; height: 42px; object-fit: contain; }
.tech svg.aws { width: 42px; height: 42px; color: var(--fg); } /* inline: the wordmark follows the theme, the smile stays orange */
.tech img.mono { filter: invert(1); } /* black brand marks (Next.js, Vercel, Railway) turn white on the dark theme */
:root[data-theme="light"] .tech img.mono { filter: none; }
.tech span { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-2); letter-spacing: 0.02em; }

/* projects bento */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.project { --r: var(--radius-xl); padding: 12px; display: flex; flex-direction: column; transition: transform 0.5s var(--ease-spring); }
.project:hover { transform: translateY(-4px); }
.project.w7 { grid-column: span 7; } .project.w5 { grid-column: span 5; }
.project.desk-last { order: 1; } /* source order is the phone stack; on desktop this card closes the bento */
.project .shot {
  border-radius: calc(var(--radius-xl) - 12px); overflow: hidden; aspect-ratio: 16 / 9;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--hairline);
  position: relative;
}
.project .shot img, .project .shot video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease-spring); }
.project:hover .shot img, .project:hover .shot video { transform: scale(1.03); }
.project .body { padding: 18px 12px 10px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project h3 { font-size: 24px; font-weight: 650; letter-spacing: -0.03em; }
.project p { color: var(--fg-2); font-size: 15px; max-width: 52ch; }
.project .view { margin-top: auto; padding-top: 8px; }
.project .view-row { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.project .view-row .view { margin-top: 0; padding-top: 0; }
.project .tools { display: flex; gap: 6px; flex-wrap: wrap; }
.gh-stats { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 4px; vertical-align: middle; animation: gh-in 0.6s var(--ease-spring) both; }
.gh-stats[hidden] { display: none; }
.project .trendshift-pair { display: inline-flex; gap: 5px; margin-left: auto; }
.project .trendshift { display: inline-block; line-height: 0; transition: transform 0.3s var(--ease-spring), opacity 0.3s; opacity: 0.94; }
.project .trendshift:hover { opacity: 1; transform: translateY(-1px); }
.project .trendshift img { width: 116px; height: auto; display: block; border-radius: 8px; }
@media (max-width: 760px) { .project .trendshift-pair { margin-left: 0; } }
/* On desktop the badges sit together on their own line under the title, aligned with it. */
@media (min-width: 761px) {
  .project h3:has(.gh-stats) { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 6px; }
  .project h3 .name { flex-basis: 100%; }
  .project h3 .gh-stats { margin-left: 0; }
}
.gh-stats .tag { margin-left: 0; display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; letter-spacing: 0; transition: color 0.3s; }
.gh-stats .tag:hover { color: var(--fg); }
.gh-stats svg { width: 12px; height: 12px; flex: none; }
@keyframes gh-in { from { opacity: 0; transform: translateY(4px); } }

/* publication */
.pub { --r: var(--radius-lg); padding: 24px 26px; display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; }
.pub .year { font-family: var(--font-mono); font-size: 13px; color: var(--fg-3); }
.pub h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; font-family: var(--font-body); }
.pub .venue { color: var(--fg-2); font-size: 14px; margin-top: 6px; }

/* recommendations */
.recs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rec { --r: var(--radius-xl); padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.rec .q { font-family: var(--font-display); font-size: 56px; line-height: 0.5; color: var(--accent); font-weight: 700; height: 18px; }
.rec p { font-size: 16.5px; line-height: 1.6; color: var(--fg); }
.rec .who { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.rec .who img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--glass-edge); }
.rec .who b { display: block; font-weight: 600; }
.rec .who span { color: var(--fg-2); font-size: 13.5px; }

/* links / footer */
.links { --r: var(--radius-xl); padding: clamp(28px, 4vw, 44px); display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; align-items: center; }
.links h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 650; letter-spacing: -0.035em; }
.links .sub { color: var(--fg-2); margin-top: 8px; font-size: 15.5px; }
.link-list { display: grid; gap: 10px; }
.link-row {
  --r: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; font-weight: 500; transition: transform 0.35s var(--ease-spring);
}
.link-row:hover { transform: translateX(4px); }
.link-row .l { display: flex; align-items: center; gap: 12px; }
.link-row .l svg { width: 18px; height: 18px; color: var(--fg-2); }
.link-row .r { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-3); }
.link-row .r svg { width: 14px; height: 14px; }
footer { padding: 28px 0 calc(24px + env(safe-area-inset-bottom, 0px)); text-align: center; color: var(--fg-3); font-size: 13px; font-family: var(--font-mono); }

/* list pages (awards / scholarships) */
.page-head { padding-top: clamp(110px, 16vw, 170px); }
.page-head .back { display: flex; width: fit-content; align-items: center; gap: 8px; color: var(--fg-2); font-weight: 500; font-size: 14px; margin-bottom: 28px; }
.page-head .back svg { width: 16px; height: 16px; }
.page-head h1 { font-size: clamp(40px, 7vw, 84px); font-weight: 700; letter-spacing: -0.045em; line-height: 0.98; }
.page-head .lede { margin-top: 16px; color: var(--fg-2); font-size: 17px; max-width: 60ch; }
.page-head .lede.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-3); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
main.page-main { gap: 36px; }
.list { display: grid; gap: 14px; }
.entry { --r: var(--radius-lg); padding: 26px 28px; display: grid; grid-template-columns: 92px 1fr; gap: 20px; transition: transform 0.45s var(--ease-spring); }
.entry:hover { transform: translateY(-3px); }
.entry .year { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.04em; color: var(--fg-3); line-height: 1; font-variant-numeric: tabular-nums; }
.entry h2 { font-size: 22px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.2; }
.entry .org { color: var(--fg-2); font-size: 14px; margin-top: 6px; }
.entry p { margin-top: 12px; color: var(--fg); font-size: 15.5px; line-height: 1.6; max-width: none; text-align: justify; hyphens: manual; -webkit-hyphens: manual; }
.entry .foot { margin-top: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.entry .status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--fg-2); background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--hairline); }

/* reveal (JS-gated; content is visible at rest without JS) */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.9s var(--ease-spring), transform 0.9s var(--ease-spring); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal [data-stagger] > * { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease-spring), transform 0.7s var(--ease-spring); transition-delay: calc(var(--i, 0) * 80ms + 120ms); }
.js .reveal.in [data-stagger] > * { opacity: 1; transform: none; }

/* toast */
.toast {
  --r: 999px;
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; font-size: 13.5px; font-weight: 500; z-index: 60;
  transition: transform 0.4s var(--ease-spring), opacity 0.3s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .awards-grid { grid-template-columns: 1fr 1fr; }
  /* the two hero columns no longer fit side by side: from here down the hero is always the phone card
     (text left, small photo top-right, one transition at a scroll threshold) — never a stacked desktop card.
     Nothing in the layout changes between states (constant padding/gap) so only the photo transform and
     the card surface animate */
  .hero { grid-template-columns: 1fr; padding: var(--card-pad); row-gap: 16px; --hero-fill-a: 0.09; margin-top: var(--hero-mt, clamp(84px, 14vw, 150px)); transition: background 1.4s ease, box-shadow 1.4s ease; }
  .hero::before { transition: opacity 1.4s ease; }
  .float-1 { left: 0; } .float-2 { right: 0; }
  .hero-visual { width: 100%; max-width: 520px; margin-inline: auto 0; transform-origin: top right;
    transform: translateY(calc(var(--dy, 0px) * (1 - var(--p)))) scale(calc(1 - (1 - var(--sc, 0.32)) * (1 - var(--p))));
    margin-bottom: calc(var(--vh, 0px) * -1 * (1 - var(--p))); }
  .hero.ready .hero-visual { transition: transform 1.4s cubic-bezier(0.32, 0.72, 0, 1); }
  /* the bubbles only exist on the open layout; they fade in once the card opens */
  .hero.ready .float { transition: opacity 0.9s ease; }
  .float { opacity: var(--p); }
  /* everything below the card stays hidden until the card opens; while it opens, the content below waits
     for the photo to settle; at any other time the sections keep their normal scroll-reveal transitions */
  .hero-opening main > :not(.hero), .hero-opening footer { transition: opacity 0.9s ease 1.15s; }
  .hero-closed main > :not(.hero), .hero-closed footer { opacity: 0 !important; pointer-events: none; transition: opacity 0.4s ease 0s; }
}
@media (max-width: 760px) {
  .two-col, .recs, .more-grid, .links { grid-template-columns: 1fr; }
  .project.w7, .project.w5 { grid-column: span 12; }
  .project.desk-last { order: 0; }
  .about { grid-template-columns: 1fr; gap: 4px; }
  .about p { padding: 12px 12px 8px; }
  .pub { grid-template-columns: 1fr; gap: 12px; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .dock { padding: 5px; }
  .dock-nav a { padding: 7px 7px; font-size: 12.5px; }
  .dock-btn { width: 32px; height: 32px; }
  .dock-sep { margin-inline: 2px; }
  .dock-nav a .long { display: none; }
  .dock-nav a .short { display: inline; }
  .section { scroll-margin-top: 80px; }
  .hero h1 { font-size: 40px; }
  .intro-h1 { font-size: 47px; }
  .float { font-size: 12.5px; padding: 8px 12px 8px 8px; } .float img { width: 30px; height: 30px; }
}
@media (max-width: 520px) {
  .awards-grid { grid-template-columns: 1fr; }
  .award { min-height: 0; }
  .tl-row { grid-template-columns: 44px 1fr; padding: 13px 14px; }
  .tl-row .date { grid-column: 2; text-align: left; margin-top: 4px; font-size: 12px; }
  .tl-row .date br { display: none; }
  .tl-row .date .view { justify-content: flex-start; }
  .tl-row .date .d2::before { content: " "; }
  .tl-row .date .d1:has(.now) + .d2::before { content: " · "; }
  .tl-row .chev { top: 22px; }
  .logo-tile { width: 44px; height: 44px; border-radius: 12px; }
  .entry { grid-template-columns: 1fr; gap: 10px; padding: 22px; }
  .entry .year { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .marquee .track { flex-wrap: wrap; width: auto; justify-content: center; }
  .marquee .track .dup { display: none; }
  .js .reveal, .js .reveal [data-stagger] > * { opacity: 1; transform: none; }
}

/* ---------- low-power profile for touch devices: no per-panel backdrop blur, no blend-mode grain ---------- */
@media (hover: none), (max-width: 760px) {
  .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-solid); }
  .glass .glass, .glass-strong { background: var(--glass-solid-strong); }
  .glass::after { display: none; }
  .dock.glass, .scroll-hint.glass { -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); background: var(--glass); }
  .chip.glass, .float.glass { background: var(--float-fill); }
  .grain { display: none; }
}

/* award photos (awards list) */
.entry.has-photo { grid-template-columns: 92px 1fr 232px; align-items: start; }
.entry.has-photo .entry-photo { align-self: center; }
.entry-photo { margin: 0; border-radius: calc(var(--radius-lg) - 12px); overflow: hidden; aspect-ratio: 4 / 3; box-shadow: inset 0 0 0 1px var(--glass-edge-2), 0 12px 30px -18px rgba(0, 0, 0, 0.6); position: relative; isolation: isolate; }
.entry-photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 1px 0 var(--glass-edge); pointer-events: none; }
.entry-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease-spring); }
.entry.has-photo:hover .entry-photo img { transform: scale(1.04); }
@media (max-width: 760px) {
  .entry.has-photo { grid-template-columns: 92px 1fr; align-items: start; }
  .entry-photo { grid-column: 1 / -1; order: -1; aspect-ratio: 16 / 10; margin: -8px -10px 6px; border-radius: calc(var(--radius-lg) - 8px); }
}
@media (max-width: 520px) {
  .entry.has-photo { grid-template-columns: 1fr; }
  .entry-photo { margin: -6px -6px 4px; }
}

/* lightbox for award photos */
.entry-photo[role="button"] { cursor: zoom-in; outline: none; }
.entry-photo[role="button"]:focus-visible { box-shadow: inset 0 0 0 1px var(--glass-edge-2), 0 0 0 3px var(--fg-3); }
.lightbox { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 72px 20px 28px; opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease-spring), visibility 0s linear 0.4s; }
.lightbox.open { opacity: 1; visibility: visible; transition: opacity 0.4s var(--ease-spring), visibility 0s; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.78); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); }
.lb-figure { position: relative; margin: 0; display: grid; justify-items: center; gap: 14px; max-width: min(1200px, 100%); transform: scale(0.94) translateY(10px); transition: transform 0.55s var(--ease-spring); }
.lightbox.open .lb-figure { transform: none; }
.lb-figure img { display: block; max-width: 100%; max-height: min(76vh, 76svh); width: auto; height: auto; border-radius: 18px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 40px 90px -30px rgba(0, 0, 0, 0.9); background: #111; }
.lb-figure figcaption { display: grid; gap: 4px; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.72); text-align: center; max-width: 64ch; font-variant-numeric: tabular-nums; }
.lb-figure .lb-sub { font-family: var(--font-display); font-size: 13px; letter-spacing: 0; color: rgba(255, 255, 255, 0.55); }
.lb-btn { position: absolute; z-index: 2; width: 46px; height: 46px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.1); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); cursor: pointer; transition: background 0.25s, transform 0.35s var(--ease-spring); }
.lb-btn:hover { background: rgba(255, 255, 255, 0.18); transform: scale(1.06); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-btn svg { width: 20px; height: 20px; }
.lb-close { top: 16px; right: 16px; }
html.lb-open { overflow: hidden; }
@media (max-width: 760px) {
  .lightbox { padding: 64px 12px 24px; }
  .lb-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(0, 0, 0, 0.94); }
  .lb-btn { width: 42px; height: 42px; -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 255, 255, 0.14); }
  .lb-figure img { max-height: min(66vh, 66svh); }
}
