/* nithin.kr — drafting vellum / nocturne carbon */

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg-canvas: #EFF2F6;
  --bg-surface: #FAFBFD;
  --ink-primary: #0F172A;
  --ink-muted: #475569;
  --border-hairline: #CBD5E1;
  --accent-primary: #2563EB;
  --accent-stamp: #E11D48;
  --accent-status: #0F766E;
  --grain-opacity: 0.025;
  --grain-blend: multiply;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #141517;
  --bg-surface: #1C1E21;
  --ink-primary: #ECEAE4;
  --ink-muted: #8E929B;
  --border-hairline: #2C2F35;
  --accent-primary: #D4A359;
  --accent-stamp: #E06D53;
  --accent-status: #34D399;
  --grain-opacity: 0.04;
  --grain-blend: overlay;
}

:root {
  --serif: "Newsreader", "Noto Serif Malayalam", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --sans: "Plus Jakarta Sans", "Noto Serif Malayalam", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Noto Serif Malayalam", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  --malayalam: "Noto Serif Malayalam", serif;
  --radius: 2px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--border-hairline) transparent;
  background: var(--bg-canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: var(--grain);
  background-size: 220px 220px;
  mix-blend-mode: var(--grain-blend);
}

[data-theme="dark"] body {
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--accent-stamp) 28%, transparent);
  color: var(--ink-primary);
}

:focus { outline: none; }

:focus-visible {
  outline: 1px solid var(--accent-primary);
  outline-offset: 2px;
}

h1, h2, h3, p { margin: 0; }

h1, h2, .post-title, .reader-title, .now dd, .nav-title {
  font-family: var(--serif);
  font-weight: 500;
  font-optical-sizing: auto;
}

a { color: var(--accent-primary); text-underline-offset: 0.16em; }

button, input, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

