/* ============================================================
   noelseifert.de — design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Hanken+Grotesk:ital,wght@0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- Tokens ---------- */
:root {
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --bg:      oklch(0.985 0.002 70);
  --bg-2:    oklch(0.962 0.003 70);
  --bg-3:    oklch(0.93 0.004 70);
  --fg:      oklch(0.17 0.004 70);
  --fg-2:    oklch(0.46 0.004 70);
  --fg-3:    oklch(0.66 0.004 70);
  --line:    oklch(0.87 0.003 70);
  --line-2:  oklch(0.80 0.004 70);
  --accent:  oklch(0.62 0.17 47);
  --accent-fg: oklch(0.99 0.01 70);
  --maxw: 1240px;
  --pad: clamp(1.25rem, 5vw, 4.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme='dark'] {
  --bg:      oklch(0.155 0.004 70);
  --bg-2:    oklch(0.192 0.004 70);
  --bg-3:    oklch(0.235 0.005 70);
  --fg:      oklch(0.94 0.003 70);
  --fg-2:    oklch(0.66 0.004 70);
  --fg-3:    oklch(0.48 0.004 70);
  --line:    oklch(0.27 0.004 70);
  --line-2:  oklch(0.34 0.005 70);
  --accent:  oklch(0.72 0.15 52);
  --accent-fg: oklch(0.16 0.01 70);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg); color: var(--fg);
  font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--accent-fg); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Layout primitives ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); width: 100%; }
.hr { height: 1px; background: var(--line); border: 0; width: 100%; }
.section { padding-block: clamp(4.5rem, 11vw, 9rem); position: relative; }
.section + .section { border-top: 1px solid var(--line); }

.sec-head {
  display: flex; align-items: baseline; gap: 1.2rem;
  margin-bottom: clamp(2.2rem, 5vw, 3.6rem); flex-wrap: wrap;
}
.sec-idx { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--fg-3); }
.sec-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.9rem, 4.2vw, 3.1rem); letter-spacing: -0.02em; line-height: 1; }
.sec-head .spacer { flex: 1; }
.sec-link { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-2); display: inline-flex; align-items: center; gap: 0.5em; transition: color 0.25s var(--ease), gap 0.25s var(--ease); }
.sec-link:hover { color: var(--fg); gap: 0.9em; }
.sec-link .arr { transition: transform 0.3s var(--ease); }
.sec-link:hover .arr { transform: translateX(3px); }

.kicker { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--fg-2); }
.outline { color: transparent; -webkit-text-stroke: 1.4px var(--fg); text-stroke: 1.4px var(--fg); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); height: 68px; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand .logo { height: 19px; width: auto; }
.brand .logo.dark-only { display: none; }
:root[data-theme='dark'] .brand .logo.light-only { display: none; }
:root[data-theme='dark'] .brand .logo.dark-only { display: block; }
.nav .spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 0.3rem; }
.nav-link { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); padding: 0.5rem 0.8rem; border-radius: 6px; position: relative; transition: color 0.25s var(--ease); }
.nav-link:hover { color: var(--fg); }
.nav-link.active { color: var(--fg); }
.nav-link.active::after { content: ''; position: absolute; left: 0.8rem; right: 0.8rem; bottom: 0.15rem; height: 1.5px; background: var(--accent); }

.toggle { width: 56px; height: 28px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); position: relative; cursor: pointer; flex: none; transition: background 0.3s var(--ease), border-color 0.3s var(--ease); }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--fg); display: grid; place-items: center; transition: transform 0.4s var(--ease), background 0.3s var(--ease); }
:root[data-theme='dark'] .toggle .knob { transform: translateX(28px); }
.toggle .knob svg { width: 12px; height: 12px; stroke: var(--bg); fill: none; }

.lang { display: flex; align-items: center; gap: 2px; flex: none; border: 1px solid var(--line-2); background: var(--bg-2); border-radius: 999px; padding: 2px; transition: background 0.3s var(--ease), border-color 0.3s var(--ease); }
.lang-btn { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; color: var(--fg-3); background: transparent; border: 0; cursor: pointer; padding: 0.34rem 0.52rem; border-radius: 999px; line-height: 1; transition: color 0.25s var(--ease), background 0.25s var(--ease); }
.lang-btn:hover { color: var(--fg); }
.lang-btn.active { background: var(--fg); color: var(--bg); }

