/* RupeeClarity landing + terminal chrome.
   Terminal behaviour is unchanged: app.js still targets #terminal, #status,
   #line, #inputbar, #restart, #download and [data-send]. */

:root {
  --navy: #10233A;
  --navy-deep: #0B1A2C;
  --navy-mid: #1A3654;
  --ink: #1C2836;
  --muted-ink: #4A5560;
  --cream: #F6F1E6;
  --cream-dark: #E8E0CE;
  --paper: #FFFBF3;
  --gold: #C9A35A;
  --gold-bright: #E0C37A;
  --gold-deep: #6F531C;
  --line: #D7CDB6;
  --term-bg: #0d1117;
  --term-line: #2A3340;
  --term-text: #e6edf3;
  --term-muted: #9AA4B0;
  --focus: #C9A35A;
  --max: 68rem;
  --font-serif: "Fraunces", "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-sans: "Public Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  scroll-padding-top: 4.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font: 1.0625rem/1.6 var(--font-sans);
  min-height: 100%;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: #163A5F; text-underline-offset: 0.15em; }
a:hover { color: #0B1A2C; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: inherit;
}

h1 { font-size: clamp(2.4rem, 6.2vw, 3.8rem); margin: 0 0 0.35rem; font-weight: 650; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.25rem); margin: 0 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.35rem; font-weight: 650; }

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

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100%;
  z-index: 100;
  background: var(--gold);
  color: var(--navy-deep);
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 0.75rem;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.btn {
  appearance: none;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-bright);
  padding: 0.55rem 1rem;
  border-radius: 4px;
  font: 600 0.9375rem/1.2 var(--font-sans);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn:hover:not(:disabled) { background: rgba(201, 163, 90, 0.14); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-deep);
}
.btn.primary:hover:not(:disabled) { background: var(--gold-bright); border-color: var(--gold-bright); }
.btn.ghost {
  border-color: var(--gold-bright);
  color: var(--cream);
}
.paper .btn {
  color: var(--navy);
  border-color: var(--navy-mid);
}
.paper .btn:hover:not(:disabled) { background: rgba(16, 35, 58, 0.06); }

/* ----- Header ----- */
.site-header {
  background: var(--navy-deep);
  color: var(--cream);
  border-bottom: 1px solid rgba(201, 163, 90, 0.35);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--cream);
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 650;
  font-size: 1.2rem;
}
.wordmark:hover { color: var(--gold-bright); }
.mark {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.3rem;
  background: var(--gold);
  color: var(--navy-deep);
  font-family: var(--font-serif);
  font-weight: 650;
  font-size: 1.15rem;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.site-nav a {
  color: var(--cream);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}

/* ----- Hero ----- */
.hero {
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(201, 163, 90, 0.16), transparent 55%),
    var(--navy);
  color: var(--cream);
  padding: clamp(1.8rem, 4.5vw, 3.2rem) 1.25rem 2.4rem;
  text-align: center;
}
.eyebrow {
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-bright);
}
.tagline {
  margin: 0 auto 1.25rem;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.6vw, 1.65rem);
  color: var(--gold-bright);
}
.tagline::after {
  content: "";
  display: block;
  width: 3.25rem;
  height: 2px;
  background: var(--gold);
  margin: 1.1rem auto 0;
}
.lede {
  max-width: 38rem;
  margin: 0 auto 1.5rem;
  font-size: 1.08rem;
  color: #F0E6D0;
}
.byline {
  list-style: none;
  margin: 0 auto 1.1rem;
  padding: 0;
  max-width: 36rem;
  color: #E4D8BE;
  font-size: 0.98rem;
}
.byline li + li { margin-top: 0.2rem; }
.disclaimer {
  max-width: 36rem;
  margin: 0 auto 1.6rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--term-muted);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin: 0;
}

/* ----- Shared sections ----- */
.section-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section-kicker {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold-bright);
}
.section-kicker.ink { color: var(--gold-deep); }
.section-lead {
  max-width: 42rem;
  margin: 0 0 1.6rem;
  color: #E4D8BE;
}
.section-lead.ink { color: var(--muted-ink); }
.paper {
  background: var(--cream);
  color: var(--ink);
  padding: clamp(2.4rem, 5vw, 3.6rem) 0;
  border-top: 1px solid var(--line);
}
.paper:nth-of-type(even) { background: var(--paper); }

