/*
 * Famyka's website. The app's colours (mobile: core/design/Palette.kt), carried onto paper-sized
 * screens: one blue that says "you can trust this offer", cool greys a hair off pure, and depth
 * from a hairline against a tinted ground rather than shadows. Barlow, self-hosted: a face drawn
 * from road signs, sturdy enough to read on a van and plain enough for an invoice.
 */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/barlow-semi-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/barlow-semi-condensed-700.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --ground: #EEF1F6;
  --paper: #FFFFFF;
  --raised: #F7F9FC;
  --ink: #101828;
  --muted: #525F73;
  --line: #E1E6EE;
  --line-strong: #C3CAD6;
  --brand: #1A56DB;
  --brand-hover: #12439E;
  --on-brand: #FFFFFF;
  --brand-ink: #12439E;
  --brand-soft: #DCE7FF;
  --mark: #FFE27A;
  --good: #177245;
  --good-soft: #E2F3E9;
  --attention: #8F5405;
  --attention-soft: #FDF0DA;
  --problem: #B42318;
  --problem-soft: #FCE8E6;
  --focus: #1A56DB;

  --display: "Barlow Semi Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  --step-4: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --measure: 66ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0B0E13;
    --paper: #141922;
    --raised: #1A202B;
    --ink: #E7EBF2;
    --muted: #9CA7B8;
    --line: #242C38;
    --line-strong: #34404F;
    --brand: #8DB0FF;
    --brand-hover: #B3CBFF;
    --on-brand: #0B1B3F;
    --brand-ink: #C7D9FF;
    --brand-soft: #17335F;
    --mark: #5E4F12;
    --good: #72CC99;
    --good-soft: #143023;
    --attention: #F0B55E;
    --attention-soft: #3A2A12;
    --problem: #F2867E;
    --problem-soft: #3A1D1B;
    --focus: #8DB0FF;
  }
}

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

/* Every component below sets a display; hidden must still win. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--body);
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg { max-width: 100%; }

a { color: var(--brand-ink); text-underline-offset: 0.18em; }
@media (prefers-color-scheme: dark) { a { color: var(--brand); } }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: 600; letter-spacing: 0; line-height: 1.25; }
p { margin: 0; max-width: var(--measure); }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 560px; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 12px); }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.eyebrow {
  font: 600 var(--step--1)/1 var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* -- The environment ------------------------------------------------------------ */

.env-banner {
  background: var(--attention-soft);
  color: var(--attention);
  font-size: var(--step--1);
  font-weight: 600;
  text-align: center;
  padding: 6px 16px;
}

/* -- Header and footer ---------------------------------------------------------- */

