/* Scripta landing page. No build step, no dependencies. */

:root {
  color-scheme: dark;
  --bg: #1B2130;
  --surface: #222939;
  --border: #343C50;
  --text: #E9E2D2;
  --muted: #A9B0BF;
  --accent: #D9733A;        /* brand accent: borders, marks, button fill */
  --accent-text: #E8894F;   /* accent used as text; 6:1 on --bg */
  --on-accent: #12161F;
  --focus: #F2A777;

  /* Code blocks stay dark in both themes */
  --code-bg: #141925;
  --code-border: #2C3446;
  --code-text: #E9E2D2;
  --hl-keyword: #E8894F;
  --hl-type: #8FB8DE;
  --hl-string: #A8C686;
  --hl-number: #D6B26E;
  --hl-annotation: #D6B26E;
  --hl-comment: #8A92A3;
  --hl-method: #E9E2D2;
  --hl-tag: #8FB8DE;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 10px;
  --measure: 68ch;
  --page: 64rem;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #F7F3EA;
    --surface: #FFFDF8;
    --border: #DDD5C4;
    --text: #1B2130;
    --muted: #4A5263;
    --accent: #A3501F;
    --accent-text: #A3501F;
    --on-accent: #FFFFFF;
    --focus: #A3501F;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent-text); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

code, pre { font-family: var(--font-mono); font-size: 0.9em; }

:not(pre) > code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.05em 0.35em;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Hero */

.hero {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
}

.hero .logo {
  width: 96px;
  height: 96px;
  margin: 0 auto 1.5rem;
  border-radius: 20px;
  box-shadow: 0 0 0 1px var(--border);
}

.hero h1 {
  font-size: clamp(2.75rem, 2rem + 4vw, 4.5rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.25em;
}

.tagline {
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.5rem);
  color: var(--muted);
  max-width: 34ch;
  margin: 0 auto 2rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.button-primary { background: var(--accent); color: var(--on-accent); }
.button-primary:hover { background: transparent; color: var(--accent-text); }
.button-secondary { color: var(--text); }
.button-secondary:hover { background: var(--accent); color: var(--on-accent); }
.button svg { width: 20px; height: 20px; fill: currentColor; }

.status {
  margin: 1.75rem auto 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Sections */

section { padding: 3.5rem 0; border-top: 1px solid var(--border); }

.lead { color: var(--muted); max-width: var(--measure); }

.name blockquote {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  border-left: 4px solid var(--accent);
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.9rem);
  font-style: italic;
  line-height: 1.35;
}
.name blockquote p { margin: 0; }
.name blockquote footer {
  margin-top: 0.4rem;
  font-size: 1rem;
  font-style: normal;
  color: var(--muted);
}
.name p { max-width: var(--measure); }

/* Code */

.code-grid { display: grid; gap: 1.25rem; }

.code {
  position: relative;
  margin: 0;
  min-width: 0;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code figcaption {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--code-border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--hl-comment);
}

.code pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  color: var(--code-text);
  line-height: 1.55;
  tab-size: 4;
}

.code pre:focus-visible { outline-offset: -3px; }

.copy {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  font: 600 0.75rem var(--font-sans);
  color: var(--code-text);
  background: transparent;
  border: 1px solid var(--code-border);
  border-radius: 6px;
  cursor: pointer;
}
.copy:hover { border-color: var(--hl-keyword); }

.k { color: var(--hl-keyword); }
.t { color: var(--hl-type); }
.s { color: var(--hl-string); }
.n { color: var(--hl-number); }
.a { color: var(--hl-annotation); }
.c { color: var(--hl-comment); font-style: italic; }
.m { color: var(--hl-method); font-weight: 600; }
.g { color: var(--hl-tag); }

.note {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Principles */

.cards {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.cards li {
  padding: 1.25rem 1.25rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
}
.cards p { margin: 0; color: var(--muted); font-size: 0.975rem; }

/* Quickstart */

.callout {
  max-width: var(--measure);
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}
.callout p:last-child { margin-bottom: 0; }

/* Roadmap */

.roadmap {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  max-width: var(--measure);
}

.roadmap li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.roadmap li:first-child { border-top: 1px solid var(--border); }

.badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.badge-active { border-color: var(--accent); color: var(--accent-text); }

/* Footer */

.site-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer .motto {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 1.15rem;
  font-style: italic;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 404 */

.not-found {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.not-found .hero { padding-bottom: 2rem; }

/* Larger screens */

@media (min-width: 40rem) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 6rem 0 4.5rem; }
  section { padding: 4.5rem 0; }
}

@media (min-width: 60rem) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}
