/* ==========================================================================
   WIVO web — the app's design system, ported to CSS.

   Nothing here is invented. Every token below is read directly out of
   app/lib/core/design/. Where the web needs something the app does not define
   (a fluid type scale, a link colour), it is DERIVED from these tokens — no
   foreign values.

     colours   → wivo_colors.dart
     type      → wivo_type.dart
     spacing   → wivo_spacing.dart
     buttons   → wivo_button.dart
     frame     → wivo_scaffold.dart

   Dark only. The app has no light mode ("this is a night-driving product, and
   the design commits to that" — wivo_theme.dart:7-8), so neither does the site.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts — served from this origin. NEVER from a CDN: a webfont CDN discloses
   the visitor's IP address to a third party on every page load, which for a
   product sold into Germany is a GDPR problem (and the app itself bundles the
   same files for the same reason — wivo_type.dart:5).

   All seven faces the app ships are declared. A browser downloads only the
   ones a rule actually uses, so the unused weights cost nothing.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/BarlowCondensed-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/BarlowCondensed-Medium.ttf') format('truetype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/BarlowCondensed-SemiBold.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/BarlowCondensed-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/IBMPlexSans-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/IBMPlexSans-Medium.ttf') format('truetype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/IBMPlexSans-SemiBold.ttf') format('truetype');
  font-weight: 600; font-style: normal; font-display: swap;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  /* wivo_colors.dart */
  --ink:    #0B0E13;  /* base canvas — night dashboard, deliberately not black */
  --panel:  #151A22;  /* raised surfaces: cards, the top face of a button      */
  --edge:   #262E3B;  /* edges, dividers, the bottom lip of the 3D buttons     */
  --beam:   #C8DCFF;  /* primary text, active state — headlight white-blue     */
  --amber:  #FFB01F;  /* attention, primary CTA, PRO, mobile cameras           */
  --alarm:  #FF3B30;  /* danger, errors, the speed-limit sign ring             */
  --sign:   #FFFFFF;  /* the ONLY pure white in the system                     */

  /* Derived tones — same alphas as WivoColors.beamDim / beamFaint / beamHint. */
  --beam-dim:   rgba(200, 220, 255, 0.55);
  --beam-faint: rgba(200, 220, 255, 0.28);
  --beam-hint:  rgba(200, 220, 255, 0.08);

  /* wivo_spacing.dart — base unit 8, every gap a multiple of it. */
  --unit:    8px;
  --screen: 20px;
  --card:   20px;
  --gap:    16px;
  --section: 32px;
  --radius: 14px;
  --touch:  56px;
  --lip:     4px;

  /* wivo_type.dart */
  --family-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --family-text: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Reading measure. Not in the app (a phone screen IS the measure), derived
     here from the body size: ~68 characters at 15px ≈ 34rem. */
  --measure: 34rem;
  --page-max: 60rem;
}

/* --------------------------------------------------------------------------
   Reset + page frame
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--beam);
  /* WivoType.body: 15 / w400 / letterSpacing 0 / height 1.35 */
  font-family: var(--family-text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  /* WivoSpacing.screen = 20 horizontal screen margin */
  padding: 0 var(--screen);
}

.prose { max-width: var(--measure); }

/* --------------------------------------------------------------------------
   Type scale — wivo_type.dart.

   The app's sizes are fixed because a phone screen is a fixed width. The web
   viewport is not, so the display sizes are expressed as clamp() with the
   app value as the UPPER bound: at desktop width the type is exactly the app's
   size, and it scales down on narrow screens rather than overflowing. The
   weights, letter-spacings and line-heights are the app's values unchanged.
   -------------------------------------------------------------------------- */

