/* Rocin GitHub Pages — Warm Paper & Sepia Night with 7:1+ WCAG AAA/AA contrast */

:root,
[data-theme="paper"] {
  --bg: #eae2cc;
  --bg-alt: #e2dac4;
  --surface: #f2ecdc;
  --ink: #24201b;
  --ink-strong: #171411;
  --muted: #453e34;
  --border: #b8ae97;
  --border-strong: #6e6658;
  --accent: #24201b;
  --accent-ink: #f2ecdc;
  --focus-ring: #171411;
  --code-bg: #1e1b17;
  --code-bar-bg: #2a251e;
  --code-ink: #efe6d6;
  --code-comment: #c7bba5;
  --shadow: rgba(36, 32, 27, 0.14);
}

[data-theme="sepia-night"] {
  --bg: #1c1915;
  --bg-alt: #24201b;
  --surface: #2b2620;
  --ink: #e5dccb;
  --ink-strong: #f5eee0;
  --muted: #c2b7a3;
  --border: #4a4237;
  --border-strong: #8a7f6e;
  --accent: #e5dccb;
  --accent-ink: #1c1915;
  --focus-ring: #f5eee0;
  --code-bg: #14120f;
  --code-bar-bg: #211d18;
  --code-ink: #efe6d6;
  --code-comment: #c7bba5;
  --shadow: rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.05rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink-strong);
}

code,
pre,
.eyebrow,
.brand,
.nav-desktop,
.mobile-nav,
.btn,
.quiet-link,
.inline-cta,
.terminal-bar,
.copy-btn,
.zoom-badge,
.step-num,
.disclosure-summary,
.data-table th,
figcaption code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* Accessibility utilities */
.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: -9999px;
  top: 0.5rem;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.7rem 1rem;
  font-family: ui-monospace, monospace;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.75rem;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
pre:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.wrap {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

section[id] {
  scroll-margin-top: 5.2rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-alt);
  border-bottom: 1.5px solid var(--border);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink-strong);
  min-height: 44px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-mark {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.6rem;
  font-size: 0.94rem;
}

.brand-sub {
  font-size: 0.88rem;
  color: var(--muted);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.nav-desktop a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.5rem 0.15rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--ink-strong);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.nav-social {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding-left: 0.45rem;
  border-left: 1px solid var(--border);
}

.nav-desktop .nav-icon-link {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
  border-bottom: none;
  color: var(--ink);
}

.nav-desktop .nav-icon-link:hover {
  background: var(--surface);
  color: var(--ink-strong);
}

.nav-icon-link svg {
  display: block;
}

.theme-btn {
  background: var(--surface);
  color: var(--ink-strong);
  border: 1.5px solid var(--border-strong);
  padding: 0.5rem 0.9rem;
  min-height: 44px;
  min-width: 44px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.theme-btn:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: relative;
}

.mobile-nav-trigger {
  list-style: none;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink-strong);
  border: 1.5px solid var(--border-strong);
  padding: 0.5rem 1rem;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 700;
}

.mobile-nav-trigger::-webkit-details-marker {
  display: none;
}

.mobile-nav-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: min(260px, 86vw);
  background: var(--surface);
  border: 2px solid var(--border-strong);
  box-shadow: 0 12px 30px var(--shadow);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav-panel a {
  color: var(--ink-strong);
  text-decoration: none;
  padding: 0.6rem 0.65rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
}

.mobile-nav-panel a:hover {
  background: var(--bg-alt);
}

.mobile-nav-panel .theme-btn {
  margin-top: 0.35rem;
  width: 100%;
}

/* Hero */
.hero {
  padding: 3.4rem 0 3.2rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

h1,
h2,
h3 {
  color: var(--ink-strong);
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: clamp(2.15rem, 4.6vw, 3.35rem);
  max-width: 18ch;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  margin-bottom: 0.85rem;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.55rem;
}

.lead {
  font-size: 1.22rem;
  max-width: 62ch;
  color: var(--ink);
  margin: 0 0 1.25rem;
}

.anatomy-list {
  list-style: none;
  padding: 0.9rem 1.15rem;
  margin: 0 0 1.75rem;
  max-width: 66ch;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.anatomy-list li {
  margin: 0.25rem 0;
  font-size: 1rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0.75rem 1.35rem;
  min-height: 46px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid var(--accent);
  transition: transform 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink-strong);
}

.quiet-link,
.inline-cta {
  color: var(--ink-strong);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 0.45rem 0.2rem;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.inline-cta {
  display: inline;
  padding: 0.15rem 0.1rem;
  min-height: 0;
}

/* Screenshots + Zoom Lightbox Trigger */
.shot-frame {
  margin: 0;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  padding: 0.55rem;
  box-shadow: 0 14px 36px var(--shadow);
}

.compact-shot {
  margin-bottom: 0.9rem;
  box-shadow: 0 8px 20px var(--shadow);
}

.shot-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

.shot-trigger img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
}

.zoom-badge {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--accent-ink);
}

.shot-frame figcaption {
  padding: 0.75rem 0.45rem 0.25rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.dataview-shot {
  margin-top: 2.2rem;
}

/* Sections */
.section {
  padding: 3.6rem 0;
}

.section-tinted {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-intro {
  max-width: 68ch;
  font-size: 1.08rem;
  color: var(--muted);
  margin: 0 0 1.85rem;
}

/* Progressive Disclosures */
.disclosure {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
}

.disclosure-summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 1.1rem;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--ink-strong);
  background: var(--surface);
}