.menu-btn { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 0.6em; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.85rem 1.4rem; border: 1px solid var(--fg); color: var(--fg); border-radius: 2px; cursor: pointer; background: transparent; transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease); }
.btn:hover { background: var(--fg); color: var(--bg); }
.btn.solid { background: var(--fg); color: var(--bg); }
.btn.solid:hover { background: transparent; color: var(--fg); }
.btn .arr { transition: transform 0.3s var(--ease); }
.btn:hover .arr { transform: translate(2px, -2px); }

/* ---------- Tags ---------- */
.tag { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fg-2); border: 1px solid var(--line-2); padding: 0.3em 0.6em; border-radius: 2px; white-space: nowrap; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: clamp(3rem, 7vw, 5rem); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.footer h4 { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 1.1rem; font-weight: 500; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.footer a { color: var(--fg-2); transition: color 0.25s var(--ease); width: fit-content; }
.footer a:hover { color: var(--fg); }
.footer .big { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 1rem; }
.footer-base { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-top: clamp(3rem, 7vw, 5rem); padding-top: 1.6rem; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--fg-3); }

/* ---------- Reveal motion ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d='1'] { transition-delay: 0.08s; }
.reveal[data-d='2'] { transition-delay: 0.16s; }
.reveal[data-d='3'] { transition-delay: 0.24s; }
.reveal[data-d='4'] { transition-delay: 0.32s; }
.reveal[data-d='5'] { transition-delay: 0.40s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  * { scroll-behavior: auto !important; }
}

/* ---------- Page header (sub-pages) ---------- */
.page-head { padding-top: clamp(3rem, 7vw, 5.5rem); padding-bottom: clamp(2.5rem, 6vw, 4rem); border-bottom: 1px solid var(--line); }
.page-head .kicker { display: block; margin-bottom: clamp(1.4rem, 3vw, 2rem); }
.page-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.6rem, 8vw, 6rem); letter-spacing: -0.03em; line-height: 0.95; }
.lede { margin-top: clamp(1.4rem, 3vw, 2rem); max-width: 56ch; color: var(--fg-2); font-size: clamp(1.02rem, 1.5vw, 1.18rem); }
.page-head-meta { margin-top: clamp(2rem, 4vw, 3rem); display: flex; gap: clamp(1.5rem, 4vw, 3.5rem); flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; color: var(--fg-2); }
.page-head-meta b { color: var(--fg); font-weight: 500; display: block; margin-top: 0.3rem; font-size: 0.84rem; letter-spacing: 0.02em; }

/* ---------- Image placeholder ---------- */
.ph {
  position: relative; overflow: hidden; background: var(--bg-2);
  border: 1px solid var(--line);
  background-image: repeating-linear-gradient(-45deg, transparent 0 13px, color-mix(in oklab, var(--fg) 9%, transparent) 13px 14px);
}
.ph .ph-tag { position: absolute; left: 12px; bottom: 11px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); background: color-mix(in oklab, var(--bg) 70%, transparent); padding: 0.3em 0.6em; backdrop-filter: blur(4px); }

