/* ==========================================================================
   ShijilKumar.com — Editorial dark-first personal brand
   ========================================================================== */

:root {
  --bg: #0c0b0a;
  --bg-elev: #16140f;
  --bg-soft: #1c1a15;
  --line: #2e2b25;
  --text: #f4efe5;
  --text-dim: #c9c2b3;     /* readable on dark */
  --text-mute: #8a8478;
  --photo-bg-1: #1f1d18;
  --photo-bg-2: #0f0e0c;
  --accent: #d4a574;
  --accent-soft: #e8c896;
  --serif: 'Fraunces', 'Times New Roman', serif;
  --sans: 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Consolas', monospace;
  --max: 1280px;
  --gutter: clamp(28px, 6vw, 96px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="light"] {
  --bg: #f4ede0;          /* warm paper — slightly richer than cream */
  --bg-elev: #ece2cd;     /* sand */
  --bg-soft: #e0d4ba;     /* deeper sand */
  --line: #c9bd9e;
  --text: #1c1810;
  --text-dim: #3a342a;
  --text-mute: #6c6450;
  --photo-bg-1: #ece2cd;
  --photo-bg-2: #d4c8ad;
  --accent: #b8722c;       /* burnt sienna — more alive than tan */
  --accent-soft: #d4924a;
  --accent-deep: #6a3f15;
  --ink: #14110b;
  --co1: #2d4a3e;          /* moss — secondary accent */
  --co2: #6b4729;          /* walnut */
}

/* Subtle paper grain so light mode doesn't read as flat */
[data-theme="light"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(184,114,44,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(45,74,62,0.04) 0%, transparent 60%),
    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='2' seed='3'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0 0.04  0 0 0 0.045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-attachment: fixed, fixed, fixed;
}

[data-theme="light"] ::selection { background: var(--accent); color: #fff; }

/* Varied section tones for editorial feel */
[data-theme="light"] .signal { background: var(--bg-elev); }
[data-theme="light"] .signal-item { background: var(--bg); }
[data-theme="light"] .signal-item:hover { background: var(--bg-elev); }
[data-theme="light"] .workbench { background: var(--bg); }
[data-theme="light"] .workbench .work-row { border-color: var(--line); }
[data-theme="light"] .stack-teaser { background: var(--bg-elev); }
[data-theme="light"] .stack-cell { background: var(--bg); }
[data-theme="light"] .stack-cell:hover { background: var(--bg-elev); color: var(--accent); }
[data-theme="light"] .manifesto { background: var(--bg-soft); position: relative; }
[data-theme="light"] .manifesto::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(184,114,44,0.04), transparent 60%);
  pointer-events: none;
}
[data-theme="light"] .softpitch {
  background: var(--ink); color: var(--bg);
}
[data-theme="light"] .softpitch h2 { color: var(--bg); }
[data-theme="light"] .softpitch p { color: rgba(244,237,224,0.8); }
[data-theme="light"] .softpitch .domain { color: var(--accent-soft); border-color: var(--accent-soft); }
[data-theme="light"] .softpitch .btn-primary { background: var(--accent); color: #fff; }
[data-theme="light"] .softpitch .btn-primary:hover { background: var(--accent-soft); }

[data-theme="light"] .products-signal { background: var(--bg-elev); }
[data-theme="light"] .product-card { background: var(--bg); border-color: var(--line); }
[data-theme="light"] .article-card,
[data-theme="light"] .product-tile,
[data-theme="light"] .blog-card,
[data-theme="light"] .tool { background: var(--bg); border-color: var(--line); }
[data-theme="light"] .blog-card:hover,
[data-theme="light"] .tool:hover { background: var(--bg-elev); }

[data-theme="light"] .site-header.scrolled {
  background: rgba(244, 237, 224, 0.85);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom-color: var(--line);
}

/* Buttons feel deliberate */
[data-theme="light"] .btn-primary { background: var(--ink); color: var(--bg); }
[data-theme="light"] .btn-primary:hover { background: var(--accent); color: #fff; }
[data-theme="light"] .btn-ghost { border-color: var(--line); color: var(--text); }
[data-theme="light"] .btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: rgba(184,114,44,0.06); }
[data-theme="light"] .nav-cta:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
[data-theme="light"] .email-form { background: var(--bg); }
[data-theme="light"] .email-form button { background: var(--accent); color: #fff; }
[data-theme="light"] .email-form button:hover { background: var(--accent-deep); }

/* Accent eyebrow + subtle quote highlight */
[data-theme="light"] .eyebrow { color: var(--accent-deep); }
[data-theme="light"] .eyebrow::before { background: var(--accent-deep); }
[data-theme="light"] .prose blockquote {
  background: var(--bg-elev); padding: 24px 28px; border-radius: 4px;
  border-left-width: 3px; margin: 40px -8px;
}
[data-theme="light"] .prose pre {
  background: var(--ink); color: #ece2cd; border-color: var(--ink);
}
[data-theme="light"] .prose code {
  background: var(--bg-elev); color: var(--accent-deep);
}
[data-theme="light"] .author-card { background: var(--bg-elev); border-color: var(--line); }
[data-theme="light"] .filter-bar button { border-color: var(--line); }
[data-theme="light"] .filter-bar button:hover,
[data-theme="light"] .filter-bar button.active { color: var(--accent); border-color: var(--accent); background: rgba(184,114,44,0.06); }
[data-theme="light"] .work-row em,
[data-theme="light"] .manifesto-line em,
[data-theme="light"] .hero h1 em.accent,
[data-theme="light"] h1 em,
[data-theme="light"] h2 em { color: var(--accent); }
[data-theme="light"] .work-row .status-dot { background: var(--co1); box-shadow: 0 0 0 0 var(--co1); }
[data-theme="light"] .footer-bottom .pulse::before { background: var(--co1); box-shadow: 0 0 0 0 var(--co1); }
[data-theme="light"] .accent { color: var(--accent); }

/* Theme toggle icon swap — show sun in light mode */
[data-theme="light"] .theme-toggle svg { transform: scale(1.1); }
[data-theme="light"] .theme-toggle { border-color: var(--line); }
[data-theme="light"] .theme-toggle:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; overflow-x: clip; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212,165,116,0.04) 0%, transparent 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><circle cx='1' cy='1' r='0.5' fill='%23ffffff' fill-opacity='0.03'/></svg>");
  background-attachment: fixed, fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  overflow-x: clip;
  max-width: 100vw;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

/* Section accents — faint patterns to break up plain backgrounds */
.workbench { position: relative; }
.workbench::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 100%;
  mask-image: linear-gradient(180deg, transparent 0%, black 30%, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 30%, black 70%, transparent 100%);
}
.workbench > * { position: relative; z-index: 1; }
.manifesto { position: relative; }
.manifesto::after {
  content: ""; position: absolute; right: 0; top: 0; width: 30%; height: 100%;
  background: radial-gradient(circle at 80% 50%, rgba(212,165,116,0.05), transparent 60%);
  pointer-events: none;
}
[data-theme="light"] .manifesto::after {
  background: radial-gradient(circle at 80% 50%, rgba(184,114,44,0.07), transparent 60%);
}

