/* franka-rs landing page. No external fonts or scripts. */

:root {
  --bg: #f4efe6;
  --bg-2: #ebe4d7;
  --ink: #221f1c;
  --ink-2: #5d5750;
  --line: #d6cdbd;
  --accent: #bc3b18;
  --accent-ink: #ffffff;
  --dark: #16140f;
  --dark-2: #22201a;
  --dark-line: #3a362e;
  --dark-ink: #f1ebe0;
  --dark-ink-2: #b6ae9f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 40rem;
  --wide: 72rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h2 { font-size: clamp(2rem, 4.5vw, 3.5rem); }
h3 { font-size: 1.5rem; }

p { margin: 0 0 1em; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-2);
  padding: 0.05em 0.3em;
  border-radius: 3px;
}
pre { margin: 0; overflow-x: auto; }
pre code { background: none; padding: 0; font-size: 0.875rem; line-height: 1.6; }

strong { font-weight: 650; }

.skip {
  position: absolute; left: -999px; top: 0.5rem;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 0.5rem; }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--serif); font-size: 1.35rem; text-decoration: none;
}
.brand img { border-radius: 6px; }
.top nav { display: flex; gap: clamp(0.75rem, 2vw, 1.5rem); flex-wrap: wrap; font-size: 0.95rem; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; }

