/* ============================================================
   Kasyap Varanasi — two colours only: fern green + light ash.
   Everything else is an alpha tint of the fern; no third hue.
   ============================================================ */
:root {
  --ink:    #E7E6E0;   /* light ash — background */
  --paper:  #2E4A2C;   /* fern green — ink + accent */
  --signal: #2E4A2C;   /* accent = reversal, not a new colour */

  --line:  rgba(46, 74, 44, 0.18);
  --line2: rgba(46, 74, 44, 0.10);
  --mute:  rgba(46, 74, 44, 0.62);

  --wrap: 720px;
  --gap: clamp(64px, 12vh, 128px);
  --font: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", monospace;
}

/* night-flight easter egg: invert the two colours */
body.invert { --ink: #16210F; --paper: #DCE7C6; --signal: #A7C08A; --line: rgba(220,231,198,0.16); --line2: rgba(220,231,198,0.09); --mute: rgba(220,231,198,0.6); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--ink); color: var(--paper);
  font-family: var(--font); font-weight: 400; font-size: 17px;
  line-height: 1.62; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .5s ease, color .5s ease;
  text-transform: lowercase;   /* hard rule: no capitals anywhere on the site */
}

/* film grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--signal); color: var(--ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(var(--wrap), 90vw); margin-inline: auto; }

/* ============ nav ============ */
nav { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--ink) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line2); }
.nav-in { width: min(var(--wrap), 90vw); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { font-weight: 700; letter-spacing: -0.03em; font-size: 16px; }
.brand b { color: var(--signal); font-weight: 700; cursor: pointer; }
.nav-links { display: flex; gap: 22px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }
.nav-links a { color: var(--mute); transition: color .18s ease; }
.nav-links a:hover { color: var(--paper); }
/* sequoia-style hand-drawn loop on the active tab */
.nav-links a.here { color: var(--paper); position: relative; }
.nav-links a.here::after { content: ""; position: absolute; left: -12px; right: -12px; top: -10px; bottom: -11px; background: url("../assets/ui/circle.svg") center/100% 100% no-repeat; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .nav-links a.here::after { animation: scribble .55s cubic-bezier(.2,.7,.2,1) both; } }
@keyframes scribble { from { opacity: 0; transform: rotate(-3deg) scale(.85); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .nav-links a:not(.j):not(.here) { display: none; } }

/* per-page blueprint background — one unique schematic per page, blended into the ash */
.bp-page { position: fixed; left: 0; right: 0; top: -28%; height: 156%; z-index: 0; pointer-events: none; opacity: 0.13; background-repeat: no-repeat; background-position: right -30px center; background-size: min(60%, 860px) auto; will-change: transform; }
@media (max-width: 700px) { .bp-page { opacity: 0.07; background-size: 150% auto; background-position: center 34%; } }
/* reverse-scroll parallax: the blueprint drifts down as the page scrolls up */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .bp-page { animation: bp-rev linear both; animation-timeline: scroll(root block); }
  }
}
@keyframes bp-rev { from { transform: translateY(-14%); } to { transform: translateY(14%); } }
main { position: relative; z-index: 1; }
footer { position: relative; z-index: 1; }

