/* Tokens and type follow gowthamkethineedi.com. The root page runs no script, because a
   root script would run on the origin every live project site shares, so all motion is
   CSS, and the theme comes from the media query alone. The page is complete with no
   motion at all: every moving part below starts from its final state outside the
   no-preference block. */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 300 600; font-display: swap; src: url(fonts/geist-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 300 600; font-display: swap; src: url(fonts/geist-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(fonts/geist-mono-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(fonts/geist-mono-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/newsreader-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/newsreader-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/newsreader-italic-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/newsreader-italic-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: oklch(0.18 0.008 60);
  --bg-2: oklch(0.215 0.009 60);
  --ink: oklch(0.94 0.012 75);
  --ink-2: oklch(0.78 0.012 75);
  --ink-3: oklch(0.63 0.012 75);
  --rule: oklch(0.34 0.01 70);
  --rule-2: oklch(0.28 0.01 70);
  --accent: oklch(0.78 0.12 70);
  --accent-2: oklch(0.78 0.12 70 / 0.16);
  --on-accent: oklch(0.18 0.02 60);
  --grid: color-mix(in oklab, var(--ink) 4%, transparent);
  --glow: oklch(0.78 0.12 70 / 0.1);
  --bar-low: oklch(0.78 0.12 70 / 0.35);

  --serif: "Newsreader", "Iowan Old Style", "Source Serif Pro", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "Geist Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;

  --pad-x: clamp(20px, 5vw, 88px);
  --col: min(1240px, 100% - var(--pad-x) * 2);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f0ea;
    --bg-2: #e9e6de;
    --ink: #1c1b19;
    --ink-2: #3e3b35;
    --ink-3: #6b665c;
    --rule: #c9c3b5;
    --rule-2: #e1dcd0;
    --accent: #8c5a1a;
    --accent-2: rgba(140, 90, 26, 0.14);
    --on-accent: #f2f0ea;
    --grid: color-mix(in oklab, var(--ink) 5%, transparent);
    --glow: rgba(140, 90, 26, 0.1);
    --bar-low: rgba(140, 90, 26, 0.35);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 100svh;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(ellipse at 70% 60%, black 0%, transparent 78%);
}

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }

.skip {
  position: absolute;
  z-index: 10;
  left: 16px;
  top: -100px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip:focus-visible { top: 14px; }

/* Top bar */
.bar-top {
  position: relative;
  z-index: 2;
  width: var(--col);
  margin-inline: auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

/* Buttons */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.pill.solid { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pill.small { min-height: 38px; padding: 0 16px; font-size: 13px; }
.arr { width: 14px; height: 14px; flex: none; }

/* Hero: the headline, then the trace running to the lamp */
.hero {
  position: relative;
  min-height: calc(100svh - 64px);
  display: flex;
  flex-direction: column;
  overflow: clip;
}
.hero-copy {
  position: relative;
  z-index: 2;
  width: var(--col);
  margin-inline: auto;
  padding-block: clamp(20px, 5vh, 56px) clamp(20px, 3vh, 32px);
}
h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(52px, 8.6vw, 136px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.034em;
}
h1 em { color: var(--accent); font-style: italic; }

/* The trace */
.trace {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(190px, 34vh, 340px);
  margin: 0;
  padding-block-end: 54px;
}
.trace::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -30%;
  width: 60%;
  height: 120%;
  pointer-events: none;
  background: radial-gradient(closest-side at 72% 62%, var(--glow), transparent);
}
.trace-head {
  position: relative;
  z-index: 2;
  width: var(--col);
  margin-inline: auto;
  margin-block-end: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 20px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.trace-head b { color: var(--ink); font-weight: 500; }
.track {
  position: relative;
  flex: 1 1 auto;
  width: var(--col);
  min-height: 120px;
  max-height: min(480px, 54svh);
  margin-inline: auto;
}
.bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: clamp(1px, 0.2vw, 3px);
}
.bar {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: calc(var(--v, 0) * 100%);
  border-radius: 3px 3px 0 0;
  background: linear-gradient(to top, var(--bar-low), var(--accent));
  transform-origin: bottom;
}
.bar:hover { background: var(--ink); }
.bar::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 5;
  bottom: 6px;
  left: 50%;
  transform: translateX(calc(var(--i) / var(--n, 1) * -100%));
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.bar:hover::after { opacity: 1; }
.baseline {
  position: absolute;
  left: calc((100% - 100vw) / 2);
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform-origin: left;
}
.pulse { display: none; }
.lamp {
  position: absolute;
  z-index: 3;
  right: -9px;
  bottom: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-2), 0 0 42px 12px var(--glow);
}
.range-start, .lamp-label {
  position: absolute;
  z-index: 3;
  bottom: -38px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.range-start { left: 0; color: var(--ink-2); }
.lamp-label { right: 0; }

/* The list: each project is one native disclosure row */
.list {
  width: var(--col);
  margin-inline: auto;
  padding-block-start: clamp(40px, 7vh, 72px);
}
.record { border-block-start: 1px solid var(--rule); }
.list .record:last-child { border-block-end: 1px solid var(--rule); }
.record summary {
  position: relative;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 4px clamp(20px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(22px, 3.4vh, 34px);
  cursor: pointer;
  list-style: none;
}
.record summary::-webkit-details-marker { display: none; }
.record summary::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}
.record summary:focus-visible::before, .record[open] summary::before { transform: scaleY(1); }
.record summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.record summary > time {
  grid-column: 1;
  grid-row: 1 / span 2;
  color: var(--accent);
  font-family: var(--serif);
  font-size: clamp(26px, 2.6vw, 36px);
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.015em;
}
h2 {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(36px, 4.6vw, 64px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.028em;
  transition: color 0.25s ease;
}
.short { grid-column: 2; grid-row: 2; color: var(--ink-2); font-size: 16px; overflow-wrap: anywhere; }
.toggle {
  grid-column: 3;
  grid-row: 1 / span 2;
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--rule);
  border-radius: 50%;
  transition: border-color 0.2s ease, transform 0.3s ease;
}
.toggle::before, .toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1.6px;
  margin: -0.8px 0 0 -7px;
  background: var(--ink);
  transition: transform 0.3s ease;
}
.toggle::after { transform: rotate(90deg); }
.record[open] .toggle::after { transform: rotate(0deg); }
.body {
  padding-block: 4px clamp(40px, 7vh, 72px);
  padding-inline-start: calc(180px + clamp(20px, 4vw, 56px));
  scroll-margin-block-start: 160px;
}
.tagline {
  margin: 0 0 clamp(28px, 5vh, 44px);
  max-width: 54ch;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.4;
}
.label {
  margin: 0 0 8px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.label time { color: inherit; }
.after {
  width: var(--col);
  margin: clamp(28px, 5vh, 44px) auto clamp(40px, 8vh, 72px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}
.by { color: var(--ink-2); font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.02em; }

/* Use instead: each row is one link, as in the site's Lab */
.tools { list-style: none; margin: 0 0 clamp(36px, 6vh, 56px); padding: 0; border-block-start: 1px solid var(--rule-2); }
.tool {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 24px;
  align-items: baseline;
  padding: 18px 0;
  border-block-end: 1px solid var(--rule-2);
  text-decoration: none;
  transition: padding-inline-start 0.25s ease;
}
.tool::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}
.tool:focus-visible { padding-inline-start: 14px; }
.tool:focus-visible::before { transform: scaleY(1); }
.tool b {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
  transition: color 0.25s ease;
}
.tool code { font-family: var(--mono); font-size: 1em; }
.tool .role { grid-column: 1; color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }
.tool .go {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The gap: the one thing nothing replaced */
.gap {
  margin: 0 0 clamp(36px, 6vh, 56px);
  padding: clamp(20px, 3vw, 32px);
  border-radius: 8px;
  border: 1px solid var(--rule-2);
  border-inline-start: 2px solid var(--accent);
  background: var(--bg-2);
}
.gap .say {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.012em;
}
.gap .more { margin: 0; max-width: 62ch; color: var(--ink-2); font-size: 15px; }

.prose { margin: 0 0 clamp(32px, 5vh, 48px); max-width: 66ch; color: var(--ink-2); }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

.stats { display: flex; flex-wrap: wrap; gap: 20px clamp(32px, 5vw, 64px); margin: 0 0 clamp(36px, 6vh, 56px); }
.stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
.stats dt { color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; }
.stats dd { margin: 0; font-family: var(--serif); font-size: clamp(32px, 3.6vw, 48px); line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* The one orchestrated moment: bars rise left to right, a pulse runs the line, and the
   lamp lights where it stops. */
@media (prefers-reduced-motion: no-preference) {
  .bar { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 19ms + 0.25s); }
  .baseline { animation: draw 1.8s cubic-bezier(0.4, 0, 0.6, 1) 0.2s both; }
  .pulse {
    display: block;
    position: absolute;
    z-index: 2;
    bottom: -3px;
    left: 0;
    width: 90px;
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(to right, transparent, var(--accent));
    filter: blur(1px);
    animation: run 1.8s cubic-bezier(0.4, 0, 0.6, 1) 0.2s both;
  }
  .lamp { animation: light 1.1s ease 1.9s both, breathe 6s ease-in-out 3.2s 3; }
  .range-start, .lamp-label { animation: fade 0.8s ease 2.5s both; }
  h1 { animation: up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  /* A smooth open where the browser supports it, an instant one elsewhere. */
  @supports (interpolate-size: allow-keywords) {
    :root { interpolate-size: allow-keywords; }
    .record::details-content { height: 0; overflow: clip; transition: height 0.38s ease, content-visibility 0.38s allow-discrete; }
    .record[open]::details-content { height: auto; }
  }
  @keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  @keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes run { 0% { left: 0; opacity: 1; } 96% { opacity: 1; } 100% { left: calc(100% - 90px); opacity: 0; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes light {
    0% { opacity: 0; transform: scale(0.5); box-shadow: none; }
    35% { opacity: 1; transform: scale(1.25); }
    50% { opacity: 0.45; }
    68% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 5px var(--accent-2), 0 0 42px 12px var(--glow); }
  }
  @keyframes breathe { 50% { box-shadow: 0 0 0 7px var(--accent-2), 0 0 64px 20px var(--glow); } }

}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tool, .tool::before, .pill, .record summary, .record summary::before, .toggle, .toggle::before, .toggle::after, h2 { transition: none; }
}

@media (max-width: 820px) {
  .record summary { grid-template-columns: minmax(0, 1fr) auto; }
  .record summary > time { grid-column: 1 / -1; grid-row: 1; margin-block-end: 8px; }
  h2 { grid-column: 1; grid-row: 2; }
  .short { grid-column: 1; grid-row: 3; }
  .toggle { grid-column: 2; grid-row: 2 / span 2; }
  .body { padding-inline-start: 0; scroll-margin-block-start: 240px; }
  /* The label goes and the arrow stays, so each row still reads as a link. */
  .tool .go { font-size: 0; gap: 0; }
  .pill.small { min-height: 44px; }
}

@media (max-width: 560px) {
  .trace-head, .label, .stats dt { font-size: 12px; }
  /* Half the samples, counted from the end so the last bar always stays. */
  .bar:nth-last-child(even) { display: none; }
  .bars { gap: 2px; }
}

/* Hover only where a pointer can hover, so a tap leaves no stuck state. */
@media (hover: hover) {
  .pill:hover { border-color: var(--accent); color: var(--accent); }
  .pill.solid:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  .record summary:hover::before { transform: scaleY(1); }
  .record summary:hover h2 { color: var(--accent); }
  .record summary:hover .toggle { border-color: var(--accent); }
  .tool:hover { padding-inline-start: 14px; }
  .tool:hover::before { transform: scaleY(1); }
  .tool:hover b { color: var(--accent); }
  .tool:hover .go { color: var(--ink); }
  .prose a:hover { color: var(--accent); }
}

@media (forced-colors: active) {
  .bar { background: CanvasText; forced-color-adjust: none; }
  .baseline, .lamp, .toggle::before, .toggle::after, .record summary::before { background: CanvasText; forced-color-adjust: none; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
