/* ──────────────────────────────────────────────────────────────────────────
   Canvas Viewer homepage — shared styles for index.html and the three
   install pages. Ported from the "Classical" design system; the tokens below
   are the source of truth for the palette, so retune here, not in rules.
   ────────────────────────────────────────────────────────────────────── */

:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201f1d;
  --color-accent: #b68235;
  --color-divider: color-mix(in srgb, #201f1d 16%, transparent);

  --color-neutral-100: #f8f4f4;
  --color-neutral-200: #eae7e7;
  --color-neutral-300: #d7d3d3;
  --color-neutral-400: #bab6b6;
  --color-neutral-500: #9b9797;
  --color-neutral-600: #7d7979;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;
  --color-neutral-900: #2d2b2b;

  --color-accent-100: #fff3e4;
  --color-accent-200: #ffe3bf;
  --color-accent-300: #facb8d;
  --color-accent-400: #e1ad66;
  --color-accent-500: #c28d41;
  --color-accent-600: #a06f24;
  --color-accent-700: #7d5411;
  --color-accent-800: #5a3b0a;
  --color-accent-900: #3a270d;

  --font-heading: "Cormorant Garamond", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Lora", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --space-1: 4.6px;
  --space-2: 9.2px;
  --space-3: 13.8px;
  --space-4: 18.4px;
  --space-6: 27.6px;
  --space-8: 36.8px;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 7px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
}

p { margin: 0 0 var(--space-3); text-wrap: pretty; }

a {
  color: var(--color-accent-700);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--color-accent-800); text-decoration-thickness: 2px; }

strong { font-weight: 600; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.btn-primary:active { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* ── tables ── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 1px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.table-scroll { overflow-x: auto; }
.table-scroll .table { min-width: 560px; }

/* ══════════════════════════════════════════════════════════════════════════
   Page furniture
   ══════════════════════════════════════════════════════════════════════ */

.wrap {
  max-width: 880px;
  margin: 0 auto;
}

/* ── masthead ── */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
}
.masthead-brand {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-text);
  text-decoration: none;
}
.masthead-brand:hover { color: var(--color-text); }
.masthead-links {
  display: flex;
  gap: var(--space-6);
  font-size: 13.5px;
}

/* ── hero ── */
.hero {
  padding: var(--space-8) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border-bottom: 1px solid var(--color-accent);
}
.hero-kicker {
  font-family: var(--font-heading);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-700);
  font-feature-settings: 'tnum';
}
.hero h1 {
  margin: 0;
  font-size: 58px;
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.01em;
  max-width: 22ch;
}
.hero-sub {
  margin: 0;
  font-size: 19px;
  line-height: 1.6;
  max-width: 54ch;
  color: var(--color-neutral-800);
}
.hero-cta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

/* The install pages run a shorter hero than the homepage. */
.hero-sub-page h1 { font-size: 48px; line-height: 1.08; letter-spacing: normal; max-width: 24ch; }
.hero-sub-page .hero-sub { font-size: 18px; line-height: 1.65; max-width: 56ch; }

/* ── labelled rows ── */
.row {
  padding: var(--space-8) var(--space-6);
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: var(--space-8);
  border-bottom: 1px solid var(--color-divider);
}
/* Keeps a scrollable table or code block from widening its own track. */
.row > * { min-width: 0; }
.row-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: normal;
}

/* ── plain full-width band ── */
.band {
  padding: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.band-ruled { border-bottom: 1px solid var(--color-divider); }

/* ── prose ── */
.prose {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  font-size: 16px;
  line-height: 1.75;
}
.prose p { margin: 0; }
.prose-tight { gap: var(--space-3); }
.prose-small {
  font-size: 15.5px;
  line-height: 1.7;
  gap: var(--space-2);
}

/* ── "things you can ask" ── */
.asks { display: flex; flex-direction: column; }
.asks > * {
  font-family: var(--font-heading);
  font-size: 20px;
  font-style: italic;
  line-height: 1.35;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-divider);
}
.asks > *:last-child { border-bottom: 0; }

/* ── install ── */
.install {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.install > p { margin: 0; font-size: 16px; line-height: 1.75; }

.subhead {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
}
.subhead-lg { font-size: 19px; }

.ruled-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-6);
}

.col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.col p { margin: 0; font-size: 15.5px; line-height: 1.7; }

/* The A / B / C option buttons. */
.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

/* ── numbered steps ── */
.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.step { display: flex; gap: var(--space-4); }
.step-num {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-accent-700);
  font-feature-settings: 'tnum';
}
.step p { margin: 0; font-size: 16px; line-height: 1.75; }

/* ── code and inline literals ── */
.code {
  border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius-md);
  background: var(--color-neutral-100);
  padding: var(--space-4);
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.8;
  overflow-x: auto;
  white-space: pre;
}
.mono { font-family: var(--font-mono); font-size: 14px; }
.url {
  font-family: var(--font-heading);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* What you say to Claude — an accent-ruled quotation, not a shell command. */
.prompt {
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-heading);
  font-size: 17px;
  font-style: italic;
  line-height: 1.5;
  color: var(--color-accent-800);
}

/* Railway's own brand-kit button (railway-button.svg, vendored from
   railway.com/button.svg so the page makes no third-party request). It carries
   its own shape and color, so it gets no .btn styling. */
.railway-button {
  display: inline-flex;
  text-decoration: none;
  border-radius: var(--radius-lg);
}
.railway-button img { display: block; height: auto; }
.railway-button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

/* ── copy-to-clipboard (see copy.js; the wrapper is added at runtime) ── */
.copy-wrap { position: relative; }

/* Keep the first line clear of the button. */
.copy-wrap > .code, .copy-wrap > .prompt {
  padding-right: calc(var(--space-4) + 64px);
}

.copy-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
  padding: 2px 9px;
  cursor: pointer;
  color: var(--color-neutral-700);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  transition: color 0.12s, border-color 0.12s, background-color 0.12s;
}
.copy-wrap-code .copy-btn { background: var(--color-neutral-100); }
.copy-wrap-prompt .copy-btn { background: var(--color-bg); }

.copy-btn:hover {
  color: var(--color-accent-800);
  border-color: var(--color-accent);
}
.copy-btn.is-copied {
  color: var(--color-accent-800);
  border-color: var(--color-accent);
  background: var(--color-accent-100);
}

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

.deploy-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-4);
}
.deploy-note { font-size: 14px; color: var(--color-neutral-700); }

/* ── colophon ── */
.colophon {
  padding: var(--space-4) var(--space-6) var(--space-8);
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--color-neutral-700);
}
.colophon-ruled { border-top: 1px solid var(--color-divider); }
.colophon-mit { font-feature-settings: 'tnum'; }

/* ── narrow screens ──
   The design is drawn at desktop width; these are the rules that keep the
   150px label column from strangling the text on a phone. */
@media (max-width: 720px) {
  .row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
    padding: var(--space-6) var(--space-4);
  }
  .band, .hero { padding-inline: var(--space-4); }
  .masthead, .colophon { padding-inline: var(--space-4); }
  .hero { padding-top: var(--space-6); }
  .hero h1 { font-size: 40px; }
  .hero-sub-page h1 { font-size: 34px; }
  .hero-sub { font-size: 17px; }
}