img, svg, video { max-width: 100%; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--accent); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--accent); color: var(--bg); }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 7vw, 6.4rem); }
h2 { font-size: clamp(1.9rem, 4.5vw, 3.6rem); line-height: 1.08; }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.25; }
h4 { font-size: 1.15rem; line-height: 1.3; }

p { color: var(--text-dim); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: ""; width: 24px; height: 1px; background: var(--text-mute);
}

.italic { font-style: italic; color: var(--accent-soft); }

/* Skip link */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--bg); padding: 12px 18px; z-index: 200;
}
.skip:focus { left: 12px; top: 12px; }

/* ===== HEADER ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 22px 0;
  transition: background .3s var(--ease), backdrop-filter .3s var(--ease), border-color .3s var(--ease), padding .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(12, 11, 10, 0.78);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  border-bottom-color: var(--line);
  padding: 14px 0;
}
[data-theme="light"] .site-header.scrolled { background: rgba(245, 241, 234, 0.85); }

.nav-row {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  min-height: 44px;
}
.logo {
  font-family: var(--serif); font-size: 22px; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 10px;
}
.logo-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  color: var(--text); transition: color .3s var(--ease), transform .3s var(--ease);
}
.logo-mark svg { width: 100%; height: 100%; display: block; }
.logo:hover .logo-mark { color: var(--accent); transform: rotate(-3deg); }

.nav-links { display: flex; gap: 28px; align-items: center; flex-shrink: 0; }
.nav-links a {
  font-size: 14px; color: var(--text-dim); position: relative; padding: 4px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1px;
  background: var(--accent); transition: width .3s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-cta {
  border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px;
  font-size: 13px; transition: all .25s var(--ease);
  display: inline-flex; align-items: center; gap: 8px;
}
.nav-cta:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.nav-cta .arrow { display: inline-block; transition: transform .25s var(--ease); }
.nav-cta:hover .arrow { transform: translate(2px, -2px); }

.theme-toggle {
  width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.menu-btn { display: none; width: 36px; height: 36px; align-items: center; justify-content: center; }
.menu-btn span { display: block; width: 22px; height: 1px; background: var(--text); position: relative; }
.menu-btn span::before, .menu-btn span::after {
  content: ""; position: absolute; left: 0; width: 22px; height: 1px; background: var(--text);
  transition: transform .3s var(--ease);
}
.menu-btn span::before { top: -7px; }
.menu-btn span::after { top: 7px; }

/* Mobile overlay — only renders when .open. Off-DOM-visually otherwise. */
.mobile-menu { display: none !important; }
@media (max-width: 1080px) {
  .mobile-menu.open {
    display: flex !important;
    position: fixed; inset: 0; background: var(--bg); z-index: 60;
    flex-direction: column; padding: 24px var(--gutter);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    animation: menu-in .32s var(--ease);
  }
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mobile-menu .nav-row { margin-bottom: 60px; }
.mobile-menu nav { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.mobile-menu nav a {
  font-family: var(--serif); font-size: clamp(2rem, 8vw, 3.4rem); color: var(--text);
  letter-spacing: -0.02em; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.mobile-menu nav a:hover { color: var(--accent); padding-left: 12px; }
.mobile-menu .footer-meta { padding-top: 24px; color: var(--text-mute); font-size: 13px; }

/* ===== HERO ===== */
.hero {
  min-height: 100vh; position: relative; padding: 140px 0 80px;
  display: flex; align-items: center; overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: 1.1fr .9fr;
  gap: clamp(40px, 6vw, 80px); align-items: center; width: 100%;
}
.hero-text .eyebrow { margin-bottom: 32px; }
.hero h1 {
  font-weight: 300; margin-bottom: 32px;
}
.hero h1 .accent { font-style: italic; color: var(--accent); font-weight: 400; }
.hero-sub {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem); max-width: 520px;
  color: var(--text-dim); margin-bottom: 44px; line-height: 1.55;
}
.hero-cta-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px; border-radius: 999px;
  font-size: 14px; letter-spacing: 0.02em; transition: all .3s var(--ease);
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--bg); transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary .arrow, .btn-ghost .arrow { transition: transform .3s var(--ease); }
.btn-primary:hover .arrow, .btn-ghost:hover .arrow { transform: translate(3px, -3px); }

/* Hero photo — aspect-ratio matches the actual photo (1367×1151)
   so contain produces zero letterbox top/bottom */
.hero-photo {
  position: relative; aspect-ratio: 1367 / 1151; width: 100%;
  background: transparent;
  border: none; border-radius: 0; overflow: hidden;
}
/* Blurred photo extension — ONLY appears at top + bottom edges,
   so the sharp PC/monitors in the middle remain untouched */
.hero-photo .photo-blur-bg {
  display: block;
  position: absolute; inset: 0; z-index: 0;
  background-image: url("../assets/hero.webp");
  background-size: cover; background-position: center center;
  filter: blur(28px) saturate(0.75) brightness(0.7);
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(180deg, black 0%, black 12%, transparent 28%, transparent 72%, black 88%, black 100%);
  mask-image: linear-gradient(180deg, black 0%, black 12%, transparent 28%, transparent 72%, black 88%, black 100%);
  pointer-events: none;
}
.about-photo .photo-blur-bg {
  display: block;
  position: absolute; inset: 0; z-index: 0;
  background-image: url("../assets/about.webp");
  background-size: cover; background-position: center center;
  filter: blur(28px) saturate(0.75) brightness(0.7);
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(180deg, black 0%, black 12%, transparent 28%, transparent 72%, black 88%, black 100%);
  mask-image: linear-gradient(180deg, black 0%, black 12%, transparent 28%, transparent 72%, black 88%, black 100%);
  pointer-events: none;
}
.hero-photo .real-photo,
.about-photo .real-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: center; z-index: 1;
  filter: contrast(1.05) saturate(0.95) brightness(0.98);
  /* Strong fade top/bottom (where letterbox meets page),
     subtle fade left/right (just enough to soften edges
     without blurring the PC and monitors). */
  -webkit-mask-image:
    linear-gradient(180deg, transparent 0%, black 7%, black 93%, transparent 100%),
    linear-gradient(90deg,  transparent 0%, black 4%, black 96%, transparent 100%);
  mask-image:
    linear-gradient(180deg, transparent 0%, black 7%, black 93%, transparent 100%),
    linear-gradient(90deg,  transparent 0%, black 4%, black 96%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.hero-photo .real-photo { object-position: center center; }
.about-photo .real-photo { object-position: center center; }
.hero-photo .real-photo + .photo-placeholder,
.about-photo .real-photo + span { display: none; }
/* When real photo is loaded, hide the framing chrome */
.hero-photo:has(.real-photo) .frame-corners,
.hero-photo:has(.real-photo) .hero-meta,
.about-photo:has(.real-photo) .frame-corners { display: none; }
.hero-photo:has(.real-photo)::before,
.about-photo:has(.real-photo)::before { display: none; }
/* No corner vignette — the mask handles edge softening cleanly */
.hero-photo:has(.real-photo)::after,
.about-photo:has(.real-photo)::after { display: none; }
.hero-photo::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(212,165,116,0.08), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(212,165,116,0.04), transparent 60%);
}
.hero-photo .photo-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--text-mute); font-family: var(--mono); font-size: 11px;
  text-align: center; padding: 20px; line-height: 1.7;
}
.hero-photo .photo-placeholder span {
  display: block; opacity: 0.6; letter-spacing: 0.15em;
}
.hero-photo .frame-corners::before,
.hero-photo .frame-corners::after,
.hero-photo .frame-corners > i::before,
.hero-photo .frame-corners > i::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border-color: var(--accent); border-style: solid; border-width: 0;
}
.hero-photo .frame-corners::before { top: 12px; left: 12px; border-top-width: 1px; border-left-width: 1px; }
.hero-photo .frame-corners::after { top: 12px; right: 12px; border-top-width: 1px; border-right-width: 1px; }
.hero-photo .frame-corners > i::before { content: ""; bottom: 12px; left: 12px; border-bottom-width: 1px; border-left-width: 1px; position: absolute; width: 16px; height: 16px; }
.hero-photo .frame-corners > i::after { content: ""; bottom: 12px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; position: absolute; width: 16px; height: 16px; }