/* ----- Run / terminal ----- */
.run {
  background: var(--navy-deep);
  color: var(--cream);
  padding: clamp(2.4rem, 5vw, 3.6rem) 0 3rem;
}
.run-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}
.window {
  border: 1px solid var(--term-line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--term-bg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  background: #161b22;
  border-bottom: 1px solid var(--term-line);
  font-size: 0.78rem;
  color: var(--term-muted);
}
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.r { background: #ff5f57; }
.y { background: #febc2e; }
.g { background: #28c840; }
.wtitle {
  margin-left: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 99px;
  border: 1px solid var(--term-line);
  white-space: nowrap;
}
.status.live { color: var(--gold-bright); border-color: #6b5414; }
.status.ended { color: #f0b429; border-color: #6b5414; }
#terminal { height: min(62vh, 560px); padding: 8px 6px 6px 10px; }

.inputbar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.inputbar input {
  flex: 1;
  min-width: 0;
  background: var(--term-bg);
  border: 1px solid var(--term-line);
  color: var(--term-text);
  border-radius: 8px;
  padding: 12px 14px;
  font: 16px var(--font-mono);
}
.send { padding: 0 18px; font-size: 15px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.chip {
  appearance: none;
  border: 1px solid var(--term-line);
  background: #11161d;
  color: var(--term-text);
  border-radius: 99px;
  padding: 6px 12px;
  font: 13px var(--font-sans);
  cursor: pointer;
}
.chip:hover { border-color: var(--gold); }
.chip.wide { border-color: #6b5414; color: var(--gold-bright); }
.hint {
  color: var(--term-muted);
  font-size: 0.9rem;
  margin: 12px 2px 0;
}

/* ----- Modules ----- */
.modules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem 1.75rem;
  counter-reset: mod;
}
.modules li {
  counter-increment: mod;
  padding-left: 3.1rem;
  position: relative;
  min-width: 0;
}
.modules li::before {
  content: counter(mod, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
}
.modules p { margin: 0; color: var(--muted-ink); }

@media (min-width: 720px) {
  .modules { grid-template-columns: 1fr 1fr; }
}

/* ----- Example table ----- */
.table-wrap { overflow-x: auto; margin: 0 0 1.1rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  background: var(--paper);
  min-width: 20rem;
}
caption {
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted-ink);
  margin-bottom: 0.6rem;
  caption-side: top;
}
th, td {
  border: 1px solid var(--line);
  padding: 0.7rem 0.85rem;
  text-align: left;
}
thead th {
  background: var(--navy);
  color: var(--cream);
  font-weight: 600;
  font-size: 0.92rem;
}
tbody th { font-weight: 600; }
td { text-align: right; font-family: var(--font-mono); font-size: 0.95rem; }
tr.highlight td,
tr.highlight th {
  background: #F3E6C4;
  font-weight: 600;
}
.example-note {
  margin: 0;
  max-width: 42rem;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--navy);
}

/* ----- Screenshots ----- */
.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111;
}
.gallery figcaption {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: var(--muted-ink);
}
@media (min-width: 640px) {
  .gallery { grid-template-columns: 1fr 1fr; }
}

/* ----- Video ----- */
.video-wrap {
  background: #000;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.video-wrap video { width: 100%; height: auto; vertical-align: middle; }
.video-fallback { margin: 0.75rem 0 0; font-size: 0.9rem; color: var(--muted-ink); }

/* ----- Downloads ----- */
.downloads {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  border-top: 1px solid var(--line);
}
.downloads li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.downloads a { font-weight: 600; }
.downloads span {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted-ink);
  overflow-wrap: anywhere;
}
.subhead { margin: 0 0 0.5rem; }
.install {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: stretch;
  margin-top: 0.8rem;
}
.install pre {
  flex: 1 1 16rem;
  min-width: 0;
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--navy-deep);
  color: var(--cream);
  border-radius: 6px;
  overflow-x: auto;
  font: 0.82rem/1.5 var(--font-mono);
}
.install pre code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.install .btn {
  align-self: center;
  color: var(--navy-deep);
  background: var(--gold);
  border-color: var(--gold);
}

/* ----- Documents ----- */
.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.doc-list li:first-child { border-top: 1px solid var(--line); }
.doc-list a { font-weight: 600; }

/* ----- Footer ----- */
.site-footer {
  background: var(--navy-deep);
  color: #C9C2B3;
  padding: 2rem 0 2.4rem;
  font-size: 0.9rem;
  border-top: 1px solid rgba(201, 163, 90, 0.35);
}
.site-footer p { margin: 0 0 0.7rem; max-width: 46rem; }
.site-footer a { color: var(--gold-bright); }

@media (max-width: 640px) {
  .header-inner { padding: 0.65rem 0.85rem; }
  .section-inner { padding: 0 0.85rem; }
  .hero { padding: 2rem 0.85rem 2.5rem; }
  #terminal { height: 56vh; padding: 6px 2px 4px 6px; }
  h1 { font-size: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
