/* Ferry — site styles. One accent (signal orange, like a ferry's life ring),
   warm neutrals, Geist. Motion follows design-motion-principles: marketing
   surfaces get subtle polish (Jakub), forms and navigation stay fast (Emil),
   and everything stops under prefers-reduced-motion. */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f6f4ef;
  --bg-deep: #efebe3;
  --surface: #fffdf9;
  --ink: #1c1b18;
  --ink-2: #3b3934;
  --muted: #6b665c;
  --line: #e3ded3;
  --line-strong: #cfc8b9;
  --accent: #cf5429;
  --accent-hover: #b94920;
  --accent-ink: #ffffff;
  --accent-soft: #f7e5dc;
  --ok: #2f7a4f;
  --ok-soft: #e2efe6;
  --danger: #b3261e;
  --danger-soft: #f6e0dd;
  --shadow-sm: 0 1px 2px rgb(70 52 25 / 0.06);
  --shadow: 0 1px 2px rgb(70 52 25 / 0.05), 0 18px 40px -18px rgb(70 52 25 / 0.28);
  --grain-opacity: 0.045;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 20px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-press: cubic-bezier(0.3, 0, 0.2, 1);
  --z-header: 20;
  --z-grain: 30;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --bg-deep: #0f0e0c;
    --surface: #1c1a17;
    --ink: #f1eee7;
    --ink-2: #d7d2c7;
    --muted: #a39d91;
    --line: #2d2a25;
    --line-strong: #3d3932;
    --accent: #ef7b4d;
    --accent-hover: #f59067;
    --accent-ink: #1a0d07;
    --accent-soft: #2e1d15;
    --ok: #7dc89b;
    --ok-soft: #16281c;
    --danger: #f28b82;
    --danger-soft: #331816;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 18px 40px -18px rgb(0 0 0 / 0.7);
    --grain-opacity: 0.06;
  }
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
}
/* Fine grain so large flat areas don't feel sterile. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3 { text-wrap: balance; margin: 0; }
p, li { text-wrap: pretty; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--r-sm);
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ── Header / footer ──────────────────────────────────────────────────────── */
header.site {
  position: sticky; top: 0; z-index: var(--z-header);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.bar { display: flex; align-items: center; height: 66px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 19px; letter-spacing: -0.02em; text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav a:not(.btn) {
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--r-sm);
  transition: color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}
.nav a:not(.btn):hover { color: var(--ink); background: var(--bg-deep); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--bg-deep); }
.nav .btn { margin-left: 8px; }
@media (max-width: 720px) { .nav a.opt { display: none; } }

footer.site { margin-top: 120px; border-top: 1px solid var(--line); padding: 36px 0 44px; font-size: 14px; color: var(--muted); }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot a { text-decoration: none; color: var(--muted); }
.foot a:hover { color: var(--ink); }
.foot .end { margin-left: auto; }

