/* Scribble's design system for the web, mirrored from lib/ui/theme.dart and lib/ui/chunky.dart:
   flat Duolingo-style colors where every fill has a darker "lip" for its 3D bottom edge. */

@font-face { font-family: Nunito; font-weight: 600; font-display: swap; src: url(/fonts/Nunito-SemiBold.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 700; font-display: swap; src: url(/fonts/Nunito-Bold.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 800; font-display: swap; src: url(/fonts/Nunito-ExtraBold.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 900; font-display: swap; src: url(/fonts/Nunito-Black.woff2) format("woff2"); }

:root {
  color-scheme: light dark;

  --brand: #8a3ffc;
  --brand-lip: #6a25d6;
  --brand-text: #8a3ffc;
  --brand-soft: #f3ebff;
  --brand-soft-line: #cdaeff;
  --inverse-lip: #d4bfff;

  --green: #58cc02;   --green-lip: #58a700;
  --red: #ff4b4b;     --red-lip: #ea2b2b;
  --blue: #1cb0f6;    --blue-lip: #1899d6;
  --yellow: #ffc800;  --yellow-lip: #e5a400;
  --orange: #ff9600;  --orange-lip: #e07800;
  --pink: #ff6fb5;    --pink-lip: #e04e97;

  --bg: #ffffff;
  --surface: #f7f7f7;
  --line: #e5e5e5;
  --text: #4b4b4b;
  --text-2: #777777;
  --text-3: #afafaf;

  --font: Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  /* Flutter's Curves.easeOutBack, for the face springing back up after a press. */
  --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-text: #b48cff;
    --brand-soft: #2a2245;
    --brand-soft-line: #5b3d9c;
    --bg: #131f24;
    --surface: #1b2b32;
    --line: #37464f;
    --text: #f1f7fb;
    --text-2: #9daeb6;
    --text-3: #5c707a;
  }
}

*, *::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);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-text); }
img, svg { display: block; }

:focus-visible { outline: 3px solid var(--brand-soft-line); outline-offset: 3px; border-radius: 6px; }

/* MARK: Type (AppTheme) */

.large-title { font-size: 32px; font-weight: 900; letter-spacing: -0.3px; line-height: 1.15; margin: 0; }
.title { font-size: 26px; font-weight: 900; letter-spacing: -0.2px; line-height: 1.2; margin: 0; }
.headline { font-size: 17px; font-weight: 800; margin: 0; }
.subheadline { font-size: 15px; font-weight: 600; letter-spacing: -0.1px; margin: 0; }
.footnote { font-size: 13px; font-weight: 700; letter-spacing: 0; margin: 0; }
.caps { font-size: 12px; font-weight: 900; letter-spacing: 0.6px; text-transform: uppercase; }
.secondary { color: var(--text-2); }

/* The chunky "Scribble" wordmark: heavy rounded letters sitting on a darker 3D lip. */
.wordmark {
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--wordmark, var(--brand));
  text-shadow: 0 0.07em 0 var(--wordmark-lip, var(--brand-lip));
  text-decoration: none;
}

/* MARK: Chunky button (ChunkyButton): 52px tall including its 4px lip. Pressing pushes the face
   down onto the lip; letting go springs it back up. */

.btn {
  --face: var(--brand);
  --lip: var(--brand-lip);
  --fg: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  margin: 0 0 4px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: var(--face);
  color: var(--fg);
  box-shadow: 0 4px 0 var(--lip);
  font: 800 16px/1 var(--font);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 260ms var(--spring), box-shadow 260ms var(--spring), filter 160ms;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--lip); transition-duration: 45ms; transition-timing-function: ease-out; }
@media (hover: hover) { .btn:hover { filter: brightness(1.05); } }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-inline { width: auto; display: inline-flex; }

/* White, for use on brand-colored backgrounds. */
.btn-inverse { --face: #fff; --lip: var(--inverse-lip); --fg: var(--brand); }

/* Outlined, sitting on the page background. */
.btn-secondary { --face: var(--bg); --lip: var(--line); --fg: var(--brand-text); border: 2px solid var(--line); }

/* MARK: Surfaces */

/* Outlined card with a thick bottom edge (ChunkyCard). */
.card {
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--line);
  margin-bottom: 4px;
  padding: 16px;
}
/* The tinted look of a selected plan card. */
.card-soft { background: var(--brand-soft); border-color: var(--brand-soft-line); box-shadow: 0 4px 0 var(--brand-soft-line); }

