/* Base layer: reset, type, header and footer, buttons, chips, notices. Hand-written; no framework. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--teal) 11%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, color-mix(in srgb, var(--gold) 8%, transparent), transparent 55%), var(--ink-950);
  color: var(--text); font: 16px/1.45 var(--font-body); padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-head); }
a { color: var(--teal-text); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The skip link is out of sight until a keyboard focuses it (:focus-visible, so a mouse click or a page capture never shows it), then it sits at the top of the screen. */
.skip { position: absolute; left: 8px; top: 8px; z-index: 100; background: var(--teal); color: var(--on-teal); padding: 12px 16px; border-radius: 8px; transform: translateY(-300%); }
.skip:focus-visible { position: fixed; transform: none; }

/* logo: two files, shown by theme */
.logo { display: block; height: auto; }
.logo-light { display: none; }
:root[data-theme="light"] .logo-dark { display: none; }
:root[data-theme="light"] .logo-light { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .logo-dark { display: none; }
  :root:not([data-theme]) .logo-light { display: block; }
}

/* header */
.bar {
  position: sticky; top: 0; z-index: 30; height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  backdrop-filter: blur(14px); background: color-mix(in srgb, var(--ink-950) 82%, transparent); border-bottom: 1px solid var(--line);
}
.bar .logo { width: 132px; }
.bar > a:first-child { display: flex; align-items: center; min-height: 44px; }        /* a touch target of at least 44 px */
.grow { flex: 1; }
/* the account menu: the first letter of the email in a ring in the plan's colour, the plan's badge at the lower right, a drop-down under it */
.acct { position: relative; --ring: #9ba6bc; --glow: 0; }
.acct.t-taster { --ring: #27e3c2; --glow: 1; }
.acct.t-starter { --ring: #22e27a; --glow: 1; }
.acct.t-vip { --ring: #ffc24d; --glow: 1; }
.acct.t-vvip { --ring: #ffe45c; --glow: 1; }
:root[data-theme="light"] .acct { --ring: #5f6f91; }
:root[data-theme="light"] .acct.t-taster { --ring: #00806e; }
:root[data-theme="light"] .acct.t-starter { --ring: #16a959; }
:root[data-theme="light"] .acct.t-vip { --ring: #c27c00; }
:root[data-theme="light"] .acct.t-vvip { --ring: #d9a400; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .acct { --ring: #5f6f91; }
  :root:not([data-theme]) .acct.t-taster { --ring: #00806e; }
  :root:not([data-theme]) .acct.t-starter { --ring: #16a959; }
  :root:not([data-theme]) .acct.t-vip { --ring: #c27c00; }
  :root:not([data-theme]) .acct.t-vvip { --ring: #d9a400; }
}
.acct > summary { list-style: none; cursor: pointer; }
.acct > summary::-webkit-details-marker { display: none; }
.acct-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.acct-btn .av { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink-800); color: var(--text); font: 700 16px var(--font-head); border: 2px solid var(--ring); box-shadow: 0 0 calc(var(--glow) * 12px) color-mix(in srgb, var(--ring) 65%, transparent); animation: acctglow 3s ease-in-out infinite; }
.acct-btn:hover .av, .acct[open] .av { background: var(--ink-900); }
.acct-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
@keyframes acctglow { 50% { box-shadow: 0 0 calc(var(--glow) * 20px) color-mix(in srgb, var(--ring) 85%, transparent); } }
.acct-btn .tb { position: absolute; right: 0; bottom: 1px; width: 17px; height: 17px; padding: 2px; box-sizing: border-box; border-radius: 50%; background: var(--ink-950); color: var(--ring); border: 1px solid var(--ring); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: max-content; min-width: 190px; max-width: min(260px, calc(100vw - 24px)); padding: 6px; border: 1px solid var(--line); border-radius: var(--r-lg, 14px); background: var(--ink-900); box-shadow: 0 18px 44px -12px rgba(0, 0, 0, 0.55); }
.acct-id { margin: 0; padding: 10px 12px 12px; display: grid; gap: 2px; border-bottom: 1px solid var(--line); }
.acct-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 11px var(--font-body); color: var(--text-dim); transition: color 0.2s; }
.acct-id:hover .acct-email { color: var(--text); }        /* darker on the light theme, lighter on the dark one */
.acct-plan { color: var(--text-dim); font: 600 12px var(--font-body); }
.acct-menu nav { display: grid; padding: 4px 0; }
.acct-menu nav a, .acct-menu form button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--text); text-decoration: none; font: 600 14px var(--font-body); text-align: left; cursor: pointer; }
.acct-menu nav a:hover, .acct-menu form button:hover { background: var(--ink-800); }
.acct-menu form { margin: 0; padding-top: 4px; border-top: 1px solid var(--line); }
.acct-mob { display: none; }
@media (max-width: 520px) { .acct-mob { display: grid; } }        /* the header links are hidden on a phone: they are in the menu instead */
.bar form { margin: 0; }
.navlink { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-dim); text-decoration: none; font: 600 14px var(--font-body); padding: 0 10px; border-radius: 8px; }
.navlink:hover { color: var(--text); background: var(--ink-800); }
.demo-pill { margin-left: 6px; padding: 0 6px; border-radius: 999px; border: 1px dashed var(--ring-amber); color: var(--warn-text); font: 700 10px var(--font-body); letter-spacing: 0.04em; text-transform: uppercase; }
@media (max-width: 520px) { .bar .navlink { display: none; } }        /* on a phone the same links are in the footer */

/* buttons and chips */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--ink-800); color: var(--text); border-radius: 999px; padding: 8px 14px;
  font: 600 13px var(--font-body); cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.btn:hover { border-color: var(--teal); }
.btn:active { transform: scale(0.97); }
.btn.gold { background: linear-gradient(135deg, var(--gold), #ff9a3d); color: var(--on-gold); border: 0; }
.iconbtn { min-width: 44px; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; background: var(--ink-800); max-width: 100%; }
.chip.info { border-color: color-mix(in srgb, var(--teal) 50%, var(--line)); color: var(--teal-text); }
.chip.warn { border-color: var(--ring-amber); color: var(--warn-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal) 60%, transparent); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.switch { display: inline-flex; padding: 4px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--ink-900); }
.switch a { min-height: 44px; padding: 0 20px; display: inline-flex; align-items: center; border-radius: 999px; text-decoration: none; font: 700 14px var(--font-head); color: var(--text-dim); }
.switch a:hover { color: var(--text); }
.switch a[aria-current="page"] { background: var(--teal); color: var(--on-teal); }

/* notices and banners */
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); font-size: 14.5px;
  border: 1px solid color-mix(in srgb, var(--teal) 50%, var(--line)); background: color-mix(in srgb, var(--teal) 9%, var(--ink-900));
}
.notice.bad { border-color: color-mix(in srgb, var(--ring-red) 60%, var(--line)); background: color-mix(in srgb, var(--ring-red) 12%, var(--ink-900)); }
.notice svg { flex: none; width: 20px; height: 20px; color: var(--teal-text); margin-top: 1px; }
.banner { font-size: 13px; border-radius: var(--r-sm); padding: 8px 10px; background: color-mix(in srgb, var(--ring-red) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ring-red) 40%, transparent); }
.banner.pass { background: color-mix(in srgb, var(--gold) 12%, transparent); border-color: color-mix(in srgb, var(--gold) 45%, transparent); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.empty { padding: 36px 16px; text-align: center; color: var(--text-dim); border: 1px dashed var(--line); border-radius: var(--r-lg); }
.empty h2 { color: var(--text); font-size: 18px; margin-bottom: 4px; }

main { flex: 1; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; }
.foot { color: var(--text-dim); font-size: 12px; padding: 28px 16px 40px; max-width: 1180px; margin: 0 auto; width: 100%; }
.foot-row { display: flex; gap: 12px 24px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.foot-brand { display: grid; gap: 4px; justify-items: end; text-align: right; margin-left: auto; }
.foot-brand .logo { width: 104px; filter: grayscale(1); opacity: 0.55; }
.foot-brand p { margin: 0; white-space: nowrap; }
@media (max-width: 520px) { .foot-brand p { white-space: normal; } }
.foot-note { margin: 12px 0 0; max-width: 760px; }
.foot nav { display: flex; gap: 2px 8px; flex-wrap: wrap; margin-bottom: 4px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }

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

/* The credits coin (templates/_coin.html): a gold coin with the bolt engraved in it. Colours from the tokens, so both colour schemes work. */
.coin { flex: none; vertical-align: -0.2em; }
.coin .face { fill: var(--gold); }
.coin .rim { fill: none; stroke: var(--ink-900); stroke-opacity: 0.35; stroke-width: 1; }
.coin .bolt { fill: var(--ink-900); }
@media (forced-colors: active) {
  .coin .face { fill: Canvas; stroke: CanvasText; }
  .coin .rim { stroke: CanvasText; stroke-opacity: 1; }
  .coin .bolt { fill: CanvasText; }
}