/* ── Buttons & forms ──────────────────────────────────────────────────────── */
.btn {
  --btn-bg: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid transparent; background: var(--btn-bg); color: var(--accent-ink);
  font: 600 15px/1.2 var(--font); letter-spacing: -0.005em; text-decoration: none; cursor: pointer;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out), transform 100ms var(--ease-press);
}
.btn:hover { --btn-bg: var(--accent-hover); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn-lg { min-height: 52px; padding: 14px 24px; font-size: 16.5px; border-radius: 12px; }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 14.5px; }
.btn-quiet { --btn-bg: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover { --btn-bg: var(--bg-deep); }
.btn-danger { --btn-bg: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn-danger:hover { --btn-bg: var(--danger-soft); }
.btn-solid-danger { --btn-bg: var(--danger); color: #fff; }
.btn-solid-danger:hover { --btn-bg: color-mix(in srgb, var(--danger) 85%, #000); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); cursor: pointer; }
.link:hover { text-decoration-color: currentColor; }

label.field { display: block; font-size: 14px; font-weight: 600; margin: 18px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"] {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 400 16px/1.4 var(--font);
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input.code { font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
input[aria-invalid="true"] { border-color: var(--danger); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row > input { flex: 1 1 240px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; margin: 16px 0 4px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

/* Status / error messages: short materialize-in, no exit animation. */
.msg { margin: 16px 0; padding: 12px 16px; border-radius: var(--r); font-size: 15px; border: 1px solid transparent; animation: materialize 220ms var(--ease-out); }
.msg.error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.msg.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 56px; align-items: center; padding: 88px 0 72px; }
.eyebrow { font: 500 13px/1 var(--mono); color: var(--muted); letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--line-strong); }
.hero h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -0.045em; font-weight: 650; max-width: 11ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: clamp(17px, 1.6vw, 19.5px); color: var(--ink-2); max-width: 52ch; margin: 24px 0 34px; }
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.ctas .fine { color: var(--muted); font-size: 14px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 44px; padding-top: 56px; } }

/* Product shot: the restore summary Ferry shows on Ubuntu, drawn in HTML. */
.window { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; transform: rotate(0.6deg); }
.window-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-deep); font: 500 13px/1 var(--font); color: var(--muted); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.window-bar span { margin-left: 8px; }
.window-body { padding: 22px 22px 18px; }
.window-body h3 { font-size: 18px; letter-spacing: -0.02em; margin-bottom: 14px; }
.done-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14.5px; }
.done-list li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; color: var(--ink-2); }
.done-list svg { width: 18px; height: 18px; color: var(--ok); margin-top: 2px; }
.done-list b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: 99px; background: var(--bg-deep); margin: 18px 0 14px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 100%; background: var(--ok); border-radius: inherit; }
.window-foot { display: flex; justify-content: flex-end; gap: 8px; }
.window-foot span { font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line-strong); }
.window-foot span.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ── Sections ─────────────────────────────────────────────────────────────── */
section { padding: 72px 0; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(30px, 3.8vw, 44px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 650; }
.section-head p { color: var(--muted); font-size: 18px; margin: 14px 0 0; }
.band { background: var(--bg-deep); border-block: 1px solid var(--line); }

/* Steps: a numbered timeline, not three identical cards. */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; counter-reset: step; }
.steps li { position: relative; padding: 0 28px 0 0; counter-increment: step; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block; font: 500 14px/1 var(--mono); color: var(--accent); margin-bottom: 18px;
}
.steps li::after { content: ""; position: absolute; top: 7px; left: 40px; right: 16px; height: 1px; background: var(--line-strong); }
.steps li:last-child::after { display: none; }
.steps h3 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 8px; }
.steps p { color: var(--muted); margin: 0; max-width: 34ch; }
@media (max-width: 820px) {
  .steps { grid-template-columns: 1fr; gap: 34px; }
  .steps li::after { display: none; }
}