/* ---------- Real images shared ---------- */
.img-cover { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============================================================
   HOME PAGE
   ============================================================ */

/* Hero */
.hero { position: relative; padding-top: clamp(3rem, 8vw, 6rem); padding-bottom: clamp(3.5rem, 8vw, 6rem); overflow: hidden; }
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px), linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: clamp(48px, 7vw, 92px) clamp(48px, 7vw, 92px);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 28% 35%, #000 5%, transparent 72%);
  mask-image: radial-gradient(ellipse 90% 80% at 28% 35%, #000 5%, transparent 72%);
  opacity: 0.55;
}
.hero-watermark { position: absolute; right: clamp(-3rem, -2vw, 0rem); top: 50%; transform: translateY(-50%); height: clamp(180px, 38vw, 460px); width: auto; opacity: 0.05; z-index: 0; pointer-events: none; }
.hero-inner { position: relative; z-index: 1; }
.hero-kicker { display: flex; align-items: center; gap: 0.7rem; margin-bottom: clamp(1.6rem, 4vw, 2.4rem); flex-wrap: wrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); position: relative; }
.dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--accent); opacity: 0; animation: pulse 2.6s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(0.7); opacity: 0.6; } 70%,100% { transform: scale(2.2); opacity: 0; } }
.hero h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.6rem, 7.6vw, 6.4rem); line-height: 0.98; letter-spacing: -0.03em; max-width: 17ch; }
.hero h1 .em { font-style: normal; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.hero h1 .line > span { display: inline-block; animation: rise 0.95s cubic-bezier(0.16,1,0.3,1) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: 0.1s; }
.hero h1 .line:nth-child(3) > span { animation-delay: 0.2s; }
@keyframes rise { from { transform: translateY(108%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .hero h1 .line > span { animation: none; } }
.hero-sub { margin-top: clamp(1.8rem, 4vw, 2.6rem); max-width: 50ch; color: var(--fg-2); font-size: clamp(1.02rem, 1.6vw, 1.18rem); }
.hero-sub strong { color: var(--fg); font-weight: 600; }
.hero-cta { margin-top: clamp(2rem, 4vw, 2.8rem); display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero-meta { margin-top: clamp(3rem, 7vw, 5rem); display: flex; gap: clamp(1.5rem, 4vw, 3.5rem); flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; color: var(--fg-2); padding-top: 1.4rem; border-top: 1px solid var(--line); }
.hero-meta b { color: var(--fg); font-weight: 500; display: block; margin-top: 0.3rem; font-size: 0.84rem; letter-spacing: 0.02em; }

/* Approach */
.approach { padding-block: clamp(2.6rem, 6vw, 4.2rem); border-bottom: 1px solid var(--line); }
.approach-kicker { display: flex; align-items: center; gap: 0.65rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 1.3rem; }
.approach-kicker .dot { width: 6px; height: 6px; }
.approach-line { color: var(--fg); font-family: var(--font-display); font-weight: 500; font-size: clamp(1.35rem, 3.6vw, 2.4rem); letter-spacing: -0.02em; line-height: 1.18; max-width: 22ch; text-wrap: balance; }
.approach-line .ap-sep { color: var(--accent); margin: 0 0.4em; }
.approach-line .ap-en, .approach-line .ap-de { transition: color 0.5s var(--ease); }
html[lang='de'] .approach-line .ap-en { color: var(--fg-2); }
html[lang='en'] .approach-line .ap-de { color: var(--fg-2); }
.flow { margin-top: clamp(2.2rem, 5vw, 3.2rem); display: grid; grid-template-columns: auto minmax(40px, 1fr) auto minmax(40px, 1fr) auto; align-items: center; row-gap: 0.95rem; max-width: 720px; }
.fn-mark { display: grid; place-items: center; justify-self: center; grid-row: 1; }
.fn-mark.m1 { grid-column: 1; } .fn-mark.m2 { grid-column: 3; } .fn-mark.m3 { grid-column: 5; }
.fn-dot { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--fg-3); background: var(--bg); }
.fn-dot.filled { border-color: var(--accent); background: var(--accent); position: relative; }
.fn-dot.filled::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--accent); opacity: 0; animation: pulse 2.6s var(--ease) infinite; }
.fn-glyph { font-family: var(--font-mono); font-size: 0.95rem; color: var(--accent); letter-spacing: 0.04em; }
.flow-seg { grid-row: 1; height: 1.5px; position: relative; }
.flow-seg.s1 { grid-column: 2; } .flow-seg.s2 { grid-column: 4; }
.flow-seg.dashed { background-image: linear-gradient(to right, var(--line-2) 0 6px, transparent 6px 12px); background-size: 12px 1.5px; }
.flow-seg.solid { background: var(--fg-3); overflow: hidden; container-type: inline-size; }
.flow-sheen { position: absolute; top: -1px; bottom: -1px; width: 46px; background: linear-gradient(90deg, transparent, var(--accent), transparent); transform: translateX(-46px); animation: flow-move 2s ease-in-out infinite; }
/* 100cqw = full segment width (a translateX percentage would be relative to the 46px sheen itself, stopping the sweep early).
   Travel runs from "just fully hidden" left to "just fully hidden" right — no dead time in the overflow region. */
@keyframes flow-move { 0% { transform: translateX(-46px); } 100% { transform: translateX(100cqw); } }
.fn-label { grid-row: 2; justify-self: center; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; }
.fn-label.l1 { grid-column: 1; } .fn-label.l2 { grid-column: 3; } .fn-label.l3 { grid-column: 5; }
@media (prefers-reduced-motion: reduce) { .flow-sheen { animation: none; opacity: 0; } }

/* About */
.about-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.about-lead { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.4rem, 3vw, 2.05rem); line-height: 1.25; letter-spacing: -0.015em; }
.about-lead .mut { color: var(--fg-3); }
.about-body { margin-top: 1.6rem; color: var(--fg-2); max-width: 56ch; }
.about-body p + p { margin-top: 1rem; }
.facts { display: flex; flex-direction: column; }
.fact { display: flex; justify-content: space-between; gap: 1rem; padding: 0.95rem 0; border-top: 1px solid var(--line); font-size: 0.95rem; }
.fact:last-child { border-bottom: 1px solid var(--line); }
.fact .k { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); padding-top: 0.15rem; }
.fact .v { text-align: right; color: var(--fg); }
.fact .v .accent { color: var(--accent); }
.portrait { margin-top: 1.6rem; aspect-ratio: 4/5; border-radius: 2px; overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }

/* Project teaser list (home) */
.proj-list { border-top: 1px solid var(--line); }
.proj-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: clamp(1rem, 3vw, 2.5rem); align-items: center; padding: clamp(1.3rem, 3vw, 1.9rem) 0; border-bottom: 1px solid var(--line); position: relative; transition: padding-left 0.4s var(--ease); }
.proj-row:hover { padding-left: clamp(0.5rem, 1.5vw, 1.2rem); }
.proj-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform 0.4s var(--ease); }
.proj-row:hover::before { transform: scaleY(1); }
.proj-num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-3); letter-spacing: 0.05em; }
.proj-name { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.35rem, 3.2vw, 2.1rem); letter-spacing: -0.02em; line-height: 1; }
.proj-name .sub { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.9rem; letter-spacing: 0; color: var(--fg-2); margin-top: 0.5rem; }
.proj-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; max-width: 280px; }
.proj-arr { color: var(--fg-3); transition: transform 0.35s var(--ease), color 0.35s var(--ease); }
.proj-row:hover .proj-arr { transform: translateX(5px); color: var(--fg); }
.proj-status { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); }
.proj-status.live { color: var(--accent); }

/* Row hover preview card (cursor-following; shown by site.js, pointer-fine only — home Projects + Writing teasers) */
.proj-preview {
  position: fixed; top: 0; left: 0; z-index: 60; width: clamp(240px, 22vw, 320px);
  pointer-events: none; opacity: 0;
  transform: translate3d(-50%, -50%, 0) scale(0.92) rotate(-2deg);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 24px 60px -20px color-mix(in oklab, var(--fg) 35%, transparent);
  overflow: hidden; will-change: transform, opacity;
}
.proj-preview.show { opacity: 1; transform: translate3d(-50%, -50%, 0) scale(1) rotate(0deg); }
.proj-preview-media { aspect-ratio: 16 / 10; background: var(--bg-3); overflow: hidden; }
.proj-preview-media img { width: 100%; height: 100%; object-fit: cover; }
.proj-preview:not(.has-cover) .proj-preview-media { display: none; }
.proj-preview-body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.proj-preview-title { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; letter-spacing: -0.02em; color: var(--fg); }
.proj-preview-tagline { font-size: 0.85rem; color: var(--fg-2); line-height: 1.35; }
.proj-preview-tagline:empty { display: none; }
.proj-preview-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); margin-top: 0.15rem; }
.proj-preview-meta:empty { display: none; }
@media (hover: none), (prefers-reduced-motion: reduce) { .proj-preview { display: none; } }

/* Photo strip (home teaser) */
.photo-strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(0.6rem, 1.4vw, 1rem); }
.photo-strip .ph { border-radius: 2px; }
.ps-1 { grid-column: span 5; aspect-ratio: 4/5; }
.ps-2 { grid-column: span 7; aspect-ratio: 16/10; }
.ps-3 { grid-column: span 4; aspect-ratio: 1/1; }
.ps-4 { grid-column: span 4; aspect-ratio: 1/1; }
.ps-5 { grid-column: span 4; aspect-ratio: 1/1; }
.photo-strip .ps-item { border-radius: 2px; overflow: hidden; position: relative; background: var(--bg-2); border: 1px solid var(--line); }
.photo-strip .ps-item img { width: 100%; height: 100%; object-fit: cover; }