[lang="ml"] {
  font-family: var(--malayalam);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.65;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 90;
  padding: 0.45rem 0.7rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  color: var(--ink-primary);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skip:focus { top: 0.75rem; }

.wrap {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.kicker {
  margin: 0 0 0.55rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.band { border-bottom: 1px solid var(--border-hairline); scroll-margin-top: 0.75rem; }

#folio { scroll-margin-top: 0.75rem; }

.band > .wrap,
.mast-band > .wrap { padding-block: 3.4rem; }

/* Folio strip */

.folio-strip {
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  margin-top: 0.75rem;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.folio-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.folio-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.62rem 0.8rem;
  flex-wrap: wrap;
}

.folio-edition { grid-column: 1 / 3; color: var(--accent-stamp); }
.folio-clock {
  grid-column: 3 / 7;
  border-left: 1px solid var(--border-hairline);
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.22rem;
}

.folio-role { color: var(--ink-muted); }
.folio-tools {
  grid-column: 7 / 13;
  border-left: 1px solid var(--border-hairline);
  justify-content: flex-end;
}

.reg {
  width: 0.42rem;
  height: 0.42rem;
  background: var(--accent-stamp);
  flex: none;
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-status);
  flex: none;
  animation: pulse 2.4s ease-in-out infinite;
}

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

#clock { font-variant-numeric: tabular-nums; color: var(--ink-primary); }

.folio-strip a {
  color: inherit;
  text-decoration: none;
}

.folio-strip a:hover,
.folio-strip a:focus-visible { color: var(--accent-primary); }

.folio-locale {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.2rem;
}

.folio-line, .folio-ext {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.sig {
  font-family: var(--malayalam);
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-primary);
}

.seg {
  display: inline-flex;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
}

.seg button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.28rem 0.42rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.mark {
  width: 0.9em;
  height: 0.9em;
  flex: none;
}

.seg button + button { border-left: 1px solid var(--border-hairline); }

.seg button[aria-pressed="true"] {
  color: var(--accent-primary);
  background: var(--bg-surface);
}

.folio-strip [lang="ml"] {
  font-size: 0.92rem;
  line-height: 1.3;
}

/* Masthead */

.mast-band > .wrap { padding-block: 2.4rem 2.15rem; }

.mast-grid,
.hero-grid,
.mail-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 2rem 2.25rem;
  align-items: start;
}

.mast-toc {
  border-left: 1px solid var(--border-hairline);
  padding-left: 1.35rem;
  min-width: 0;
}

.nameplate h1 {
  font-size: clamp(3rem, 6vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  max-width: 11ch;
}

.handle {
  display: inline-block;
  margin-top: 0.95rem;
  padding: 0.18rem 0.42rem;
  border: 1px solid var(--accent-stamp);
  border-radius: var(--radius);
  color: var(--accent-stamp);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.handle:hover { background: var(--bg-surface); }

.subtitle {
  margin-top: 0.95rem;
  max-width: 34ch;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.28rem;
  line-height: 1.35;
}

.toc-link {
  display: grid;
  grid-template-rows: auto 0fr;
  gap: 0;
  padding: 0.78rem 0;
  border-bottom: 1px solid var(--border-hairline);
  color: inherit;
  text-decoration: none;
  transition: grid-template-rows 280ms var(--ease);
}

.toc-link:first-child { border-top: 1px solid var(--border-hairline); }

.toc-link:hover,
.toc-link:focus-visible { grid-template-rows: auto 1fr; }

.toc-row {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  min-width: 0;
}

.toc-idx,
.note-idx,
.compass-num,
.spot-idx {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.toc-link:hover .toc-idx,
.toc-link:focus-visible .toc-idx,
.toc-link.is-active .toc-idx { color: var(--accent-primary); }

.toc-label {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-primary);
}

.toc-leader {
  flex: 1;
  border-bottom: 1px dotted var(--ink-muted);
  transform: translateY(-0.28em);
  opacity: 0.7;
  min-width: 1.25rem;
}

.toc-more {
  overflow: hidden;
  min-height: 0;
}

.toc-more span {
  display: block;
  padding: 0.35rem 0 0.1rem;
  max-width: 38ch;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

/* Compass */

.compass {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 70;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}

.compass.is-in {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.compass-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--ink-primary);
}

.compass-btn::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-stamp);
}

.compass-num {
  font-size: 0.8rem;
  color: var(--ink-primary);
  line-height: 1;
}

.compass-pop {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  width: 15.5rem;
  padding: 0.3rem 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
}

.compass-pop a {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.48rem 0.8rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.02rem;
}

.compass-pop a:hover,
.compass-pop a.is-active { color: var(--accent-primary); }

.compass-pop a.is-active span:first-child { color: var(--accent-stamp); }

/* Hero */

.hero-title {
  font-size: clamp(1.85rem, 3.6vw, 2.65rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.04em;
}

.rise {
  display: block;
  transform: translateY(105%);
  animation: rise 720ms var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}

@keyframes rise {
  to { transform: translateY(0); }
}

html[data-locale="ml"] .hero-title {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.35;
}

.hero-copy {
  margin-top: 1.35rem;
  max-width: 62ch;
  font-size: 1.0625rem;
  line-height: 1.82;
}

.hero-copy p + p { margin-top: 1rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.45rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.58rem 0.75rem;
  border: 1px solid var(--ink-primary);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--ink-primary);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn-quiet { border-color: var(--border-hairline); }

.btn:hover,
.btn:focus-visible {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.now {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-surface);
  padding: 1rem 1.05rem 0.35rem;
}

.now-row {
  display: grid;
  grid-template-columns: minmax(6.5rem, 8.5rem) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border-hairline);
}

.now dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.now dd {
  font-size: 1.15rem;
  line-height: 1.35;
}

.now-sub {
  display: block;
  margin-top: 0.22rem;
  font-family: var(--sans);
  font-style: normal;
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.section-title {
  font-size: clamp(2rem, 3vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

.lede, .work-lede {
  margin-top: 0.85rem;
  max-width: 68ch;
  font-size: 1.0625rem;
  line-height: 1.82;
}

.work + .work {
  margin-top: 3.25rem;
  padding-top: 2.6rem;
  border-top: 1px solid var(--border-hairline);
}

.work-title {
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2vw, 1.85rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  max-width: 28ch;
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Viewports */

.viewport {
  margin-top: 1.25rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.chrome-bar,
.viewport-foot,
.stark-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-hairline);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
}

.chrome-dots { display: flex; gap: 0.28rem; flex: none; }

.chrome-dots i {
  width: 0.45rem;
  height: 0.45rem;
  border: 1px solid var(--border-hairline);
  display: block;
}

.chrome-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.22rem 0.45rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-canvas);
  color: var(--ink-muted);
}

.chrome-badge,
.specimen-flag {
  flex: none;
  color: var(--accent-stamp);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-btn, .icon-btn {
  appearance: none;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-canvas);
  color: var(--ink-primary);
  text-decoration: none;
}

.text-btn:hover,
.icon-btn:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

.text-btn {
  padding: 0.42rem 0.6rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* Clean Sweep 2.0 specimen. Product radius and shadow stay inside .cs-app. */

.viewport:has(.cs-app) { overflow: hidden; padding: 0; }

.cs-app {
  --cs-bg-app: #f4f4f5;
  --cs-bg-panel: #ffffff;
  --cs-bg-elevated: #fafafa;
  --cs-bg-hover: #f0f0f2;
  --cs-text: #18181b;
  --cs-text-muted: #3f3f46;
  --cs-text-faint: #71717a;
  --cs-border: #e4e4e7;
  --cs-border-strong: #d4d4d8;
  --cs-accent: #4169e1;
  --cs-success: #15803d;
  --cs-warning: #b45309;
  --cs-danger: #b91c1c;
  --cs-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  height: auto;
  display: flex;
  flex-direction: column;
  background: var(--cs-bg-app);
  color: var(--cs-text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  color-scheme: light;
}

[data-theme="dark"] .cs-app:not(.is-light),
.cs-app.is-dark {
  --cs-bg-app: #0d0d0d;
  --cs-bg-panel: #111113;
  --cs-bg-elevated: #18181b;
  --cs-bg-hover: rgba(30, 30, 30, 0.65);
  --cs-text: #e4e4e7;
  --cs-text-muted: #a1a1aa;
  --cs-text-faint: #71717a;
  --cs-border: rgba(39, 39, 42, 0.9);
  --cs-border-strong: #3f3f46;
  --cs-success: #22c55e;
  --cs-warning: #f59e0b;
  --cs-danger: #ef4444;
  --cs-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

.cs-app.is-light {
  --cs-bg-app: #f4f4f5;
  --cs-bg-panel: #ffffff;
  --cs-bg-elevated: #fafafa;
  --cs-bg-hover: #f0f0f2;
  --cs-text: #18181b;
  --cs-text-muted: #3f3f46;
  --cs-text-faint: #71717a;
  --cs-border: #e4e4e7;
  --cs-border-strong: #d4d4d8;
  --cs-success: #15803d;
  --cs-warning: #b45309;
  --cs-danger: #b91c1c;
  --cs-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  color-scheme: light;
}

.cs-app h4,
.cs-app h5,
.cs-app p { margin: 0; font-family: inherit; font-weight: inherit; }

.cs-app :where(button) {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  text-align: inherit;
  border-radius: 0.5rem;
}

.cs-app :focus-visible {
  outline: 2px solid var(--cs-accent);
  outline-offset: 2px;
}

.cs-app svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cs-shell {
  display: flex;
  min-height: 0;
  flex: 1;
}

.cs-side {
  width: 14rem;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--cs-bg-panel);
  border-right: 1px solid var(--cs-border);
  min-height: 0;
}

.cs-brand {
  height: 3.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--cs-border);
}

.cs-logo {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #4169e1 0%, #10b981 100%);
  box-shadow: 0 4px 14px rgba(65, 105, 225, 0.25);
  color: #fff;
}

.cs-logo svg { width: 1rem; height: 1rem; }

.cs-logo-lg {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  border-radius: 0.75rem;
  box-shadow: 0 8px 18px rgba(65, 105, 225, 0.22);
}

.cs-logo-lg svg { width: 1.25rem; height: 1.25rem; }

.cs-brand-copy { min-width: 0; display: flex; flex-direction: column; }
.cs-brand-copy strong { font-size: 0.875rem; font-weight: 600; line-height: 1.2; }
.cs-brand-copy span { font-size: 10px; color: var(--cs-text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cs-nav {
  flex: 0 1 auto;
  overflow: auto;
  padding: 0.35rem 0.5rem 0.5rem;
}

.cs-group {
  margin: 0.7rem 0 0.15rem;
  padding: 0 0.75rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cs-text-faint);
}

.cs-group:first-child { margin-top: 0.2rem; }

.cs-nav button {
  width: 100%;
  height: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.7rem;
  border-radius: 0.5rem;
  color: var(--cs-text-muted);
  position: relative;
}

.cs-nav button svg { width: 1.15rem; height: 1.15rem; flex: none; }

.cs-nav button span { font-size: 0.875rem; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cs-nav button em {
  margin-left: 0.15rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0.25rem;
  background: rgba(65, 105, 225, 0.1);
  color: var(--cs-accent);
  font-style: normal;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cs-nav button:hover { background: var(--cs-bg-hover); color: var(--cs-text); }

.cs-nav button[aria-current="page"] {
  background: rgba(65, 105, 225, 0.1);
  color: var(--cs-text);
}

.cs-nav button[aria-current="page"] svg { color: var(--cs-accent); }

.cs-nav button[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 1.35rem;
  transform: translateY(-50%);
  border-radius: 0 2px 2px 0;
  background: var(--cs-accent);
}

.cs-nav button[aria-current="page"]::after {
  content: "";
  margin-left: auto;
  width: 0.38rem;
  height: 0.38rem;
  border-right: 2px solid var(--cs-accent);
  border-top: 2px solid var(--cs-accent);
  transform: rotate(45deg);
  flex: none;
}

.cs-collapse {
  margin: 0.35rem 0.5rem 0.55rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.7rem;
  border-top: 1px solid var(--cs-border);
  border-radius: 0;
  color: var(--cs-text-muted);
  width: calc(100% - 1rem);
}

.cs-collapse::before {
  content: "";
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  background: currentColor;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><path d='M11 19l-7-7 7-7m8 14l-7-7 7-7'/></svg>") center / contain no-repeat;
}

.cs-collapse:hover { background: var(--cs-bg-hover); color: var(--cs-text); border-radius: 0.5rem; }

.cs-app.is-collapsed .cs-side { width: 3.4rem; }
.cs-app.is-collapsed .cs-brand { justify-content: center; padding: 0; }
.cs-app.is-collapsed .cs-brand-copy,
.cs-app.is-collapsed .cs-group,
.cs-app.is-collapsed .cs-nav button span,
.cs-app.is-collapsed .cs-nav button em { display: none; }
.cs-app.is-collapsed .cs-collapse { font-size: 0; }
.cs-app.is-collapsed .cs-nav button { justify-content: center; padding: 0; }
.cs-app.is-collapsed .cs-nav button[aria-current="page"]::before,
.cs-app.is-collapsed .cs-nav button[aria-current="page"]::after { display: none; }
.cs-app.is-collapsed .cs-collapse { justify-content: center; width: calc(100% - 0.5rem); margin-inline: 0.25rem; padding: 0; }
.cs-app.is-collapsed .cs-collapse::before { transform: rotate(180deg); }

.cs-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--cs-bg-app);
}

.cs-titlebar {
  height: 2.5rem;
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-left: 1rem;
  background: var(--cs-bg-elevated);
  border-bottom: 1px solid var(--cs-border);
}

.cs-title { min-width: 0; display: flex; align-items: baseline; gap: 0.4rem; flex: 1; }
.cs-title strong { font-size: 0.875rem; font-weight: 600; }
.cs-title span { font-size: 0.75rem; color: var(--cs-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-title span::before { content: "· "; color: var(--cs-text-faint); }

.cs-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--cs-border);
  background: var(--cs-bg-elevated);
  color: var(--cs-text-muted);
  font-size: 11px;
  line-height: 1.3;
}

.cs-chip strong { color: var(--cs-text); font-family: var(--mono); font-weight: 500; }

.cs-chip-warn {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(217, 119, 6, 0.1);
  color: #92400e;
}

.cs-app.is-dark .cs-chip-warn,
[data-theme="dark"] .cs-app:not(.is-light) .cs-chip-warn { color: #fde68a; }

.cs-theme {
  height: 100%;
  width: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 0;
  color: var(--cs-text-muted);
}

.cs-theme:hover { background: var(--cs-bg-hover); color: var(--cs-text); }
.cs-theme svg { width: 1rem; height: 1rem; }
.cs-theme .cs-sun { display: none; color: #eab308; }

[data-theme="dark"] .cs-app:not(.is-light) .cs-theme .cs-moon,
.cs-app.is-dark .cs-theme .cs-moon { display: none; }

[data-theme="dark"] .cs-app:not(.is-light) .cs-theme .cs-sun,
.cs-app.is-dark .cs-theme .cs-sun { display: block; }

.cs-app.is-light .cs-theme .cs-moon { display: block; }
.cs-app.is-light .cs-theme .cs-sun { display: none; }

.cs-stage { flex: none; min-height: 0; overflow: visible; }

.cs-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
  padding: 1.35rem 1.35rem 1.15rem;
  border-bottom: 1px solid var(--cs-border);
  background:
    linear-gradient(135deg, rgba(65, 105, 225, 0.06), transparent 42%, rgba(16, 185, 129, 0.06));
}

.cs-hero-id { display: flex; align-items: center; gap: 0.75rem; }
.cs-hero-id h4 { font-size: 1.25rem; font-weight: 700; line-height: 1.15; }
.cs-hero-id p { font-size: 0.875rem; color: var(--cs-text-muted); }
.cs-hero-copy {
  order: 3;
  flex: 1 1 100%;
  max-width: 42rem;
  font-size: 12px;
  color: var(--cs-text-muted);
  line-height: 1.55;
}

.cs-pills {
  order: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: 0.4rem;
  max-width: 36rem;
}

.cs-body { padding: 1.15rem 1.35rem 1.5rem; display: flex; flex-direction: column; gap: 1.15rem; }

.cs-body > h5,
.cs-tools > h5 {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cs-text-muted);
}

.cs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: 0.65rem;
}

.cs-cards button {
  padding: 0.85rem 0.8rem 0.75rem;
  border: 1px solid var(--cs-border);
  border-radius: 0.75rem;
  background: var(--cs-bg-panel);
  box-shadow: var(--cs-shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.4rem;
}

.cs-cards button:hover { border-color: rgba(16, 185, 129, 0.45); }
.cs-cards button span { font-size: 11px; font-weight: 500; color: var(--cs-text-muted); }
.cs-cards button strong { grid-column: 1 / -1; font-size: 0.875rem; font-weight: 650; line-height: 1.3; }
.cs-cards button small { grid-column: 1 / -1; font-size: 11px; color: var(--cs-text-muted); }

.dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  display: inline-block;
  background: #a1a1aa;
}

.dot-red { background: #ef4444; }
.dot-orange { background: #f97316; }
.dot-green { background: #22c55e; }
.dot-violet { background: #8b5cf6; }

.cs-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(13.5rem, 0.8fr);
  gap: 1rem;
  align-items: start;
}

.cs-path {
  background: var(--cs-bg-panel);
  border: 1px solid var(--cs-border);
  border-radius: 1rem;
  box-shadow: var(--cs-shadow);
  overflow: hidden;
}

.cs-path > header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--cs-border);
  background: linear-gradient(90deg, rgba(65, 105, 225, 0.1), rgba(16, 185, 129, 0.05), transparent);
}

.cs-path h5 { font-size: 0.875rem; font-weight: 650; text-transform: none; letter-spacing: 0; color: var(--cs-text); }
.cs-path header p { margin-top: 0.15rem; font-size: 11px; color: var(--cs-text-muted); }

.cs-progress-label {
  margin: 0;
  text-align: right;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cs-text-faint);
}

.cs-progress-label strong { display: block; font-size: 0.875rem; letter-spacing: 0; text-transform: none; color: var(--cs-text); font-variant-numeric: tabular-nums; }
.cs-progress-label span { color: var(--cs-text-muted); font-weight: 400; }

.cs-bar {
  height: 0.38rem;
  margin: 0.7rem 1.1rem 0.15rem;
  border-radius: 999px;
  background: var(--cs-bg-elevated);
  border: 1px solid var(--cs-border);
  overflow: hidden;
}

.cs-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4169e1, #10b981);
}

.cs-path ol { list-style: none; margin: 0.35rem 0 0; padding: 0; }

.cs-path li { position: relative; }

.cs-path li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 2.2rem;
  top: 2.55rem;
  bottom: 0;
  width: 1px;
  background: var(--cs-border);
  z-index: 0;
}

.cs-path li.is-done:not(:last-child)::before { background: rgba(21, 128, 61, 0.4); }

.cs-path li button {
  width: 100%;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  grid-template-areas:
    "icon title arrow"
    "icon desc arrow";
  gap: 0.15rem 0.75rem;
  align-items: start;
  padding: 0.75rem 1.05rem 0.8rem;
  border-radius: 0;
}

.cs-path li button:hover { background: var(--cs-bg-hover); }

.cs-path li.is-current button {
  background: rgba(65, 105, 225, 0.06);
  box-shadow: inset 0 0 0 1px rgba(65, 105, 225, 0.2);
}

.cs-path li.is-current button:hover { background: rgba(65, 105, 225, 0.1); }

.cs-path b {
  grid-area: icon;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 0.7rem;
  border: 1px solid var(--cs-border);
  background: var(--cs-bg-elevated);
  color: var(--cs-text-muted);
  box-shadow: var(--cs-shadow);
  position: relative;
  z-index: 1;
}

.cs-path b svg { width: 0.9rem; height: 0.9rem; }
.cs-path b.is-done { background: rgba(21, 128, 61, 0.12); border-color: rgba(21, 128, 61, 0.35); color: var(--cs-success); }
.cs-path b.is-done svg { stroke-width: 2.5; }
.cs-path b.is-issue { background: rgba(220, 38, 38, 0.1); border-color: rgba(220, 38, 38, 0.3); color: var(--cs-danger); }
.cs-path b.is-next { background: rgba(65, 105, 225, 0.14); border-color: rgba(65, 105, 225, 0.35); color: var(--cs-accent); }

.cs-path li button > span {
  grid-area: title;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.cs-path em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cs-text-faint);
}