/* What comes back: asymmetric grid, files get the big tile. */
.bento { display: grid; grid-template-columns: 1.25fr 1fr 1fr; grid-auto-rows: minmax(170px, auto); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.tile.big { grid-row: span 2; justify-content: space-between; }
.tile.big > div:first-child { display: flex; flex-direction: column; gap: 8px; }
.tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tile.wide p { color: color-mix(in srgb, var(--bg) 72%, transparent); }
.tile.wide .btn-quiet { --btn-bg: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.tile.wide .btn-quiet:hover { --btn-bg: color-mix(in srgb, var(--bg) 10%, transparent); }
.tile .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.tile .ico svg { width: 22px; height: 22px; }
.tile h3 { font-size: 19px; letter-spacing: -0.02em; }
.tile p { margin: 0; color: var(--muted); font-size: 15.5px; }
.tile.big .files { font: 500 13.5px/1.9 var(--mono); color: var(--muted); border-top: 1px dashed var(--line-strong); padding-top: 14px; margin-top: 14px; }
.tile.big .files b { color: var(--ink); font-weight: 500; }
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .tile.big { grid-row: auto; grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .tile.wide { flex-direction: column; align-items: flex-start; }
}

/* Trust: plain facts, no cards. */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.facts div { border-top: 2px solid var(--ink); padding-top: 18px; }
.facts h3 { font-size: 18px; letter-spacing: -0.015em; margin-bottom: 6px; }
.facts p { margin: 0; color: var(--muted); font-size: 15.5px; }
@media (max-width: 820px) { .facts { grid-template-columns: 1fr; gap: 26px; } }

/* Download */
.download { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.download .section-head { margin-bottom: 0; }
.download ul { margin: 18px 0 0; padding-left: 20px; color: var(--ink-2); }
.download li { margin: 6px 0; }
.dl-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.dl-box .meta { font: 500 13px/1.5 var(--mono); color: var(--muted); margin: 14px 0 18px; }
.note { background: var(--accent-soft); border-radius: var(--r); padding: 14px 16px; font-size: 14.5px; color: var(--ink-2); margin: 0; }
.note b { color: var(--ink); }
@media (max-width: 820px) { .download { grid-template-columns: 1fr; gap: 28px; } }

/* ── Prose (privacy, terms) ───────────────────────────────────────────────── */
.page-head { padding: 72px 0 28px; }
.page-head h1 { font-size: clamp(36px, 5vw, 54px); letter-spacing: -0.04em; line-height: 1.05; font-weight: 650; }
.page-head p { color: var(--muted); font-size: 18px; margin: 14px 0 0; max-width: 60ch; }
.prose { max-width: 68ch; }
.prose h2 { font-size: 22px; letter-spacing: -0.02em; margin: 40px 0 10px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.updated { font: 500 13px/1 var(--mono); color: var(--muted); }

/* FAQ: question left, answer right — scannable, nothing hidden. */
.qa { display: grid; grid-template-columns: minmax(220px, 0.8fr) 1.2fr; border-top: 1px solid var(--line); margin: 0; }
.qa dt, .qa dd { padding: 22px 0; border-bottom: 1px solid var(--line); margin: 0; }
.qa dt { font-weight: 600; letter-spacing: -0.01em; padding-right: 32px; }
.qa dd { color: var(--ink-2); }
@media (max-width: 720px) {
  .qa { grid-template-columns: 1fr; }
  .qa dt { border-bottom: 0; padding-bottom: 4px; }
  .qa dd { padding-top: 0; }
}

/* ── Account & admin ──────────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; margin: 18px 0; }
.panel h2 { font-size: 20px; letter-spacing: -0.02em; }
.panel > p:first-of-type { margin-top: 6px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* Tabs switch instantly (navigation: no motion). */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-deep); border-radius: 12px; margin-bottom: 22px; }
.tabs button { border: 0; background: transparent; color: var(--muted); font: 600 14.5px/1 var(--font); padding: 10px 16px; border-radius: 9px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.backups { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.backup { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); }
.backup .when { grid-column: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.backup .sub { grid-column: 1; color: var(--muted); font-size: 14px; }
.backup .actions { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 8px; }
.confirm { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong); animation: materialize 180ms var(--ease-out); }
.confirm span { flex: 1 1 220px; font-size: 14.5px; }

.status { display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px/1 var(--font); padding: 5px 9px; border-radius: 6px; background: var(--bg-deep); color: var(--muted); margin-left: 8px; vertical-align: 2px; }
.status.uploaded { background: var(--ok-soft); color: var(--ok); }
.status.paid { background: var(--accent-soft); color: var(--accent); }

.empty { text-align: center; padding: 34px 16px 12px; }
.empty .ico { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--bg-deep); color: var(--muted); }
.empty .ico svg { width: 26px; height: 26px; }
.empty h3 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin: 0 auto 18px; max-width: 42ch; }

.skeleton { display: grid; gap: 10px; margin-top: 18px; }
.skeleton i { display: block; height: 62px; border-radius: var(--r); background: var(--bg-deep); }

.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.danger-zone h2 { color: var(--danger); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.stat b { display: block; font: 600 30px/1.1 var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td .mono { color: var(--muted); }

/* 404 */
.lost { padding: 120px 0 40px; }
.lost .code { font: 500 14px/1 var(--mono); color: var(--accent); }
.lost .page-head { padding-top: 12px; }

/* ── Motion ───────────────────────────────────────────────────────────────── */
@keyframes materialize {
  from { opacity: 0; transform: translateY(4px); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes enter {
  from { opacity: 0; transform: translateY(12px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(18px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Page load, once: the hero settles in with a short stagger. */
  .enter { animation: enter 640ms var(--ease-out) both; }
  .enter.d2 { animation-delay: 70ms; }
  .enter.d3 { animation-delay: 140ms; }
  .enter.d4 { animation-delay: 210ms; }
  .enter.d5 { animation-delay: 280ms; }

  /* Sections materialize as they scroll into view. Pure CSS; browsers
     without scroll timelines simply show the content. */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
