/* LooplyEnglish web design system.
   Tokens mirror packages/design-tokens/tokens.json and the mobile theme.
   Module styles live in /css/modules/*.css and are linked per page. */

/* ---------- Tokens ---------- */
:root {
  --logo-ink: #0e1116; /* brand Ink; Paper in dark mode */
  --blue: #2f5bff; /* brand book Loop Blue */
  --orange: #ff6b3d; /* brand book Coral */
  --teal: #0e8c7f;

  --bg: #faf7f2; /* Paper */
  --surface: #ffffff;
  --surface-2: #f1ede4;
  --text: #0e1116; /* Ink */
  --muted: #6e685c;
  --border: #e6e1d7;
  --primary: var(--blue);
  --on-primary: #ffffff;
  --accent: var(--orange);
  --success: #2fae66;
  --danger: #e5484d;
  /* Small-text tones (mobile *Strong parity): the base hues are 2.7–3.7:1 on
     Paper; these are 4.6–5.0:1 on Paper. On a tint of their own hue, mix
     them 85% with --text to stay >= 4.5:1. Dark mode: the base hues pass. */
  --accent-strong: #b8471f;
  --success-strong: #2a7f4e;
  --danger-strong: #cc2f35;
  /* Destructive fill + label: white on #e5484d was 3.9:1, now 5.2:1; dark
     mode uses ink on #ff6369 (6.5:1; white was 2.9:1). */
  --danger-fill: #cc2f35;
  --on-danger: #ffffff;
  /* Success fill + label (correct-answer key, YDS tick): white on #2fae66
     was 2.9:1; white on #2a7f4e is 5.0:1, dark mode ink on #3bd07e 9.5:1. */
  --success-fill: #2a7f4e;
  --on-success: #ffffff;
  /* Label on a coral fill (active word): ink in both themes, 6.7:1 on
     #ff6b3d / 7.3:1 on #ff7a50 (white was 2.8:1); same pair as .badge--plus. */
  --on-accent: #0e1116;
  /* Coral on the inverted surface (toast: --text background). */
  --accent-on-inverse: var(--orange);
  --deep: #12163a;
  --deep-2: #1f2f8f; /* gradient end for hero panels */
  --on-deep: #f3f1ec;
  --deep-edge: transparent; /* hairline around deep panels; visible in dark mode */
  --primary-soft: color-mix(in srgb, var(--primary) 9%, transparent);

  /* Headings: Space Grotesk (brand book §03). Body stays Inter — DM Sans reads
     smaller (x-height ~9% lower, ~15% narrower) in dense UI text. */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-ui: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-read: "Literata", Georgia, serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 999px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  --content: 1120px;
  --reading: 720px;
  --header-h: 64px;
  --shadow: 0 1px 2px rgb(18 22 31 / 4%), 0 8px 24px rgb(18 22 31 / 6%);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Text size setting (cookie → html style), 1 = default. */
  --text-scale: 1;
  /* Primary button fill: --primary-fill (default --primary) mixed with black
     by this much. White label >= 4.5:1 in both themes; the dark theme's
     lighter link blue (#6a84ff) is 3.3:1, so dark buttons use the brand blue. */
  --btn-primary-mix: 100%;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d13;
    --surface: #171a22;
    --surface-2: #1d212b;
    --text: #f3f1ec;
    --muted: #a7a296;
    --border: #262a34;
    --blue: #6a84ff;
    --orange: #ff7a50;
    --teal: #37c2af;
    --success: #3bd07e;
    --danger: #ff6369;
    --accent-strong: #ff7a50;
    --success-strong: #3bd07e;
    --danger-strong: #ff6369;
    --danger-fill: #ff6369;
    --on-danger: #0e1116;
    --success-fill: #3bd07e;
    --on-success: #0e1116;
    --accent-on-inverse: #b8471f;
    --deep: #0b0e1f;
    --deep-edge: rgb(255 255 255 / 9%);
    --shadow: none;
    --logo-ink: #faf7f2;
    --primary-fill: #2f5bff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --logo-ink: #faf7f2;
  --bg: #0b0d13;
  --surface: #171a22;
  --surface-2: #1d212b;
  --text: #f3f1ec;
  --muted: #a7a296;
  --border: #262a34;
  --blue: #6a84ff;
  --orange: #ff7a50;
  --teal: #37c2af;
  --success: #3bd07e;
  --danger: #ff6369;
  --accent-strong: #ff7a50;
  --success-strong: #3bd07e;
  --danger-strong: #ff6369;
  --danger-fill: #ff6369;
  --on-danger: #0e1116;
  --success-fill: #3bd07e;
  --on-success: #0e1116;
  --accent-on-inverse: #b8471f;
  --deep: #0b0e1f;
  --deep-edge: rgb(255 255 255 / 9%);
  --shadow: none;
  --primary-fill: #2f5bff;
  color-scheme: dark;
}