/* Hero */
.hero {
  padding: clamp(3rem, 6vw, 5rem) var(--gutter) clamp(3rem, 5vw, 4rem);
  max-width: var(--wide); margin: 0 auto;
}
.eyebrow {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.75rem, 7.5vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.hero h1::after { content: ""; display: block; width: 3rem; height: 4px; background: var(--accent); margin-top: 1.25rem; }
.lede { font-size: clamp(1.15rem, 2vw, 1.45rem); max-width: var(--measure); margin: 2rem 0; color: var(--ink-2); }
.lede strong { color: var(--ink); }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.btn {
  display: inline-block; padding: 0.75rem 1.4rem; border: 1.5px solid var(--ink);
  border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 1rem;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #b93a17; border-color: #b93a17; color: var(--accent-ink); }
.hero-code { max-width: 44rem; }
.hero-footnote { font-size: 0.85rem; color: var(--ink-2); }
.hero-footnote span { margin-inline: 0.4rem; color: var(--accent); }

/* Command blocks with copy buttons */
.cmd {
  position: relative;
  background: var(--dark);
  color: var(--dark-ink);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 0 0 0.9rem;
}
.cmd pre { padding-right: 4.5rem; }
.cmd .copy {
  position: absolute; top: 0.6rem; right: 0.6rem;
  font: 600 0.75rem var(--sans);
  background: var(--dark-2); color: var(--dark-ink);
  border: 1px solid var(--dark-line); border-radius: 6px;
  padding: 0.35rem 0.6rem; cursor: pointer;
}
.cmd .copy:hover { border-color: var(--accent); color: #fff; }
.cmd .copy.ok { border-color: #5ca86a; color: #a8e3b3; }
.cmd .copy.fail { border-color: var(--accent); color: #ffb39e; }

/* Sections */
section { padding: clamp(3rem, 7vw, 6rem) var(--gutter); }
section > h2, section > .lead, section > .note, section > .grid, section > .selector, section > .panels, section > details {
  max-width: var(--wide); margin-left: auto; margin-right: auto;
}
.lead { font-size: 1.15rem; max-width: var(--measure); color: var(--ink-2); }
.lead strong { color: inherit; }
.note { color: var(--ink-2); font-size: 0.95rem; margin-top: 1.5rem; }

.grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin-top: 2rem;
}
.grid article {
  border-top: 2px solid var(--ink);
  padding-top: 1rem;
}
.grid article h3 { margin-bottom: 0.5rem; }
.grid article p { color: var(--ink-2); }
.grid article a { font-weight: 600; }

/* Dark architecture section */
.dark {
  background: var(--dark);
  color: var(--dark-ink);
}
.dark .wrap { max-width: var(--wide); margin: 0 auto; }
.dark .lead { color: var(--dark-ink-2); }
.dark .lead strong { color: var(--dark-ink); }
.dark a { text-decoration-color: var(--accent); }
.dark code { background: var(--dark-2); }

.media { margin: 3rem 0 2rem; }
.media video, .media img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  background: var(--dark-2); border-radius: 10px; object-fit: cover;
}
.media figcaption, .diagram figcaption {
  margin-top: 0.75rem; font-size: 0.95rem; color: var(--dark-ink-2);
}

.diagram { margin: 2rem 0 3rem; }
.diagram svg { width: 100%; height: auto; display: block; font-family: var(--sans); }
.dg-box rect { fill: var(--dark-2); stroke: var(--dark-line); stroke-width: 1.5; }
.dg-accent rect { stroke: var(--accent); stroke-width: 2; }
.dg-h { fill: var(--dark-ink); font-family: var(--serif); font-size: 22px; text-anchor: middle; }
.dg-s { fill: var(--dark-ink-2); font-size: 13px; text-anchor: middle; }
.dg-l { fill: #f19a7d; font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-anchor: middle; text-transform: uppercase; }
.dg-link line { stroke: var(--accent); stroke-width: 2; }
.dg-opt line { stroke: var(--dark-ink-2); stroke-width: 1.5; stroke-dasharray: 5 5; }
.dg-note { font-style: italic; }

.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.facts li { border-top: 1px solid var(--dark-line); padding-top: 1rem; color: var(--dark-ink-2); }
.facts strong { color: var(--dark-ink); display: block; margin-bottom: 0.25rem; }

/* Get started: selector and panels */
.start { background: var(--bg-2); }
.start code { background: var(--bg); }
.start pre code { background: none; }
.selector {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem;
}
.selector a, .selector button {
  font: 600 0.95rem var(--sans);
  color: var(--ink); background: transparent;
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 0.55rem 1.1rem; text-decoration: none; cursor: pointer;
}
.selector a:hover, .selector button:hover { background: var(--ink); color: var(--bg); }
.selector button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.panels { margin-top: 2rem; }
.setup {
  padding: 2rem 0; border-top: 1px solid var(--line);
  max-width: var(--wide); margin: 0 auto;
}
.setup:first-child { border-top: 0; padding-top: 0.5rem; }
.setup[hidden] { display: none; }
.setup h3 { font-size: 1.75rem; }
.setup p { max-width: var(--measure); }
.setup .cmd { max-width: 52rem; }
.hint { color: var(--ink-2); font-size: 0.95rem; }
.demos { border-top: 1px solid var(--line); }
.demos .media { margin: 0; min-width: 0; }
.demos .media figcaption { color: var(--ink-2); }
.demos .media strong { color: var(--ink); }

/* FAQ */
.faq details {
  border-top: 1px solid var(--line); padding: 1rem 0;
}
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; font-family: var(--serif); font-size: 1.35rem; list-style: none;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-family: var(--mono); font-size: 1.25rem; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { max-width: var(--measure); margin: 0.75rem 0 0; color: var(--ink-2); }

/* Footer */
footer {
  padding: 3rem var(--gutter) 4rem; border-top: 1px solid var(--line);
  font-size: 0.9rem; color: var(--ink-2);
}
footer p { max-width: var(--wide); margin: 0 auto 0.75rem; }

/* Toast for copy feedback */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(1rem);
  background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: 8px;
  font-size: 0.9rem; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

@media (max-width: 640px) {
  .top { padding: 0.75rem 1rem; }
  .top nav { font-size: 0.9rem; }
  .cmd { padding: 0.85rem 1rem; }
  .cmd pre { padding-right: 0; padding-bottom: 2rem; }
  .diagram { margin-inline: calc(-1 * var(--gutter)); }
  .diagram svg { min-width: 60rem; }
  .diagram { overflow-x: auto; padding-inline: var(--gutter); }
}

@media print {
  .top nav, .copy, .toast, video { display: none; }
  .dark { background: none; color: var(--ink); }
}