.site-header { padding-block: 18px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 700 1.625rem/1 var(--display);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark img { width: 30px; height: 30px; flex: none; }

.site-nav { display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; }
.site-nav a:not(.button) { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav a:not(.button):hover { color: var(--brand-ink); }
.site-nav a[aria-current="page"] { color: var(--brand-ink); }

main { flex: 1; padding-block: 24px 72px; }

.site-footer { border-top: 1px solid var(--line); padding-block: 28px 40px; color: var(--muted); font-size: var(--step--1); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--muted); }

/* -- Buttons ---------------------------------------------------------------------- */

.button {
  --bg: var(--brand);
  --fg: var(--on-brand);
  --bd: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: var(--radius-m);
  border: 1px solid var(--bd);
  background: var(--bg);
  color: var(--fg);
  font: 600 var(--step-0)/1.2 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.button:hover { --bg: var(--brand-hover); --bd: var(--brand-hover); text-decoration: none; }
.button.secondary { --bg: var(--brand-soft); --fg: var(--brand-ink); --bd: var(--brand-soft); }
.button.secondary:hover { --bd: var(--brand); }
.button.quiet { --bg: transparent; --fg: var(--ink); --bd: var(--line-strong); }
.button.quiet:hover { --bd: var(--ink); }
.button.danger { --bg: var(--problem); --fg: #FFFFFF; --bd: var(--problem); }
@media (prefers-color-scheme: dark) { .button.danger { --fg: #2A0D0B; } }
.button.danger:hover { --bg: var(--problem); filter: brightness(1.08); }
.button.small { min-height: 40px; padding: 6px 14px; font-size: var(--step--1); }
.button.full { width: 100%; }
.button[disabled], .button[aria-busy="true"] { opacity: 0.6; cursor: default; pointer-events: none; }
.button .google-g { width: 18px; height: 18px; flex: none; }

/* -- Forms ------------------------------------------------------------------------ */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-weight: 600; }
.field .hint { color: var(--muted); font-size: var(--step--1); }
input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input[aria-invalid="true"] { border-color: var(--problem); }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--brand); flex: none; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--step--1); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* -- Surfaces --------------------------------------------------------------------- */

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: clamp(20px, 3vw, 32px);
}

.notice {
  border-radius: var(--radius-m);
  padding: 14px 16px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notice.good { background: var(--good-soft); color: var(--good); }
.notice.attention { background: var(--attention-soft); color: var(--attention); }
.notice.problem { background: var(--problem-soft); color: var(--problem); }
.notice strong { font-weight: 600; }
.notice p { max-width: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 600;
  background: var(--raised);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.good { color: var(--good); background: var(--good-soft); border-color: transparent; }
.pill.attention { color: var(--attention); background: var(--attention-soft); border-color: transparent; }
.pill.problem { color: var(--problem); background: var(--problem-soft); border-color: transparent; }
.pill.info { color: var(--brand-ink); background: var(--brand-soft); border-color: transparent; }

.skeleton { color: transparent !important; background: var(--raised); border-radius: 6px; animation: breathe 1.5s ease-in-out infinite alternate; }
@keyframes breathe { from { opacity: 1; } to { opacity: 0.55; } }

/* -- Home ------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-block: 24px 56px;
}
.hero .lead { font-size: var(--step-1); color: var(--muted); max-width: 34ch; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 58%, var(--mark) 58%, var(--mark) 92%, transparent 92%); padding-inline: 2px; }
@media (max-width: 860px) { .hero { grid-template-columns: minmax(0, 1fr); } }

/* A quote, the way the app renders it. The numbers add up: 857,75 + 21% = 1.037,88. */
.quote-sheet {
  position: relative;
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 22px 22px 18px;
  font-size: 0.9375rem;
}
.memo {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  margin-bottom: 18px;
}
.memo .wave { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; }
.memo .wave svg { width: 18px; height: 18px; }
.memo q { font-style: italic; quotes: "“" "”"; }
.memo .len { font-weight: 600; font-size: var(--step--1); display: block; margin-bottom: 2px; }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 6px; }
.sheet-head b { font: 700 var(--step-1)/1.1 var(--display); }
.lines { width: 100%; border-collapse: collapse; }
.lines td { padding: 7px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.lines td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.lines .qty { color: var(--muted); font-size: var(--step--1); display: block; }
.lines .from-voice td:first-child { background: linear-gradient(transparent 60%, var(--mark) 60%); }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 0; margin-top: 10px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; padding-left: 16px; text-align: right; }
.totals .grand { font-weight: 600; color: var(--ink); font-size: var(--step-1); padding-top: 6px; border-top: 1px solid var(--line-strong); }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; margin: 24px 0 0; padding: 0; counter-reset: flow; }
.flow li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px; display: flex; flex-direction: column; gap: 10px; counter-increment: flow; }
.flow li::before { content: counter(flow); font: 700 var(--step-1)/1 var(--display); color: var(--brand-ink); background: var(--brand-soft); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
@media (max-width: 860px) { .flow { grid-template-columns: minmax(0, 1fr); } }

.band { padding-block: 40px; }
.band + .band { border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 56px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ticks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.bullets { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.ticks li::before { content: ""; width: 14px; height: 8px; margin: 7px 0 0 3px; border-left: 2.5px solid var(--good); border-bottom: 2.5px solid var(--good); transform: rotate(-45deg); }

/* -- Pricing ---------------------------------------------------------------------- */

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: stretch; }
.plan { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.plan.featured { border: 2px solid var(--brand); padding: 23px; }
.plan h3 { font: 700 var(--step-2)/1 var(--display); }
.plan .price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.plan .amount { font: 700 var(--step-3)/1 var(--display); }
.plan .per { color: var(--muted); font-size: var(--step--1); }
.plan .ticks { flex: 1; }
.plan .ticks li.off::before { border-color: var(--line-strong); }
.plan .ticks li.off { color: var(--muted); }

/* -- Sign-up steps ---------------------------------------------------------------- */

.steps { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.steps li { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: var(--step--1); color: var(--muted); }
.steps li::before { content: ""; height: 4px; border-radius: 2px; background: var(--line); }
.steps li[data-state="done"]::before, .steps li[data-state="current"]::before { background: var(--brand); }
.steps li[data-state="current"] { color: var(--ink); font-weight: 600; }

/* -- Account ---------------------------------------------------------------------- */

.account-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .account-grid { grid-template-columns: minmax(0, 1fr); } }
.meters { display: flex; flex-direction: column; gap: 16px; }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter .top { display: flex; justify-content: space-between; gap: 12px; }
.meter .bar { height: 8px; border-radius: 4px; background: var(--raised); border: 1px solid var(--line); overflow: hidden; }
.meter .bar span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.meter.full .bar span { background: var(--attention); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.choice { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.choice:first-of-type { border-top: 0; }

/* -- Long text -------------------------------------------------------------------- */

.prose { max-width: 72ch; }
.prose h2 { font-size: var(--step-2); margin: 40px 0 12px; }
.prose h3 { margin: 24px 0 8px; }
.prose p, .prose ul, .prose table { margin: 0 0 14px; }
.prose ul { padding-left: 22px; }
.prose li { margin: 4px 0; }
.table-scroll { overflow-x: auto; margin: 0 0 16px; }
.prose table { border-collapse: collapse; width: 100%; font-size: var(--step--1); background: var(--paper); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 9px 12px; border: 1px solid var(--line); }
.prose th { background: var(--raised); font-weight: 600; }
.fill-in { background: var(--mark); color: var(--ink); padding: 0 4px; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.stack.tight { --gap: 6px; }
.stack.loose { --gap: 24px; }
.stack.wide { --gap: 32px; }
.panel h2 { font-size: var(--step-2); }
.spread { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