/* Writing post rows (home) */
.posts { border-top: 1px solid var(--line); }
.post-row { display: grid; grid-template-columns: auto 1fr auto; gap: clamp(1rem, 3vw, 2.5rem); align-items: baseline; padding: clamp(1.2rem, 3vw, 1.7rem) 0; border-bottom: 1px solid var(--line); transition: padding-left 0.4s var(--ease); }
.post-row:hover { padding-left: clamp(0.5rem, 1.5vw, 1rem); }
.post-date { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; color: var(--fg-3); white-space: nowrap; }
.post-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.15rem, 2.4vw, 1.55rem); letter-spacing: -0.015em; line-height: 1.2; }
.post-title .meta { display: block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--fg-3); margin-top: 0.45rem; font-weight: 400; text-transform: uppercase; }
.post-arr { color: var(--fg-3); transition: transform 0.35s var(--ease), color 0.35s var(--ease); }
.post-row:hover .post-arr { transform: translateX(5px); color: var(--fg); }

/* Stack */
.stack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.5rem, 4vw, 3rem); }
.stack-col h3 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 1.1rem; font-weight: 500; }
.stack-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.stack-col li { font-size: 1.02rem; color: var(--fg); display: flex; align-items: center; gap: 0.6rem; }
.stack-col li::before { content: ''; width: 5px; height: 5px; background: var(--fg-3); flex: none; }
.stack-col.learning li::before { background: var(--accent); }

/* Contact */
.contact { text-align: left; }
.contact-big { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.4rem, 7vw, 5.5rem); letter-spacing: -0.03em; line-height: 0.98; }
.contact-big a { transition: color 0.3s var(--ease); }
.contact-big a:hover { color: var(--accent); }
.contact-sub { margin-top: 1.5rem; color: var(--fg-2); max-width: 44ch; }
.contact-socials { margin-top: 2.5rem; display: flex; gap: 0.7rem; flex-wrap: wrap; }

/* ============================================================
   PROJECTS PAGE
   ============================================================ */