.hero-meta {
  position: absolute; bottom: 16px; left: 16px; right: 16px;
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  color: var(--text-mute); text-transform: uppercase;
  background: rgba(12,11,10,0.55); padding: 10px 14px; backdrop-filter: blur(6px);
}

.hero-scroll { display: none; }

/* ===== SECTIONS ===== */
section { padding: clamp(80px, 12vw, 160px) 0; position: relative; }
.section-head { margin-bottom: 64px; max-width: 760px; }
.section-head .eyebrow { margin-bottom: 24px; }
.section-head h2 { margin-bottom: 20px; }
.section-head p { font-size: 1.1rem; color: var(--text-dim); }

/* What I do — signal section */
.signal {
  background: var(--bg-elev); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.signal-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
}
.signal-item {
  background: var(--bg-elev); padding: 48px clamp(28px, 3.2vw, 48px); position: relative;
  transition: background .4s var(--ease);
}
.signal-item:hover { background: var(--bg-soft); }
.signal-item .num {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--accent); margin-bottom: 24px; display: block;
}
.signal-item h3 { font-size: clamp(1.2rem, 1.8vw, 1.45rem); margin-bottom: 14px; line-height: 1.3; }
.signal-item p { color: var(--text-dim); font-size: 0.96rem; }

/* Current work — workbench */
.workbench { background: var(--bg); }
.workbench-list { display: flex; flex-direction: column; }
.work-row {
  display: grid; grid-template-columns: 80px 1fr auto; gap: 32px; align-items: center;
  padding: 32px 0; border-top: 1px solid var(--line);
  transition: padding .35s var(--ease);
}
.work-row:last-child { border-bottom: 1px solid var(--line); }
.work-row:hover { padding-left: 16px; }
.work-row .idx { font-family: var(--mono); color: var(--text-mute); font-size: 12px; letter-spacing: 0.15em; }
.work-row h3 { font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 2.1rem); font-weight: 300; }
.work-row h3 em { color: var(--accent); font-style: italic; }
.work-row .meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--text-mute); text-transform: uppercase; }
.work-row .status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(212,165,116,0.6); }
  70% { box-shadow: 0 0 0 10px rgba(212,165,116,0); }
  100% { box-shadow: 0 0 0 0 rgba(212,165,116,0); }
}

