/* ==========================================================================
   Neriah Ben David — liquid-glass personal site
   ========================================================================== */

/* ---------- Tokens (dark only) ---------- */
:root {
  color-scheme: dark;
  --bg: #0b0a09;
  --text: #f2f2f0;
  --muted: rgba(242, 242, 240, 0.6);
  --faint: rgba(242, 242, 240, 0.08);
  --surface: #131210;
  --accent: #ffb020;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --on-accent: #fff;

  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-strong: rgba(255, 255, 255, 0.12);
  --glass-rim: rgba(255, 255, 255, 0.22);
  --glass-rim-2: rgba(255, 255, 255, 0.06);
  --glass-edge: rgba(255, 255, 255, 0.09);
  --glass-shade: rgba(0, 0, 0, 0.3);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sheen: rgba(255, 255, 255, 0.07);

  --radius: 20px;
  --radius-sm: 18px;
  --maxw: 1080px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
svg { stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 12px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  transition: top 0.2s;
}
.skip:focus { top: 16px; }

.link {
  color: var(--accent);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease);
}
.link:hover { background-size: 100% 1.5px; }

/* ---------- Liquid glass material ---------- */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(190%);
  backdrop-filter: blur(18px) saturate(190%);
  box-shadow:
    inset 0 1px 0.5px 0 var(--glass-rim),
    inset 0 -1px 1px 0 var(--glass-shade),
    inset 0 0 0 1px var(--glass-edge),
    var(--glass-shadow);
  transition:
    transform 0.5s var(--spring),
    box-shadow 0.4s var(--ease),
    background-color 0.5s var(--ease);
}
/* Specular sheen that follows the pointer (JS sets --mx/--my) */
.glass::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(140px 140px at var(--mx, 25%) var(--my, -10%), var(--sheen), transparent 70%);
  opacity: 0.8;
  transition: opacity 0.4s var(--ease);
}
/* Bevelled rim: bright top-left and bottom-right edge */
.glass::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: linear-gradient(135deg, var(--glass-rim) 0%, transparent 30%, transparent 70%, var(--glass-rim-2) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
/* Real refraction on Chromium (class set by script.js) */
html.can-refract .glass.refract {
  -webkit-backdrop-filter: url(#lg-refract) blur(10px) saturate(190%);
  backdrop-filter: url(#lg-refract) blur(10px) saturate(190%);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 16px; color: var(--text);
  cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.5s var(--spring), box-shadow 0.4s var(--ease), background-color 0.4s var(--ease);
}
.btn svg { width: 18px; height: 18px; stroke-width: 2.2; transition: transform 0.4s var(--spring); }
.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn:active { transform: scale(0.95); transition-duration: 0.15s; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-tinted {
  position: relative; isolation: isolate;
  color: var(--bg);
  background: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 20px -10px rgba(0, 0, 0, 0.5);
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; padding: 0; background: transparent; color: var(--text);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.5s var(--spring);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { transform: translateY(-2px) scale(1.08); }
.icon-btn:active { transform: scale(0.92); transition-duration: 0.15s; }

/* ---------- Navigation ---------- */
.nav-wrap {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 16px 0;
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: 4px;
  max-width: 100%;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  transition: transform 0.5s var(--spring), box-shadow 0.4s var(--ease);
}
.nav.scrolled { box-shadow: inset 0 1px 0.5px 0 var(--glass-rim), inset 0 0 0 1px var(--glass-edge), 0 18px 40px -12px rgba(0, 0, 0, 0.3); }
.brand {
  flex: none; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  font-weight: 800; font-size: 18px; color: var(--bg);
  background: var(--text);
  transition: transform 0.5s var(--spring);
}
.brand:hover { transform: rotate(-8deg) scale(1.06); }
.nav-links {
  position: relative; display: flex; gap: 2px;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  border-radius: 999px;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  position: relative; z-index: 1; flex: none;
  padding: 8px 14px; border-radius: 999px;
  font-size: 15px; font-weight: 500; color: var(--muted);
  transition: color 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-lens {
  position: absolute; top: 0; bottom: 0; left: 0; z-index: 0;
  width: var(--lens-w, 0); transform: translateX(var(--lens-x, 0));
  border-radius: 999px;
  background: var(--glass-bg-strong);
  box-shadow: inset 0 1px 0.5px var(--glass-rim), inset 0 0 0 1px var(--glass-edge), 0 4px 12px -4px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: transform 0.6s var(--spring), width 0.6s var(--spring), opacity 0.3s var(--ease);
}
.nav-lens.on { opacity: 1; }

/* ---------- Layout ---------- */
main { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 40px 0; }
.section-head { margin-bottom: 16px; }
.section-head h2, .contact h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 700; }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.card { border-radius: var(--radius); padding: 18px 20px; }

/* ---------- Hero ---------- */
.hero {
  min-height: 0;
  display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: 48px;
  padding: 104px 0 24px;
}
.name {
  font-size: clamp(40px, 6.5vw, 68px); font-weight: 800; letter-spacing: -0.045em; line-height: 0.98;
  color: var(--text);
  padding-bottom: 0.04em;
}
.hero .eyebrow { font-size: 15px; }
.lede { margin-top: 14px; max-width: 40ch; font-size: clamp(16px, 1.8vw, 18px); color: var(--muted); }
.lede strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero-actions.center { justify-content: center; }
.socials { display: flex; gap: 8px; margin-top: 16px; }

.portrait-wrap { position: relative; justify-self: center; width: min(100%, 300px); }
.portrait {
  aspect-ratio: 1; border-radius: 50%; padding: 14px;
  animation: float 9s ease-in-out infinite;
}
.portrait-inner {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}
.portrait-inner span { font-size: clamp(56px, 10vw, 96px); font-weight: 800; letter-spacing: -0.05em; color: var(--muted); }
.portrait-inner img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08); transition: filter 0.8s var(--ease); }
.portrait:hover .portrait-inner img { filter: none; }
.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip-a { left: -8%; bottom: 14%; animation: float 7s ease-in-out infinite -2s; }
.chip-b { right: -4%; top: 10%; animation: float 8s ease-in-out infinite -4s; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #30d158; box-shadow: 0 0 0 4px rgba(48, 209, 88, 0.25); }
@keyframes float { 50% { transform: translateY(-12px); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.about-grid .card p + p { margin-top: 10px; }
.about-grid .card p { color: var(--muted); }
.about-grid .card strong, .about-grid .card em { color: var(--text); }

.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px;
  background: var(--faint);
}
.timeline li { position: relative; padding-bottom: 12px; }
.timeline li::before {
  content: ""; position: absolute; left: -27px; top: 7px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 0 0 3px var(--text);
}
.year { display: block; font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.tl-items { display: flex; flex-direction: column; gap: 6px; }
.tl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 14px; font-size: 15px; font-weight: 500;
}
.tl-item:hover { transform: translateX(4px); }
.tl-kind {
  flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  color: var(--muted); background: var(--faint);
}

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.project { display: flex; flex-direction: column; padding: 8px; transform-style: preserve-3d; }
.project:hover { transform: translateY(-6px); }
.project:hover::before { opacity: 1; }
.thumb {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 8; width: 100%; border-radius: calc(var(--radius) - 8px);
  display: grid; place-items: center; object-fit: cover;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}
.thumb span {
  font-size: 36px; font-weight: 800; letter-spacing: -0.05em; color: var(--muted); opacity: 0.6;
  transition: transform 0.6s var(--spring);
}
.project:hover .thumb span { transform: scale(1.12) rotate(-4deg); }
.project-body { padding: 10px 8px 6px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.project h3 { font-size: 17px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.arrow { width: 20px; height: 20px; flex: none; color: var(--muted); transition: transform 0.4s var(--spring), color 0.3s; }
.project:hover .arrow { transform: translate(3px, -3px); color: var(--accent); }
.role { font-size: 14px; font-weight: 600; color: var(--muted); }
.project-body > p:not(.role) { color: var(--muted); font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.tags li {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--faint); color: var(--muted);
}

/* ---------- Education / rows ---------- */
.list { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.row-main .date { margin: 2px 0 0; }
.row-main > .date:first-child { margin: 0 0 4px; }
.bullets { display: grid; gap: 2px; margin-top: 2px; }
.bullets li { position: relative; padding-left: 18px; color: var(--muted); font-size: 15px; }
.bullets li::before { content: ""; position: absolute; left: 2px; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
/* Flash the entry a timeline link jumps to */
.row:target { animation: target-flash 1.6s var(--ease); }
@keyframes target-flash { 0%, 40% { box-shadow: inset 0 0 0 1px var(--text), var(--glass-shadow); } }
.row-logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; font-size: 22px; color: var(--muted);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}
.row-logo img { width: 100%; height: 100%; object-fit: contain; padding: 7px; opacity: 0.9; }
.row h3 { font-size: 17px; }
.meta { margin: 0 0 4px; font-weight: 500; font-size: 15px; }
.row-main > p:last-child:not(.meta) { color: var(--muted); font-size: 16px; }
.date { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }

/* ---------- Publications ---------- */
.pub { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: start; }
.pub-thumb { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); }
.pub-body h3 { font-size: 18px; margin: 2px 0 4px; }
.authors { font-size: 15px; color: var(--muted); margin-bottom: 10px; }
.authors strong { color: var(--text); }
.pub-body > p:not(.date):not(.authors) { color: var(--muted); }
.pub-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* ---------- Awards ---------- */
.awards { display: grid; gap: 14px; }
.award { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 20px 24px; }
.award-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: var(--glass-bg-strong); box-shadow: inset 0 1px 0.5px var(--glass-rim), inset 0 0 0 1px var(--glass-edge);
}
.award h3 { font-size: 18px; }
.award div p { color: var(--muted); font-size: 15px; }

/* ---------- Contact ---------- */
.contact { text-align: center; padding: 32px 20px; }
.contact > p:not(.eyebrow) { margin: 14px auto 0; max-width: 46ch; color: var(--muted); font-size: 16px; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 8px 16px 32px; font-size: 14px; color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transform: translate(-50%, 140%) scale(0.9); opacity: 0;
  transition: transform 0.6s var(--spring), opacity 0.3s var(--ease);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0) scale(1); opacity: 1; }

/* ---------- Scroll reveal (only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px) scale(0.98); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.8s var(--ease), transform 0.9s var(--spring);
  transition-delay: var(--d, 0s);
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 110px; text-align: left; min-height: auto; }
  .portrait-wrap { width: min(60%, 240px); grid-row: 1; }
  .about-grid { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; }
  .pub-thumb { max-width: 100%; aspect-ratio: 16 / 7; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  main { padding: 0 16px; }
  .section { padding: 32px 0; }
  .card { padding: 16px; }
  .project { padding: 10px; }
  .projects { grid-template-columns: 1fr; }
  .row { grid-template-columns: auto 1fr; }
  .row-logo { width: 40px; height: 40px; font-size: 15px; }
  .award { grid-template-columns: auto 1fr; padding: 18px; }
  .award .date { grid-column: 2; }
  .nav-links a { padding: 8px 11px; font-size: 14px; }
  .brand { width: 36px; height: 36px; }
  .chip-a { left: -6%; }
  .chip-b { right: -6%; }
  .float-chip { font-size: 12px; padding: 8px 12px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Section names appear once (heading only) */
.section-head .eyebrow { display: none; }

/* ---------- Accent + monospace details ---------- */
.accent { color: var(--accent); }
.nav-links a.active { color: var(--accent); }
.timeline li::before { box-shadow: inset 0 0 0 3px var(--accent); }
.date, .tl-kind, .tags li, .year, .eyebrow, .role, .float-chip {
  font-family: var(--mono);
  font-feature-settings: "zero" 0;
}
.date, .tl-kind, .tags li, .role { font-size: 12px; letter-spacing: 0.02em; font-weight: 500; }
.year { font-size: 14px; font-weight: 600; }
.eyebrow { letter-spacing: 0.08em; }
.float-chip { font-size: 12px; font-weight: 500; }
.row-logo { overflow: hidden; }
.row-logo img { width: 24px; height: 30px; padding: 0; object-fit: contain; }
/* Institution names: neutral, accent only on hover */
.meta .link { color: var(--text); }
.meta .link:hover { color: var(--accent); }

/* ==========================================================================
   Material system v2: soft black + matte surfaces + clear floating glass
   ========================================================================== */
:root {
  --panel: #12110f;
  --panel-hover: #171614;
  --hairline: rgba(255, 245, 230, 0.07);
  --hairline-strong: rgba(255, 245, 230, 0.14);
}
/* Fine film grain so the black reads as a material, not a void */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Matte surfaces: flat, hairline edge, no blur, no sheen */
.surface {
  position: relative;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: background-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.4s var(--spring);
}
a.surface:hover, .project.surface:hover { background: var(--panel-hover); box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.project:hover { transform: translateY(-3px); }
.tl-item.surface:hover { transform: translateX(3px); }

/* Floating glass: clear, strongly blurred, crisp specular edge */
.glass {
  background: rgba(28, 26, 24, 0.42);
  -webkit-backdrop-filter: blur(22px) saturate(170%) brightness(1.05);
  backdrop-filter: blur(22px) saturate(170%) brightness(1.05);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 250, 240, 0.16),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 250, 240, 0.07),
    0 10px 30px -8px rgba(0, 0, 0, 0.7),
    0 2px 6px rgba(0, 0, 0, 0.4);
}
.glass::before {
  background: radial-gradient(120px 80px at var(--mx, 30%) var(--my, -20%), rgba(255, 250, 240, 0.08), transparent 70%);
  opacity: 1;
}
.glass::after {
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.22), transparent 35%, transparent 75%, rgba(255, 250, 240, 0.05));
}
html.can-refract .glass.refract {
  -webkit-backdrop-filter: url(#lg-refract) blur(14px) saturate(170%) brightness(1.05);
  backdrop-filter: url(#lg-refract) blur(14px) saturate(170%) brightness(1.05);
}
.nav-lens { background: rgba(255, 250, 240, 0.08); box-shadow: inset 0 1px 0 rgba(255, 250, 240, 0.12), inset 0 0 0 1px rgba(255, 250, 240, 0.06); }

/* Portrait: hairline ring instead of a glass frame */
.portrait { padding: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.portrait-inner { box-shadow: none; }

/* Inner placeholders sit one step lighter than panels */
.thumb, .row-logo, .portrait-inner { background: #1a1917; box-shadow: inset 0 0 0 1px var(--hairline); }
.tags li, .tl-kind { background: rgba(255, 245, 230, 0.06); }

/* Real project cards: 3 across, wordmark thumbnails */
.projects { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.thumb span { font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.row-main .tags { margin-top: 8px; padding-top: 0; }
.project:target, .row:target { animation: target-flash 1.6s var(--ease); }

.thumb { object-fit: cover; object-position: top; }
.thumb-icon { width: 34%; aspect-ratio: 1; border-radius: 22%; box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.08); }

.projects { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Compact app-style project cards */
.project.app { flex-direction: row; align-items: flex-start; gap: 16px; padding: 18px; }
.app-icon {
  flex: none; width: 56px; height: 56px; border-radius: 13px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 6px 16px -6px rgba(0, 0, 0, 0.7);
}
.project.app .project-body { padding: 0; gap: 2px; }
.project.app .project-body > p:not(.role) { margin-top: 6px; color: var(--muted); font-size: 15px; }
.project.app .tags { padding-top: 10px; }

/* ---------- Project list: flat items + gliding liquid-glass lens ---------- */
.projects { position: relative; gap: 8px; }
.project.app.surface { background: transparent; box-shadow: none; transform: none; z-index: 1; border-radius: 18px; }
.project.app:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.project.app:hover .arrow { transform: translate(3px, -3px); color: var(--accent); }
.project.app:focus-visible { outline-offset: -2px; }
.proj-lens {
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none;
  width: var(--w, 0); height: var(--h, 0);
  transform: translate(var(--x, 0), var(--y, 0)) scale(0.96);
  border-radius: 18px; opacity: 0;
  background: rgba(255, 250, 240, 0.055);
  transition:
    transform 0.55s var(--spring), width 0.55s var(--spring), height 0.55s var(--spring),
    opacity 0.25s var(--ease);
}
.proj-lens.on { opacity: 1; transform: translate(var(--x, 0), var(--y, 0)) scale(1); }
.proj-lens.instant { transition: opacity 0.25s var(--ease); }
.proj-lens::before {
  background: radial-gradient(180px 120px at var(--mx, 30%) var(--my, 0%), rgba(255, 250, 240, 0.10), transparent 70%);
}
@media (prefers-reduced-motion: reduce) { .proj-lens { transition: opacity 0.01ms; } }

/* Store buttons */
.store-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn.store { height: 34px; padding: 0 14px 0 11px; gap: 7px; font-size: 13px; }
.btn.store svg { width: 16px; height: 16px; transition: none; }
.btn.store:hover svg { transform: none; }
.btn.store:hover { color: var(--accent); }
.project.app:not(a):hover h3 { text-decoration: none; }

.pub-thumb span { font-size: 26px; }

.timeline-wrap { max-width: 620px; }

/* ---------- Timeline: two columns, one rail per year ---------- */
.timeline-wrap { max-width: none; }
.timeline {
  padding-left: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; align-items: start;
}
.timeline::before { display: none; }
.timeline li { padding: 0 0 14px 28px; }
.timeline li::before { left: 1px; }
.timeline li::after {
  content: ""; position: absolute; left: 7px; top: 26px; bottom: 4px;
  width: 2px; border-radius: 2px; background: var(--faint);
}
@media (max-width: 720px) { .timeline { grid-template-columns: 1fr; } }

/* ---------- Timeline v3: compact, column-flow, no boxes ---------- */
.timeline-wrap { max-width: 980px; }
.timeline { display: block; columns: 2; column-gap: 56px; }
.timeline li { break-inside: avoid; padding: 0 0 18px 26px; }
.timeline li::after { top: 24px; bottom: 8px; }
.year { margin-bottom: 4px; }
.tl-items { gap: 0; }
.tl-item.surface {
  display: grid; grid-template-columns: 92px 1fr; align-items: baseline; gap: 10px;
  background: transparent; box-shadow: none; border-radius: 8px;
  padding: 5px 8px; margin-left: -8px;
  font-size: 15px; line-height: 1.45;
}
a.tl-item.surface:hover { background: rgba(255, 250, 240, 0.04); box-shadow: none; transform: none; color: var(--accent); }
.tl-kind { justify-self: start; font-size: 10.5px; padding: 2px 7px; }
@media (max-width: 720px) { .timeline { columns: 1; } }

/* ---------- First screen: hero + timeline together ---------- */
.hero { padding: 92px 0 8px; gap: 32px; }
.portrait-wrap { width: min(100%, 250px); }
#timeline { padding-top: 20px; }
#timeline .section-head { display: none; }
.timeline-wrap { max-width: none; }
.timeline { columns: 3; column-gap: 32px; }
.timeline li { padding: 0 0 12px 24px; }
.year { font-size: 13px; margin-bottom: 2px; }
.tl-item.surface { grid-template-columns: 84px 1fr; gap: 8px; padding: 3px 8px; font-size: 14px; line-height: 1.4; }
.tl-kind { font-size: 10px; padding: 1px 6px; }
@media (max-width: 1000px) { .timeline { columns: 2; } }
@media (max-width: 640px) { .timeline { columns: 1; } }

/* Timeline: two columns */
.timeline { columns: 2; column-gap: 48px; }
@media (max-width: 1000px) { .timeline { columns: 2; } }
@media (max-width: 640px) { .timeline { columns: 1; } }

.pub-icon { width: 46%; aspect-ratio: 1; border-radius: 22%; box-shadow: 0 8px 24px -6px rgba(0,0,0,0.7); }

.pub { grid-template-columns: 96px 1fr; gap: 20px; }
.pub-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 10px 28px -8px rgba(0,0,0,0.8); }
@media (max-width: 880px) { .pub { grid-template-columns: 1fr; } .pub-icon { width: 72px; height: 72px; border-radius: 17px; } }

/* Timeline hover = gliding liquid glass (replaces flat highlight) */
.timeline-wrap { position: relative; }
.timeline .tl-item { position: relative; z-index: 1; }
a.tl-item.surface:hover { background: transparent; color: var(--text); }
a.tl-item.surface:hover .tl-kind { color: var(--accent); }
.proj-lens.lens-sm { border-radius: 10px; }

/* Timeline hover hugs the item's content instead of the full column */
.tl-items { align-items: flex-start; }
.tl-item.surface { width: fit-content; max-width: 100%; padding-right: 12px; }

/* ==========================================================================
   Liquid glass v3: lens body, curved specular, bright rim, inner glow, jelly press
   ========================================================================== */
.glass {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.10) 0%, rgba(255, 250, 240, 0.025) 55%, rgba(255, 250, 240, 0.05) 100%),
    rgba(24, 22, 20, 0.38);
  -webkit-backdrop-filter: blur(18px) saturate(180%) brightness(1.08);
  backdrop-filter: blur(18px) saturate(180%) brightness(1.08);
  box-shadow:
    inset 0 1.5px 0.5px -0.5px rgba(255, 255, 255, 0.55),   /* top specular line */
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.10),            /* bottom refracted rim */
    inset 0 0 14px 0 rgba(255, 250, 240, 0.06),              /* inner glow */
    inset 0 -10px 18px -12px rgba(0, 0, 0, 0.55),            /* lens depth */
    0 10px 24px -10px rgba(0, 0, 0, 0.75),
    0 2px 5px rgba(0, 0, 0, 0.35);
}
/* curved highlight across the upper half + pointer sheen */
.glass::before {
  background:
    radial-gradient(90% 55% at 50% -8%, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.04) 55%, transparent 70%),
    radial-gradient(120px 90px at var(--mx, 30%) var(--my, -20%), rgba(255, 250, 240, 0.12), transparent 70%);
  opacity: 1;
}
/* rim: bright top-left, quiet sides, glint bottom-right */
.glass::after {
  background: linear-gradient(140deg,
    rgba(255, 255, 255, 0.60) 0%, rgba(255, 255, 255, 0.10) 28%,
    rgba(255, 255, 255, 0.03) 50%, rgba(255, 255, 255, 0.08) 72%,
    rgba(255, 255, 255, 0.32) 100%);
}

/* Liquid motion for glass controls */
.icon-btn.glass, .btn.glass {
  transition: transform 0.55s cubic-bezier(0.3, 1.9, 0.5, 1), box-shadow 0.35s var(--ease), background-color 0.35s var(--ease);
}
.icon-btn.glass:hover, .btn.glass:hover { transform: translateY(-2px) scale(1.07); }
.icon-btn.glass:active, .btn.glass:active { transform: scale(1.06, 0.9); transition-duration: 0.12s; }
.icon-btn.glass svg { transition: transform 0.55s cubic-bezier(0.3, 1.9, 0.5, 1); }
.icon-btn.glass:hover svg { transform: scale(1.14); }
.icon-btn.glass:hover, .btn.glass:hover {
  box-shadow:
    inset 0 1.5px 0.5px -0.5px rgba(255, 255, 255, 0.7),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 18px 0 rgba(255, 250, 240, 0.09),
    inset 0 -10px 18px -12px rgba(0, 0, 0, 0.55),
    0 14px 30px -10px rgba(0, 0, 0, 0.8),
    0 2px 5px rgba(0, 0, 0, 0.35);
}
@media (prefers-reduced-motion: reduce) {
  .icon-btn.glass:hover, .btn.glass:hover, .icon-btn.glass:hover svg { transform: none; }
}

/* Liquid glass v3.1: toned down */
.glass {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.06) 0%, rgba(255, 250, 240, 0.02) 60%, rgba(255, 250, 240, 0.03) 100%),
    rgba(24, 22, 20, 0.38);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.05),
    inset 0 0 10px 0 rgba(255, 250, 240, 0.03),
    0 8px 20px -10px rgba(0, 0, 0, 0.7),
    0 2px 4px rgba(0, 0, 0, 0.3);
}
.glass::before {
  background:
    radial-gradient(90% 50% at 50% -10%, rgba(255, 255, 255, 0.08), transparent 65%),
    radial-gradient(110px 80px at var(--mx, 30%) var(--my, -20%), rgba(255, 250, 240, 0.07), transparent 70%);
}
.glass::after {
  background: linear-gradient(140deg,
    rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.06) 30%,
    rgba(255, 255, 255, 0.02) 55%, rgba(255, 255, 255, 0.12) 100%);
}
.icon-btn.glass, .btn.glass { transition: transform 0.45s var(--spring), box-shadow 0.3s var(--ease); }
.icon-btn.glass:hover, .btn.glass:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.06),
    inset 0 0 12px 0 rgba(255, 250, 240, 0.05),
    0 10px 22px -10px rgba(0, 0, 0, 0.75),
    0 2px 4px rgba(0, 0, 0, 0.3);
}
.icon-btn.glass:active, .btn.glass:active { transform: scale(0.97); }
.icon-btn.glass:hover svg { transform: none; }

