/* ---------------------------------------------------------
   agnish ghosh — personal site
   theme: editorial minimalism after calaiclub.com
   display: Instrument Serif (lowercase, oversized)
   body:    Inter
   --------------------------------------------------------- */

/* light: off-white paper, black ink, bright neon-green accents */
:root,
html[data-theme="light"] {
  --bg: #f1efe6;
  --ink: #0d0f0d;
  --muted: #5c625c;
  --hairline: #dcd9cc;
  --accent: #14b814;        /* bright neon green, legible on off-white */
  --accent-ink: #0d0f0d;    /* text color on top of accent fills */
  --accent-soft: #e4efdc;
  --measure: 42rem;
  --display: "Instrument Serif", Georgia, serif;
  --body: "Inter", -apple-system, "Segoe UI", sans-serif;
}

/* dark: near-black with a darker, calmer neon green + off-white text */
html[data-theme="dark"] {
  --bg: #101410;
  --ink: #efede2;
  --muted: #9aa398;
  --hairline: #232b23;
  --accent: #35d96b;        /* neon green, dimmed for dark backgrounds */
  --accent-ink: #0b0f0b;
  --accent-soft: #162016;
}

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

body,
.topbar,
.btn {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--hairline); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
a:focus-visible,
.btn:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 5vw, 3rem);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.35rem;
  text-decoration: none;
}

.topnav { display: flex; gap: 1.4rem; }
.topnav a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}
.topnav a:hover { color: var(--accent); }

/* ---------- hero ---------- */

.hero {
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8rem) clamp(1.25rem, 5vw, 3rem) clamp(3rem, 7vw, 5rem);
  text-align: center;
}

.eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hero-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4rem, 14vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
}

.hero-sub {
  max-width: 36rem;
  margin: 2rem auto 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- theme toggle ---------- */

.nav-right { display: flex; align-items: center; gap: 1.4rem; }

.theme-toggle {
  appearance: none;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.25s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-sun,
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }

.hero-more {
  display: inline-block;
  margin-top: 2.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}
.hero-more:hover { color: var(--accent); }

/* ---------- sections ---------- */

.section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 5vw, 2rem);
  border-top: 1px solid var(--hairline);
}

.section h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.05;
  margin: 0 0 1.5rem;
}

.lede { font-size: 1.15rem; }

/* ---------- cards ---------- */

.cards { display: grid; gap: 1.75rem; margin-top: 0.5rem; }

.card h3 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.35rem;
}
.card p { margin: 0; color: var(--muted); }

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

/* ---------- collapsible CV ---------- */

.cv { margin-top: 2.5rem; }
.cv summary {
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--accent);
}
.cv-list { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.cv-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.dates { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.cv-langs { color: var(--muted); font-size: 0.9rem; margin-top: 1rem; }

/* ---------- founder-style profile ---------- */

.founder-body p:last-child { margin-bottom: 0; color: var(--muted); }

/* ---------- story ---------- */

.story-body p {
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.65;
  margin: 0 0 1.4rem;
}

.story-body p:first-child::first-letter {
  font-size: 3.4em;
  float: left;
  line-height: 0.85;
  padding-right: 0.12em;
}

/* ---------- links / footer ---------- */

.links { list-style: none; padding: 0; margin: 1rem 0 0; }
.links li { padding: 0.55rem 0; border-bottom: 1px solid var(--hairline); }
.links a { text-decoration: none; }

.footer {
  border-top: 1px solid var(--hairline);
  padding: 2rem clamp(1.25rem, 5vw, 3rem);
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- motion & small screens ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .topnav { gap: 0.9rem; }
}

/* ---------- always-on green accents ---------- */

/* thin neon rule across the very top of the viewport */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  z-index: 20;
}

/* live status dot on the wordmark */
.wordmark::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
  vertical-align: 0.05em;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* eyebrow line sits in green */
.eyebrow { color: var(--accent); }

/* every section heading gets a short green underline */
.section h2::after {
  content: "";
  display: block;
  width: 2.2rem;
  height: 3px;
  margin-top: 0.6rem;
  background: var(--accent);
}

/* links are statically underlined in green */
a { text-decoration-color: var(--accent); }

/* the arrow prompts glow green without hover */
.hero-more { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .wordmark::before { animation: none; }
}

/* ---------- consensus loader ---------- */

body.loading { overflow: hidden; }

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0a0d0a;
  color: #35d96b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.45s ease;
}

.loader-done { opacity: 0; pointer-events: none; }

.loader-inner {
  width: min(36rem, 92vw);
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

/* fork-choice canvas */
.loader-canvas {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 1.1rem;
}


/* lifecycle legend */
.loader-legend {
  display: flex;
  gap: 1.5rem;
  margin: -0.2rem 0 1.1rem;
  font-size: 0.7rem;
  color: #6fae86;
  letter-spacing: 0.04em;
}
.lg::before {
  content: "";
  display: inline-block;
  width: 1.6rem;
  height: 0;
  margin-right: 0.45rem;
  vertical-align: middle;
}
.lg-proposed::before { border-top: 1.5px dashed #2f7a52; }
.lg-justified::before { border-top: 2px solid #35d96b; }
.lg-finalized::before { border-top: 4px solid #a8ffcb; box-shadow: 0 0 8px rgba(168,255,203,0.9); }

/* rolling log */
.loader-log {
  margin: 0 0 1.25rem;
  min-height: 9.5em;
  white-space: pre-wrap;
  color: #9fe8b8;
  font-size: 0.8rem;
  line-height: 1.55;
}

/* attestation bar */
.loader-votes {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.vote-label { color: #6fae86; font-size: 0.75rem; }

.vote-bar {
  flex: 1;
  height: 6px;
  border: 1px solid rgba(53, 217, 107, 0.5);
  border-radius: 999px;
  overflow: hidden;
}

.vote-fill {
  display: block;
  height: 100%;
  width: 0;
  background: #35d96b;
  box-shadow: 0 0 10px rgba(53, 217, 107, 0.8);
  transition: width 0.25s ease;
}

.vote-pct { min-width: 3ch; text-align: right; font-size: 0.75rem; }

.loader-skip {
  margin: 1.75rem 0 0;
  text-align: center;
  font-size: 0.7rem;
  color: #4d6b57;
  letter-spacing: 0.06em;
}

@media (prefers-reduced-motion: reduce) {
  .loader { display: none; }
}