.proj { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.proj + .proj { border-top: 1px solid var(--line); }
.proj-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.8rem; flex-wrap: wrap; }
.proj-head .num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-3); letter-spacing: 0.08em; }
.proj-head .status { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); border: 1px solid var(--line-2); padding: 0.3em 0.7em; border-radius: 2px; }
.proj-head .status.live { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 50%, var(--line-2)); }
.proj-head .spacer { flex: 1; }
.proj-head .year { font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-3); letter-spacing: 0.05em; }
.proj-cover {display: block; aspect-ratio: 16/8; border-radius: 3px; margin-bottom: clamp(1.8rem, 4vw, 2.6rem); overflow: hidden; }
.proj-cover img { width: 100%; height: 100%; object-fit: cover; }
.proj-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.proj-h { font-family: var(--font-display); font-weight: 500; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.025em; line-height: 1; }
.proj-tagline { color: var(--fg-2); font-size: clamp(1.05rem, 1.6vw, 1.2rem); margin-top: 1.1rem; max-width: 46ch; }
.proj-desc { color: var(--fg-2); }
.proj-desc p + p { margin-top: 0.9rem; }
.proj-side { display: flex; flex-direction: column; }
.proj-side .row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-top: 1px solid var(--line); font-size: 0.93rem; }
.proj-side .row:first-child { border-top: 0; padding-top: 0; }
.proj-side .row .k { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.proj-side .row .v { text-align: right; color: var(--fg); }
.proj-stack { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; max-width: 220px; }
.proj-links { display: flex; gap: 0.7rem; margin-top: 1.6rem; flex-wrap: wrap; }

/* ============================================================
   PHOTOGRAPHY PAGE
   ============================================================ */

.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; padding-block: clamp(1.5rem, 3vw, 2.2rem); border-bottom: 1px solid var(--line); position: sticky; top: 68px; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(12px); z-index: 20; }
.chip { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); border: 1px solid var(--line-2); padding: 0.5em 0.95em; border-radius: 999px; cursor: pointer; background: transparent; transition: all 0.25s var(--ease); }
.chip:hover { color: var(--fg); border-color: var(--fg-3); }
.chip.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip .n { opacity: 0.5; margin-left: 0.4em; }
.gallery { columns: 3; column-gap: clamp(0.7rem, 1.5vw, 1.1rem); padding-block: clamp(1.5rem, 4vw, 2.5rem); }
.shot { break-inside: avoid; margin-bottom: clamp(0.7rem, 1.5vw, 1.1rem); position: relative; cursor: pointer; transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); border-radius: 3px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.shot img { width: 100%; display: block; }
.shot::after { content: ''; position: absolute; inset: 0; background: var(--fg); opacity: 0; transition: opacity 0.3s var(--ease); pointer-events: none; }
.shot:hover::after { opacity: 0.05; }
.shot.hide { display: none; }
.shot .meta { position: absolute; left: 12px; bottom: 11px; right: 12px; display: flex; justify-content: space-between; align-items: flex-end; opacity: 0; transform: translateY(4px); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
.shot:hover .meta { opacity: 1; transform: none; }
.shot .meta .cat { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg); background: color-mix(in oklab, var(--bg) 78%, transparent); padding: 0.3em 0.6em; backdrop-filter: blur(4px); }
.shot .meta .loc { font-family: var(--font-mono); font-size: 0.62rem; color: var(--fg-2); }
.a45 { aspect-ratio: 4/5; } .a11 { aspect-ratio: 1/1; } .a169 { aspect-ratio: 16/9; }
.a23 { aspect-ratio: 2/3; } .a32 { aspect-ratio: 3/2; } .a54 { aspect-ratio: 5/4; }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 100; background: color-mix(in oklab, var(--bg) 92%, #000 8%); backdrop-filter: blur(20px); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity 0.35s var(--ease); padding: clamp(1rem, 5vw, 4rem); }
.lb.open { opacity: 1; pointer-events: auto; }
.lb-stage { width: min(78vw, 1000px); max-height: 82vh; }
.lb-img { width: 100%; aspect-ratio: 3/2; border-radius: 3px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.lb-img img { width: 100%; height: 100%; object-fit: cover; }
.lb-cap { display: flex; justify-content: space-between; margin-top: 1rem; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; color: var(--fg-2); }
.lb-close { position: absolute; top: clamp(1rem,3vw,2rem); right: clamp(1rem,3vw,2rem); width: 44px; height: 44px; border: 1px solid var(--line-2); background: var(--bg); border-radius: 50%; cursor: pointer; color: var(--fg); font-size: 1.1rem; display: grid; place-items: center; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 1px solid var(--line-2); background: var(--bg); border-radius: 50%; cursor: pointer; color: var(--fg); display: grid; place-items: center; font-size: 1.2rem; }
.lb-nav.prev { left: clamp(0.5rem,2vw,1.5rem); } .lb-nav.next { right: clamp(0.5rem,2vw,1.5rem); }

/* ============================================================
   WRITING PAGE
   ============================================================ */

.feat { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; padding-block: clamp(3rem, 6vw, 5rem); border-bottom: 1px solid var(--line); position: relative; }
.feat .feat-img { aspect-ratio: 4/3; border-radius: 3px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.feat .feat-img img { width: 100%; height: 100%; object-fit: cover; }
.feat .tagline { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.1rem; }
.feat h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -0.025em; line-height: 1.04; }
/* Stretched link: the title anchor's hit area covers the whole <article>, keeping the semantics
   of <article> + a single <a> while making the entire preview (image, excerpt, meta) clickable. */
.feat h2 a { transition: color 0.3s var(--ease); }
.feat h2 a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.feat:hover h2 a { color: var(--accent); }
.feat .feat-img img { transition: transform 0.5s var(--ease); }
.feat:hover .feat-img img { transform: scale(1.03); }
.feat p { color: var(--fg-2); margin-top: 1.2rem; max-width: 46ch; }
.feat .m { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--fg-3); margin-top: 1.6rem; display: flex; gap: 1.2rem; }
.year-group { padding-block: clamp(2.5rem, 5vw, 4rem); }
.year-group + .year-group { border-top: 1px solid var(--line); }
.year-label { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.16em; color: var(--fg-3); margin-bottom: 1.5rem; }
.entry { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: baseline; padding: clamp(1.2rem, 3vw, 1.8rem) 0; border-top: 1px solid var(--line); transition: padding-left 0.4s var(--ease); position: relative; }
.entry:hover { padding-left: clamp(0.5rem, 1.5vw, 1rem); }
.entry::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform 0.35s var(--ease); }
.entry:hover::before { transform: scaleY(1); }
.entry h3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.2rem, 2.6vw, 1.7rem); letter-spacing: -0.015em; line-height: 1.15; }
.entry .excerpt { color: var(--fg-2); margin-top: 0.6rem; max-width: 60ch; font-size: 0.98rem; }
.entry .tags { display: flex; gap: 0.4rem; margin-top: 0.9rem; flex-wrap: wrap; }
.entry .right { text-align: right; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; color: var(--fg-3); white-space: nowrap; }
.entry .right .read { display: block; margin-top: 0.4rem; }
.entry .arr { color: var(--fg-3); transition: transform 0.35s var(--ease), color 0.35s var(--ease); display: inline-block; margin-top: 0.5rem; }
.entry:hover .arr { transform: translateX(4px); color: var(--fg); }