/* ==========================================================================
   Glass only on hover: controls are flat at rest, turn to liquid glass on hover
   ========================================================================== */
.icon-btn.glass, .btn.glass, .nav.glass {
  transition: transform 0.45s var(--spring), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.icon-btn.glass::before, .btn.glass::before, .nav.glass::before,
.icon-btn.glass::after,  .btn.glass::after,  .nav.glass::after { opacity: 0; transition: opacity 0.3s var(--ease); }

/* at rest: flat */
.icon-btn.glass, .btn.glass {
  background: rgba(255, 250, 240, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.09);
}
.nav.glass {
  background: rgba(16, 15, 13, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.08), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}

/* on hover: liquid glass */
.icon-btn.glass:hover, .btn.glass:hover, .nav.glass:hover {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.07) 0%, rgba(255, 250, 240, 0.02) 60%, rgba(255, 250, 240, 0.035) 100%),
    rgba(24, 22, 20, 0.42);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.06),
    inset 0 0 12px 0 rgba(255, 250, 240, 0.05),
    0 10px 22px -10px rgba(0, 0, 0, 0.75),
    0 2px 4px rgba(0, 0, 0, 0.3);
}
.icon-btn.glass:hover::before, .btn.glass:hover::before, .nav.glass:hover::before,
.icon-btn.glass:hover::after,  .btn.glass:hover::after,  .nav.glass:hover::after { opacity: 1; }
.icon-btn.glass:focus-visible, .btn.glass:focus-visible { box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.2); }