.cs-path small {
  grid-area: desc;
  font-size: 11px;
  color: var(--cs-text-muted);
  line-height: 1.45;
}

.cs-arrow { grid-area: arrow; color: var(--cs-text-faint); font-style: normal; font-size: 12px; align-self: center; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.35rem;
  border-radius: 0.35rem;
  border: 1px solid var(--cs-border);
  background: var(--cs-bg-elevated);
  color: var(--cs-text-faint);
  font-style: normal;
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
}

.tag-ok { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.28); color: var(--cs-success); }
.tag-bad { background: rgba(220, 38, 38, 0.1); border-color: rgba(220, 38, 38, 0.28); color: var(--cs-danger); }
.tag-next { background: rgba(14, 165, 233, 0.12); border-color: rgba(14, 165, 233, 0.28); color: #0369a1; }
.tag-warn { background: rgba(217, 119, 6, 0.12); border-color: rgba(217, 119, 6, 0.3); color: var(--cs-warning); }

.cs-app.is-dark .tag-next,
[data-theme="dark"] .cs-app:not(.is-light) .tag-next { color: #7dd3fc; }

.cs-start { display: flex; flex-direction: column; gap: 0.7rem; }

.cs-start-card {
  padding: 1.05rem 1.05rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(16, 185, 129, 0.28);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.16), rgba(16, 185, 129, 0.04) 55%, transparent);
  box-shadow: var(--cs-shadow);
}