/* ============ section furniture ============ */
section { padding-block: var(--gap); border-top: 1px solid var(--line2); position: relative; }
section:first-of-type { border-top: 0; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: lowercase; color: var(--mute); display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.eyebrow .n { color: var(--signal); }
h2 { font-size: clamp(24px, 4vw, 30px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }

/* ============ hero ============ */
.hero { padding-top: clamp(56px, 12vh, 110px); border-top: 0; position: relative; overflow: hidden; }
.chip { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12px; color: var(--mute); border: 1px solid var(--line); border-radius: 100px; padding: 6px 13px; margin-bottom: 34px; position: relative; z-index: 2; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
@media (prefers-reduced-motion: no-preference) { .dot { animation: pulse 2.4s ease-in-out infinite; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.lede { font-size: clamp(34px, 7vw, 58px); font-weight: 500; line-height: 1.05; letter-spacing: -0.035em; max-width: 14ch; margin-bottom: 30px; position: relative; z-index: 2; filter: url(#ink); }
.lede em { font-style: italic; }
.sub { font-size: 18px; color: var(--mute); max-width: 46ch; position: relative; z-index: 2; }
.sub b { color: var(--paper); font-weight: 600; }
.sub a, .tl a, .now-list a, .daily a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; transition: text-decoration-color .18s; }
.sub a:hover, .tl a:hover, .now-list a:hover, .daily a:hover { text-decoration-color: var(--signal); }

.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; position: relative; z-index: 2; }
.links a { font-family: var(--mono); font-size: 13px; border: 1px solid var(--line); border-radius: 100px; padding: 9px 16px; color: var(--paper); transition: border-color .18s ease, color .18s ease; }
.links a:hover { border-color: var(--signal); color: var(--signal); }

/* flight blueprint layer */
.blueprint { position: absolute; inset: -6% -10% auto; z-index: 0; pointer-events: none; opacity: 0.16; }
.blueprint svg { width: 100%; height: auto; }
.blueprint .stroke { fill: none; stroke: var(--signal); stroke-width: 1; vector-effect: non-scaling-stroke; }
.blueprint .thin { stroke-width: .5; opacity: .5; }
.blueprint .lbl { font-family: var(--mono); font-size: 9px; fill: var(--signal); letter-spacing: .1em; }
@media (prefers-reduced-motion: no-preference) {
  .blueprint { animation: drift 60s ease-in-out infinite alternate; }
  .blueprint .draw { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw 3.5s ease forwards .2s; }
}
@keyframes drift { from { transform: translate3d(0,0,0) rotate(0deg); } to { transform: translate3d(-3%, 2%, 0) rotate(1.2deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* portrait */
.portrait { margin-top: 56px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: relative; z-index: 2; }
.portrait .pic { position: relative; isolation: isolate; overflow: hidden; }
.portrait img { width: 100%; height: auto; display: block; }

/* creative reveal: fern duotone that "develops" to full colour on hover, top-down wipe */
.person .pic, .moment .pic, .paper .thumb:not(.brief) { position: relative; isolation: isolate; overflow: hidden; }
.portrait .pic::after, .person .pic::after, .moment .pic::after, .paper .thumb:not(.brief)::after { content: ""; position: absolute; inset: 0; background: var(--signal); mix-blend-mode: color; clip-path: inset(0); transition: clip-path .65s cubic-bezier(.45,.02,.1,1); pointer-events: none; z-index: 1; }
.portrait:hover .pic::after, .person:hover .pic::after, .moment:hover .pic::after, .paper:hover .thumb:not(.brief)::after { clip-path: inset(0 0 100% 0); }
.portrait figcaption { font-family: var(--mono); font-size: 10px; color: var(--mute); padding: 11px 15px; border-top: 1px solid var(--line2); letter-spacing: 0.06em; display: flex; justify-content: space-between; gap: 12px; }

/* ============ now ============ */
.now-list { list-style: none; display: grid; gap: 4px; }
.now-list li { display: grid; grid-template-columns: 96px 1fr; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line2); }
.now-list li:first-child { border-top: 0; }
.now-list .k { font-family: var(--mono); font-size: 12px; color: var(--signal); letter-spacing: 0.04em; padding-top: 3px; }
.now-list .v b { font-weight: 600; }
.now-list .v span { color: var(--mute); }
@media (max-width: 500px) { .now-list li { grid-template-columns: 1fr; gap: 4px; } }

/* ============ today (daily) ============ */
.daily { border: 1px solid var(--line); border-radius: 12px; padding: 26px 26px 22px; position: relative; }
.daily .q { font-size: clamp(20px, 3.4vw, 26px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; }
.daily .who { font-family: var(--mono); font-size: 12px; color: var(--mute); margin-top: 12px; letter-spacing: .04em; }
.daily .who b { color: var(--paper); font-weight: 600; }
.daily .fact { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line2); color: rgba(46,74,44,0.82); font-size: 15px; }
.daily .fact .k { font-family: var(--mono); font-size: 10px; text-transform: lowercase; letter-spacing: .14em; color: var(--signal); display: block; margin-bottom: 6px; }

/* ============ field notes ============ */
.note { border-top: 1px solid var(--line); padding: 34px 0; scroll-margin-top: 80px; }
.note:last-child { border-bottom: 1px solid var(--line); }
.note-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.note-idx { font-family: var(--mono); font-size: 13px; color: var(--signal); }
.note-date { font-family: var(--mono); font-size: 12px; color: var(--mute); margin-left: auto; }
.note h3, .note summary h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; display: inline; }
.note h3 a { transition: color .18s; }
.note:hover h3 a { color: var(--signal); }
.note p { color: rgba(46,74,44,0.82); margin-top: 12px; }
.note p:first-of-type { margin-top: 0; }
.note .ask { color: var(--paper); font-weight: 600; }
.note-more { font-family: var(--mono); font-size: 12px; color: var(--mute); margin-top: 40px; }
.note-more a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.note-more a:hover { text-decoration-color: var(--signal); }
/* collapsible on the notes page */
details.note > summary { list-style: none; cursor: pointer; }
details.note > summary::-webkit-details-marker { display: none; }
details.note .note-date::after { content: " +"; }
details.note[open] .note-date::after { content: " –"; }

/* ============ people wall ============ */
.marquee { margin-inline: calc(50% - 50vw); width: 100vw; overflow: hidden; padding: 4px 0; }
.track { display: flex; gap: 16px; width: max-content; will-change: transform; }
@media (prefers-reduced-motion: no-preference) {
  .track.left  { animation: scrollx 64s linear infinite; }
  .track.right { animation: scrollx 64s linear infinite reverse; }
  .marquee:hover .track { animation-play-state: paused; }
}
@keyframes scrollx { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.person { position: relative; width: 200px; flex: 0 0 auto; }
.person .pic { position: relative; isolation: isolate; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--ink); }
.person .pic img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.person .quote { z-index: 2; }
.person .quote { position: absolute; inset: 0; padding: 16px; display: flex; align-items: flex-end; background: color-mix(in srgb, var(--ink) 82%, transparent); opacity: 0; transition: opacity .35s ease; font-size: 14px; font-weight: 500; line-height: 1.3; letter-spacing: -0.01em; border-radius: 10px; }
.person:hover .quote { opacity: 1; }
.person figcaption { padding: 10px 2px 0; }
.person figcaption b { display: block; font-weight: 600; font-size: 15px; }
.person figcaption span { font-family: var(--mono); font-size: 10px; color: var(--mute); letter-spacing: .04em; }
.people-note { font-family: var(--mono); font-size: 11px; color: var(--mute); margin-top: 26px; }

/* ============ research ============ */
.paper { display: grid; grid-template-columns: 108px 1fr; gap: 24px; padding: 26px 0; border-top: 1px solid var(--line2); align-items: start; }
.paper:first-of-type { border-top: 0; }
.paper .thumb { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; aspect-ratio: 4/3; background: var(--ink); }
.paper .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.paper .thumb.brief { display: flex; align-items: center; justify-content: center; background: var(--signal); border-color: var(--signal); }
.paper .thumb.brief span { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; color: var(--ink); text-align: center; line-height: 1.35; }
.paper h3 { font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.paper h3 a:hover { color: var(--signal); }
.paper .who { color: var(--mute); font-size: 14px; margin-top: 6px; }
.paper .who .me { color: var(--paper); font-weight: 600; }
.paper .meta { font-family: var(--mono); font-size: 12px; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.paper .venue { color: var(--signal); }
.paper .meta a { color: var(--mute); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.paper .meta a:hover { color: var(--paper); }
.paper .sep { color: var(--line); }
.tag { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: lowercase; background: var(--signal); color: var(--ink); border-radius: 3px; padding: 2px 6px; vertical-align: middle; }
@media (max-width: 500px) { .paper { grid-template-columns: 1fr; } .paper .thumb { max-width: 108px; } }

.subhead { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: lowercase; color: var(--mute); margin: 56px 0 4px; }
.pub { display: grid; grid-template-columns: 56px 1fr; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line2); }
.pub .yr { font-family: var(--mono); font-size: 12px; color: var(--mute); padding-top: 2px; }
.pub a { font-weight: 500; }
.pub a:hover { color: var(--signal); }
.pub .mini { display: block; color: var(--mute); font-size: 13px; margin-top: 2px; }
@media (max-width: 500px) { .pub { grid-template-columns: 1fr; gap: 3px; } }

/* ============ learnings ============ */
.learnings { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 44px; }
.learnings li { padding: 16px 0; border-top: 1px solid var(--line2); font-size: 16px; line-height: 1.45; color: rgba(46,74,44,0.9); transition: color .2s ease; }
.learnings li::before { content: "//"; font-family: var(--mono); color: var(--signal); margin-right: 10px; font-size: 12px; }
.learnings li:hover { color: var(--paper); }
@media (max-width: 600px) { .learnings { grid-template-columns: 1fr; } }

/* ============ moments gallery ============ */

/* ============ timeline ============ */
.tl { list-style: none; }
.tl li { display: grid; grid-template-columns: 118px 1fr; gap: 22px; padding: 18px 0; border-top: 1px solid var(--line2); }
.tl li:first-child { border-top: 0; }
.tl .when { font-family: var(--mono); font-size: 12px; color: var(--mute); padding-top: 3px; }
.tl .role { font-weight: 600; }
.tl .role .at { color: var(--mute); font-weight: 400; }
.tl .desc { color: var(--mute); font-size: 14px; margin-top: 2px; }
.tl .more { font-family: var(--mono); font-size: 12px; color: var(--mute); margin-top: 20px; }
@media (max-width: 500px) { .tl li { grid-template-columns: 1fr; gap: 4px; } }

/* ============ footer ============ */
footer { border-top: 1px solid var(--line2); padding-block: 56px; }
footer .foot-in { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; }
footer p { font-family: var(--mono); font-size: 12px; color: var(--mute); line-height: 1.9; }
footer a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
footer a:hover { color: var(--signal); text-decoration-color: var(--signal); }
footer .coord { color: var(--signal); }

/* ============ motion ============ */
@keyframes rise  { from { opacity: 0; transform: translateY(30px) scale(.986); filter: blur(7px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes enter { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .hero .chip  { animation: enter .8s cubic-bezier(.2,.7,.2,1) both; animation-delay: .05s; }
  .hero .lede  { animation: enter .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: .16s; }
  .hero .sub   { animation: enter .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: .30s; }
  .hero .links { animation: enter .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: .42s; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 3% cover 24%; }
  }
}
/* barrel-roll easter egg */
.barrel { animation: barrel 1s ease-in-out; }
@keyframes barrel { to { transform: rotate(360deg); } }