/* WivoType.hero: 96 / w700 / -2 / 0.9 */
.t-hero {
  font-family: var(--family-display);
  font-size: clamp(3.25rem, 11vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.9;
  margin: 0;
}

/* WivoType.display: 56 / w600 / -1 / 1.0 */
.t-display {
  font-family: var(--family-display);
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1;
  margin: 0;
}

/* WivoType.title: 28 / w600 / 0 / 1.1 */
.t-title {
  font-family: var(--family-display);
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

/* WivoType.label: 16 / w600 / +1.5 / 1.2 — ALWAYS uppercase (wivo_button.dart:315) */
.t-label {
  font-family: var(--family-text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  line-height: 1.2;
  text-transform: uppercase;
}

/* WivoType.caption: 12 / w500 / +1 / 1.3 — ALWAYS uppercase */
.t-caption {
  font-family: var(--family-text);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--beam-dim);
}

p { margin: 0 0 var(--gap); }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; }

ul { margin: 0 0 var(--gap); padding-left: var(--card); }
li { margin-bottom: var(--unit); }
li:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Links — no link colour exists in the app (it has no hyperlinks), so this is
   derived: body text is `beam`, and a link is the same colour with the
   underline carrying the affordance. Hover moves to `amber`, the system's
   attention colour.
   -------------------------------------------------------------------------- */
a {
  color: var(--beam);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--beam-dim);
}
a:hover { color: var(--amber); text-decoration-color: var(--amber); }

/* Focus ring — the app marks focus with a 1.5px `beam` border
   (wivo_theme.dart:107). Same colour, as an outline. */
:focus-visible {
  outline: 2px solid var(--beam);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link — hidden until focused. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--panel);
  color: var(--beam);
  padding: var(--gap);
  border-radius: var(--radius);
  z-index: 10;
}
.skip:focus { left: var(--screen); top: var(--screen); }

/* --------------------------------------------------------------------------
   Header — mirrors wivo_scaffold.dart: no app bar, just the wordmark in
   display type with widened tracking (letterSpacing: 2, wivo_scaffold.dart:65).
   -------------------------------------------------------------------------- */
.site-head {
  padding: var(--section) 0 var(--gap);
  display: flex;
  align-items: baseline;
  gap: var(--gap);
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--family-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--beam);
  text-decoration: none;
  line-height: 1;
}
.wordmark:hover { color: var(--beam); }


/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
section { padding: var(--section) 0; }

.hero { padding-top: var(--unit); padding-bottom: var(--section); }

.hero .lede {
  margin-top: var(--gap);
  max-width: var(--measure);
  color: var(--beam-dim);
  font-size: 1.0625rem;
}

.section-label {
  margin-bottom: var(--gap);
  color: var(--beam-dim);
}

/* --------------------------------------------------------------------------
   Card — the `panel` surface with an `edge` hairline and the 1px lit top line
   that every raised surface in the app carries (wivo_button.dart:296-302).
   No blurred shadow anywhere: "a hard edge reads better on a night display".
   -------------------------------------------------------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: var(--card);
  box-shadow: inset 0 1px 0 var(--beam-hint);
}

.card h3 { margin: 0 0 var(--unit); }
.card p { color: var(--beam-dim); }

.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* --------------------------------------------------------------------------
   Tier columns — FREE vs PRO. The PRO column is marked with `amber`, exactly
   as the app marks the PRO badge (WivoButtonVariant.accent: panel face, amber
   text, amber border — wivo_button.dart:359-364).
   -------------------------------------------------------------------------- */
.tier { display: flex; flex-direction: column; }
.tier-pro { border-color: var(--amber); }
.tier-pro .tier-name { color: var(--amber); }

.tier-name { margin-bottom: var(--unit); }

.tier-price {
  color: var(--beam-dim);
  margin-bottom: var(--gap);
  padding-bottom: var(--gap);
  border-bottom: 1px solid var(--edge);
}

.tier ul {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--beam-dim);
}
.tier li {
  padding-left: calc(var(--gap) + var(--unit));
  position: relative;
}
/* The dot is the app's camera-marker language: `beam` for what FREE gets,
   `amber` for what PRO adds. */
.tier li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: var(--unit);
  height: var(--unit);
  border-radius: 50%;
  background: var(--beam);
}
.tier-pro li::before { background: var(--amber); }