.cs-start-card h5 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cs-text);
}

.cs-bolt {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 0.5rem;
  background: rgba(16, 185, 129, 0.2);
  color: var(--cs-success);
}

.cs-bolt svg { width: 1rem; height: 1rem; stroke-width: 2; }

.cs-start-card > p { margin-bottom: 0.85rem; font-size: 12px; color: var(--cs-text-muted); line-height: 1.5; }

.cs-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.62rem 0.9rem;
  border-radius: 0.75rem;
  background: #059669;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 550;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.25);
}

.cs-go:hover { background: #10b981; }

.cs-go-quiet {
  margin-top: 0.45rem;
  background: color-mix(in srgb, var(--cs-bg-panel) 82%, transparent);
  color: var(--cs-text);
  border: 1px solid var(--cs-border);
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
}

.cs-go-quiet:hover { background: var(--cs-bg-hover); }

.cs-go-danger { background: var(--cs-danger); box-shadow: none; }
.cs-go-danger:hover { filter: brightness(1.05); }

.cs-note {
  padding: 0.85rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid var(--cs-border);
  background: var(--cs-bg-panel);
  font-size: 11px;
  color: var(--cs-text-muted);
  line-height: 1.5;
}

.cs-note strong { color: var(--cs-text); font-weight: 600; }

.cs-tools h5 { margin-bottom: 0.65rem; }

.cs-toolgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.cs-toolgrid button {
  padding: 0.85rem 0.85rem 0.9rem;
  border: 1px solid var(--cs-border);
  border-radius: 0.75rem;
  background: var(--cs-bg-panel);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.cs-toolgrid button:hover { border-color: rgba(65, 105, 225, 0.4); }
.cs-toolgrid button:hover strong { color: var(--cs-accent); }
.cs-toolgrid b {
  width: 2.4rem;
  height: 2.4rem;
  min-width: 2.4rem;
  margin-bottom: 0.45rem;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 0.55rem;
}
.cs-toolgrid b svg { width: 1.15rem; height: 1.15rem; }
.cs-toolgrid strong { font-size: 0.875rem; font-weight: 550; }
.cs-toolgrid span { font-size: 11px; color: var(--cs-text-muted); line-height: 1.35; }

.tone-emerald { background: rgba(16, 185, 129, 0.12); color: #047857; }
.tone-violet { background: rgba(139, 92, 246, 0.12); color: #6d28d9; }
.tone-amber { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.tone-sky { background: rgba(14, 165, 233, 0.12); color: #0369a1; }
.tone-purple { background: rgba(168, 85, 247, 0.12); color: #7e22ce; }
.tone-cyan { background: rgba(6, 182, 212, 0.12); color: #0e7490; }
.tone-zinc { background: rgba(113, 113, 122, 0.12); color: var(--cs-text-muted); }

.cs-app.is-dark .tone-emerald,
[data-theme="dark"] .cs-app:not(.is-light) .tone-emerald { color: #34d399; }
.cs-app.is-dark .tone-violet,
[data-theme="dark"] .cs-app:not(.is-light) .tone-violet { color: #c4b5fd; }
.cs-app.is-dark .tone-amber,
[data-theme="dark"] .cs-app:not(.is-light) .tone-amber { color: #fbbf24; }
.cs-app.is-dark .tone-sky,
[data-theme="dark"] .cs-app:not(.is-light) .tone-sky { color: #7dd3fc; }
.cs-app.is-dark .tone-purple,
[data-theme="dark"] .cs-app:not(.is-light) .tone-purple { color: #d8b4fe; }
.cs-app.is-dark .tone-cyan,
[data-theme="dark"] .cs-app:not(.is-light) .tone-cyan { color: #67e8f9; }

.cs-tool { padding: 1.25rem 1.35rem 1.6rem; display: flex; flex-direction: column; gap: 0.85rem; max-width: 52rem; }
.cs-tool-head { display: flex; align-items: center; gap: 0.75rem; }
.cs-tool-head h4 { font-size: 1.25rem; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.cs-tool-head p { font-size: 0.875rem; color: var(--cs-text-muted); }
.cs-mark {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  font-size: 1.1rem;
}
.mark-green { background: rgba(16, 185, 129, 0.12); color: var(--cs-success); }

.cs-hub { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.cs-hub button {
  padding: 1.1rem 1rem;
  border: 1px solid var(--cs-border);
  border-radius: 0.75rem;
  background: var(--cs-bg-panel);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cs-hub button:hover { border-color: rgba(16, 185, 129, 0.4); background: var(--cs-bg-hover); }
.cs-hub strong { font-size: 1rem; }
.cs-hub span { font-size: 12px; color: var(--cs-text-muted); line-height: 1.45; }
.cs-hub em { align-self: flex-start; margin-top: 0.25rem; }

.cs-tip, .cs-crumb { font-size: 11px; color: var(--cs-text-faint); }
.cs-crumb button { display: inline; width: auto; color: var(--cs-text-muted); font-size: 12px; border-radius: 0.25rem; }
.cs-crumb button:hover { color: var(--cs-text); }

.cs-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; }
.cs-stats p {
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--cs-border);
  border-radius: 0.75rem;
  background: var(--cs-bg-panel);
}
.cs-stats span { display: block; font-size: 10px; color: var(--cs-text-muted); }
.cs-stats strong { font-size: 1.05rem; }
.cs-stats .is-bad { color: var(--cs-danger); }
.cs-stats .is-warn { color: var(--cs-warning); }

.cs-panel {
  padding: 1rem;
  border: 1px solid var(--cs-border);
  border-radius: 0.75rem;
  background: var(--cs-bg-panel);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cs-panel h5 { font-size: 0.875rem; font-weight: 650; }
.cs-panel > h4 { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.02em; }
.cs-kicker { font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cs-accent); }

.cs-warn {
  padding: 0.7rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(217, 119, 6, 0.32);
  background: rgba(217, 119, 6, 0.1);
  color: #92400e;
  font-size: 12px;
  line-height: 1.45;
}
.cs-app.is-dark .cs-warn,
[data-theme="dark"] .cs-app:not(.is-light) .cs-warn { color: #fde68a; }
.cs-warn strong { display: block; margin-bottom: 0.15rem; }

.cs-profiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem; }
.cs-profiles button {
  padding: 0.75rem;
  border: 1px solid var(--cs-border);
  border-radius: 0.55rem;
  background: var(--cs-bg-app);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}
.cs-profiles button[aria-pressed="true"] {
  background: rgba(65, 105, 225, 0.1);
  border-color: rgba(65, 105, 225, 0.5);
  box-shadow: 0 0 0 2px rgba(65, 105, 225, 0.22);
}
.cs-profiles button[data-cs-profile="deep"][aria-pressed="true"] {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22);
}
.cs-profiles strong { font-size: 0.875rem; }
.cs-profiles span { font-size: 12px; color: var(--cs-text-faint); }

.cs-panel > .cs-go,
.cs-tool > .cs-go,
.cs-action .cs-go { width: auto; align-self: flex-start; padding-inline: 1.1rem; background: var(--cs-accent); box-shadow: none; }
.cs-panel > .cs-go:hover,
.cs-tool > .cs-go:hover,
.cs-action .cs-go:hover { background: #3557c4; }
.cs-tool > .cs-go-danger { background: var(--cs-danger); }
.cs-tool > .cs-go-danger:hover { background: #991b1b; filter: none; }

.cs-action {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cs-action p { display: flex; flex-direction: column; gap: 0.15rem; }
.cs-action span { font-size: 12px; color: var(--cs-text-muted); }
.cs-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cs-chips .cs-chip { border-radius: 999px; }

.cs-foot {
  height: 1.5rem;
  flex: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 0.75rem;
  background: var(--cs-bg-elevated);
  border-top: 1px solid var(--cs-border);
  color: var(--cs-text-muted);
  font-size: 11px;
}

.cs-foot span:last-child { margin-left: auto; }
.cs-foot span:nth-child(2) { margin-left: auto; color: var(--cs-text-faint); }
.cs-foot span:last-child { margin-left: 1rem; }
.cs-foot .dot { margin-right: 0.3rem; }

@media (max-width: 980px) {
  .cs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-split, .cs-hub, .cs-profiles, .cs-toolgrid { grid-template-columns: 1fr 1fr; }
  .cs-pills { max-width: none; justify-content: flex-start; }
}

@media (max-width: 720px) {
  .cs-app { height: auto; }
  .cs-shell { flex-direction: column; }
  .cs-side {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--cs-border);
  }
  .cs-app.is-collapsed .cs-side { width: 100%; }
  .cs-nav {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding-bottom: 0.45rem;
  }
  .cs-group { display: none; }
  .cs-nav button { width: auto; flex: none; }
  .cs-collapse { display: none; }
  .cs-stage { max-height: 26rem; overflow: auto; }
  .cs-cards, .cs-toolgrid { grid-template-columns: 1fr 1fr; }
  .cs-split, .cs-hub, .cs-profiles { grid-template-columns: 1fr; }
  .cs-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs-title span { display: none; }
  .cs-hero-copy { display: none; }
  .cs-hero { padding: 0.8rem 0.85rem 0.7rem; }
  .cs-body { padding: 0.8rem 0.85rem 1rem; gap: 0.8rem; }
  .cs-brand { height: 2.75rem; padding-inline: 0.75rem; }
  .cs-brand-copy span { display: none; }
  .cs-nav button { height: 2.15rem; }
  .cs-cards button,
  .cs-toolgrid button { padding: 0.65rem 0.6rem; }
  .cs-path li button { padding: 0.55rem 0.7rem; }
  .cs-tool { padding: 0.9rem 0.85rem 1.1rem; }
}
.viewport-foot {
  border-bottom: 0;
  border-top: 1px solid var(--border-hairline);
  justify-content: space-between;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.viewport-foot a { color: inherit; text-decoration: none; }
.viewport-foot a:hover { color: var(--accent-primary); }

.noscript {
  margin: 0;
  padding: 0.7rem 0.8rem;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

/* Stark specimen */

.stark-bar { flex-wrap: wrap; justify-content: space-between; }

.stark-controls { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }

.stark-spec {
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post { padding: 1.25rem 1.15rem 1.5rem; }

.post-meta {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 280ms var(--ease), opacity 220ms linear;
}

.post-meta-inner {
  overflow: hidden;
  min-height: 0;
  padding-bottom: 0.85rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: padding-bottom 280ms var(--ease);
}

.specimen.is-pure .post-meta {
  grid-template-rows: 0fr;
  opacity: 0;
}

.specimen.is-pure .post-meta-inner { padding-bottom: 0; }

.post-title {
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 72ch;
  transition: max-width 280ms var(--ease);
}

.post-body {
  max-width: 72ch;
  margin-top: 0.9rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.82;
  transition: max-width 280ms var(--ease);
}

.post-body p + p { margin-top: 1rem; }

.specimen.is-narrow .post-title,
.specimen.is-narrow .post-body { max-width: 60ch; }

.specimen.is-sans .post-title,
.specimen.is-sans .post-body { font-family: var(--sans); font-weight: 400; }

.specimen.is-sans .post-title { font-weight: 600; }

/* Notes */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  margin-top: 1.6rem;
  border-bottom: 1px solid var(--border-hairline);
}

.filters button {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
  padding: 0.62rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.filters button[aria-pressed="true"] {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.filter-count {
  margin-left: auto;
  align-self: center;
  padding: 0.4rem 0.2rem 0.4rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.ml-banner {
  margin: 0.8rem 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

html:not([data-locale="ml"]) [data-ml-only] { display: none !important; }

.note-hit {
  width: 100%;
  display: grid;
  grid-template-rows: auto 0fr;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border-hairline);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: grid-template-rows 280ms var(--ease);
}

.note-hit:hover,
.note-hit:focus-visible { grid-template-rows: auto 1fr; }

.note-top {
  display: grid;
  grid-template-columns: 2.4rem 7.4rem minmax(0, 1fr) auto auto auto;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.95rem 0.15rem;
}

.note-title {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink-primary);
}

.note-hit:hover .note-title,
.note-hit:focus-visible .note-title { color: var(--accent-primary); }

.note-date,
.note-cat,
.note-time {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.note-arrow {
  color: var(--ink-muted);
  transition: transform 180ms var(--ease), color 180ms linear;
}

.note-hit:hover .note-arrow,
.note-hit:focus-visible .note-arrow {
  transform: translateX(4px);
  color: var(--accent-primary);
}

.note-draw { overflow: hidden; min-height: 0; }

.note-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 68ch;
  padding: 0 2rem 0.95rem calc(2.4rem + 7.4rem + 1.4rem);
  color: var(--ink-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.empty-notes {
  margin: 1rem 0 0;
  color: var(--ink-muted);
}

/* Reader */

.reader {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  overflow: auto;
}

.reader::backdrop { background: var(--bg-canvas); }

.reader-progress {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 3px;
  background: transparent;
}

.reader-progress > span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--accent-stamp);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.reader-chrome {
  position: sticky;
  top: 3px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.15rem;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-canvas);
  transition: opacity 200ms linear;
}

.reader.is-focus .reader-chrome { opacity: 0; }

.reader.is-focus .reader-chrome:hover,
.reader.is-focus .reader-chrome:focus-within { opacity: 1; }

.reader-back, .reader-focus {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.15rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-primary);
}

.reader-back:hover, .reader-focus:hover { color: var(--accent-primary); }

.reader-focus[aria-pressed="true"] { color: var(--accent-primary); }

.reader-esc {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.reader-body {
  width: min(1080px, calc(100% - 2.5rem));
  margin: 2rem auto 4rem;
}

.reader-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem);
  gap: 2.4rem;
  align-items: start;
}

.reader-title {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 16ch;
  text-wrap: balance;
}

.reader-title:focus { outline: none; }

.reader-original {
  margin-top: 0.8rem;
  color: var(--accent-stamp);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#reader-article {
  margin-top: 1.35rem;
  max-width: 68ch;
  font-size: 1.0625rem;
  line-height: 1.82;
}

#reader-article p + p { margin-top: 1.15em; }

#reader-article p.drop::first-letter {
  font-family: var(--serif);
  font-weight: 500;
  float: left;
  font-size: 3.35rem;
  line-height: 0.8;
  padding: 0.08em 0.12em 0 0;
  color: var(--accent-stamp);
}

#reader-article a { text-decoration-thickness: 1px; }

.reader-aside .margin-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.45;
}

.author-colo {
  margin-top: 1.4rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-hairline);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.6;
}

.colo-name {
  margin: 0.35rem 0;
  font-family: var(--malayalam);
  font-size: 1.15rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-primary);
  line-height: 1.4;
}

.reader.is-focus .reader-grid { grid-template-columns: minmax(0, 68ch); }
.reader.is-focus .reader-aside { display: none; }
.reader.is-focus .reader-body { width: min(74ch, calc(100% - 2.5rem)); }

.reader-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 2.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-hairline);
}

.reader-nav button {
  appearance: none;
  min-height: 5.6rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-surface);
  text-align: left;
}

.reader-nav button:last-child { text-align: right; }

.reader-nav button:disabled { opacity: 0.45; cursor: default; }

.reader-nav button:not(:disabled):hover {
  border-color: var(--accent-primary);
}

.nav-title {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.2rem;
  line-height: 1.25;
}

/* Contributions */

.matrix {
  margin-top: 1.7rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.spot { padding: 1rem 1rem 1.15rem; min-width: 0; }
.spot + .spot { border-left: 1px solid var(--border-hairline); }

.spot h3 {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  margin: 0 0 0.8rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.pills { display: flex; flex-direction: column; gap: 0.4rem; }

.pill {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  width: 100%;
  padding: 0.52rem 0.6rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-canvas);
  text-align: left;
  font-size: 0.98rem;
  line-height: 1.3;
}

.matrix.is-hot .pill:not(.is-hot) { opacity: 0.45; }

.pill.is-hot,
.pill[aria-pressed="true"] {
  opacity: 1;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.pill-year {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  flex: none;
}

.pill.is-hot .pill-year,
.pill[aria-pressed="true"] .pill-year { color: var(--accent-primary); }

.context {
  padding: 1rem 1.05rem 1.15rem;
  border-top: 1px solid var(--border-hairline);
  min-height: 9.5rem;
}

.context h3 {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.context p { margin-top: 0.55rem; max-width: 68ch; line-height: 1.65; }

.context-link { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; }

.photo-note {
  margin-top: 0.9rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: baseline;
  margin-top: 1.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-hairline);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.35;
}

/* Correspondence */

.mail-actions {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
  margin-top: 1.2rem;
}

.email-card {
  display: block;
  flex: 1;
  width: 100%;
  perspective: 900px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.email-flip {
  display: block;
  position: relative;
  min-height: 5.25rem;
  transform-style: preserve-3d;
  transition: transform 620ms var(--spring);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.email-card.is-flipped .email-flip { transform: rotateX(180deg); }

.email-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 1.1rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.2;
}

.email-back {
  transform: rotateX(180deg);
  color: var(--accent-status);
}

.icon-btn {
  width: 5.25rem;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-stack { display: flex; flex-direction: column; gap: 0.55rem; }

.profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "kicker arrow"
    "title arrow"
    "body arrow";
  gap: 0.15rem 0.8rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: inherit;
  text-decoration: none;
}

.profile-card .kicker { grid-area: kicker; margin: 0; }
.profile-card strong {
  grid-area: title;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
}
.profile-card span:last-of-type,
.profile-body { grid-area: body; color: var(--ink-muted); font-size: 0.92rem; }
.profile-arrow {
  grid-area: arrow;
  align-self: center;
  color: var(--ink-muted);
  transition: transform 180ms var(--ease), color 180ms linear;
}
.profile-card:hover .profile-arrow {
  transform: translateX(4px);
  color: var(--accent-primary);
}

.colophon {
  margin-top: 2.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-hairline);
}

.colophon-edition {
  margin-bottom: 0.45rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-stamp);
}

.colophon-line {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.45;
}

/* Responsive */

@media (max-width: 980px) {
  .folio-grid { grid-template-columns: 1fr 1fr; }
  .folio-edition, .folio-clock, .folio-tools { grid-column: auto; }
  .folio-clock, .folio-tools { border-left: 0; }
  .folio-clock { border-left: 1px solid var(--border-hairline); }
  .folio-tools {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-hairline);
    justify-content: flex-end;
  }

  .mast-grid, .hero-grid, .mail-grid, .reader-grid, .matrix-grid {
    grid-template-columns: 1fr;
  }

  .mast-toc {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--border-hairline);
    padding-top: 1.2rem;
  }

  .spot + .spot {
    border-left: 0;
    border-top: 1px solid var(--border-hairline);
  }
}

@media (max-width: 720px) {
  .wrap { width: min(1180px, calc(100% - 1.4rem)); }
  .band > .wrap, .mast-band > .wrap { padding-block: 1.55rem; }
  .mast-band > .wrap { padding-block: 1.2rem 0.9rem; }

  .folio-strip { margin-top: 0.35rem; letter-spacing: 0.04em; }
  .folio-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "edition clock"
      "tools tools";
  }
  .folio-cell { padding: 0.38rem 0; border: 0; }
  .folio-edition { grid-area: edition; }
  .folio-clock {
    grid-area: clock;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    border: 0;
  }
  .folio-role,
  .folio-ext,
  .folio-locale > .folio-line > span,
  .folio-tools > .folio-line > span { display: none; }
  .folio-locale {
    grid-area: locale;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    border: 0;
  }
  .folio-tools {
    grid-area: tools;
    justify-content: flex-end;
    border: 0;
  }
  .folio-tools .seg button {
    font-size: 0;
    gap: 0;
    padding: 0.36rem 0.46rem;
  }
  .folio-tools .mark { width: 0.95rem; height: 0.95rem; }

  .nameplate h1 { max-width: none; font-size: 2.7rem; }
  .subtitle { font-size: 1.12rem; margin-top: 0.7rem; }
  .hero-copy { margin-top: 1rem; line-height: 1.6; }
  .hero-copy p + p { margin-top: 0.75rem; }
  .lede, .work-lede { line-height: 1.6; }
  .actions { margin-top: 1.1rem; }

  .now { padding: 0.7rem 0.8rem 0.15rem; }
  .now-row {
    grid-template-columns: minmax(5.8rem, 6.6rem) minmax(0, 1fr);
    padding: 0.5rem 0;
    gap: 0.35rem 0.6rem;
  }
  .now dd { font-size: 1.02rem; }

  .reader-nav, .note-top { grid-template-columns: 1fr; }

  .chrome-bar, .viewport-foot, .reader-chrome { flex-wrap: wrap; }

  .note-top {
    grid-template-columns: 2rem auto minmax(0, 1fr) auto;
    grid-template-areas:
      "idx title title arrow"
      "idx date cat time";
    gap: 0.18rem 0.5rem;
    align-items: start;
    padding: 0.72rem 0.05rem 0.62rem;
  }
  .note-idx { grid-area: idx; padding-top: 0.28rem; }
  .note-title { grid-area: title; font-size: 1.16rem; }
  .note-arrow { grid-area: arrow; padding-left: 0.4rem; }
  .note-date { grid-area: date; }
  .note-time { grid-area: time; justify-self: end; }
  .note-cat {
    grid-area: cat;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .note-cat::before { content: "·"; margin-right: 0.35rem; }

  .note-excerpt { padding: 0 0.15rem 0.85rem; }

  .filters {
    flex-wrap: wrap;
    overflow: visible;
    margin-top: 0.9rem;
  }
  .filters button,
  .filters button[aria-pressed="true"] {
    flex: none;
    white-space: nowrap;
    padding: 0.5rem 0.65rem;
    margin-bottom: 0;
    border-bottom-width: 0;
  }
  .filter-count {
    width: auto;
    flex: none;
    margin-left: 0.15rem;
    padding: 0.5rem 0.15rem;
    white-space: nowrap;
  }

  .stark-bar {
    flex-wrap: wrap;
    overflow: visible;
    align-items: flex-start;
    row-gap: 0.4rem;
  }
  .stark-controls { flex-wrap: wrap; width: 100%; }
  .stark-controls .seg,
  .stark-controls .text-btn,
  .stark-controls .seg button { flex: none; white-space: nowrap; }
  .stark-spec { display: none; }

  .mail-actions { flex-direction: row; }
  .email-flip { min-height: 3.5rem; }
  .email-face { font-size: 1.2rem; }
  .icon-btn { width: 3.25rem; min-height: 3.5rem; flex: none; }

  .compass {
    top: auto;
    bottom: 0.55rem;
    right: 0.45rem;
  }
  .compass-btn {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--bg-canvas);
    outline: 4px solid var(--bg-canvas);
  }
  .compass-pop {
    top: auto;
    bottom: calc(100% + 0.4rem);
  }

  .reader-esc { display: none; }
}

@media (hover: none) {
  .note-hit, .toc-link { grid-template-rows: auto 1fr; }
}

@media (max-width: 720px) {
  .toc-link,
  .note-hit { grid-template-rows: auto 0fr; }
  body { padding-bottom: 3.6rem; }
  html { scroll-padding-bottom: 3.6rem; }
}

.kicker[lang="ml"],
.seg button[lang="ml"],
.steps li[lang="ml"],
.filters button [lang="ml"],
.btn [lang="ml"],
.text-btn [lang="ml"],
.reader-back [lang="ml"],
.reader-focus [lang="ml"],
.metric-label[lang="ml"],
.note-cat[lang="ml"],
.note-time[lang="ml"],
.note-date[lang="ml"],
.folio-strip [lang="ml"],
.compass-pop [lang="ml"],
.spot h3 [lang="ml"],
.colophon-edition[lang="ml"],
.viewport-foot [lang="ml"],
.stark-spec[lang="ml"] {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--malayalam);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .rise { transform: none; }
  .email-flip { transform: none !important; }
  .email-back { transform: none; visibility: hidden; }
  .email-card.is-flipped .email-front { visibility: hidden; }
  .email-card.is-flipped .email-back { visibility: visible; }
}

@media (forced-colors: active) {
  .folio-strip, .band, .viewport, .now, .email-flip, .profile-card,
  .pill, .note-hit, .compass-btn, .compass-pop, .matrix {
    border-color: CanvasText;
  }
  .pulse, .reg, .reader-progress > span { background: CanvasText; }
}

@media print {
  body::before, .compass, .folio-strip, .skip, .reader { display: none !important; }
  .note-hit { grid-template-rows: auto 1fr; }
  #essay-store {
    display: block !important;
  }
  #essay-store article {
    break-inside: avoid;
    margin-top: 1.5rem;
  }
}