/* Writing preview */
.writing-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
}
.article-card {
  border: 1px solid var(--line); padding: 28px 24px 32px; border-radius: 4px;
  background: var(--bg-elev); display: flex; flex-direction: column; gap: 18px;
  transition: transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
  height: 100%; min-height: 280px;
}
.article-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.article-card .cat {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent);
}
.article-card h3 {
  font-size: 1.2rem; line-height: 1.25; flex: 1;
}
.article-card .meta { font-family: var(--mono); font-size: 11px; color: var(--text-mute); letter-spacing: 0.1em; }

/* Stack teaser */
.stack-teaser { background: var(--bg-elev); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stack-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); margin-bottom: 40px;
}
.stack-cell {
  background: var(--bg-elev); padding: 32px 20px; text-align: center;
  font-family: var(--serif); font-size: 1.15rem; color: var(--text-dim);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.stack-cell:hover { background: var(--bg-soft); color: var(--accent); }

/* Manifesto */
.manifesto { background: var(--bg); }
.manifesto-list { display: flex; flex-direction: column; gap: 12px; max-width: 940px; }
.manifesto-line {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.4rem, 3.4vw, 2.6rem); line-height: 1.25;
  color: var(--text); padding: 24px 0; border-bottom: 1px solid var(--line);
  letter-spacing: -0.015em;
}
.manifesto-line:last-child { border-bottom: none; }
.manifesto-line em { color: var(--accent); font-style: italic; }
.manifesto-line .num { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--text-mute); margin-right: 24px; vertical-align: middle; }