/* --------------------------------------------------------------------------
   Buttons — wivo_button.dart, faithfully.

   At rest: `panel` face, 14px radius, a 4px SOLID lip of `edge` underneath
   (box-shadow with zero blur — a lip, not a shadow), and a 1px `beam-hint`
   line along the top as if lit from above.
   Pressed: the face drops 3px and the lip shrinks to 1px over 60ms easeOut.
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);          /* WivoSpacing.touchTarget = 56 */
  padding: 0 var(--card);
  border: none;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--beam);
  font-family: var(--family-text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 var(--lip) 0 var(--edge), inset 0 1px 0 var(--beam-hint);
  transition: transform 60ms ease-out, box-shadow 60ms ease-out;
}
.btn:hover { color: var(--beam); }
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--edge), inset 0 1px 0 var(--beam-hint);
}

/* WivoButtonVariant.primary — amber face, ink text. */
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { color: var(--ink); }

/* WivoButtonVariant.ghost — transparent, beamDim text, edge border, NO lip. */
.btn-ghost {
  background: transparent;
  color: var(--beam-dim);
  border: 1.5px solid var(--edge);
  box-shadow: none;
}
.btn-ghost:hover { color: var(--beam); }
.btn-ghost:active { transform: none; box-shadow: none; }

/* Disabled — 40% opacity, no lip, no press animation, and the size does NOT
   change (wivo_button.dart:230 + the design doc's "Letiltott" state). This is
   what the store buttons use until the apps are actually published. */
.btn-disabled {
  opacity: 0.4;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin-top: var(--section);
}
.btn-row .btn { flex: 1 1 14rem; }

.btn-note { margin-top: var(--unit); color: var(--beam-dim); }

/* --------------------------------------------------------------------------
   Legal notice — WivoButtonVariant.danger's language (panel face, alarm text,
   alarm border). In the app that pairing means "this reports a hazard"; that
   is exactly what this block does.
   -------------------------------------------------------------------------- */
.notice {
  background: var(--panel);
  border: 1.5px solid var(--alarm);
  border-radius: var(--radius);
  padding: var(--card);
  box-shadow: inset 0 1px 0 var(--beam-hint);
}
.notice h2, .notice h3 { color: var(--alarm); margin: 0 0 var(--gap); }
.notice p, .notice li { color: var(--beam-dim); }
.notice ul { padding-left: var(--card); }

.notice-lead { color: var(--beam) !important; }

/* --------------------------------------------------------------------------
   Legal pages
   -------------------------------------------------------------------------- */
.legal h2 {
  font-family: var(--family-display);
  font-size: clamp(1.375rem, 3.5vw, 1.75rem);
  font-weight: 600;
  line-height: 1.1;
  margin: var(--section) 0 var(--gap);
  padding-top: var(--gap);
  border-top: 1px solid var(--edge);
}
.legal h2:first-of-type { border-top: none; padding-top: 0; margin-top: var(--gap); }

.legal h3 {
  font-family: var(--family-text);
  font-size: 1rem;
  font-weight: 600;
  margin: var(--gap) 0 var(--unit);
  color: var(--beam);
}

.legal p, .legal li { color: var(--beam-dim); }
.legal .prose { max-width: var(--measure); }

/* A value Viktor still has to fill in. Deliberately loud: an unfilled
   placeholder must never quietly ship. */
.todo {
  color: var(--amber);
  border-bottom: 1px dashed var(--amber);
  font-weight: 600;
  font-style: normal;
}

.addr {
  font-style: normal;
  color: var(--beam-dim);
}

/* Definition-style rows for the data tables in the privacy policy. */
.dl { margin: 0 0 var(--gap); }
.dl dt {
  font-weight: 600;
  color: var(--beam);
  margin-top: var(--gap);
}
.dl dt:first-child { margin-top: 0; }
.dl dd { margin: var(--unit) 0 0; color: var(--beam-dim); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--edge);
  margin-top: var(--section);
  padding: var(--section) 0 calc(var(--section) * 1.5);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap) var(--card);
  margin: 0 0 var(--card);
  padding: 0;
  list-style: none;
}
.foot-links li { margin: 0; }

.foot-legal { color: var(--beam-dim); font-size: 0.8125rem; line-height: 1.5; }
.foot-legal a { color: var(--beam-dim); }

/* --------------------------------------------------------------------------
   Motion — the app ships exactly two animations and respects the OS setting.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .btn:active { transform: none; }
}
