/* HAKGED — the site's ONE shared stylesheet (P0 of the 2026-11 redesign).
 *
 * WHY IT EXISTS, given every page here is deliberately self-contained: the redesign fixed a set of
 * values that must be the SAME on every page — one button corner, one button height, one Fraunces
 * standard, one motion curve, one loading logo. Copying them into twenty pages is exactly the shape
 * that let the Fraunces weights drift to 400 / 500 / 600 in the first place (docs/plan-website-
 * practice-exam-2026-11-04.md, "One Fraunces standard"). So the values live here once and pages
 * read them as custom properties or the hk-* classes.
 *
 * RULES FOR THIS FILE
 * - Only tokens and the few components the plan fixed site-wide (buttons, the title face, the
 *   loading logo, the reveal). Page layout stays in the page.
 * - Every class is prefixed `hk-` and every property `--hk-`, so nothing here can collide with a
 *   page's own names (the pages already use .btn, .title, --ink, --muted in different meanings).
 * - Served with a one-hour lifetime (see _headers), not immutable: like nav-user.js it carries
 *   decisions that may need a same-day correction.
 * - Animations: fast start, soft landing, always (the author's standing preference).
 */

@font-face { font-family: 'Fraunces'; src: url('/fonts/Fraunces-Variable.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Variable.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Myanmar Sagar'; src: url('/fonts/SagarPro-Regular-myanmar-v2.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Myanmar Sagar'; src: url('/fonts/SagarPro-Bold-myanmar-v2.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* Motion — every animation on the site. */
  --hk-ease: cubic-bezier(.2,.8,.2,1);
  --hk-dur: .4s;          /* rolls, fades of whole blocks */
  --hk-dur-fast: .25s;    /* hovers, small fades */

  /* Colour. Greys are the ones the grill settled on; red/green are the quiz shell's own. */
  --hk-ink: #000;
  --hk-text-2: #6e6e73;   /* secondary text (muted email, numbers) */
  --hk-muted: #a1a1a6;    /* muted rows, greyed tabs, "not tappable" */
  --hk-rule: #d2d2d7;     /* thin lines and light borders */
  --hk-hover: #f0f0f2;    /* hover AND keyboard focus (never a blue ring) */
  --hk-paper-2: #f5f5f7;  /* the one muted surface grey (desk, explanation box) */
  --hk-red: #c44d3e;      /* wrong, dates, LIVE */
  --hk-green: #2d7a4f;    /* right, credit scores */
  --hk-off-line: #e5e5ea; /* A10b: a button that can't be pressed - its line ... */
  --hk-off-ink: #c7c7cc;  /* ... and its words or icon. Both muted together, always. */
  --hk-blue: #2f6db5;     /* sign up / join (2026-11-08 polish A7) */
  --hk-line: #c7c7cc;     /* the standard button's line; the scrollbar handle; the small grey point */
  --hk-list-bg: #f5f5f7;  /* the standard list box (B) */
  --hk-list-edge: #e5e5ea;
  --hk-list-hover: #ebebef;

  /* Type scale (2026-11-08 polish A1): seven sizes, everywhere except question cards. */
  --hk-fs-hero: 56px;     /* Fraunces: home wordmark, "Your Name", "Wait for Access" */
  --hk-fs-page: 34px;     /* Fraunces: page titles, account name */
  --hk-fs-top: 24px;      /* Fraunces: top-row titles (subject picker, Exam status) */
  --hk-fs-list: 15px;     /* Inter 400: list rows, table names */
  --hk-fs-ui: 14px;       /* Inter: menus, email, Sign out */
  --hk-fs-small: 12px;    /* Inter: dates, TODAY, admin cells */
  --hk-fs-cap: 11px;      /* Inter 600 spaced caps: section headers, tab labels, tags */

  /* Icons (A3): every icon line is 1.5px ON SCREEN whatever the icon size. Use the .hk-ico class
     (non-scaling stroke) or set stroke-width = 1.5 x 24 / icon px by hand. */
  --hk-icon-line: 1.5px;
  --hk-open: .42s;        /* drawers and lists opening */
  --hk-close: .28s;       /* ... and closing */

  /* Buttons (site-wide, 2026-11-06): one corner, one height, one side padding. */
  --hk-btn-radius: 8px;
  --hk-btn-h: 46px;
  --hk-btn-px: 26px;
  --hk-btn-border: 1px;   /* 2026-11-08 A10: 1px #c7c7cc, white, black words, grey-wash hover */
  --hk-btn-fs: 12px;      /* Inter 12px 600, ALL CAPS, .08em - on every page, the quiz screen too */
  /* The one exception: Confirm in the quiz's top-right slot. */
  --hk-confirm-h: 32px;
  --hk-confirm-px: 16px;
  --hk-confirm-fs: 12px;

  /* The Fraunces standard (2026-11-07): titles, headings, the wordmark, Study Timer digits, Typing. */
  --hk-title-family: 'Fraunces', Georgia, serif;
  --hk-title-wght: 550;
  --hk-title-opsz: 60;

  /* UI text. */
  --hk-ui-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hk-mm-family: 'Myanmar Sagar', 'Padauk', sans-serif;
}

/* ---- The Fraunces standard ------------------------------------------------------------------
   opsz pinned at 60 (not automatic) and weight 550. A page that sets its own size keeps it; only
   the face, weight and optical size come from here. */
.hk-title {
  font-family: var(--hk-title-family);
  font-weight: var(--hk-title-wght);
  font-variation-settings: 'opsz' var(--hk-title-opsz);
}

/* ---- Buttons (2026-11-08 polish A10) -------------------------------------------------------
   THE standard button - every button on the site; there is no solid black button any more.
   46px, 8px corners, white, 1px #c7c7cc line, black words in Inter 12px 600 capitals (.08em);
   hover = grey wash #f0f0f2 only (no line or colour change). Buttons in a group share one width:
   wrap them in `.hk-btn-row` (equal widths, the widest label decides). No blue focus ring:
   keyboard focus looks like hover. `.hk-btn--outline` is kept as an alias of the standard. */
.hk-btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-sizing: border-box;
  height: var(--hk-btn-h);
  padding: 0 var(--hk-btn-px);
  border-radius: var(--hk-btn-radius);
  border: var(--hk-btn-border) solid var(--hk-line);
  background: #fff; color: var(--hk-ink);
  font-family: var(--hk-ui-family); font-size: var(--hk-btn-fs); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color var(--hk-dur-fast) var(--hk-ease), color var(--hk-dur-fast) var(--hk-ease);
  -webkit-tap-highlight-color: transparent;
}
.hk-btn:focus { outline: none; }
.hk-btn:hover, .hk-btn:focus-visible { background: var(--hk-hover); }
.hk-btn:active { background: #e8e8ec; }
.hk-btn--outline { background: #fff; color: var(--hk-ink); }
.hk-btn--confirm {
  height: var(--hk-confirm-h);
  padding: 0 var(--hk-confirm-px);
  font-size: var(--hk-confirm-fs);
}
/* A10b: can't be pressed = the line AND the words both muted together, white, no hover. */
.hk-btn[disabled], .hk-btn.is-muted { background: #fff; color: var(--hk-off-ink); border-color: var(--hk-off-line); cursor: default; }
/* Grouped buttons: one width each (the widest label decides), side by side. */
.hk-btn-row { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; }
.hk-btn-row > .hk-btn { width: 100%; }

/* The COMPACT button (2026-11-08 K5b) - admin's LIVE / STOP. 32px, 8px corners, 1px red line, red
   words + 7px dot/square, pale red hover. Not pressable yet = white, grey line, grey words. The
   page gives it a fixed width so LIVE and STOP share one (neither edge moves when it switches). */
.hk-cbtn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  box-sizing: border-box; height: 32px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--hk-red); background: #fff; color: var(--hk-red);
  font-family: var(--hk-ui-family); font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background-color var(--hk-dur-fast) var(--hk-ease), color var(--hk-dur-fast) var(--hk-ease), border-color var(--hk-dur-fast) var(--hk-ease);
}
.hk-cbtn:focus { outline: none; }
.hk-cbtn:hover, .hk-cbtn:focus-visible { background: #fdf3f2; }
.hk-cbtn .hk-dot, .hk-cbtn .hk-sq { width: 7px; height: 7px; background: currentColor; flex: none; }
.hk-cbtn .hk-dot { border-radius: 50%; }
.hk-cbtn.is-muted, .hk-cbtn[disabled] { border-color: var(--hk-line); color: var(--hk-muted); cursor: default; background: #fff; }

/* ---- Standard tick and cross (A11) ----------------------------------------------------------
   Drawn SVGs (never the typed check / cross characters), 16px with a 1.5px line, in a 28px hover
   square. The tick follows its sentence (red when the question is red, black otherwise); the cross
   is always grey. Markup: HK.tickBtn('red'|'black') / HK.crossBtn() in /hk-ui.js. */
.hk-tc {
  -webkit-appearance: none; appearance: none; border: 0; background: none; padding: 0; margin: 0;
  width: 28px; height: 28px; border-radius: 6px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background-color var(--hk-dur-fast) var(--hk-ease);
}
.hk-tc:hover, .hk-tc:focus-visible { background: var(--hk-hover); outline: none; }
.hk-tc svg { width: 16px; height: 16px; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; display: block; }
.hk-tc.is-red svg { stroke: var(--hk-red); }
.hk-tc.is-black svg { stroke: var(--hk-ink); }
.hk-tc.is-grey svg { stroke: var(--hk-text-2); }

/* Icons: 1.5px on screen at any size. */
.hk-ico { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.hk-ico * { vector-effect: non-scaling-stroke; stroke-width: var(--hk-icon-line); }

/* The small grey point that marks an empty cell (Record). */
.hk-pt { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--hk-line); vertical-align: middle; }

/* Section header (A9): the name only, 11px Inter 600 spaced caps, muted. */
.hk-sec { font-family: var(--hk-ui-family); font-size: var(--hk-fs-cap); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--hk-muted); }

/* ---- The standard list box (B) - every drop-down and pop-up menu ----------------------------
   Fill #f5f5f7, 1px #e5e5ea edge, 8px corners, NO shadow, Inter 14px, 32px rows, 10px top / 12px
   bottom padding, inset dividers. Current row Inter 600, scrolled into view on opening. 8 rows
   visible, then it scrolls. Opens like a drawer (0.42s), closes in 0.28s. Built by HK.menu(). */
.hk-list {
  position: fixed; z-index: 2147482000; box-sizing: border-box;
  min-width: 140px; max-height: calc(10px + 12px + 8 * 32px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 0 12px; margin: 0;
  background: var(--hk-list-bg); border: 1px solid var(--hk-list-edge); border-radius: 8px; box-shadow: none;
  font-family: var(--hk-ui-family); font-size: 14px; font-weight: 400; color: var(--hk-ink);
  letter-spacing: normal; text-transform: none; text-align: left;
  clip-path: inset(0 0 100% 0 round 8px);
  transition: clip-path var(--hk-close) var(--hk-ease);
}
.hk-list.hk-open { clip-path: inset(0 0 0 0 round 8px); transition: clip-path var(--hk-open) var(--hk-ease); }
.hk-list .hk-li {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 14px; box-sizing: border-box;
  white-space: nowrap; cursor: pointer; user-select: none;
}
.hk-list .hk-li:hover, .hk-list .hk-li.hk-kb { background: var(--hk-list-hover); }
.hk-list .hk-li.hk-cur { font-weight: 600; }
.hk-list .hk-li.hk-mute { color: var(--hk-muted); }
.hk-list .hk-li.hk-center { justify-content: center; }
.hk-list .hk-li .hk-li-r { margin-left: auto; padding-left: 16px; color: var(--hk-muted); }
.hk-list .hk-li svg { width: 18px; height: 18px; flex: none; }
.hk-list .hk-sep { height: 1px; background: var(--hk-list-edge); margin: 6px 14px; }
.hk-list .hk-cap { padding: 2px 14px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--hk-muted); }
.hk-list .hk-filter { display: block; box-sizing: border-box; width: calc(100% - 28px); margin: 0 14px 4px; height: 28px; padding: 0; border: 0; background: transparent; font: inherit; outline: none; color: var(--hk-ink); }
.hk-list .hk-filter::placeholder { color: var(--hk-muted); }
/* The closed look of a drop-down: words + the standard chevron (A4), which flips up while open. */
.hk-dd { -webkit-appearance: none; appearance: none; border: 0; background: none; padding: 4px 0; margin: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.hk-dd:focus { outline: none; }
.hk-dd[disabled] { opacity: .35; cursor: default; }
.hk-chev { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--hk-close) var(--hk-ease); }
.hk-dd.hk-open .hk-chev { transform: rotate(180deg); transition: transform var(--hk-open) var(--hk-ease); }

/* ---- Scrollbar on computers (A6): thin grey handle, no track, no arrow buttons. Phones keep their
   own. ::-webkit-scrollbar is what drops Chrome-on-Windows' arrows; Firefox gets scrollbar-width. */
@media (hover: hover) and (pointer: fine) {
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--hk-line); border-radius: 4px; border: 0; }
  ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
  @supports (-moz-appearance: none) { * { scrollbar-width: thin; scrollbar-color: var(--hk-line) transparent; } }
}

/* ---- The loading logo -----------------------------------------------------------------------
   The logo traced as a thin line, "draw, then un-draw" (the erase starts where the line began, so
   it seems to chase itself round), 2.6 s a loop. ALWAYS at the exact centre of the whole window,
   whatever bars the page has, so it never jumps between pages. Drawn by /site-loader.js per frame
   (stroke-dashoffset), not CSS keyframes. */
.hk-loader {
  position: fixed; left: 50%; top: 50%;
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  pointer-events: none; z-index: 2147483000;
  opacity: 0; transition: opacity var(--hk-dur-fast) var(--hk-ease);
}
.hk-loader.hk-on { opacity: 1; }
.hk-loader svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hk-loader path { fill: none; stroke: var(--hk-ink); stroke-width: 6; stroke-linejoin: round; stroke-linecap: round; }

/* ---- "The content appears all at once when ready" -------------------------------------------
   Mark the block that waits on data `hk-reveal`; HKLoad.reveal(el) fades it in, whole, in one go.
   The frame (corners, bars) is never marked: it arrives at once. */
.hk-reveal { opacity: 0; visibility: hidden; }
.hk-reveal.hk-in { opacity: 1; visibility: visible; transition: opacity var(--hk-dur) var(--hk-ease); }