/* Soft pitch */
.softpitch { background: var(--bg-elev); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.softpitch-inner { max-width: 820px; margin: 0 auto; text-align: center; }
.softpitch h2 { margin-bottom: 24px; }
.softpitch p { font-size: 1.15rem; line-height: 1.65; color: var(--text-dim); margin-bottom: 36px; }
.softpitch .domain {
  font-family: var(--mono); color: var(--accent); border-bottom: 1px dashed var(--accent);
}

/* Products signal */
.products-signal { background: var(--bg); overflow: hidden; }
.products-signal-inner {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 80px; align-items: center;
}
.products-signal-inner > * { min-width: 0; max-width: 100%; }
.products-signal h2 { margin-bottom: 20px; }
.products-signal p { color: var(--text-dim); margin-bottom: 24px; max-width: 480px; }
.email-form { display: flex; gap: 0; max-width: 460px; width: 100%; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.email-form input {
  flex: 1; min-width: 0; background: transparent; border: none; padding: 16px 22px;
  color: var(--text); font: inherit; outline: none;
}
.email-form button { flex-shrink: 0; white-space: nowrap; }
.email-form input::placeholder { color: var(--text-mute); }
.email-form button {
  background: var(--accent); color: var(--bg); padding: 16px 24px; font-weight: 500; font-size: 14px;
  transition: background .3s var(--ease);
}
.email-form button:hover { background: var(--accent-soft); }

.product-stack {
  position: relative; height: 320px;
  margin: 0 auto; max-width: 420px; width: 100%;
  padding: 0 24px; overflow: hidden;
}
.product-card {
  position: absolute; left: 24px; right: 24px; padding: 22px 24px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 8px;
  transition: transform .4s var(--ease);
  transform-origin: center center;
}
.product-card:nth-child(1) { top: 0; transform: rotate(-1.5deg); }
.product-card:nth-child(2) { top: 80px; transform: rotate(0.8deg); }
.product-card:nth-child(3) { top: 160px; transform: rotate(-0.8deg); }
.product-stack:hover .product-card:nth-child(1) { transform: rotate(-2.5deg) translateX(-6px); }
.product-stack:hover .product-card:nth-child(3) { transform: rotate(1.5deg) translateX(6px); }
@media (max-width: 1080px) {
  .product-stack { max-width: 100%; padding: 0 4px; }
  .product-card { left: 4px; right: 4px; padding: 18px 20px; }
  .product-card:nth-child(1),
  .product-card:nth-child(2),
  .product-card:nth-child(3) { transform: rotate(0deg); }
  .product-stack:hover .product-card:nth-child(1),
  .product-stack:hover .product-card:nth-child(3) { transform: rotate(0deg); }
}
.product-card .tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--accent); margin-bottom: 8px; display: block; }
.product-card h4 { font-family: var(--serif); font-size: 1.2rem; }
.product-card .pill {
  display: inline-block; margin-top: 10px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.15em; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--text-mute); color: var(--text-mute);
}