/* A small colored 3D tile holding a white glyph (IconTile). Set --size to its total height. */
.tile {
  --size: 44px;
  --depth: 3px;
  --c: var(--brand);
  --c-lip: var(--brand-lip);
  flex: none;
  display: grid;
  place-items: center;
  width: calc(var(--size) - var(--depth));
  height: calc(var(--size) - var(--depth));
  margin-bottom: var(--depth);
  border-radius: calc(var(--size) * 0.3);
  background: var(--c);
  box-shadow: 0 var(--depth) 0 var(--c-lip);
  color: #fff;
}
.tile svg { width: calc(var(--size) * 0.46); height: calc(var(--size) * 0.46); }
.tile-lg { --depth: 6px; }
.tile.brand  { --c: var(--brand);  --c-lip: var(--brand-lip); }
.tile.blue   { --c: var(--blue);   --c-lip: var(--blue-lip); }
.tile.green  { --c: var(--green);  --c-lip: var(--green-lip); }
.tile.orange { --c: var(--orange); --c-lip: var(--orange-lip); }
.tile.pink   { --c: var(--pink);   --c-lip: var(--pink-lip); }
.tile.red    { --c: var(--red);    --c-lip: var(--red-lip); }
.tile.yellow { --c: var(--yellow); --c-lip: var(--yellow-lip); }

/* Small tinted label with an icon (the paywall's "Plus" chips). */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}
.chip svg { width: 15px; height: 15px; flex: none; }

/* MARK: Motion */

/* A gentle idle float and sway (Bob). */
.bob { animation: bob 2.4s ease-in-out infinite alternate; }
@keyframes bob {
  from { transform: translateY(0) rotate(-3.44deg); }
  to   { transform: translateY(-6px) rotate(3.44deg); }
}

/* Elements that spring in (PopIn) stay hidden until their animation starts. */
.motion [data-pop]:not(.popped) { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .bob { animation: none; }
  .btn { transition: none; }
}

/* MARK: Footer */

.site-footer {
  padding: 40px 20px calc(32px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--line);
  text-align: center;
}
.site-footer .wordmark { display: inline-block; font-size: 28px; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 18px 0 14px; }
.site-footer nav a { color: var(--text-2); font-size: 15px; font-weight: 800; text-decoration: none; }
.site-footer nav a:hover { color: var(--brand-text); }
.site-footer .footnote { color: var(--text-3); }

/* MARK: Legal pages (privacy policy, terms of use) */

.bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  background: var(--bg);
  border-bottom: 2px solid var(--line);
}
.bar .wordmark { font-size: 28px; }
.bar .btn { height: 40px; padding: 0 16px; font-size: 14px; }

.doc { max-width: 720px; margin: 0 auto; padding: 40px 20px 72px; }
.doc > header { margin-bottom: 28px; }
.doc > header .footnote { margin-top: 8px; color: var(--text-2); }
.doc section { margin-top: 36px; scroll-margin-top: 88px; }
.doc h2.title { font-size: 24px; margin-bottom: 10px; }
.doc h3.headline { margin: 20px 0 4px; }
.doc p, .doc li { color: var(--text-2); line-height: 1.55; }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--brand-text); font-weight: 800; }
.doc strong { color: var(--text); font-weight: 800; }
.doc a { font-weight: 800; text-decoration: none; }
.doc a:hover { text-decoration: underline; }

/* "The short version": tinted card with icon-tile rows. */
.doc .summary { padding: 20px; margin-bottom: 40px; }
.doc .summary h2 { margin-bottom: 14px; }
.doc .summary ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.doc .summary li { margin: 0; display: flex; gap: 14px; align-items: center; }
.doc .summary p { margin: 0; color: var(--text); line-height: 1.4; }

/* Company details, as label/value rows in an outlined card. */
.company { margin: 16px 0 0; padding: 4px 16px; }
.company div { display: grid; grid-template-columns: 9.5em 1fr; gap: 4px 12px; padding: 12px 0; border-top: 2px solid var(--line); }
.company div:first-child { border-top: 0; }
.company dt { font-size: 15px; font-weight: 800; color: var(--text-2); }
.company dd { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .company div { grid-template-columns: 1fr; } }

/* Table of contents for long legal pages. */
.doc .toc { padding: 16px 20px 8px; margin-bottom: 8px; }
.doc .toc h2 { margin-bottom: 8px; }
.doc .toc ol { margin: 0; padding-left: 26px; columns: 2 240px; column-gap: 24px; }
.doc .toc li { margin-bottom: 6px; break-inside: avoid; }
.doc .toc a { font-weight: 700; }
.doc ol > li > ul { margin-top: 6px; }
/* "Legal basis: …" notes under a list item. */
.doc li em { display: block; margin-top: 2px; font-size: 15px; font-style: normal; color: var(--text-2); }
.site-footer .footnote a { color: var(--text-2); text-decoration: none; }
.site-footer .footnote a:hover { color: var(--brand-text); }