.disclosure-summary::-webkit-details-marker {
  display: none;
}

.disclosure-summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1rem;
  font-weight: 700;
}

.disclosure[open] .disclosure-summary {
  border-bottom: 1.5px solid var(--border);
}

.disclosure[open] .disclosure-summary::after {
  content: "−";
}

.disclosure-body {
  padding: 1.25rem;
}

/* Walkthrough Steps */
.step-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.4rem;
}

.step-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.step-head h3 {
  margin: 0;
}

.step-num {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.95rem;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* Cards & Grids */
.pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 1.4rem;
}

.card h2 {
  font-size: 1.22rem;
  margin-bottom: 0.55rem;
}

.card p {
  margin: 0 0 0.75rem;
  font-size: 0.99rem;
  color: var(--muted);
}

.card p:last-child {
  margin-bottom: 0;
}

.stack-gap {
  margin-bottom: 0.85rem;
}

.fine-note {
  font-size: 0.92rem !important;
  color: var(--muted);
  margin-top: 0.25rem !important;
}

/* Feature Splits */
.feature-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 2.2rem;
  align-items: center;
  margin-bottom: 3rem;
}

.feature-split:last-child {
  margin-bottom: 0;
}

.feature-split.reverse .feature-copy {
  order: 2;
}

.check-list {
  padding-left: 1.2rem;
  margin: 0.9rem 0 0;
}

.check-list li {
  margin-bottom: 0.6rem;
}

/* Terminal / Code Cards */
.story-card,
.terminal-card {
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1.5px solid var(--border-strong);
  overflow: hidden;
}

.story-card {
  max-width: 840px;
}

.cli-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 1.2rem;
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--code-bar-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.35rem 0.6rem 0.35rem 0.9rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--code-comment);
}

.copy-btn {
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1.5px solid var(--code-comment);
  padding: 0.45rem 0.85rem;
  min-height: 44px;
  min-width: 44px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: var(--code-ink);
  color: var(--code-bg);
}

.story-card pre,
.terminal-card pre {
  margin: 0;
  padding: 1.05rem 1.15rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  background: var(--code-bg);
  color: var(--code-ink);
}

pre > code {
  background: transparent;
  color: inherit;
  border: none;
  padding: 0;
  font-size: inherit;
}

.story-card .c,
.terminal-card .c {
  color: var(--code-comment);
}

.copy-fallback {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.65rem 1.15rem;
  border: 0;
  border-top: 1px solid var(--border-strong);
  background: var(--code-bar-bg);
  color: var(--code-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: none;
}

/* Inline code only (never matches pre > code inside lists) */
:not(pre) > code {
  background: var(--surface);
  color: var(--ink-strong);
  border: 1px solid var(--border);
  padding: 0.08rem 0.35rem;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

/* Install Steps (explicit 2-column sequential layout on desktop) */
.install-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1.8rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.storage-callout,
.tradeoff-note {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-left: 5px solid var(--accent);
  padding: 1.25rem 1.45rem;
}

.storage-callout p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.storage-callout a {
  color: var(--ink-strong);
  font-weight: 600;
}

.tradeoff-note {
  margin: 1.4rem 0 0;
  color: var(--ink);
  font-size: 0.98rem;
}

/* Tables */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 2rem;
}

.table-scroll {
  overflow-x: auto;
  border: 1.5px solid var(--border);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--bg);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-strong);
}

.compare-table td:nth-child(2),
.compare-table th:nth-child(2) {
  background: var(--bg-alt);
  font-weight: 700;
  color: var(--ink-strong);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}

.faq-grid h3 {
  font-size: 1.12rem;
  margin-bottom: 0.55rem;
}

/* Lightbox Dialog */
.lightbox {
  max-width: min(1280px, 95vw);
  max-height: 92vh;
  padding: 0;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
}

.lightbox::backdrop {
  background: rgba(20, 18, 15, 0.78);
}

.lightbox-inner {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lightbox-close {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1.5px solid var(--accent);
  padding: 0.5rem 1.05rem;
  min-height: 44px;
  min-width: 44px;
  font-family: ui-monospace, monospace;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
}

.lightbox-caption {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
}

/* Closing CTA */
.closing-cta {
  background: var(--bg-alt);
  border-top: 1.5px solid var(--border);
  padding: 3rem 0;
}

.closing-cta-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem 2.2rem;
  flex-wrap: wrap;
}

.closing-cta-inner h2 {
  margin-bottom: 0.45rem;
}

.closing-cta-copy {
  margin: 0;
  color: var(--muted);
  max-width: 56ch;
}

.closing-cta-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Footer */
.site-footer {
  background: var(--bg-alt);
  border-top: 1.5px solid var(--border);
  padding: 1.8rem 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-row p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--ink-strong);
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 1060px) {
  .nav-desktop {
    gap: 0.72rem;
    font-size: 0.86rem;
  }
}

@media (max-width: 920px) {
  .nav-desktop {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .feature-split,
  .feature-split.reverse {
    grid-template-columns: 1fr;
  }

  .feature-split.reverse .feature-copy {
    order: 0;
  }

  .hero {
    padding: 2.4rem 0 2.2rem;
  }
}

@media (max-width: 760px) {
  .install-steps {
    grid-template-columns: 1fr;
  }
}
