/* Westminster Tutor: shared look for every page.
   Brand (brand/brand-guide.md): dark grey #1F2124 and white; red only in the logo's sign.
   Geist for headings and interface text; Geist Mono for anything the student types.
   Light is the default; dark follows the device, or the choice in Settings (theme.js). */

:root {
  --ground: #FBFBFC;        /* page */
  --surface: #FFFFFF;       /* cards, inputs, panels */
  --soft: #F3F4F6;          /* quiet fills */
  --ink: #1F2124;           /* brand dark grey */
  --ink-2: #3F434A;         /* secondary text */
  --muted: #6B7079;
  --rule: #E8E9EC;
  --rule-strong: #D6D8DC;
  --accent: #1F2124;
  --accent-hover: #34373C;
  --sign: #C8321E;          /* the logo's red sign; used for nothing else */
  --on-accent: #FFFFFF;
  --ring: rgba(31, 33, 36, .16);
  --warn: #FCF4E6;
  --shade: rgba(20, 22, 25, .32);
  --shadow-sm: 0 1px 2px rgba(16, 18, 20, .04), 0 1px 3px rgba(16, 18, 20, .05);
  --shadow-md: 0 4px 12px -2px rgba(16, 18, 20, .07), 0 2px 4px rgba(16, 18, 20, .04);
  --shadow-lg: 0 18px 40px -16px rgba(16, 18, 20, .22), 0 4px 10px rgba(16, 18, 20, .05);
  --r-sm: 8px; --r: 10px; --r-lg: 16px;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;   /* the tutor's reading text */
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d828b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #1F2124; --surface: #26292D; --soft: #2D3035; --ink: #F4F5F6; --ink-2: #D2D4D8; --muted: #9A9FA7;
    --rule: #33363B; --rule-strong: #41454B; --accent: #F4F5F6; --accent-hover: #FFFFFF; --on-accent: #1F2124;
    --ring: rgba(255, 255, 255, .2); --warn: #3A3226; --shade: rgba(0, 0, 0, .55); --sign: #E5482F;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 18px 40px -16px rgba(0, 0, 0, .65), 0 4px 10px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #1F2124; --surface: #26292D; --soft: #2D3035; --ink: #F4F5F6; --ink-2: #D2D4D8; --muted: #9A9FA7;
  --rule: #33363B; --rule-strong: #41454B; --accent: #F4F5F6; --accent-hover: #FFFFFF; --on-accent: #1F2124;
  --ring: rgba(255, 255, 255, .2); --warn: #3A3226; --shade: rgba(0, 0, 0, .55); --sign: #E5482F;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 18px 40px -16px rgba(0, 0, 0, .65), 0 4px 10px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 500 16px/1.6 var(--sans);
       -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.015em; line-height: 1.25; color: var(--ink); }
a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
button, select, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--ground); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--rule);
       background: color-mix(in srgb, var(--ground) 82%, transparent);
       -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); }
.brand { display: flex; align-items: center; gap: .65rem; }
.brand > a { display: block; border-radius: 6px; }
.logo { display: block; height: auto; }
/* Slanted "beta" mark: the site is a work in progress. Not red: red belongs to the logo's sign. */
.beta { display: inline-block; transform: rotate(-8deg); font: italic 500 .625rem/1 var(--mono); letter-spacing: .1em;
        text-transform: uppercase; color: var(--muted); border: 1px solid var(--rule-strong); background: var(--surface);
        border-radius: 999px; padding: .28rem .5rem .24rem; }
.bar-link, nav a, nav button { display: inline-flex; align-items: center; height: 36px; padding: 0 .8rem; border: 0;
        border-radius: var(--r-sm); background: none; color: var(--ink-2); font-weight: 500; font-size: .9375rem;
        text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s; }
.bar-link:hover, nav a:hover, nav button:hover { background: var(--soft); color: var(--ink); }
/* The site menu (Tutor · About · Admin), the same on every page; the current page is marked. */
.topnav { display: flex; align-items: center; gap: .15rem; }
.bar-link[aria-current="page"] { color: var(--ink); font-weight: 600; background: var(--soft); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: var(--r-sm);
            background: none; cursor: pointer; color: var(--ink-2); transition: background-color .15s, color .15s; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 40px; padding: 0 1.1rem;
       border: 1px solid var(--accent); border-radius: var(--r); background: var(--accent); color: var(--on-accent);
       font-weight: 600; font-size: .9375rem; letter-spacing: -.005em; white-space: nowrap; cursor: pointer; text-decoration: none;
       box-shadow: var(--shadow-sm); transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn.quiet { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.btn.quiet:hover { background: var(--soft); border-color: var(--rule-strong); }
.btn.small { height: 30px; padding: 0 .7rem; font-size: .8125rem; border-radius: var(--r-sm); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn:disabled:hover { background: var(--accent); border-color: var(--accent); }
.btn.quiet:disabled:hover { background: var(--surface); border-color: var(--rule-strong); }

/* Form fields */
select, input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; min-height: 42px; padding: .55rem .8rem; border: 1px solid var(--rule-strong); border-radius: var(--r);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s; }
select:hover, input[type=text]:hover, input[type=email]:hover, input[type=password]:hover, textarea:hover { border-color: var(--muted); }
select:focus, input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--ring); }
select { appearance: none; -webkit-appearance: none; padding-right: 2.2rem; cursor: pointer;
         background-image: var(--chevron); background-repeat: no-repeat; background-position: right .8rem center; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input[type=checkbox] { accent-color: var(--ink); width: 1rem; height: 1rem; vertical-align: -.15em; }
.field { display: grid; gap: .4rem; }
.field label { font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { display: inline-flex; align-items: center; background: var(--soft); border: 1px solid var(--rule); border-radius: 999px;
        padding: .1rem .6rem; font: 500 .78rem/1.6 var(--mono); color: var(--ink-2); white-space: nowrap; }
.alert { background: var(--soft); border: 1px solid var(--rule); border-left: 3px solid var(--accent);
         padding: .7rem .9rem; border-radius: var(--r-sm); font-size: .9rem; }

/* Footer */
footer { color: var(--muted); font-size: .8125rem; border-top: 1px solid var(--rule); }
footer a { color: var(--muted); text-decoration: none; transition: color .15s; }
footer a:hover { color: var(--ink); }

/* Reading pages (About, Privacy) */
.doc-bar { max-width: 760px; margin: 0 auto; padding: 0 max(20px, 4vw); height: 60px; display: flex; align-items: center; justify-content: space-between; }
.doc { max-width: 760px; margin: 0 auto; padding: clamp(2rem, 6vw, 3.5rem) max(20px, 4vw) 3rem; }
.doc h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin: 0 0 .5rem; letter-spacing: -.025em; }
.doc h2 { font-size: 1.125rem; margin: 2.25rem 0 .5rem; }
.doc p, .doc ul { margin: 0 0 1rem; max-width: 68ch; color: var(--ink-2); line-height: 1.7; }
.doc ul { padding-left: 1.25rem; display: grid; gap: .45rem; }
.doc li::marker { color: var(--muted); }
.doc .meta { color: var(--muted); font-size: .9rem; margin-bottom: 2rem; }
.doc .lede { font-size: 1.0625rem; color: var(--ink); }
.doc-foot { max-width: 760px; margin: 0 auto; padding: 1.1rem max(20px, 4vw); display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
