/* habloop.com styles. System fonts only, no external resources (plan: issue #33).
   Colours, type sizes, radii and spacing are copied from app/src/theme.js (PALETTE, TYPE, R, SP)
   so site and app look like one brand. Change them there first, then here.
   Colours carry meaning: -ar blue, -er green, -ir purple, irregular orange. Never decoration. */

:root {
  /* PALETTE.light */
  --bg: #F2F3F5;
  --surface: #FFFFFF;
  --surface2: #E9EBEF;
  --text: #12151A;
  --muted: #5E6778;
  --line: #E4E7EC;
  --accent: #12151A;
  --on-accent: #FFFFFF;
  --ok: #137639;
  --bad: #C81E1E;
  --mid: #C08400;
  --ok-bg: #ECFDF3;
  --bad-bg: #FEF2F2;
  --ar: #1D4ED8;
  --er: #137639;
  --ir: #7C3AED;
  --irr: #B54708;

  /* R */
  --r-s: 12px;
  --r-l: 20px;

  /* SP */
  --sp-xs: 4px;
  --sp-s: 8px;
  --sp-m: 12px;
  --sp-l: 16px;
  --sp-xl: 24px;
  --sp-xxl: 32px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* PALETTE.dark */
    --bg: #0C0F14;
    --surface: #171B22;
    --surface2: #222833;
    --text: #F2F4F7;
    --muted: #98A2B3;
    --line: #2B323D;
    --accent: #F2F4F7;
    --on-accent: #0C0F14;
    --ok: #4ADE80;
    --bad: #F87171;
    --mid: #FACC15;
    --ok-bg: #12301F;
    --bad-bg: #3A1717;
    --ar: #60A5FA;
    --er: #4ADE80;
    --ir: #A78BFA;
    --irr: #FB923C;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  /* TYPE.body: 17/24 */
  font-size: 1.0625rem;
  line-height: 1.5;
}

.site-header,
.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--sp-l);
}

.site-header {
  padding-top: var(--sp-l);
  padding-bottom: var(--sp-s);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-s);
}

.lang-switch { display: flex; gap: var(--sp-xs); }

.lang-switch a {
  /* TYPE.sub: 15/20 */
  font-size: 0.9375rem;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--r-s);
}

.lang-switch a[aria-current="page"] { color: var(--text); font-weight: 700; }

.brand {
  /* TYPE.headline: 20/26 */
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.page { padding-bottom: var(--sp-xxl); }

h1 {
  /* TYPE.title: 28/34 */
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
  margin: var(--sp-xl) 0 var(--sp-m);
}

a { color: var(--text); }

a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Language choice at / */
.choices {
  list-style: none;
  margin: var(--sp-xl) 0 0;
  padding: 0;
  display: grid;
  gap: var(--sp-m);
}

.choice {
  display: block;
  min-height: 48px;
  padding: var(--sp-l);
  background: var(--surface);
  border-radius: var(--r-s);
  font-weight: 600;
  text-decoration: none;
}

/* Home and How it works (#35) */
p { margin: 0 0 var(--sp-l); }

.lead {
  /* TYPE.headline: 20/26 */
  font-size: 1.25rem;
  line-height: 1.3;
}

.more { font-weight: 600; }

.card {
  background: var(--surface);
  border-radius: var(--r-s);
  padding: var(--sp-l);
  margin: var(--sp-xl) 0 0;
}

.card p { margin: 0; }

/* The address must stay readable at 375px: break it rather than overflow. */
.feedback a { overflow-wrap: anywhere; }

.steps {
  margin: 0 0 var(--sp-xl);
  padding-left: var(--sp-xl);
}

.steps li { margin-bottom: var(--sp-s); }

/* Privacy (#36) */
h2 {
  /* TYPE.headline: 20/26 */
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
  margin: var(--sp-xl) 0 var(--sp-s);
}

/* The address must stay readable at 375px: break it rather than overflow. */
.email { overflow-wrap: anywhere; }

/* 404 (#36): one card per language. */
.not-found { margin-top: var(--sp-m); }

/* Footer on every page (#36): the privacy link. */
.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--sp-s) var(--sp-l) var(--sp-xxl);
  border-top: 1px solid var(--line);
  /* TYPE.sub: 15/20 */
  font-size: 0.9375rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--sp-l);
}

.site-footer a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-footer a[aria-current="page"] { color: var(--text); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
