/* Youth AI Club demo: shared styles.
   The look follows the session slides: the brand gradient is the stage,
   charcoal panels hold the activity, JetBrains Mono is the machine's voice. */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-greek-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-latin-ext-wght-normal.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;

  /* Stage: the session's brand gradient */
  --violet: #9246db;
  --iris: #7b7dbe;
  --teal: #69a9a4;
  --mint: #66d48f;
  --stage: linear-gradient(160deg, #9246db 0%, #8a58d2 24%, #7b7dbe 50%, #69a9a4 76%, #66d48f 100%);

  /* Panels */
  --panel: #26262b;
  --panel-raised: #313137;
  --panel-sunken: #1d1d21;
  --line: rgb(255 255 255 / 0.08);
  --line-strong: rgb(255 255 255 / 0.2);

  /* Text */
  --paper: #f7f7f8;
  --mist: #c4c4ca;
  --dim: #8f8f99;
  --ink: #19191c;

  /* Signals */
  --done: #6fdc97;
  --alarm: #ff8a80;
  --sticker-yellow: #ffd43b;
  --sticker-red: #ff5a5f;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Type scale: major third on 16px */
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.25rem;
  --text-lg: 1.5625rem;
  --text-xl: 1.9375rem;
  --text-2xl: 2.4375rem;
  --text-display: clamp(2.75rem, 1.5rem + 5.6vw, 6rem);

  --radius-panel: 24px;
  --radius-control: 12px;
  --radius-pill: 999px;

  --gutter: 16px;
  --page-width: 1120px;
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--paper);
  background-color: #7b7dbe;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The stage stays put while content scrolls over it. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgb(20 16 34 / 0) 45%, rgb(20 16 34 / 0.22) 100%),
    var(--stage);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* ---------- layout ---------- */

.page {
  width: min(100% - 2 * var(--gutter), var(--page-width));
  margin-inline: auto;
  padding-block: 8px 64px;
}

.page-title {
  font-size: var(--text-xl);
}

.page-lead {
  margin-top: 8px;
  max-width: 46ch;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.45;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius-panel);
  padding: 24px;
}

@media (min-width: 720px) {
  .panel {
    padding: 32px;
  }
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(100% - 2 * var(--gutter), var(--page-width));
  min-height: 64px;
  margin-inline: auto;
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  width: 28px;
  height: 28px;
}

.site-nav {
  display: none;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: rgb(255 255 255 / 0.84);
}

.site-nav a:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.12);
}

.site-nav a[aria-current='page'] {
  color: #fff;
  background: rgb(25 25 28 / 0.32);
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-left: auto;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: rgb(25 25 28 / 0.38);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.player-chip:hover {
  background: rgb(25 25 28 / 0.52);
}

.player-chip[data-loading] {
  opacity: 0;
}

.player-chip .status-dot {
  background: var(--done);
}

@media (min-width: 720px) {
  .site-nav {
    display: flex;
  }

  .site-nav + .player-chip {
    margin-left: 0;
  }
}

/* ---------- buttons ---------- */

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-control);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.button:active:not([disabled]) {
  transform: translateY(1px);
}

.button[disabled] {
  cursor: default;
  opacity: 0.45;
}

.button-primary {
  background: var(--paper);
  color: var(--ink);
}

.button-primary:hover:not([disabled]) {
  background: #fff;
}

.button-secondary {
  background: transparent;
  color: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

.button-secondary:hover:not([disabled]),
.button-secondary[aria-pressed='true'] {
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.45);
  background: rgb(255 255 255 / 0.06);
}

.button-quiet {
  padding-inline: 12px;
  background: transparent;
  color: var(--mist);
}

.button-quiet:hover:not([disabled]) {
  color: var(--paper);
}

.button-danger {
  background: var(--alarm);
  color: var(--ink);
}

.button-small {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 0.875rem;
}

.button-block {
  width: 100%;
}

.link {
  color: var(--mist);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / 0.3);
  text-underline-offset: 3px;
}

.link:hover {
  color: var(--paper);
  text-decoration-color: currentColor;
}

/* ---------- forms ---------- */

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--mist);
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--panel-sunken);
  font-size: 1.0625rem;
  font-weight: 500;
  transition: border-color 0.15s;
}

.input::placeholder {
  color: var(--dim);
  opacity: 1;
}

.input:focus {
  outline: none;
  border-color: var(--paper);
}

.input[aria-invalid='true'] {
  border-color: var(--alarm);
}

.field-hint {
  font-size: var(--text-sm);
  color: var(--dim);
}

.field-error {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--alarm);
}

/* ---------- small pieces ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--mist);
}

.status-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
}

.status[data-tone='live'] .status-dot {
  background: var(--done);
  box-shadow: 0 0 0 4px rgb(111 220 151 / 0.18);
}

.status[data-tone='warn'] .status-dot {
  background: var(--sticker-yellow);
}

.status[data-tone='error'] .status-dot {
  background: var(--alarm);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--mist);
  white-space: nowrap;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgb(255 255 255 / 0.1);
  box-shadow: inset 0 -1px 0 rgb(255 255 255 / 0.12);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.icon {
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

dialog.confirm {
  width: min(100% - 32px, 420px);
  padding: 28px;
  border: 0;
  border-radius: var(--radius-panel);
  background: var(--panel);
  color: var(--paper);
}

dialog.confirm::backdrop {
  background: rgb(16 14 26 / 0.6);
}

.confirm h2 {
  font-size: var(--text-md);
}

.confirm p {
  margin-top: 8px;
  color: var(--mist);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

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