/* YDS area: its own teal identity (mobile YdsTheme). */
[data-area="yds"] {
  --primary: var(--teal);
  --deep: #0b3a37;
  --primary-soft: color-mix(in srgb, var(--teal) 10%, transparent);
  /* Button fill: the light-theme teal in both themes (the dark theme's
     #37c2af is too light under white text), darkened to 5.4:1. */
  --primary-fill: #0e8c7f;
  --btn-primary-mix: 85%;
  /* Paywall/hero gradient end: YDS teal instead of the generic blue. */
  --deep-2: #0f6b62;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: calc(16px * var(--text-scale));
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 var(--s-3);
  letter-spacing: -0.01em;
  /* No one-word last lines ("Aradığın sayfa burada / değil"). */
  text-wrap: balance;
}
h1 {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem);
  font-weight: 700;
}
h2 {
  font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.75rem);
  font-weight: 600;
}
h3 {
  font-size: 1.15rem;
  font-weight: 600;
}
p {
  margin: 0 0 var(--s-4);
  text-wrap: pretty;
}
a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
img,
svg {
  max-width: 100%;
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
/* The hidden attribute always wins over component display rules
   (e.g. a flex result box rendered with `hidden` until JS fills it). */
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
/* "İçeriğe geç": visually hidden until a keyboard user focuses it. */
.skip-link:not(:focus):not(:active) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link:focus,
.skip-link:active {
  position: fixed;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
/* prefers-reduced-motion: see the motion section below. */

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--s-4);
}
@media (min-width: 768px) {
  .container {
    padding-inline: var(--s-6);
  }
}
.main {
  flex: 1;
  padding-block: var(--s-6) var(--s-16);
}
.page-narrow {
  max-width: var(--reading);
  margin-inline: auto;
}
/* Content column + sticky side panel on desktop. */
.with-aside {
  display: grid;
  /* minmax(0, …): a wide table inside must scroll, not widen the page. */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-8);
}
@media (min-width: 1024px) {
  .with-aside {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
  .with-aside > aside {
    position: sticky;
    top: calc(var(--header-h) + var(--s-4));
  }
}
.grid-2,
.grid-3 {
  display: grid;
  gap: var(--s-4);
}
@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 960px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.stack > * + * {
  margin-top: var(--s-4);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.row--between {
  justify-content: space-between;
}
.spacer {
  flex: 1;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--s-6);
}
/* Logo (brand book §01): mark + Space Grotesk wordmark. Triangle + "Looply"
   are Ink on light and Paper on dark; "English" is always Sand. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--logo-ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand__mark {
  width: 28px;
  height: 28px;
  flex: none;
}
.brand__word {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: -0.01em;
}
/* Header chrome keeps its size when the learner raises the text size
   (rem would scale the wordmark and push the header actions off-screen). */
.site-header .brand__word {
  font-size: 20.8px;
}
.brand__word b {
  font-weight: 700;
}
.brand__word span {
  font-weight: 400;
  color: #8c8778;
}
.nav {
  display: none;
  gap: var(--s-1);
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
/* Header controls are 44px touch targets (theme toggle, menu, avatar, Giriş yap). */
.site-header .icon-btn,
.menu-toggle--account > summary {
  width: 44px;
  height: 44px;
}
.menu-toggle--account > summary {
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.site-header .header-actions > .btn--sm {
  min-height: 44px;
  padding-inline: 14px;
}
/* 375px phones: logo + theme + "Giriş yap" + menu overflowed by ~20px. */
@media (max-width: 419px) {
  .site-header__inner {
    gap: var(--s-3);
  }
  .header-actions {
    gap: var(--s-1);
  }
  .site-header .brand {
    gap: 8px;
  }
  .site-header .brand__word {
    font-size: 18.4px;
  }
}
/* 320px phones: the guest header (logo + theme + "Giriş yap" + menu) still
   overflowed by ~36px; tighten the chrome a step further (px, not rem, so the
   learner's text size cannot push it off-screen again). */
@media (max-width: 359px) {
  .site-header__inner {
    gap: var(--s-1);
    padding-inline: var(--s-3);
  }
  .site-header .brand {
    gap: 6px;
  }
  .site-header .brand__mark {
    width: 24px;
    height: 24px;
  }
  .site-header .brand__word {
    font-size: 14.4px;
  }
  /* 44px controls touch each other (no gap) so the guest header fits 288px. */
  .header-actions {
    gap: 0;
  }
  .site-header .header-actions > .btn--sm {
    padding-inline: 6px;
  }
}
/* Section links inside the account menu, for widths without the header nav
   (the phone tab bar has no YDS / Kelime havuzları entry). */
.menu-panel__sections {
  display: grid;
}
@media (min-width: 900px) {
  .nav {
    display: flex;
  }
  /* The guest hamburger duplicates the nav; the account menu stays. */
  .menu-toggle:not(.menu-toggle--account),
  .menu-panel__sections {
    display: none;
  }
}
/* Mobile menu (details/summary, no JS). */
.menu-toggle {
  position: relative;
}
.menu-toggle > summary {
  list-style: none;
  cursor: pointer;
}
.menu-toggle > summary::-webkit-details-marker {
  display: none;
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: var(--s-2);
  display: grid;
}
.menu-panel a,
.menu-panel button {
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text);
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.menu-panel a:hover,
.menu-panel button:hover {
  background: var(--surface-2);
}
.menu-panel__name {
  padding: 6px 12px;
  font-size: 0.85rem;
  max-width: 260px;
  overflow-wrap: anywhere;
}
.menu-panel a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}
.menu-panel hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-1) 0;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-family: var(--font-display);
}