/* Footer */
.site-footer { background: var(--bg); border-top: 1px solid var(--line); padding: 88px 0 40px; position: relative; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 56px;
  padding-bottom: 64px; border-bottom: 1px solid var(--line); position: relative;
}
.footer-grid h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 22px; font-weight: 400; }
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-grid a { color: var(--text-dim); font-size: 14px; transition: color .25s var(--ease), padding .25s var(--ease); display: inline-block; }
.footer-grid a:hover { color: var(--accent); padding-left: 4px; }
.footer-tag p { color: var(--text-dim); max-width: 360px; font-size: 14px; line-height: 1.65; margin-top: 18px; }
.footer-bottom {
  padding-top: 36px; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--text-mute); text-transform: uppercase;
  flex-wrap: wrap; position: relative;
}
.footer-bottom a { color: var(--text-mute); }
.footer-bottom a:hover { color: var(--accent); }
.footer-bottom .pulse { display: inline-flex; align-items: center; gap: 8px; }
.footer-bottom .pulse::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s infinite;
}

/* ===== Article / Editorial ===== */
.page-hero {
  padding: 180px 0 80px; border-bottom: 1px solid var(--line);
}
.page-hero h1 { max-width: 16ch; margin-bottom: 28px; font-weight: 300; }
.page-hero h1 em { font-style: italic; color: var(--accent); }
.page-hero p { font-size: 1.2rem; max-width: 640px; line-height: 1.55; color: var(--text-dim); }
.page-hero .eyebrow { margin-bottom: 28px; }

.prose { max-width: 720px; margin: 0 auto; padding: 80px 0 40px; }
.prose p { font-family: var(--serif); font-size: 1.25rem; line-height: 1.75; color: var(--text); margin-bottom: 28px; font-weight: 300; }
.prose p strong { font-weight: 500; color: var(--text); }
.prose h2 { margin: 64px 0 24px; font-size: 2rem; }
.prose h3 { margin: 48px 0 16px; font-family: var(--sans); font-size: 1.1rem; letter-spacing: 0.02em; color: var(--text-dim); text-transform: uppercase; font-weight: 500; }
.prose ul { padding-left: 24px; margin-bottom: 28px; }
.prose ul li { font-family: var(--serif); font-size: 1.15rem; line-height: 1.65; color: var(--text); margin-bottom: 12px; font-weight: 300; }
.prose blockquote {
  border-left: 2px solid var(--accent); padding: 12px 0 12px 28px; margin: 40px 0;
  font-family: var(--serif); font-style: italic; font-size: 1.5rem; line-height: 1.45; color: var(--text);
}
.prose pre {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 6px;
  padding: 20px 24px; overflow-x: auto; font-family: var(--mono); font-size: 14px;
  line-height: 1.7; margin: 32px 0; color: var(--text-dim);
}
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--bg-elev); padding: 2px 6px; border-radius: 4px; color: var(--accent); }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 32px 0; font-size: 0.95rem; }
.prose th, .prose td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-mute); font-weight: 400; }
.prose td { color: var(--text-dim); }

