/* StaffSprint prototype design system — mobile-first.
   Base styles target ~375px phones; media queries only ADD layout for wider screens. */

:root {
  --ink: #1f2440;
  --ink-2: #4a5073;
  --muted: #6f7491;
  --paper: #faf7f2;
  --paper-2: #f3eee5;
  --card: #ffffff;
  --line: #e7e2d8;
  --accent: #e2763a;
  --accent-ink: #b9531c;
  --accent-soft: #fbe9df;
  --teal: #2f6f73;
  --teal-soft: #e3f0f0;
  --ok: #2e9e5b;
  --bad: #d64545;
  --gold: #f2b84b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(31, 36, 64, 0.05), 0 8px 24px rgba(31, 36, 64, 0.06);
  --tap: 48px; /* minimum touch target */
  --pad: 20px; /* page side padding on phones */
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; line-height: 1.5; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); }
.muted { color: var(--muted); }
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Type scale (phone) */
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 2rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.1rem; }
p { margin: 0; }

/* Buttons — full width on phones, auto on larger screens */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; text-decoration: none; white-space: nowrap; transition: transform 0.1s, background 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline { border-color: var(--ink); background: transparent; }
.btn-ghost { background: transparent; color: var(--ink); padding-inline: 12px; }
.btn-block { width: 100%; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(250, 247, 242, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 8px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); display: grid; place-items: center; flex: none; }
.header-nav { display: none; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.header-actions .btn { min-height: 40px; padding: 8px 16px; font-size: 0.92rem; }

/* Sections */
.section { padding: 56px 0; }
.section-head { margin-bottom: 28px; }
.section-head p { margin-top: 10px; color: var(--ink-2); font-size: 1.05rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Footer */
.site-footer { background: var(--ink); color: #c9cbe0; padding: 40px 0 calc(32px + env(safe-area-inset-bottom)); font-size: 0.92rem; }
.site-footer a { color: #fff; text-decoration: none; }
.footer-grid { display: grid; gap: 28px; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.footer-cols h4 { margin: 0 0 8px; color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer-cols a { display: inline-block; padding: 6px 0; color: #c9cbe0; }
.footer-bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.12); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }

/* Tablet and up */
@media (min-width: 768px) {
  :root { --pad: 32px; }
  h1 { font-size: 3rem; }
  h2 { font-size: 2.1rem; }
  .btn-block { width: auto; }
  .section { padding: 88px 0; }
  .footer-grid { grid-template-columns: 1.2fr 2fr; }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
}

/* Desktop */
@media (min-width: 1024px) {
  h1 { font-size: 3.6rem; }
  .header-nav { display: flex; gap: 4px; margin-left: 32px; }
  .header-nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 0.95rem; }
  .header-nav a:hover { background: var(--paper-2); color: var(--ink); }
}

/* Prototype helper: toast for links to pages not built yet */
.proto-toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 0.9rem; font-weight: 600; max-width: calc(100% - 32px); text-align: center; transition: opacity 0.2s, transform 0.2s; }
.proto-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Language switch (AZ / EN / RU) */
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--card); }
.lang-switch button { border: none; background: transparent; min-height: 36px; min-width: 40px; padding: 4px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 800; color: var(--muted); }
.lang-switch button.on { background: var(--ink); color: #fff; }
.lang-switch-dark { background: transparent; border-color: rgba(255, 255, 255, 0.3); }
.lang-switch-dark button { color: #c9cbe0; font-weight: 600; font-size: 0.88rem; min-height: 40px; padding: 4px 14px; }
.lang-switch-dark button.on { background: #fff; color: var(--ink); }

/* Phones: header keeps brand + language + log in; the hero and sticky bar carry "start free". */
@media (max-width: 519px) {
  .header-start { display: none; }
}
/* Small phones: tighten the header so brand + AZ/EN/RU + log in fit on a 360-375 px screen. */
@media (max-width: 419px) {
  .site-header .wrap { gap: 6px; }
  .brand { gap: 8px; font-size: 1rem; }
  .brand-mark { width: 30px; height: 30px; }
  .site-header .lang-switch button { min-width: 32px; padding: 4px 7px; }
  .header-actions .btn { padding-inline: 10px; }
}

/* Bottom sheets and their forms (teacher pages, Assignments) */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; display: grid; align-items: end; background: rgba(31, 36, 64, 0.45); }
.sheet { width: 100%; max-width: 480px; margin: 0 auto; padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); background: #fff; border-radius: 22px 22px 0 0; text-align: center; animation: up 0.25s ease-out; max-height: 100dvh; overflow-y: auto; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { font-size: 1.15rem; outline: none; }
.sheet .btn-block { width: 100%; margin-top: 12px; }
@media (min-width: 600px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 22px; } }
.grab { display: block; width: 40px; height: 4px; margin: 0 auto 10px; border-radius: 99px; background: var(--line); }
.form-sheet { text-align: left; }
.form-sheet h2 { text-align: center; }
.f-label { display: block; margin-top: 14px; font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }
.f-input { display: block; width: 100%; min-height: var(--tap); margin-top: 6px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; font-size: 1rem; }
.f-input:focus { outline: none; border-color: var(--ink); }
.f-input[aria-invalid="true"] { border-color: var(--bad); }
.f-hint { margin-top: 4px; font-size: 0.78rem; color: var(--muted); }
.f-err { margin-top: 6px; font-size: 0.82rem; font-weight: 700; color: var(--bad); }
.link-btn { display: block; width: 100%; min-height: 44px; margin-top: 4px; border: 0; background: none; color: var(--muted); font-weight: 700; cursor: pointer; }
.btn-danger { background: #c0392b; color: #fff; border: 0; }
.btn-danger:hover { background: #a93226; }

/* A parent's device practising as a child (assets/sync.js) */
.child-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; background: #fbe9df; color: #b9531c; font-weight: 800; font-size: 0.88rem; }
.child-bar a { color: #1f2440; font-weight: 800; white-space: nowrap; }