/* Signed-in bottom tab bar on small screens (the app's navigation). */
.tabbar {
  display: none;
}
@media (max-width: 767px) {
  body.has-tabbar {
    /* Tab bar height: 44px of icon/padding + its label (scales with text
       size) + the iOS home-indicator inset. */
    padding-bottom: calc(48px + 1.5rem + env(safe-area-inset-bottom));
  }
  .tabbar {
    display: grid;
    grid-auto-flow: column;
    /* minmax(0, …): equal tabs even when large text makes a label wider. */
    grid-auto-columns: minmax(0, 1fr);
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 8px 0 10px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
  }
  .tabbar a[aria-current="page"] {
    color: var(--primary);
    font-weight: 600;
  }
  .tabbar svg {
    width: 24px;
    height: 24px;
  }
  .tabbar a span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--s-10);
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer__grid {
  display: grid;
  gap: var(--s-6);
}
/* Phones: the two short link groups side by side; the brand and the long
   legal group take the full width (their links would wrap in a half column). */
@media (min-width: 360px) and (max-width: 767px) {
  .site-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .site-footer__grid > :first-child,
  .site-footer__grid > .site-footer__group--wide {
    grid-column: 1 / -1;
  }
}
@media (min-width: 768px) {
  /* Brand on top-left, the copyright/legal note at the bottom of the same
     (otherwise empty) column; the link groups span both rows. */
  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    grid-template-rows: auto 1fr;
  }
  .site-footer__grid > :not(:first-child):not(.site-footer__legal) {
    grid-row: 1 / span 2;
  }
  .site-footer__grid > .site-footer__tagline {
  margin-top: var(--s-3);
  max-width: 34ch;
}
.site-footer__legal {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
  }
}
/* Phones: the note closes the footer, full width. */
@media (max-width: 767px) {
  .site-footer__grid > .site-footer__legal {
    grid-column: 1 / -1;
  }
}
.site-footer__legal {
  display: flex;
  margin-top: var(--s-2);
  flex-direction: column;
  gap: var(--s-1, 4px);
  max-width: 40ch;
}
.site-footer__legal small {
  font-size: 0.8rem;
  line-height: 1.45;
  opacity: 0.85;
}
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-3);
}
.site-footer a {
  display: block;
  color: var(--text);
  text-decoration: none;
  padding: 3px 0;
}
/* Touch: every footer link is a 44px row. */
@media (pointer: coarse), (max-width: 767px) {
  .site-footer a:not(.brand) {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 0;
    line-height: 1.4;
  }
  .site-footer h4 {
    margin-bottom: var(--s-1);
  }
}
.site-footer a:hover {
  color: var(--primary);
}
/* The footer link rule above must not flatten the logo lockup (mark + word gap). */
.site-footer .brand {
  display: inline-flex;
}

