/*
  Terrace's website styles: light and dark follow the system, the green of
  the app icon, system fonts.

  Author: Alexius Academia
  Date: 2026-10-30
*/
:root {
  --bg: #ffffff;
  --bg-tint: #f2f7f3;
  --text: #16202e;
  --muted: #5a6677;
  --line: #dde3ec;
  --accent: #1d7a55;
  --accent-strong: #145e41;
  --accent-soft: #e3f2ea;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(16, 32, 64, 0.06), 0 8px 28px rgba(16, 32, 64, 0.10);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141c;
    --bg-tint: #131c19;
    --text: #e6ebf2;
    --muted: #9aa6b6;
    --line: #273142;
    --accent: #5cc493;
    --accent-strong: #8ad9b3;
    --accent-soft: #17302a;
    --card: #182130;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
kbd {
  font: 0.85em ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 0.05em 0.4em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-tint);
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 760px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 19px; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
nav a { color: var(--muted); }
nav a:hover { color: var(--text); text-decoration: none; }
nav .pill { color: #fff; background: var(--accent); padding: 6px 14px; border-radius: 999px; }
nav .pill:hover { color: #fff; background: var(--accent-strong); }

/* Hero */
.hero { padding: 72px 0 40px; text-align: center; }
.hero-icon { margin: 0 auto 18px; border-radius: 24px; }
.eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent);
}
h1 { font-size: clamp(36px, 5.4vw, 60px); line-height: 1.08; letter-spacing: -0.02em; margin: 12px 0 18px; }
h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; letter-spacing: -0.015em; margin: 8px 0 10px; }
h3 { font-size: 21px; line-height: 1.3; margin: 0 0 8px; }
.lead { max-width: 760px; margin: 0 auto; font-size: 19px; color: var(--muted); }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 28px 0 44px; }
.button {
  display: inline-block; padding: 11px 20px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--text); background: var(--card); font-weight: 600;
}
.button:hover { text-decoration: none; border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-strong); }
.hero-shot img, .shot img { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }

/* Sections */
section { padding: 84px 0; }
section.tint { background: var(--bg-tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.heads { text-align: center; margin-bottom: 48px; }
.sub { color: var(--muted); margin: 0; }

.step { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: center; margin-bottom: 72px; }
.step:last-child { margin-bottom: 0; }
.step.flip .words { order: 2; }
.step .words p { color: var(--muted); }
.mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 10px;
}
figure { margin: 0; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; text-align: center; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 56px; }

/* Terracets */
.formats { width: 100%; border-collapse: collapse; font-size: 16px; }
.formats th, .formats td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.formats th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.formats td:nth-child(2), .formats td:nth-child(3), .formats th:nth-child(2), .formats th:nth-child(3) { text-align: center; width: 90px; }
.formats td:first-child { font-weight: 600; white-space: nowrap; }
.formats td:last-child { color: var(--muted); }

#status p { font-size: 18px; color: var(--muted); text-align: center; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 15px; color: var(--muted); }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Plain pages (privacy) */
.page { padding: 56px 0 72px; }
.page h1 { font-size: 40px; }
.page h2 { font-size: 24px; margin-top: 32px; }
.page p, .page li { color: var(--muted); }

@media (max-width: 900px) {
  .step, .pair { grid-template-columns: 1fr; gap: 24px; }
  .step.flip .words { order: 0; }
  .cards { grid-template-columns: 1fr; }
  nav a:not(.pill) { display: none; }
  .formats td:first-child { white-space: normal; }
  section { padding: 60px 0; }
}
@media (max-width: 560px) {
  .formats th:nth-child(4), .formats td:nth-child(4) { display: none; }
}

/* The page-not-found page. */
.center { text-align: center; }
.big-icon { display: block; margin: 0 auto 16px; border-radius: 20px; }

/* ---- The guide (website/guide/, made by tools/guide/build.py) ---- */
.guide { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 40px; padding-top: 32px; padding-bottom: 64px; }
.chapters, .toc { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; font-size: 15px; }
.chapters span, .toc span { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
.chapters ol, .toc ul { list-style: none; margin: 0; padding: 0; }
.chapters li a, .toc li a { display: block; padding: 4px 10px; border-radius: 7px; color: var(--muted); }
.chapters li a:hover, .toc li a:hover { color: var(--text); background: var(--bg-tint); text-decoration: none; }
.chapters li a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.toc { font-size: 14px; }
.chapter { min-width: 0; }
.chapter article { max-width: 780px; }
.chapter h1 { font-size: clamp(32px, 4vw, 42px); margin: 0 0 12px; }
.chapter h2 { font-size: 26px; margin: 48px 0 12px; padding-top: 8px; scroll-margin-top: 80px; }
.chapter h3 { font-size: 19px; margin: 28px 0 8px; scroll-margin-top: 80px; }
.chapter p, .chapter li { color: var(--text); }
.chapter .intro { font-size: 19px; color: var(--muted); margin-bottom: 24px; }
.chapter ol, .chapter ul { padding-left: 24px; }
.chapter li { margin: 6px 0; }
.chapter figure { margin: 24px 0 28px; }
.chapter figure img { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.chapter figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }
.chapter code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--bg-tint); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.chapter .ui { font-weight: 600; }
.chapter table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0 24px; }
.chapter th, .chapter td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.chapter th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.chapter td code { white-space: nowrap; }
.tip, .note, .warn { border-radius: 10px; padding: 14px 18px; margin: 20px 0; border: 1px solid var(--line); background: var(--bg-tint); }
.tip { border-left: 4px solid var(--accent); }
.note { border-left: 4px solid var(--muted); }
.warn { border-left: 4px solid #d98a00; }
.tip p, .note p, .warn p { margin: 0; }
.tip strong:first-child, .note strong:first-child, .warn strong:first-child { margin-right: 4px; }
.steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.steps > li { counter-increment: step; position: relative; padding-left: 40px; margin: 14px 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.soon { color: var(--muted); font-style: italic; }
.chapter-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 24px 0; }
.chapter-cards a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); }
.chapter-cards a:hover { border-color: var(--accent); text-decoration: none; }
.chapter-cards strong { display: block; margin-bottom: 4px; }
.chapter-cards span { color: var(--muted); font-size: 15px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { display: block; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); max-width: 48%; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.pager .next { margin-left: auto; text-align: right; }
@media (max-width: 1100px) {
  .guide { grid-template-columns: 200px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .guide { grid-template-columns: 1fr; }
  .chapters { position: static; max-height: none; }
  .chapters ol { display: flex; flex-wrap: wrap; gap: 4px; }
  .chapter-cards { grid-template-columns: 1fr; }
}
.chapters nav, nav.toc { display: block; }

/* ---- Terrace Pro (pro.html) and the download section (2026-11-06) ---- */
.pro-hero { padding-bottom: 24px; }
.plans-section { padding-top: 24px; }
.plans { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; align-items: start; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.plan.best { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.plan h2 { font-size: 26px; margin: 0; }
.price { font-size: 36px; font-weight: 700; margin: 6px 0 14px; }
.price span { font-size: 17px; font-weight: 400; color: var(--muted); }
.plan ul { padding-left: 20px; margin: 0 0 22px; }
.plan li { margin: 7px 0; color: var(--muted); }
.plan li strong { color: var(--text); }
.fine { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.checked { text-align: center; color: var(--muted); margin: 0; }
.pro-faq h2 { font-size: 30px; margin-top: 40px; }
.pro-faq h3 { margin-top: 26px; }
.pro-faq p, .how li { color: var(--muted); }
.how li { margin: 8px 0; }
.how strong { color: var(--text); }
dialog.order {
  width: min(520px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 16px;
  padding: 28px; background: var(--card); color: var(--text); box-shadow: var(--shadow);
}
dialog.order::backdrop { background: rgba(10, 16, 24, 0.5); }
dialog.order:not([open]):target { display: block; position: static; margin: 32px auto; }
.order h2 { font-size: 26px; margin: 0 0 4px; }
.order label { display: block; margin: 14px 0 0; font-weight: 600; font-size: 15px; }
.order label span { font-weight: 400; color: var(--muted); }
.order input, .order select, .order textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px; font: inherit; font-weight: 400;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
}
.order input:focus, .order select:focus, .order textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.order-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.order button { font: inherit; cursor: pointer; }
.hidden-field { position: absolute; left: -9999px; }
#download p, #pro p { font-size: 18px; color: var(--muted); text-align: center; }
.req { font-size: 15px !important; }
@media (max-width: 900px) {
  .plans { grid-template-columns: 1fr; }
}
.release { margin-top: 28px; }
.release h2 span { font-size: 16px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.release ul { padding-left: 22px; }
.release li { margin: 6px 0; }
.release li strong { color: var(--text); }
/* Home page download cards, one per system (2026-11-07). */
.downloads { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0; }
.download-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.download-card h3 { margin: 0 0 8px; }
.download-card .button { margin: 6px 0 4px; }
@media (max-width: 760px) { .downloads { grid-template-columns: 1fr; } }
