/* Shared stylesheet for tutoring-online.mn645680.workers.dev
   Design tokens and base components mirror the homepage (index.html) inline
   styles, so /homework, /materials and /materials/vocabulary match it exactly.
   The homepage itself keeps its own inline <style> untouched. */

:root {
  --paper: #F3F6FB;
  --surface: #FFFFFF;
  --surface-2: #EAEFF8;
  --ink: #1C2438;
  --muted: #5B6478;
  --accent: #2E4C8C;
  --accent-ink: #ffffff;
  --accent-2: #C98A3E;
  --border: rgba(28, 36, 56, 0.12);
  --shadow: 0 18px 40px -22px rgba(28, 36, 56, 0.35);
  --danger: #B3423C;
  --danger-bg: rgba(179, 66, 60, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11162A;
    --surface: #1A2038;
    --surface-2: #212945;
    --ink: #E9ECF5;
    --muted: #9BA3BC;
    --accent: #7FA0E0;
    --accent-ink: #0E1424;
    --accent-2: #E3B268;
    --border: rgba(233, 236, 245, 0.14);
    --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.6);
    --danger: #E28A85;
    --danger-bg: rgba(226, 138, 133, 0.14);
  }
}

:root[data-theme="dark"] {
  --paper: #11162A;
  --surface: #1A2038;
  --surface-2: #212945;
  --ink: #E9ECF5;
  --muted: #9BA3BC;
  --accent: #7FA0E0;
  --accent-ink: #0E1424;
  --accent-2: #E3B268;
  --border: rgba(233, 236, 245, 0.14);
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.6);
  --danger: #E28A85;
  --danger-bg: rgba(226, 138, 133, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Golos Text", "Segoe UI", -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Unbounded", "Golos Text", sans-serif; text-wrap: balance; margin: 0; line-height: 1.15; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; padding-block: 0.9rem; }
.brand { font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 1rem; letter-spacing: 0.01em; text-decoration: none; }
.nav-links { display: none; gap: clamp(1rem, 3vw, 1.75rem); list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
@media (min-width: 640px) { .nav-links { display: flex; } }
.nav-links a { text-decoration: none; color: var(--muted); transition: color 0.15s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: clamp(1rem, 3vw, 1.75rem); }

.eyebrow {
  display: inline-block; font-family: "Golos Text", sans-serif; font-weight: 600;
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.9rem;
}

section { padding-block: clamp(3rem, 7vw, 5rem); }
section + section { border-top: 1px solid var(--border); }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 60ch; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; font-family: "Golos Text", sans-serif;
  font-weight: 600; font-size: 0.95rem; padding: 0.85rem 1.5rem; border-radius: 999px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-primary:hover { box-shadow: 0 22px 44px -20px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.85rem; }
.btn-danger { background: transparent; border-color: var(--border); color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }

/* ---------- page header ---------- */
.page-hero { padding-top: clamp(2.5rem, 7vw, 4rem); padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.page-hero h1 { font-size: clamp(1.9rem, 3.4vw + 1rem, 2.75rem); font-weight: 800; max-width: 22ch; }
.page-hero .lede { margin-top: 0.9rem; }

/* ---------- topic / file lists ---------- */
.block-group + .block-group { margin-top: 2.25rem; }
.block-heading {
  font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.file-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; transition: border-color 0.15s ease, transform 0.15s ease;
}
.file-card:hover { border-color: var(--accent); }
.file-card-main { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.file-num {
  font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 0.8rem;
  color: var(--accent); background: var(--surface-2); border-radius: 8px;
  padding: 0.35rem 0.55rem; flex-shrink: 0;
}
.file-title { font-weight: 600; }
.file-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- login ---------- */
.login-wrap { display: flex; justify-content: center; padding-block: clamp(3rem, 10vw, 6rem); }
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: clamp(2rem, 5vw, 2.75rem); width: 100%; max-width: 380px; box-shadow: var(--shadow);
}
.login-card h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.4rem; }
.login-card .lede { font-size: 0.95rem; margin-bottom: 1.75rem; }
.field { display: grid; gap: 0.4rem; margin-bottom: 1.1rem; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.field input {
  font: inherit; padding: 0.75rem 0.9rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--paper); color: var(--ink); width: 100%;
}
.field input:focus { border-color: var(--accent); outline: none; }
.login-error {
  background: var(--danger-bg); color: var(--danger); border-radius: 10px;
  padding: 0.75rem 1rem; font-size: 0.9rem; margin-bottom: 1.1rem;
}
.login-submit { width: 100%; justify-content: center; margin-top: 0.4rem; }

/* ---------- materials dashboard ---------- */
.dash-topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* ---------- vocabulary pages ---------- */
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 2rem; }
.vocab-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem 1.4rem; }
.vocab-pos {
  display: inline-block; font-family: "Unbounded", sans-serif; font-weight: 600; font-size: 0.68rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent);
  border-radius: 999px; padding: 0.2rem 0.55rem; margin-bottom: 0.6rem;
}
.vocab-word { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.35rem; }
.vocab-meaning { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.45rem; }
.vocab-example { font-size: 0.92rem; font-style: italic; color: var(--ink); opacity: 0.85; }
.vocab-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }

/* ---------- reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

footer { padding-block: 2.25rem; border-top: 1px solid var(--border); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; color: var(--muted); font-size: 0.85rem; }
footer a { text-decoration: none; color: var(--muted); }
footer a:hover { color: var(--ink); }