/* ---------- Type helpers ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}
.eyebrow--muted {
  color: var(--muted);
}
.lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 62ch;
}
.muted {
  color: var(--muted);
}
.mono {
  font-family: var(--font-mono);
}
.reading {
  font-family: var(--font-read);
  font-size: 1.1rem;
  line-height: 1.75;
  letter-spacing: 0.005em;
}
.reading p {
  margin-bottom: 1.1em;
}
.kbd {
  font-family: var(--font-mono);
  font-size: 0.75em;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
}

/* ---------- Breadcrumbs ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: var(--s-4);
  padding: 0;
  list-style: none;
}
.crumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--border);
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
}
/* Touch / phones: a 44px tall hit area without moving the line. */
@media (pointer: coarse), (max-width: 767px) {
  .crumbs a {
    display: inline-block;
    padding-block: 12px;
    margin-block: -12px;
  }
}
.crumbs a:hover {
  color: var(--primary);
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  /* <a class="btn"> inherits line-height 1.6 while <button> uses the UA's
     "normal": pin both so mixed groups line up. (No margin reset here: it
     would beat .stack's sibling spacing.) */
  line-height: 1.2;
  text-align: center;
  vertical-align: middle;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
  white-space: nowrap;
}
.btn:hover {
  border-color: color-mix(in srgb, var(--btn-fg) 25%, var(--btn-border));
  text-decoration: none;
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}
/* White text needs >= 4.5:1: see --primary-fill / --btn-primary-mix. */
.btn--primary {
  --btn-primary: color-mix(in srgb, var(--primary-fill, var(--primary)) var(--btn-primary-mix, 100%), black);
  --btn-bg: var(--btn-primary);
  --btn-fg: var(--on-primary);
  --btn-border: var(--btn-primary);
}
.btn--primary:hover {
  --btn-bg: color-mix(in srgb, var(--btn-primary) 88%, black);
}
.btn--accent {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  --btn-border: var(--accent);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-border: transparent;
  --btn-fg: var(--muted);
}
.btn--ghost:hover {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
}
.btn--on-deep {
  --btn-bg: #fff;
  --btn-fg: var(--deep);
  --btn-border: #fff;
}
.btn--lg {
  min-height: 52px;
  padding: 0 24px;
  font-size: 1rem;
}
.btn--sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.85rem;
  border-radius: var(--r-sm);
}
.btn--block {
  width: 100%;
  /* A full-width button wraps instead of pushing its column wider. */
  white-space: normal;
  text-wrap: balance;
  padding-block: 8px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
/* Phones: the compact controls are still 44px touch targets everywhere. */
@media (max-width: 767px) {
  .btn--sm {
    min-height: 44px;
    min-width: 44px;
  }
  .icon-btn {
    width: 44px;
    height: 44px;
  }
}
/* Ghost buttons on deep (navy/teal) panels: a light veil, not the paper hover. */
.card--deep .btn--ghost {
  --btn-fg: color-mix(in srgb, var(--on-deep) 80%, transparent);
}
.card--deep .btn--ghost:hover {
  --btn-bg: rgb(255 255 255 / 10%);
  --btn-fg: var(--on-deep);
}

/* ---------- Action groups ----------
   <div class="actions"> holds a row of buttons/links (forms inside are fine).
   Wraps on narrow screens; on phones every item grows so a wrapped group is
   a column of equal-width buttons and a single row fills the width evenly.
   Modifiers: --center, --end, --between, --stack (always one column). */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
}
.actions > form {
  display: contents;
}
.actions--center {
  justify-content: center;
}
.actions--end {
  justify-content: flex-end;
}
.actions--between {
  justify-content: space-between;
}
.actions--stack {
  flex-direction: column;
  align-items: stretch;
}
@media (max-width: 479px) {
  .actions > *,
  .actions > form > * {
    flex: 1 1 auto;
  }
}

/* "iPhone uygulaması · yakında": a status, not a disabled call to action. */
.store-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  max-width: 100%;
  padding: 6px 16px;
  border-radius: var(--r-md);
  border: 1px dashed color-mix(in srgb, currentColor 35%, transparent);
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: center;
}
.store-soon--sm {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 0.82rem;
}
.card--deep .store-soon {
  color: color-mix(in srgb, var(--on-deep) 75%, transparent);
}

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.card--link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.card--link:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  box-shadow: var(--shadow);
  text-decoration: none;
}
.card--deep {
  background: var(--deep);
  color: var(--on-deep);
  border-color: var(--deep-edge);
}
.card--deep .muted,
.card--deep .eyebrow--muted {
  color: color-mix(in srgb, var(--on-deep) 65%, transparent);
}
.card--flat {
  background: transparent;
}
.hero-card {
  display: flex;
  align-items: center;
  gap: var(--s-5);
}

