/* Chalkberry landing page. Plain CSS, no build step, no external requests. */

/* Archivo, self-hosted: Latin only, normal width, weights 400-700 (OFL, see fonts/OFL.txt). */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Arial resized to match Archivo, shown while Archivo loads, so the text
   doesn't jump when it swaps in. Same technique as Next.js's next/font. */
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial");
  size-adjust: 98.62%;
  ascent-override: 89.03%;
  descent-override: 21.29%;
  line-gap-override: 0%;
}

:root {
  --berry: #cc241d;
  --berry-dark: #a51c16;
  --radius: 14px;
  --width: 1080px;
}

/* Dark theme (default): an old-school slate chalkboard with a fine grain. */
:root {
  color-scheme: dark;
  --accent: #ef5b52;          /* red text and ticks, lifted to read on the board */
  --ink: #ece8e1;             /* chalk white */
  --muted: #a9b0aa;
  --paper: #1f2522;           /* the board */
  --card: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.12);
  --board: #161b19;
  --nav: rgba(31, 37, 34, 0.88);
  --shadow: rgba(0, 0, 0, 0.5);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Light theme: chosen when the system is set to light, or with the switch. */
:root[data-theme="light"] {
  color-scheme: light;
  --accent: #cc241d;
  --ink: #1f1d1b;
  --muted: #5f5a55;
  --paper: #fbf8f4;
  --card: #ffffff;
  --line: #e7e1d9;
  --board: #23272a;
  --nav: rgba(251, 248, 244, 0.9);
  --shadow: rgba(31, 29, 27, 0.25);
  --noise: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Archivo", "Archivo Fallback", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--noise), var(--paper);
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }

.wrap { max-width: var(--width); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }
section { padding: 88px 0; }
section h2 { text-align: center; margin-bottom: 1.2em; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--berry);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.button:hover { background: var(--berry-dark); transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.button-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.button-ghost:hover { background: var(--card); }
.button-small { padding: 8px 18px; font-size: 0.9rem; gap: 8px; }
/* The Windows logo, turned white so it reads on the red button. */
.button-icon { width: 1em; height: 1em; filter: brightness(0) invert(1); }

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a:not(.button) { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav-links a:not(.button):hover { color: var(--ink); }

/* Theme switch: a moon in the dark theme, a sun in the light one. */
.theme-switch {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.theme-switch:hover { background: var(--card); }
.theme-switch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.theme-switch svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }

/* Hero */
.hero { text-align: center; padding-top: 80px; }
.lead { font-size: 1.25rem; color: var(--muted); max-width: 640px; margin: 0 auto 1.6em; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.fine { font-size: 0.9rem; color: var(--muted); margin-top: 14px; }

/* A hand-drawn chalk underline, in the app's own spirit */
.underline {
  color: var(--accent);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M3 14 C 80 4, 200 4, 297 11' stroke='%23cc241d' stroke-width='5' fill='none' stroke-linecap='round' opacity='.55'/%3E%3C/svg%3E") bottom / 100% 0.3em no-repeat;
  padding-bottom: 0.12em;
}

/* Screenshots. The dashed box and file name show until the image exists. */
.shot {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 2px dashed var(--line);
  box-shadow: 0 20px 50px -20px var(--shadow);
}
.shot::before {
  content: "Screenshot: " attr(data-file);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.shot img, .shot video { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; }
.shot:has(img, video) { border-style: solid; border-color: transparent; }
/* Hide the file name while a video is still loading. */
.shot:has(img, video)::before { content: none; }
.shot-hero { margin-top: 56px; }

/* Problem */
.problem { background: var(--noise), var(--board); color: #f3efe9; text-align: center; }
.problem h2 { margin-bottom: 0.6em; }
/* The same hand-drawn chalk stroke as the hero, in light chalk for the dark board. */
.underline-light {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 20' preserveAspectRatio='none'%3E%3Cpath d='M3 14 C 80 4, 200 4, 297 11' stroke='%23f3efe9' stroke-width='4' fill='none' stroke-linecap='round' opacity='.35'/%3E%3C/svg%3E") bottom / 100% 0.25em no-repeat;
  padding-bottom: 0.15em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.problem-logo { display: block; margin: 0 auto 24px; }
.problem p { color: #c9c3bb; font-size: 1.15rem; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.steps p { color: var(--muted); margin: 0; }
.step-number {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--berry);
  color: #fff;
  font-weight: 700;
}

/* Features: text and screenshot side by side, alternating */
.features { background: var(--card); border-block: 1px solid var(--line); }
.feature { display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; align-items: center; margin-bottom: 88px; }
.feature:nth-of-type(even) { grid-template-columns: 1.4fr 1fr; }
.feature:nth-of-type(even) .feature-text { order: 2; }
.feature-text p { color: var(--muted); }
.extras { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 40px; }
.extras li { padding-left: 28px; position: relative; color: var(--muted); }
.extras li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.extras strong { color: var(--ink); }

/* Use cases */
.use-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.use-grid div { border-top: 3px solid var(--berry); padding-top: 16px; }
.use-grid p { color: var(--muted); margin: 0; }

/* Shortcuts */
.shortcuts { padding-top: 0; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
td { padding: 16px 24px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
td:last-child { text-align: right; }
kbd {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--paper);
  font-family: inherit;
  font-size: 0.85em;
}

/* FAQ */
.faq { background: var(--card); border-block: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); padding: 18px 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { color: var(--muted); margin: 12px 0 0; }
code { font-size: 0.9em; background: var(--paper); padding: 1px 6px; border-radius: 4px; }

/* Final call to action */
.final { text-align: center; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 0.9rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-inner span { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.footer nav { display: flex; gap: 24px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* Phones and small tablets */
@media (max-width: 820px) {
  section { padding: 64px 0; }
  .nav-links a:not(.button) { display: none; }
  .steps, .extras, .use-grid { grid-template-columns: 1fr; }
  .use-grid { grid-template-columns: 1fr 1fr; }
  .feature { grid-template-columns: 1fr; gap: 24px; margin-bottom: 64px; }
  .feature:nth-of-type(even) { grid-template-columns: 1fr; }
  .feature:nth-of-type(even) .feature-text { order: 0; }
}

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