/* FerryTerm marketing site. All colours come from the tokens below. */
:root {
  color-scheme: light dark;
  --bg: #fbfcfd;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --text: #14202b;
  --text-muted: #44566a;
  --border: #d3dce4;
  --accent: #0a6b7c;
  --accent-hover: #08596a;
  --on-accent: #ffffff;
  --soon-bg: #fff1cc;
  --soon-text: #6a4300;
  --paid-bg: #e3edff;
  --paid-text: #1b3f8f;
  --free-bg: #dcf5e6;
  --free-text: #0f5a2f;
  --warn-bg: #fff1cc;
  --warn-border: #d9a520;
  --warn-text: #5c3b00;
  --shadow: 0 1px 2px rgba(10, 30, 50, 0.08), 0 8px 24px rgba(10, 30, 50, 0.08);
  /* Illustration tokens: the terminal is dark in both themes. */
  --term-bg: #0f1820;
  --term-text: #d6e2ea;
  --term-muted: #93a7b7;
  --term-prompt: #7ee0a0;
  --term-accent: #7fd3e6;
  --chip-blue: #8ebcff;
  --chip-green: #6fddaa;
  --chip-orange: #f5b84a;
  --chip-pink: #f7a8cf;
  --chip-text: #0b1118;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1117;
    --surface: #121a22;
    --surface-2: #19232d;
    --text: #e7eef4;
    --text-muted: #a4b4c2;
    --border: #2a3947;
    --accent: #52c4d8;
    --accent-hover: #7bd6e6;
    --on-accent: #04222a;
    --soon-bg: #3b2e0c;
    --soon-text: #ffd98a;
    --paid-bg: #1c2d52;
    --paid-text: #b8cdff;
    --free-bg: #123b27;
    --free-text: #a6efc6;
    --warn-bg: #3b2e0c;
    --warn-border: #b98a1a;
    --warn-text: #ffd98a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="dark"] {
  --bg: #0b1117;
  --surface: #121a22;
  --surface-2: #19232d;
  --text: #e7eef4;
  --text-muted: #a4b4c2;
  --border: #2a3947;
  --accent: #52c4d8;
  --accent-hover: #7bd6e6;
  --on-accent: #04222a;
  --soon-bg: #3b2e0c;
  --soon-text: #ffd98a;
  --paid-bg: #1c2d52;
  --paid-text: #b8cdff;
  --free-bg: #123b27;
  --free-text: #a6efc6;
  --warn-bg: #3b2e0c;
  --warn-border: #b98a1a;
  --warn-text: #ffd98a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.15rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--mono); font-size: 0.92em; background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 5px; }

.skip-link { position: absolute; left: 16px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip-link:focus { top: 8px; color: var(--on-accent); }

.wrap { width: min(100% - 32px, 1280px); margin-inline: auto; }
.narrow { width: min(100% - 32px, 820px); margin-inline: auto; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; display: block; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface-2); font-weight: 700; }

.theme-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; background: var(--bg); margin-left: 8px; }
.theme-switch button { font: inherit; font-size: 0.85rem; border: 0; background: transparent; color: var(--text-muted); padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.theme-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.theme-switch button:not([aria-pressed="true"]):hover { color: var(--text); }

/* Buttons and badges */
.btn { display: inline-block; font: inherit; font-weight: 600; text-decoration: none; padding: 12px 22px; border-radius: 10px; border: 2px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.secondary:hover { background: var(--surface-2); color: var(--accent-hover); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }
.badge { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; padding: 2px 10px; border-radius: 999px; vertical-align: middle; }
.badge.soon { background: var(--soon-bg); color: var(--soon-text); }
.badge.paid { background: var(--paid-bg); color: var(--paid-text); }
.badge.preview { background: var(--free-bg); color: var(--free-text); }
.badge.free { background: var(--free-bg); color: var(--free-text); }

/* Hero */
.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(32px, 5vw, 64px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.hero .lede { font-size: clamp(1.1rem, 1.6vw, 1.35rem); color: var(--text-muted); max-width: 40ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.85rem; margin-bottom: 12px; }

/* Sections */
.section { padding: clamp(36px, 5vw, 72px) 0; }
.section.alt { background: var(--surface-2); }
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.feature.flip .feature-visual { order: -1; }
.feature p { color: var(--text-muted); }
.feature ul { color: var(--text-muted); padding-left: 1.2em; }
.feature li { margin-bottom: 0.4em; }
.feature-visual { min-width: 0; }
.caption { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.card ul { color: var(--text-muted); padding-left: 1.2em; margin: 0; }
.card li { margin-bottom: 0.4em; }
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }

/* Table */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-size: 0.9rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; }
tr.current { outline: 2px solid var(--accent); outline-offset: -2px; }

.notice { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 14px 18px; margin: 16px 0; }
.draft-banner { background: var(--warn-bg); color: var(--warn-text); border: 2px solid var(--warn-border); border-radius: 12px; padding: 14px 18px; font-weight: 700; margin: 24px 0; }
.todo { background: var(--warn-bg); color: var(--warn-text); border-left: 4px solid var(--warn-border); padding: 8px 14px; border-radius: 6px; margin: 8px 0 16px; }
.price-big { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.price-big small { font-size: 1rem; font-weight: 500; color: var(--text-muted); }

.page-head { padding: clamp(32px, 5vw, 64px) 0 16px; }
.page-head p { color: var(--text-muted); font-size: 1.15rem; max-width: 60ch; }
.prose { padding-bottom: 64px; }
.prose h2 { margin-top: 1.8em; }
.prose li { margin-bottom: 0.4em; }
.rules { counter-reset: r; list-style: none; padding: 0; }
.rules li { padding: 12px 0 12px 0; border-bottom: 1px solid var(--border); }
.rules li:last-child { border-bottom: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 32px 0; color: var(--text-muted); font-size: 0.95rem; margin-top: 32px; }
.site-footer .wrap { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ---------- Illustrations (HTML/CSS) ---------- */
.mock { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; font-size: 0.8rem; line-height: 1.4; }
.mock * { margin: 0; }
.mock-titlebar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); min-width: 0; }
.dots { display: flex; gap: 6px; flex: none; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--border); display: block; }
.mock-tabs { display: flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 6px; color: var(--chip-text); font-weight: 700; font-size: 0.75rem; white-space: nowrap; }
.chip.blue { background: var(--chip-blue); }
.chip.green { background: var(--chip-green); }
.chip.orange { background: var(--chip-orange); }
.chip.pink { background: var(--chip-pink); }
.mtab { padding: 3px 10px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-muted); background: var(--surface); white-space: nowrap; font-size: 0.75rem; }
.mtab.active { color: var(--text); border-color: var(--accent); font-weight: 600; }
.mtab.blue { border-top: 3px solid var(--chip-blue); }
.mtab.green { border-top: 3px solid var(--chip-green); }
.mtab.orange { border-top: 3px solid var(--chip-orange); }
.mock-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); min-height: 230px; }
.mock-body.single { grid-template-columns: minmax(0, 1fr); }
.term { background: var(--term-bg); color: var(--term-text); font-family: var(--mono); font-size: 0.74rem; padding: 12px 14px; overflow: hidden; white-space: pre; }
.term .p { color: var(--term-prompt); }
.term .m { color: var(--term-muted); }
.term .a { color: var(--term-accent); }
.cursor { display: inline-block; width: 0.6em; height: 1em; background: var(--term-text); vertical-align: text-bottom; }
.panel { border-left: 1px solid var(--border); background: var(--surface); min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--border); font-weight: 700; color: var(--text); font-size: 0.78rem; }
.panel-head span.m { color: var(--text-muted); font-weight: 500; }
.files { list-style: none; padding: 0; }
.files li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 5px 10px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 0.76rem; }
.files li span:last-child { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.files li.sel { background: var(--surface-2); }
.menu { position: relative; margin: -6px 10px 6px 34px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 4px 0; width: 190px; font-size: 0.74rem; color: var(--text); }
.menu div { padding: 3px 12px; }
.menu div.hl { background: var(--accent); color: var(--on-accent); }
.menu div.danger { color: #b3261e; }
:root[data-theme="dark"] .menu div.danger { color: #ff9a92; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .menu div.danger { color: #ff9a92; } }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.dialog { margin: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); color: var(--text); font-size: 0.8rem; }
.dialog b { display: block; margin-bottom: 4px; font-size: 0.85rem; }
.dialog p { color: var(--text-muted); margin-bottom: 10px; }
.dialog .row { display: flex; gap: 8px; flex-wrap: wrap; }
.dialog .row span { border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; background: var(--surface-2); }
.dialog .row span.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.sync-diagram { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 18px; }
.sync-node { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--surface); text-align: center; color: var(--text); font-size: 0.82rem; }
.sync-node small { display: block; color: var(--text-muted); font-size: 0.74rem; }
.sync-cloud { border: 2px dashed var(--accent); border-radius: 12px; padding: 10px 14px; text-align: center; color: var(--text); font-size: 0.78rem; }
.sync-cloud code { display: block; margin-top: 4px; font-size: 0.7rem; word-break: break-all; }
.sync-arrows { grid-column: 1 / -1; text-align: center; color: var(--text-muted); font-size: 0.78rem; }

.diagram { padding: 18px; display: grid; gap: 12px; }
.diagram .lane { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.diagram .box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); color: var(--text); text-align: center; }
.diagram .box small { display: block; color: var(--text-muted); }
.diagram .pipe { color: var(--accent); font-weight: 700; font-size: 0.78rem; text-align: center; }
.diagram .server { grid-column: 1 / -1; }
.diagram .link { height: 4px; background: var(--accent); border-radius: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 900px) {
  .hero .wrap, .feature { grid-template-columns: minmax(0, 1fr); }
  .feature.flip .feature-visual { order: 0; }
  .nav { margin-left: 0; width: 100%; }
  .mock-body { grid-template-columns: minmax(0, 1fr); }
  .panel { border-left: 0; border-top: 1px solid var(--border); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background 0.15s; }
}

/* Timeline illustration */
.timeline { margin: 0; }
.tl-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tl-step { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.tl-step h3 { font-size: 1rem; margin: 0 0 6px; min-height: 2.6em; }
.tl-num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; display: grid; place-items: center; font-size: 0.85rem; }
.tl-box { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 0.85rem; color: var(--text); background: var(--surface-2); }
.tl-box b { display: block; }
.tl-box span { color: var(--text-muted); }
.tl-box.off { border-style: dashed; }
.tl-box.srv { border-left: 4px solid var(--accent); }
.tl-link { width: 4px; height: 20px; margin-left: 20px; background: var(--accent); border-radius: 2px; }
.tl-link.off { background: repeating-linear-gradient(to bottom, var(--text-muted) 0 4px, transparent 4px 8px); }
.tl-link.wait { background: repeating-linear-gradient(to bottom, var(--accent) 0 4px, transparent 4px 8px); }
@media (max-width: 900px) { .tl-steps { grid-template-columns: minmax(0, 1fr); } .tl-step h3 { min-height: 0; } }
.feature.big h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.feature.big p { font-size: 1.15rem; }
.checks { list-style: none; padding: 0; color: var(--text-muted); }
.checks li { padding-left: 1.6em; position: relative; margin-bottom: 0.5em; }
.checks li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