/* Row lists (settings-like, topic lists). */
.rows {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  padding: 0;
  margin: 0;
  list-style: none;
}
/* .rows resets margins; keep the .stack rhythm when a list follows a sibling. */
.stack > * + .rows {
  margin-top: var(--s-4);
}
.rows > li + li {
  border-top: 1px solid var(--border);
}
.rows__item {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  color: inherit;
  text-decoration: none;
}
a.rows__item:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.rows__num {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.85rem;
  width: 28px;
}
.rows__main {
  flex: 1;
  min-width: 0;
}
.rows__title {
  font-family: var(--font-display);
  font-weight: 600;
}
.rows__sub {
  color: var(--muted);
  font-size: 0.9rem;
}
.chev {
  display: inline-flex;
  flex: none;
  color: var(--muted);
}

/* ---------- Badges, chips, tags ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--muted);
}
/* Brand coral with Ink text in both themes: white on coral was 2.8:1; Ink is
   6.7:1 on #ff6b3d (light), 7.3:1 on #ff7a50 (dark), 8.1:1 on #ff8a4c.
   The mobile PlusBadge should use the same pair. */
.badge--plus {
  background: linear-gradient(135deg, var(--orange), #ff8a4c);
  color: #0e1116;
}
.badge--level {
  background: var(--primary-soft);
  color: var(--primary);
}
.badge--success {
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: color-mix(in srgb, var(--success-strong) 85%, var(--text));
}

/* Underline tabs (mobile UnderlineTabs). */
.tabs {
  display: flex;
  gap: var(--s-5);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: var(--s-5);
}
.tabs a,
.tabs button {
  position: relative;
  padding: 10px 0 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tabs--code a,
.tabs--code button {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}
/* Tabs scroll sideways instead of squeezing a label past its box. */
.tabs > * {
  flex: none;
}
/* Short level codes (A1, B2) still get a 44px wide tap area. */
.tabs--code {
  gap: var(--s-1);
}
.tabs--code a,
.tabs--code button,
.tabs--code .tabs__soon {
  min-width: 44px;
  padding-inline: 8px;
  text-align: center;
}
.tabs a[aria-current="page"],
.tabs button[aria-selected="true"] {
  color: var(--text);
}
.tabs a[aria-current="page"]::after,
.tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
}

/* ---------- Callouts (lesson tip/trap/TR box) ---------- */
.callout {
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
}
.callout__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--s-2);
}
.callout--trap {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border-left-color: var(--danger);
}
.callout--trap .callout__label {
  color: color-mix(in srgb, var(--danger-strong) 85%, var(--text));
}
.callout--tr {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-left-color: var(--accent);
}
.callout--tr .callout__label {
  color: color-mix(in srgb, var(--accent-strong) 85%, var(--text));
}

/* Example sentence block. */
.example {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
}
.example__en {
  font-family: var(--font-read);
  font-size: 1.08rem;
}
.example__tr {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Loop ring (brand motif) ---------- */
.loop-ring__track {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}
.loop-ring__bar {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease);
}
.card--deep .loop-ring__track {
  stroke: rgb(255 255 255 / 14%);
}
.loop-ring__label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  fill: currentColor;
  text-anchor: middle;
  dominant-baseline: central;
}

/* ---------- Stats ---------- */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  text-align: center;
}
.stat__value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary);
}
.stat__label {
  color: var(--muted);
  font-size: 0.85rem;
}
.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}

/* ---------- Forms ---------- */
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-weight: 600;
  font-size: 0.9rem;
}
.input,
select.input,
textarea.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
@media (max-width: 767px) {
  .segmented button {
    min-height: 44px;
    min-width: 44px;
  }
}
.segmented button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--on-primary);
}