.article-meta {
  max-width: 720px; margin: 0 auto; padding: 32px 0 0;
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--text-mute); text-transform: uppercase;
}
.article-meta .cat { color: var(--accent); }
.article-meta .dot { width: 3px; height: 3px; background: var(--text-mute); border-radius: 50%; }

.author-card {
  max-width: 720px; margin: 64px auto 0; padding: 32px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--bg-elev);
  display: grid; grid-template-columns: 60px 1fr; gap: 20px; align-items: center;
}
.author-avatar {
  width: 60px; height: 60px; border-radius: 50%; background: var(--bg-soft);
  border: 1px solid var(--line); display: grid; place-items: center;
  font-family: var(--serif); font-size: 22px; color: var(--accent);
}
.author-card h4 { font-family: var(--sans); font-size: 15px; margin-bottom: 4px; font-weight: 500; }
.author-card p { font-size: 14px; color: var(--text-dim); }

.related { padding: 80px 0; border-top: 1px solid var(--line); margin-top: 80px; }
.related h3 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-mute); font-weight: 400; margin-bottom: 32px; }

/* About specific */
.about-photo {
  /* Aspect matches actual photo (941×1672, ~9:16) so contain produces
     zero letterbox left/right */
  aspect-ratio: 941 / 1672;
  background: transparent;
  border: none; margin: 80px auto;
  max-width: 420px; width: 100%; border-radius: 0;
  display: grid; place-items: center; color: var(--text-mute);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em; text-align: center;
  position: relative; overflow: hidden;
}
/* Only show the placeholder gradient when no real photo is loaded */
.about-photo:not(:has(.real-photo)) {
  background: linear-gradient(180deg, var(--photo-bg-1) 0%, var(--photo-bg-2) 100%);
  overflow: hidden;
}
.hero-photo:not(:has(.real-photo)) {
  background: linear-gradient(180deg, var(--photo-bg-1) 0%, var(--photo-bg-2) 100%);
  overflow: hidden;
}
.about-photo .frame-corners > i:first-child::before,
.about-photo .frame-corners > i:first-child::after,
.about-photo .frame-corners::before,
.about-photo .frame-corners::after { content: ""; position: absolute; width: 16px; height: 16px; border-color: var(--accent); border-style: solid; }

/* Now page */
.now-list { max-width: 720px; margin: 0 auto; padding: 60px 0 100px; }
.now-block { padding: 32px 0; border-bottom: 1px solid var(--line); }
.now-block:last-child { border-bottom: none; }
.now-block h3 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px; font-weight: 400;
}
.now-block ul { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.now-block li {
  font-family: var(--serif); font-size: 1.2rem; line-height: 1.55;
  color: var(--text); padding-left: 28px; position: relative; font-weight: 300;
}
.now-block li::before {
  content: "—"; position: absolute; left: 0; color: var(--accent);
}

/* Stack page detail */
.stack-section { padding: 80px 0; border-bottom: 1px solid var(--line); }
.stack-section:last-child { border-bottom: none; }
.stack-section-head {
  display: grid; grid-template-columns: 240px 1fr; gap: 60px; align-items: start; margin-bottom: 40px;
}
.stack-section-head h2 { font-size: 1.8rem; }
.stack-section-head p { color: var(--text-dim); font-size: 1rem; max-width: 580px; }
.tools-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tool {
  background: var(--bg); padding: 28px 32px; transition: background .3s var(--ease);
}
.tool:hover { background: var(--bg-elev); }
.tool h4 { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 6px; }
.tool h4 .ext { font-family: var(--mono); font-size: 10px; color: var(--accent); margin-left: 10px; letter-spacing: 0.15em; }
.tool p { font-size: 0.95rem; color: var(--text-dim); }

/* Blog index */
.blog-index { padding: 60px 0 120px; }
.blog-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.blog-card {
  background: var(--bg); padding: 40px 36px; display: flex; flex-direction: column; gap: 20px;
  min-height: 260px; transition: background .3s var(--ease);
}
.blog-card:hover { background: var(--bg-elev); }
.blog-card .cat { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--accent); text-transform: uppercase; }
.blog-card h2 { font-size: 1.6rem; line-height: 1.2; flex: 1; }
.blog-card .meta { font-family: var(--mono); font-size: 11px; color: var(--text-mute); letter-spacing: 0.1em; }