/* ============================================================
   ARTICLE PAGE
   ============================================================ */

.article-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; color: var(--fg-3); margin-top: clamp(1.5rem, 3vw, 2.2rem); }
.article-cover { aspect-ratio: 16/7; border-radius: 3px; margin-block: clamp(2rem, 5vw, 3.5rem); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body { max-width: 68ch; }
.article-body p { margin-bottom: 1.4rem; color: var(--fg-2); line-height: 1.75; }
.article-body h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; line-height: 1.1; margin-top: 2.5rem; margin-bottom: 1rem; color: var(--fg); }
.article-body h3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.1rem, 2vw, 1.4rem); letter-spacing: -0.01em; margin-top: 2rem; margin-bottom: 0.7rem; color: var(--fg); }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1.4rem; color: var(--fg-2); }
.article-body li { margin-bottom: 0.4rem; line-height: 1.65; }
.article-body blockquote { border-left: 2px solid var(--accent); padding-left: 1.2rem; margin: 1.8rem 0; color: var(--fg-2); font-style: italic; }
.article-body code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-3); padding: 0.15em 0.4em; border-radius: 3px; }
.article-body pre { background: var(--bg-3); border: 1px solid var(--line); border-radius: 3px; padding: 1.2rem; overflow-x: auto; margin-bottom: 1.4rem; }
.article-body pre code { background: none; padding: 0; }
.article-back { display: inline-flex; align-items: center; gap: 0.5em; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 2rem; transition: color 0.25s var(--ease); }
.article-back:hover { color: var(--fg); }
.article-back:hover .arr { transform: translateX(-3px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-tags { display: none; }
  .proj-row { grid-template-columns: auto 1fr auto; }
  .proj-body { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 820px) {
  .feat { grid-template-columns: 1fr; }
  .feat .feat-img { order: -1; }
}

@media (max-width: 760px) {
  .nav-links { position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 0.5rem var(--pad) 1.5rem; transform: translateY(-130%); transition: transform 0.4s var(--ease); box-shadow: 0 20px 40px -20px color-mix(in oklab, var(--fg) 25%, transparent); }
  .nav.open .nav-links { transform: none; }
  .nav-link { padding: 0.9rem 0; font-size: 0.95rem; border-bottom: 1px solid var(--line); }
  .nav-link.active::after { display: none; }
  .menu-btn { display: grid; place-items: center; width: 40px; height: 40px; background: transparent; border: 0; cursor: pointer; }
  .menu-btn span { display: block; width: 22px; height: 1.5px; background: var(--fg); position: relative; transition: 0.3s var(--ease); }
  .menu-btn span::before, .menu-btn span::after { content: ''; position: absolute; left: 0; width: 22px; height: 1.5px; background: var(--fg); transition: 0.3s var(--ease); }
  .menu-btn span::before { top: -6px; } .menu-btn span::after { top: 6px; }
  .nav.open .menu-btn span { background: transparent; }
  .nav.open .menu-btn span::before { top: 0; transform: rotate(45deg); }
  .nav.open .menu-btn span::after { top: 0; transform: rotate(-45deg); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer .big-col { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .photo-strip { grid-template-columns: repeat(2, 1fr); }
  .ps-1,.ps-3,.ps-4,.ps-5 { grid-column: span 1; aspect-ratio: 1/1; }
  .ps-2 { grid-column: span 2; aspect-ratio: 16/10; }
  .post-row { grid-template-columns: 1fr auto; }
  .post-date { grid-column: 1 / -1; }
  .flow { row-gap: 0.7rem; }
  .fn-label { font-size: 0.58rem; letter-spacing: 0.05em; }
}

@media (max-width: 820px) { .gallery { columns: 2; } }
@media (max-width: 520px) { .gallery { columns: 1; } .lb-nav { display: none; } }
