/* Shared look for every page.
   Dark navy, like a Studio viewport at night. The mascot is a rig mannequin (light limbs,
   blue shirt) with yellow joint dots like the Animation Editor's handles. Accents: yellow
   for the main action, blue for links, green for success.
   One typeface, Bricolage Grotesque: narrow and heavy for headlines, normal for text.
   Page-specific styles live in their own files (landing.css, account.css). */

@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage.woff") format("woff");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --ink: #0b1430;        /* page background */
  --ink-2: #111c40;      /* raised areas: header, stage */
  --ink-3: #18265a;      /* cards, inputs */
  --line: #283a72;       /* borders */
  --text: #f1f4ff;
  --muted: #a3afd6;
  --yellow: #f5cd30;     /* main actions (Bright yellow) */
  --yellow-hover: #ffdc55;
  --blue: #4aa3ff;       /* links, focus details */
  --green: #a4bd47;      /* success (Bright yellowish green) */
  --red: #ff6b6b;        /* errors and danger */
  --amber: #e3a72f;      /* warnings */

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --page: 1120px;        /* widest content */
  --text-width: 64ch;    /* comfortable reading width */

  /* Type scale (about 1.25 per step). */
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --step-4: 2.25rem;
  --step-5: 3rem;
  --step-6: clamp(3rem, 7vw + 1rem, 5.75rem);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--text);
  font-family: "Bricolage", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--step-0);
  font-variation-settings: "opsz" 14;
  line-height: 1.55;
}

body > main { flex: 1; }

img, svg { max-width: 100%; }

/* Headlines: narrow and heavy. */
h1, h2, h3, .display {
  font-weight: 800;
  font-stretch: 78%;
  font-variation-settings: "opsz" 96;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); font-stretch: 85%; line-height: 1.15; }

p { margin: 0 0 1em; color: var(--muted); max-width: var(--text-width); }
strong { color: var(--text); font-weight: 650; }

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: #7cc0ff; }

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 4px;
}

.hidden { display: none !important; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--yellow);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: var(--radius-s);
  font-weight: 700;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* Header and footer ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(11, 20, 48, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-stretch: 80%;
  font-size: var(--step-2);
  letter-spacing: -0.01em;
}
.logo:hover { color: var(--text); }
.logo svg { width: 28px; height: 28px; flex: none; }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.site-header nav a:not(.btn) {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-s);
}
.site-header nav a:not(.btn):hover { color: var(--text); background: var(--ink-3); }
@media (max-width: 640px) {
  .site-header nav a.nav-optional { display: none; }
}
@media (max-width: 400px) {
  .site-header .inner { padding-inline: 14px; gap: 10px; }
  .logo { font-size: var(--step-1); white-space: nowrap; }
  .logo svg { width: 24px; height: 24px; }
  .site-header .btn { white-space: nowrap; }
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--step--1);
}
.site-footer .inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 28px 20px 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: baseline;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer .note { margin: 0; flex-basis: 100%; max-width: none; font-size: 0.8125rem; }

/* Layout -------------------------------------------------------------------------- */

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 20px; }
main.narrow { width: 100%; max-width: 640px; margin: 0 auto; padding: 48px 20px 64px; }
main.doc { width: 100%; max-width: 760px; margin: 0 auto; padding: 48px 20px 64px; }
main.doc p, main.doc li { color: var(--text); }
main.doc h2 { font-size: var(--step-3); margin-top: 1.6em; }
main.wide { width: 100%; max-width: 1040px; margin: 0 auto; padding: 40px 20px 64px; }

/* Buttons --------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: #1a1400;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--yellow-hover); color: #1a1400; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn.secondary {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn.secondary:hover { background: var(--ink-3); color: var(--text); }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: var(--step--1); }
.btn.big { min-height: 54px; padding: 14px 28px; font-size: var(--step-1); }
.btn.danger { background: var(--red); color: #2a0606; }
.btn.danger:hover { background: #ff8787; }
button.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--blue);
  font: inherit;
  font-size: var(--step--1);
  cursor: pointer;
}

/* Forms ------------------------------------------------------------------------------ */

label { display: block; font-weight: 650; margin: 0 0 6px; }
input[type="text"], input[type="email"], input[type="search"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  margin: 0 0 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--ink);
  color: var(--text);
  font: inherit;
}
input::placeholder, textarea::placeholder { color: #6f7ba3; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); outline: none; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; }
/* Codes typed from the plugin (ABCD-2345). */
input.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.08em; text-transform: uppercase; }
input.plain { text-transform: none; letter-spacing: normal; font-family: inherit; }

.msg { margin: 12px 0 0; font-weight: 650; }
.msg.good { color: var(--green); }
.msg.bad { color: var(--red); }

.warning {
  border: 1.5px solid rgba(227, 167, 47, 0.55);
  background: rgba(227, 167, 47, 0.1);
  color: var(--text);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 0.95rem;
  max-width: none;
}

/* Cards and lists (account and admin pages) -------------------------------------- */

.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 22px;
  margin-top: 20px;
}
.card h2 { font-size: var(--step-2); font-stretch: 85%; line-height: 1.15; }
.card.danger { border-color: rgba(255, 107, 107, 0.45); }

.user { display: flex; align-items: center; gap: 14px; }
.user img { width: 52px; height: 52px; border-radius: 50%; background: var(--ink-3); }
.user strong { display: block; font-size: var(--step-1); }
.user span { color: var(--muted); font-size: 0.95rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.list li:first-child { border-top: 0; padding-top: 0; }
.list strong { display: block; }
.list span { color: var(--muted); font-size: 0.9rem; }

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.8rem;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 12px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-s);
  margin: 8px 0 16px;
}

.muted { opacity: 0.7; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }

/* Admin pages (internal) ------------------------------------------------------------ */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 20px; }
.toolbar select { width: auto; margin: 0; padding: 7px 10px; }
.counts { color: var(--muted); font-size: 0.9rem; }
.events { list-style: none; margin: 0 0 16px; padding: 0; }
.event {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}
.event.warning { border-left-color: var(--amber); }
.event-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 0.9rem; }
.badge { font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: rgba(255, 107, 107, 0.18); color: #ff8f8f; }
.badge.warning { background: rgba(227, 167, 47, 0.18); color: #f0c25e; }
.where { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }
.when { margin-left: auto; color: var(--muted); }
.event-msg { margin: 6px 0 4px; }
.event-meta { color: var(--muted); font-size: 0.85rem; }
.event-details { margin-top: 8px; }
.event-details pre {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 10px;
  overflow-x: auto;
  font-size: 0.8rem;
  margin: 4px 0 10px;
}
.hint { font-size: 0.9rem; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 650; border-top: 0; }
.table tr.ok td:nth-child(2) { color: var(--green); font-weight: 650; }
.table tr.bad td:nth-child(2) { color: var(--red); font-weight: 650; }
.table .problem { color: var(--muted); overflow-wrap: anywhere; }
details summary { cursor: pointer; color: var(--muted); margin-top: 16px; }
.available { list-style: none; padding: 0; margin: 8px 0 0; max-height: 320px; overflow-y: auto; }
.available li { padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.available li:hover { background: var(--ink-3); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 8px 0 4px; }
.stat { background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat span { display: block; color: var(--muted); font-size: 0.85rem; }
.stat strong { font-size: 1.35rem; }
input.small-input { width: 110px; display: inline-block; margin: 0 0 0 4px; padding: 6px 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
