/* Step In design system: warm off-white, soft pastel light, white glass cards,
   a serif for what matters, black pills for actions, orange as the one accent. */

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #f6f5f2;
  --glass: rgba(255, 255, 255, 0.7);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.95);
  --ink: #121212;
  --muted: #6b6b6b;
  --faint: #a6a6a6;
  --line: rgba(18, 18, 18, 0.08);
  --pill: #111111;
  --on-pill: #ffffff;
  --accent: #f27a2a;
  --accent-light: #ffb46e;
  --accent-soft: #fff0e4;
  --good: #23824a;
  --good-soft: #e5f4ea;
  --bad: #cf3f3f;
  --bad-soft: #fcebea;
  --blob-peach: rgba(255, 168, 120, 0.55);
  --blob-pink: rgba(255, 160, 190, 0.42);
  --blob-mint: rgba(130, 214, 196, 0.42);
  --blob-lilac: rgba(182, 172, 255, 0.36);
  --blob-sun: rgba(255, 222, 140, 0.45);
  --shadow: 0 14px 34px rgba(40, 30, 20, 0.08);
  --radius-l: 28px;
  --radius-m: 20px;
  --serif: "Instrument Serif", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0f;
    --glass: rgba(30, 30, 32, 0.72);
    --glass-strong: rgba(34, 34, 37, 0.94);
    --glass-border: rgba(255, 255, 255, 0.07);
    --ink: #f3f2ef;
    --muted: #a3a19c;
    --faint: #6c6a66;
    --line: rgba(255, 255, 255, 0.09);
    --pill: #f3f2ef;
    --on-pill: #111111;
    --accent: #ff8a3d;
    --accent-light: #ffb46e;
    --accent-soft: #3a2414;
    --good: #4fc27e;
    --good-soft: #14301f;
    --bad: #ff7d7d;
    --bad-soft: #3a1b1b;
    --blob-peach: rgba(255, 130, 70, 0.22);
    --blob-pink: rgba(255, 110, 160, 0.16);
    --blob-mint: rgba(80, 190, 170, 0.16);
    --blob-lilac: rgba(140, 120, 255, 0.16);
    --blob-sun: rgba(255, 200, 90, 0.12);
    --shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

/* Only html carries the colour: a body background would paint over the glow below. */
html {
  background: var(--bg);
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Soft pastel light behind everything, like the glow in the reference */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38vmax 30vmax at 18% 22%, var(--blob-peach), transparent 70%),
    radial-gradient(30vmax 26vmax at 85% 18%, var(--blob-lilac), transparent 70%),
    radial-gradient(34vmax 28vmax at 80% 62%, var(--blob-mint), transparent 70%),
    radial-gradient(36vmax 30vmax at 22% 78%, var(--blob-pink), transparent 70%),
    radial-gradient(26vmax 22vmax at 55% 45%, var(--blob-sun), transparent 70%);
  filter: blur(30px);
}

button,
input {
  font: inherit;
  color: inherit;
}

/* Phones: no zoom on double tap, no grey flash on tap, no text resizing on rotation */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
a,
.option,
.lesson,
.tab {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon-solid {
  fill: currentColor;
  stroke: none;
}

.serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 6px 0 10px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  margin: 28px 2px 12px;
}

.lead {
  font-size: 17px;
  color: var(--muted);
  margin: 0 0 18px;
}

/* Glass card */

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-l);
  padding: 20px;
  margin: 14px 0;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
}

.card h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 6px;
}

.card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.alert {
  background: var(--bad-soft);
  color: var(--bad);
  border-radius: var(--radius-m);
  padding: 12px 16px;
  font-weight: 600;
}

/* Pills */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin-top: 12px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary,
.btn-duel {
  background: var(--pill);
  color: var(--on-pill);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.btn-secondary {
  background: var(--glass-strong);
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost {
  background: none;
  color: var(--muted);
  min-height: 44px;
}

.btn-small {
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 8px 16px;
  font-size: 14px;
}

.btn-inline {
  display: inline-flex;
  width: auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  color: var(--ink);
  cursor: pointer;
}

/* Shell */

.shell,
.stage {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
}

.shell {
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 4px;
  padding-top: max(20px, env(safe-area-inset-top));
}

.top-hello {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.top-date {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.1;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  font-weight: 600;
  color: var(--muted);
}

.streak.is-on {
  color: var(--accent);
}

.lang {
  font-size: 13px;
  font-weight: 700;
}

.main {
  flex: 1;
  padding: 8px 20px 128px;
}

/* Floating bottom bar: round icons, the active tab as a pill, an orange spark */

.dock {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 488px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 5;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  min-width: 52px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.tab span {
  display: none;
}

.tab.is-active {
  color: var(--ink);
  padding: 0 20px;
}

.tab.is-active span {
  display: inline;
}

.fab {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  flex: none;
  border-radius: 50%;
  border: 0;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, var(--accent-light), var(--accent) 70%);
  box-shadow: 0 12px 28px rgba(242, 122, 42, 0.4);
  cursor: pointer;
}

.fab:active {
  transform: scale(0.96);
}