.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; padding: 0 0 32px;
  border-bottom: 1px solid var(--line); margin-bottom: 0;
}
.filter-bar button {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-mute);
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px;
  transition: all .25s var(--ease);
}
.filter-bar button:hover, .filter-bar button.active { color: var(--accent); border-color: var(--accent); }

/* Products page */
.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 60px 0; }
.product-tile {
  border: 1px solid var(--line); padding: 32px 28px 36px; border-radius: 4px;
  background: var(--bg-elev); display: flex; flex-direction: column; gap: 18px;
  min-height: 320px; position: relative; overflow: hidden;
}
.product-tile .tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--accent); text-transform: uppercase; }
.product-tile h3 { font-size: 1.4rem; }
.product-tile p { color: var(--text-dim); font-size: 0.95rem; flex: 1; }
.product-tile .pill {
  align-self: flex-start; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.15em; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--text-mute); color: var(--text-mute); text-transform: uppercase;
}

/* Contact */
.contact-block {
  max-width: 720px; margin: 0 auto; padding: 80px 0;
}
.contact-block .lead { font-family: var(--serif); font-size: 1.5rem; line-height: 1.5; color: var(--text); margin-bottom: 40px; font-weight: 300; }
.contact-rows { display: flex; flex-direction: column; }
.contact-row {
  display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: center;
  padding: 24px 0; border-top: 1px solid var(--line);
}
.contact-row:last-child { border-bottom: 1px solid var(--line); }
.contact-row .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-mute); }
.contact-row .value { font-size: 1.1rem; color: var(--text); word-break: break-word; }
.contact-row .value a { border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.contact-row .value a:hover { border-color: var(--accent); }

/* 404 */
.notfound {
  min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 120px 0;
}
.notfound .big { font-family: var(--serif); font-size: clamp(8rem, 22vw, 18rem); line-height: 1; color: var(--accent); font-weight: 300; }
.notfound h2 { margin: 24px 0 16px; font-size: 2rem; }
.notfound p { color: var(--text-dim); margin-bottom: 32px; }

/* ===== Animations ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

.reveal-mask { overflow: hidden; }
.reveal-mask > * { transform: translateY(110%); transition: transform .9s var(--ease); }
.reveal-mask.in > * { transform: translateY(0); }

.reveal-stagger > * { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-stagger.in > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: .08s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: .16s; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: .24s; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: .32s; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: .4s; }
.reveal-stagger.in > *:nth-child(7) { transition-delay: .48s; }
.reveal-stagger.in > *:nth-child(8) { transition-delay: .56s; }

.reveal-slide { opacity: 0; transform: translateX(-40px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-slide.in { opacity: 1; transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .reveal-stagger > *, .reveal-slide, .reveal-mask > * { opacity: 1 !important; transform: none !important; }
}

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .nav-links, .nav-cta, .theme-toggle { display: none; }
  .menu-btn { display: flex; }
  .hero { min-height: auto; padding: 120px 0 60px; }
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-photo { aspect-ratio: 4/5; max-width: 480px; margin: 0 auto; }
  .signal-grid { grid-template-columns: 1fr; }
  .writing-grid { grid-template-columns: 1fr 1fr; }
  .stack-grid { grid-template-columns: repeat(3, 1fr); }
  .products-signal-inner { grid-template-columns: 1fr; gap: 60px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .stack-section-head { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
  .tools-grid { grid-template-columns: 1fr; }
  .blog-list { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .contact-row { grid-template-columns: 1fr; gap: 8px; }
  .work-row { grid-template-columns: 60px 1fr; gap: 16px; }
  .work-row .meta { display: none; }
  .hero-scroll { display: none; }
}

@media (max-width: 540px) {
  .writing-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
}