/* ---------- Multiple choice (shared by quizzes, reviews, YDS) ---------- */
.choices {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  width: 100%;
  text-align: left;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.choice:hover:not([disabled]) {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}
.choice__key {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--muted);
}
.choice__text {
  padding-top: 2px;
}
.choice[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.choice[aria-pressed="true"] .choice__key {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.choice.is-correct {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
}
.choice.is-correct .choice__key {
  background: var(--success-fill);
  border-color: var(--success-fill);
  color: var(--on-success);
}
.choice.is-wrong {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}
.choice.is-wrong .choice__key {
  background: var(--danger-fill);
  border-color: var(--danger-fill);
  color: var(--on-danger);
}
/* The options not picked after answering: muted text, never opacity (0.55
   left them at ~2:1). Contrast: light 5.5:1, dark 7:1, deep panels 6:1. */
.choice.is-dim {
  color: var(--muted);
}
.choice.is-dim .choice__key {
  color: var(--muted);
}
.card--deep .choice.is-dim {
  color: color-mix(in srgb, var(--on-deep) 62%, transparent);
}
.choice[disabled] {
  cursor: default;
}
.blank {
  display: inline-block;
  min-width: 64px;
  border-bottom: 2px solid var(--primary);
  margin: 0 2px;
}
.feedback {
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border-left: 3px solid var(--success);
}
.feedback--wrong {
  border-left-color: var(--danger);
}

/* ---------- Empty / error (paywall: .paywall-hero below) ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: var(--s-10) var(--s-4);
}
.empty h1,
.empty h2 {
  color: var(--text);
}
/* An empty state's call to action sits as far below the text as on the error pages. */
.empty > .actions {
  margin-top: var(--s-4);
}
.notice {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* ---------- Page header ---------- */
.page-head {
  margin-bottom: var(--s-8);
}
.page-head .lead {
  margin-top: var(--s-2);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  background: var(--text);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  font-weight: 500;
  /* Sized to its text (up to the screen width), not the right half of it. */
  width: max-content;
  max-width: calc(100vw - 32px);
  animation: toast-in 0.25s var(--ease);
}
.toast--action {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast__action {
  flex: none;
  border: 0;
  background: none;
  color: var(--accent-on-inverse);
  font: inherit;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.toast__action:hover {
  text-decoration: underline;
}
@media (max-width: 767px) {
  .toast__action {
    min-height: 44px;
    padding-inline: 10px;
  }
  body.has-tabbar .toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

/* ---------- Print (grammar pages are printable) ---------- */
@media print {
  .site-header,
  .site-footer,
  .tabbar,
  [data-island],
  .no-print {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}

/* ---------- Word tap sheet (shared) ---------- */
.wordsheet {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  padding: var(--s-5);
  box-shadow: var(--shadow);
}
/* showModal() focuses the dialog itself; the sheet doesn't need a focus ring
   (its buttons keep theirs). */
.wordsheet:focus-visible {
  outline: none;
}
.wordsheet::backdrop {
  background: rgb(18 22 31 / 45%);
}
@media (max-width: 767px) {
  .wordsheet {
    margin: auto 0 0;
    width: 100%;
    max-width: none;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: calc(var(--s-6) + env(safe-area-inset-bottom));
  }
}
.wordsheet__head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}
.wordsheet__head > div:first-child {
  flex: 1;
}
.wordsheet__word {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}
/* Tappable English example words (topic examples, vocab/phrasal examples,
   the word sheet's own example) — same feel as the reader's .w spans. */
.tap-words .w {
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s var(--ease);
}
.tap-words .w:hover {
  background: var(--primary-soft);
}
.tap-words .w.is-pressed {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
}
.wordsheet__listen {
  color: var(--primary);
}
.wordsheet__lemma {
  margin-top: 2px;
  font-size: 0.9rem;
}
.wordsheet__tr {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
}


/* =========================================================================
   Motion & "juice" — same language as the mobile app (springy presses,
   pop on correct, shake on wrong, self-drawing mark, brand confetti).
   Everything collapses under prefers-reduced-motion.
   ========================================================================= */
:root {
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn {
  transition: transform 0.32s var(--spring), background-color 0.15s, border-color 0.15s, box-shadow 0.2s;
}
.btn:active:not([disabled]) {
  transform: scale(0.96);
  transition-duration: 0.1s;
}
.btn--primary {
  background-image: linear-gradient(120deg, var(--btn-primary), color-mix(in srgb, var(--btn-primary) 80%, #7c93ff));
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--btn-primary) 70%, transparent);
}
/* The gradient sits over --btn-bg, so the base hover (a darker --btn-bg) was
   invisible: darken the gradient itself. */
.btn--primary:hover {
  background-image: linear-gradient(120deg, color-mix(in srgb, var(--btn-primary) 88%, black), color-mix(in srgb, var(--btn-primary) 72%, #7c93ff));
}
.card--link {
  transition: transform 0.35s var(--spring), box-shadow 0.25s, border-color 0.2s;
}
.card--link:active {
  transform: scale(0.985);
  transition-duration: 0.1s;
}
@media (hover: hover) {
  .card--link:hover {
    transform: translateY(-2px);
  }
}

/* Answer feedback: every quiz option uses .is-correct / .is-wrong. */
@keyframes juice-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes juice-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(7px); }
  45% { transform: translateX(-5px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
.is-correct:not(.quiz__explain):not(.cloze-gap) {
  animation: juice-pop 0.46s var(--spring);
}
.is-wrong:not(.quiz__explain):not(.cloze-gap) {
  animation: juice-shake 0.42s ease-out;
}
.quiz__explain {
  animation: juice-rise 0.32s var(--ease) both;
}
@keyframes juice-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Completed-loop confetti canvas (lib/juice.ts). */
.juice-burst {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1000;
}
.quiz--done .loop-ring,
.lp-summary .loop-ring,
.yds-summary > :first-child {
  animation: juice-pop 0.7s var(--spring) 0.05s both;
}

/* Self-drawing brand mark (landing hero, sign-in). */
.mark-draw .mark-ring {
  stroke-dasharray: 268;
  stroke-dashoffset: 268;
  animation: mark-ring 0.85s cubic-bezier(0.65, 0, 0.35, 1) 0.15s forwards;
}
.mark-draw .mark-tri {
  transform-box: fill-box;
  transform-origin: 40% 50%;
  transform: scale(0);
  animation: mark-tri 0.7s var(--spring) 0.95s forwards;
}
.mark-draw .mark-dot {
  transform-box: view-box;
  transform-origin: 50px 50px;
  transform: rotate(-310deg) scale(0.6);
  animation: mark-dot 1.05s cubic-bezier(0.65, 0, 0.35, 1) 0.15s forwards;
}
@keyframes mark-ring { to { stroke-dashoffset: 0; } }
@keyframes mark-tri { to { transform: scale(1); } }
@keyframes mark-dot {
  80% { transform: rotate(8deg) scale(1); }
  to { transform: rotate(0) scale(1); }
}

/* Ambient orbit: a big faint loop with a coral dot circling it. */
.ambient-loop {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  border: clamp(28px, 6vw, 64px) solid color-mix(in srgb, var(--primary) 8%, transparent);
}
.ambient-loop::after {
  content: "";
  position: absolute;
  width: clamp(22px, 4vw, 44px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 18%, transparent);
  top: 50%;
  left: 50%;
  offset-path: none;
  transform-origin: 0 0;
  animation: ambient-orbit 24s linear infinite;
}
@keyframes ambient-orbit {
  from { transform: rotate(0deg) translate(calc(var(--orbit-r, 200px)), 0) translate(-50%, -50%); }
  to { transform: rotate(360deg) translate(calc(var(--orbit-r, 200px)), 0) translate(-50%, -50%); }
}

/* Weekly streak strip (panel). */
.week-strip {
  display: grid;
  gap: var(--s-3);
}
.week-strip__head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.week-strip__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--s-2);
  text-align: center;
}
.week-day {
  display: grid;
  justify-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}
.week-day__dot {
  width: clamp(28px, 7vw, 36px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.6px solid var(--border);
}
.week-day--done .week-day__dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.week-day--missed .week-day__dot {
  background: var(--surface-2);
  border-color: transparent;
}
.week-day--today {
  color: var(--text);
}
.week-day--today .week-day__dot {
  border: 2.4px solid var(--accent);
  animation: day-pulse 1.4s ease-in-out infinite alternate;
}
@keyframes day-pulse {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
  to { box-shadow: 0 0 14px 2px color-mix(in srgb, var(--accent) 30%, transparent); }
}

/* Gradient hero panel (panel review card). */
.card--deep.lp-macro {
  background: linear-gradient(135deg, var(--deep), color-mix(in srgb, var(--deep) 72%, var(--blue)));
  position: relative;
  overflow: hidden;
}
.card--deep.lp-macro::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  top: -90px;
  border-radius: 50%;
  border: 32px solid rgb(255 255 255 / 6%);
  pointer-events: none;
}

/* Skeleton shimmer for any .skeleton placeholder. */
.skeleton {
  background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 40%, #fff) 50%, var(--surface-2) 70%);
  background-size: 300% 100%;
  animation: skeleton-sweep 1.3s linear infinite;
}
@keyframes skeleton-sweep {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .mark-draw .mark-ring { stroke-dashoffset: 0; }
  .mark-draw .mark-tri, .mark-draw .mark-dot { transform: none; }
}

/* Mobile-web tab bar: soft pill behind the active tab (mobile app parity). */
@media (max-width: 767px) {
  .tabbar a {
    position: relative;
    transition: color 0.2s;
  }
  .tabbar a svg {
    position: relative;
    z-index: 1;
  }
  .tabbar a[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 50%;
    width: 56px;
    height: 32px;
    translate: -50% 0;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--primary) 13%, transparent);
    animation: tab-pill 0.42s var(--spring) both;
  }
}
@keyframes tab-pill {
  from { transform: scaleX(0.4); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Sign-in + paywall (mobile parity). */
.signin {
  max-width: 460px;
  margin: var(--s-6) auto 0;
  padding: var(--s-8);
}
@media (max-width: 479px) {
  /* Phones: no card chrome, the page is the card. */
  .signin {
    margin-top: var(--s-2);
    padding: 0;
    border: 0;
    background: none;
  }
}
.signin-mark {
  width: 56px;
  height: 56px;
}
.signin__title {
  margin-top: var(--s-5);
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2rem);
}
.signin__lead {
  font-size: 1.02rem;
}
.signin__providers {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.signin__providers > form {
  display: contents;
}
.signin__apple {
  --btn-bg: #12161f;
  --btn-fg: #fff;
  --btn-border: #12161f;
}
/* Dark theme: the black Apple button keeps an edge on the dark card. */
.signin__apple:is(:root[data-theme="dark"] *) {
  --btn-border: rgb(255 255 255 / 22%);
}
@media (prefers-color-scheme: dark) {
  .signin__apple:is(:root:not([data-theme="light"]) *) {
    --btn-border: rgb(255 255 255 / 22%);
  }
}
.signin .notice {
  margin-top: var(--s-4);
}
.signin__providers .notice {
  margin-top: 0;
}
.signin__fine {
  margin-top: var(--s-6);
  font-size: 0.85rem;
}
.signin__fine p:last-child {
  margin-bottom: 0;
}
.paywall-hero {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.paywall-hero__head {
  position: relative;
  overflow: hidden;
  padding: var(--s-8) var(--s-6) var(--s-6);
  color: #fff;
  background: linear-gradient(135deg, var(--deep), var(--deep-2));
}
.paywall-hero__head h1 {
  color: #fff;
  font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.4rem);
  letter-spacing: -0.03em;
  margin: var(--s-5) 0 var(--s-2);
  position: relative;
}
.paywall-hero__orbit {
  width: 340px;
  aspect-ratio: 1;
  right: -130px;
  top: -130px;
  border-color: rgb(255 255 255 / 7%);
  --orbit-r: 141px;
}
.paywall-hero__brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  position: relative;
}
.paywall-hero__mark {
  width: 52px;
  height: 52px;
  --logo-ink: #faf7f2;
}
.paywall-hero__feature {
  display: inline-block;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: rgb(255 255 255 / 10%);
  font-size: 0.78rem;
  font-weight: 700;
  position: relative;
  margin: 0;
}
.paywall-hero__body {
  padding: var(--s-6);
}
.paywall-perks {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-5);
  display: grid;
  gap: var(--s-3);
}
.paywall-perks li {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  font-size: 1.02rem;
}
.paywall-perks li::before {
  content: "✓";
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: color-mix(in srgb, var(--accent-strong) 85%, var(--text));
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.paywall-hero__head > :not(.ambient-loop) {
  position: relative;
  z-index: 1;
}
.paywall-hero__orbit::after {
  opacity: 0.55;
}
.paywall-hero__note {
  font-size: 0.85rem;
  margin: var(--s-4) 0 0;
}
.paywall-hero__back {
  margin-top: var(--s-5);
}
/* Phones: the orbit's dot sat alone in the corner like a stray red dot; the
   store label and the way back take the full width. */
@media (max-width: 559px) {
  .paywall-hero__orbit {
    display: none;
  }
  .paywall-hero__head {
    padding: var(--s-6) var(--s-5) var(--s-5);
  }
  .paywall-hero__body {
    padding: var(--s-5);
  }
  .paywall__stores > .store-soon,
  .paywall__stores > .app-store-badge,
  .paywall-hero__back {
    width: 100%;
    justify-content: center;
  }
}

/* Apple's official App Store badge: shown as delivered (no recolouring or effects), at least 40px tall,
   with clear space around it (App Store marketing guidelines). */
.app-store-badge {
  display: inline-flex;
  padding: 4px 0;
  border-radius: 8px;
}
.app-store-badge img {
  display: block;
  height: 40px;
  width: auto;
}
.app-store-badge--lg img {
  height: 48px;
}
.app-store-badge:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
