/* oopsjar.com. Same colours and fonts as the app (src/constants/theme.ts). */

@font-face { font-family: 'Bagel Fat One'; src: url('/fonts/BagelFatOne-Regular.woff') format('woff'); font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/fonts/Figtree-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/fonts/Figtree-SemiBold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/fonts/Figtree-Bold.woff') format('woff'); font-weight: 700; font-display: swap; }

:root {
  --bg: #E6EEE9;
  --surface: #F7FAF8;
  --line: #C6D6CD;
  --ink: #10302A;
  --muted: #536A62;
  --accent: #1D6852;
  --on-accent: #F7FAF8;
  --coin: #D49B1F;
  --coin-edge: #9A6D08;
  --glass: rgba(255, 255, 255, 0.6);
  --shine: rgba(255, 255, 255, 0.95);
  --jar-line: #10302A;
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1915;
    --surface: #14251F;
    --line: #2A4038;
    --ink: #E1ECE6;
    --muted: #92A9A0;
    --accent: #5BC29D;
    --on-accent: #0C1915;
    --coin: #E5B33D;
    --coin-edge: #B8861B;
    --glass: rgba(255, 255, 255, 0.05);
    --shine: rgba(255, 255, 255, 0.2);
    --jar-line: #BCD2C8;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

main {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left)) 3rem max(16px, env(safe-area-inset-right));
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 7vw, 2.75rem); }
h2 { font-size: 1.375rem; margin-top: 2rem; }
h3 { font-size: 1.0625rem; margin-top: 1.5rem; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.4em; }
li::marker { color: var(--muted); }
strong { font-weight: 700; }

.display { font-family: 'Bagel Fat One', 'Figtree', system-ui, sans-serif; font-weight: 400; letter-spacing: 0.005em; }
.lead { font-size: 1.1875rem; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 0.9375rem; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 2; }

/* Header and footer */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left));
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: 'Bagel Fat One', 'Figtree', sans-serif;
  font-size: 1.5rem;
}
.brand .jar { width: 30px; height: auto; }
.top-link { font-weight: 600; text-decoration: none; padding: 10px 4px; }

.foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  padding: 1.5rem max(16px, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.foot > * { max-width: 44rem; margin-left: auto; margin-right: auto; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 0.75rem; }
.foot nav a { font-weight: 600; padding: 6px 0; }
.foot p { margin-bottom: 0.25rem; overflow-wrap: anywhere; }

/* The jar drawing */
.jar .jar-glass { fill: var(--glass); }
.jar .coin { fill: var(--coin); stroke: var(--coin-edge); stroke-width: 1.6; }
.jar .jar-line { fill: none; stroke: var(--jar-line); stroke-width: 3.5; stroke-linejoin: round; }
.jar .jar-shine { fill: none; stroke: var(--shine); stroke-width: 6; stroke-linecap: round; }
.jar .jar-lid { fill: var(--accent); stroke: var(--jar-line); stroke-width: 3; }
.jar .jar-lid-lines { fill: none; stroke: var(--on-accent); stroke-opacity: 0.45; stroke-width: 2; }

/* Home */
.hero { text-align: center; padding: 1.5rem 0 1rem; }
.hero .jar { width: 150px; height: auto; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.25rem, 9vw, 3.5rem); }
.hero .lead { max-width: 32rem; margin-left: auto; margin-right: auto; }
.pill {
  display: inline-block;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  color: var(--muted);
}

.steps ol { list-style: none; padding: 0; display: grid; gap: 12px; counter-reset: step; }
.steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 16px 64px;
  position: relative;
  margin: 0;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.steps h3 { margin: 0 0 0.25rem; }
.steps p { margin: 0; color: var(--muted); }

.facts { list-style: none; padding: 0; display: grid; gap: 10px; }
.facts li { margin: 0; padding-left: 28px; position: relative; }
.facts li::before { content: '✓'; position: absolute; left: 4px; color: var(--accent); font-weight: 700; }

/* Cards, buttons and the invite page */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.join { text-align: center; margin-top: 0.5rem; }
.join .jar { width: 110px; height: auto; margin: 0.5rem 0 1rem; }
.join h2 { font-size: 1.125rem; margin-top: 1.75rem; }

.code { margin: 1.25rem 0; display: grid; gap: 8px; justify-items: center; }
.code .label { font-size: 0.875rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.code output {
  font: 700 2rem/1.1 'Figtree', ui-monospace, monospace;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 12px 18px;
  user-select: all;
  -webkit-user-select: all;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font: 700 1.0625rem/1.2 'Figtree', system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  max-width: 22rem;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: transparent; color: var(--accent); min-height: 44px; width: auto; padding: 8px 18px; font-size: 0.9375rem; }

[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }

/* Terms, privacy and help */
.doc h1 { margin-top: 0.5rem; }
.doc .updated { color: var(--muted); font-size: 0.9375rem; }
.doc .summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.doc .summary ul { margin: 0; padding-left: 1.2em; }
.doc .summary h2 { margin-top: 0; font-size: 1.0625rem; }
.doc dl { margin: 0 0 1em; }
.doc dt { font-weight: 700; margin-top: 1rem; }
.doc dd { margin: 0.25rem 0 0; }
.faq h2 { font-size: 1.125rem; }

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}
