/*
 * Shared mobile-first stylesheet used by the workshop hub and the
 * waitlist page. Uses the same theme tokens as the deck (defined here
 * for the modern-dark default; overrides per-theme are in the theme
 * blocks at the bottom of this file).
 */

:root {
  --ivory:       #F5F1EA;
  --ivory-deep:  #EDE7DA;
  --navy:        #0E2340;
  --navy-deep:   #081628;
  --navy-soft:   #1E3A5F;
  --slate:       #4A5766;
  --slate-soft:  #8A95A6;
  --teal:        #17A9A3;
  --teal-bright: #3FD0C9;
  --teal-dark:   #107A76;
  --coral:       #EF6F4A;
  --coral-bright:#FF8A65;
  --coral-dark:  #C9532E;
  --ink:         #0B1628;

  --role-system:        #B580FF;
  --role-user:          #3FD0C9;
  --role-assistant:     #F5F1EA;
  --role-tool-def:      #F5B547;
  --role-tool-call:     #EF6F4A;
  --role-tool-result:   #7FD97F;

  --font-display: "Inter", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --font-body:    "Inter", "Helvetica Neue", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(ellipse at top right, rgba(23,169,163,0.10), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(239,111,74,0.07), transparent 55%),
    var(--navy);
  background-attachment: fixed;
  min-height: 100dvh;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ivory);
}
h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 5.5vw, 1.7rem); }
h3 { font-size: clamp(1.1rem, 4vw, 1.25rem); }
h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--teal-bright);
  font-weight: 700;
  margin-bottom: 0.8em;
}

p { margin: 0.6em 0 1em; }
strong { color: var(--teal-bright); font-weight: 700; }
em { color: var(--coral-bright); font-style: normal; font-weight: 600; }
a {
  color: var(--teal-bright);
  text-decoration: none;
  border-bottom: 2px solid rgba(63,208,201,0.4);
}
a:hover { color: var(--coral-bright); border-bottom-color: var(--coral-bright); }

/* Layout */

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 4.5rem 1.4rem 5rem;
}

.eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--teal-bright);
  font-weight: 700;
  margin-bottom: 1.1em;
}

.brand {
  position: fixed;
  top: 0.9rem;
  left: 1rem;
  z-index: 50;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  color: var(--ivory);
  text-decoration: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(20, 30, 45, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
}
.brand::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--teal-bright);
}
html[data-mode="light"] .brand,
html[data-theme="paper"] .brand {
  background: rgba(255,253,247,0.7);
  color: var(--ink);
  border-color: rgba(0,0,0,0.1);
}

/* Cards / tiles */

.card {
  display: block;
  padding: 1.3rem 1.3rem 1.4rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ivory);
  text-decoration: none;
  margin: 0.9rem 0;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(63,208,201,0.35);
}
.card:active { transform: translateY(1px); }
.card h3 { margin: 0 0 0.3em; font-size: 1.15rem; }
.card p  { margin: 0; font-size: 0.95rem; color: var(--slate-soft); }
.card .badge {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-bright);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Form */

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}
.form-row { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--slate-soft);
}
.form-input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  color: var(--ivory);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.form-input::placeholder { color: var(--slate-soft); }
.form-input:focus {
  border-color: var(--teal-bright);
  background: rgba(63,208,201,0.08);
}
.form-help {
  font-size: 0.78rem;
  color: var(--slate-soft);
}

.btn {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1rem 1.4rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--teal-bright);
  color: var(--ink);
}
.btn-primary:hover { background: #5BDED8; }
.btn-primary[disabled] {
  background: rgba(63,208,201,0.4);
  cursor: not-allowed;
}
.btn-secondary {
  background: transparent;
  border: 1px solid rgba(245,241,234,0.3);
  color: var(--ivory);
}
.btn-secondary:hover {
  border-color: var(--coral-bright);
  color: var(--coral-bright);
}

.form-state {
  font-size: 0.95rem;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  margin-top: 1rem;
  display: none;
}
.form-state.ok {
  display: block;
  background: rgba(127,217,127,0.13);
  border: 1px solid rgba(127,217,127,0.5);
  color: var(--ivory);
}
.form-state.err {
  display: block;
  background: rgba(239,111,74,0.13);
  border: 1px solid rgba(239,111,74,0.55);
  color: var(--ivory);
}

/* "Class pill" used on waitlist + welcome to indicate which class */
.class-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(63,208,201,0.13);
  border: 1px solid rgba(63,208,201,0.4);
  color: var(--teal-bright);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.foot {
  margin-top: 3rem;
  padding-top: 1.6rem;
  font-size: 0.8rem;
  color: var(--slate-soft);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ===================================================================== */
/* THEMES — same data-theme / data-mode model as the deck.               */
/* ===================================================================== */

html[data-theme="modern"][data-mode="light"] {
  --ivory:       #1A2536;
  --navy:        #F4EFE3;
  --navy-deep:   #E9E1CE;
  --navy-soft:   #FFFFFF;
  --slate:       #4A5766;
  --slate-soft:  #6B7585;
  --teal-bright: #0E8581;
  --teal-dark:   #0B6B66;
  --coral-bright:#C9532E;
  --coral-dark:  #A0411F;
  --ink:         #1A2536;
}
html[data-theme="modern"][data-mode="light"] body {
  background:
    radial-gradient(ellipse at top right, rgba(14,133,129,0.10), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(201,83,46,0.08), transparent 55%),
    #F4EFE3;
  background-attachment: fixed;
  color: #1A2536;
}
html[data-theme="modern"][data-mode="light"] .card {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.08);
}
html[data-theme="modern"][data-mode="light"] .form-input {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.15);
  color: #1A2536;
}

html[data-theme="paper"] {
  --ivory:       #1A1A1A;
  --navy:        #F6F1E4;
  --navy-deep:   #EAE2CD;
  --navy-soft:   #FFFDF7;
  --slate:       #4A4A4A;
  --slate-soft:  #6E6E6E;
  --teal-bright: #1A4D7A;
  --teal-dark:   #14406B;
  --coral-bright:#A8341E;
  --ink:         #1A1A1A;
}
html[data-theme="paper"] body {
  background: #F6F1E4;
  color: #1A1A1A;
  font-family: "Source Serif 4", "Georgia", "Times New Roman", serif;
}
html[data-theme="paper"] h1,
html[data-theme="paper"] h2,
html[data-theme="paper"] h3 {
  font-family: "Source Serif 4", "Georgia", serif;
  letter-spacing: -0.015em;
}
html[data-theme="paper"] .card {
  background: rgba(0,0,0,0.025);
  border: 1px solid rgba(0,0,0,0.1);
}
html[data-theme="paper"] .form-input {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.18);
  color: #1A1A1A;
}

html[data-theme="terminal"] {
  --ivory:       #C4FFC4;
  --navy:        #050A05;
  --navy-deep:   #000300;
  --navy-soft:   #0B1A0B;
  --slate:       #4A8A4A;
  --slate-soft:  #5A8A5A;
  --teal-bright: #7FFF7F;
  --teal-dark:   #3FA63F;
  --coral-bright:#FFD060;
  --ink:         #050A05;
}
html[data-theme="terminal"] body,
html[data-theme="terminal"] h1,
html[data-theme="terminal"] h2,
html[data-theme="terminal"] h3,
html[data-theme="terminal"] h4 {
  font-family: var(--font-mono);
  letter-spacing: 0;
}
html[data-theme="terminal"] body {
  background:
    repeating-linear-gradient(180deg, rgba(127,255,127,0.03) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at center, rgba(127,255,127,0.06), transparent 70%),
    #050A05;
}
html[data-theme="terminal"] .card,
html[data-theme="terminal"] .form-input {
  background: rgba(127,255,127,0.03);
  border-color: rgba(127,255,127,0.3);
  box-shadow: 0 0 12px rgba(127,255,127,0.05) inset;
}
html[data-theme="terminal"] strong { color: #B5FF6B; }
html[data-theme="terminal"] em { color: #FFD060; }

/* Skeuomorphic */
html[data-theme="skeuomorphic"][data-mode="dark"] {
  --ivory:       #F4E7CB;
  --navy:        #2A1A18;
  --navy-deep:   #1A0E0C;
  --navy-soft:   #3C2620;
  --slate:       #8E6F50;
  --slate-soft:  #B8956E;
  --teal-bright: #D9B45A;
  --teal-dark:   #A3853B;
  --coral-bright:#D17F4F;
  --coral-dark:  #A0552B;
  --ink:         #1A0E0C;
}
html[data-theme="skeuomorphic"][data-mode="dark"] body {
  background:
    repeating-linear-gradient(45deg, rgba(217,180,90,0.03) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,0.05) 0 1px, transparent 1px 7px),
    radial-gradient(ellipse at top, rgba(217,180,90,0.1), transparent 55%),
    linear-gradient(180deg, #3a2420 0%, #2A1A18 50%, #1d0f0d 100%);
  background-attachment: fixed;
}
html[data-theme="skeuomorphic"][data-mode="light"] {
  --ivory:       #2A1B0C;
  --navy:        #E8DDC4;
  --navy-deep:   #D6C7A6;
  --navy-soft:   #F7EFD9;
  --slate:       #6C5238;
  --slate-soft:  #7B5E40;
  --teal-bright: #6E4A22;
  --teal-dark:   #4F341A;
  --coral-bright:#A35420;
  --ink:         #2A1B0C;
}
html[data-theme="skeuomorphic"][data-mode="light"] body {
  background:
    repeating-linear-gradient(45deg, rgba(110,74,34,0.025) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(110,74,34,0.02) 0 1px, transparent 1px 7px),
    radial-gradient(ellipse at top, rgba(255,220,160,0.4), transparent 60%),
    linear-gradient(180deg, #F2E6CB 0%, #E8DDC4 50%, #DCCFB0 100%);
  background-attachment: fixed;
  color: #2A1B0C;
}
html[data-theme="skeuomorphic"] h1,
html[data-theme="skeuomorphic"] h2,
html[data-theme="skeuomorphic"] h3 {
  font-family: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  letter-spacing: -0.01em;
}
html[data-theme="skeuomorphic"][data-mode="dark"] h1,
html[data-theme="skeuomorphic"][data-mode="dark"] h2 {
  text-shadow: 0 1px 0 rgba(0,0,0,0.6), 0 2px 4px rgba(0,0,0,0.35);
}
html[data-theme="skeuomorphic"][data-mode="light"] h1,
html[data-theme="skeuomorphic"][data-mode="light"] h2 {
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}
html[data-theme="skeuomorphic"][data-mode="dark"] .card,
html[data-theme="skeuomorphic"][data-mode="dark"] .form-input {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.05));
  border: 1px solid var(--teal-bright);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 -1px 0 rgba(0,0,0,0.25) inset,
    0 8px 18px rgba(0,0,0,0.35);
}
html[data-theme="skeuomorphic"][data-mode="light"] .card,
html[data-theme="skeuomorphic"][data-mode="light"] .form-input {
  background: linear-gradient(180deg, #FFF7E4 0%, #F0E3C2 100%);
  border: 1px solid rgba(110,74,34,0.4);
  color: #2A1B0C;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 -1px 0 rgba(0,0,0,0.08) inset,
    0 8px 18px rgba(60,40,15,0.18);
}
html[data-theme="skeuomorphic"] .btn-primary {
  background: linear-gradient(180deg, #f4d27a, var(--teal-bright) 50%, #a87f2e 100%);
  color: #2A1B0C;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5) inset,
    0 -1px 0 rgba(0,0,0,0.25) inset,
    0 2px 4px rgba(0,0,0,0.25);
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

/* ===================================================================== */
/* THEME TOOLBAR — shared across deck / workshop / waitlist              */
/* ===================================================================== */

.theme-toolbar {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 9999;
  display: flex;
  gap: 0.3rem;
  align-items: center;
  padding: 0.3rem 0.45rem;
  border-radius: 999px;
  background: rgba(20, 30, 45, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  font-family: var(--font-display);
  font-size: 11px;
  color: #f5f1ea;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.theme-toolbar .group {
  display: flex;
  gap: 0.15rem;
  padding: 0 0.2rem;
  border-right: 1px solid rgba(255,255,255,0.12);
}
.theme-toolbar .group:last-child { border-right: none; }
.theme-toolbar button {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: inherit;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}
.theme-toolbar button:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}
.theme-toolbar button.active {
  background: #3FD0C9;
  color: #0B1628;
  border-color: #3FD0C9;
}
.theme-toolbar .tb-label {
  display: none;
}
.theme-toolbar button[data-mode-toggle] {
  font-size: 1.05em;
  padding: 0.3rem 0.5rem;
}
html[data-mode="light"] .theme-toolbar,
html[data-theme="paper"] .theme-toolbar {
  background: rgba(255,253,247,0.75);
  color: #2A1B0C;
  border-color: rgba(0,0,0,0.12);
}
html[data-mode="light"] .theme-toolbar button:hover,
html[data-theme="paper"] .theme-toolbar button:hover {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.12);
}
html[data-mode="light"] .theme-toolbar button.active,
html[data-theme="paper"] .theme-toolbar button.active {
  background: #0E8581;
  color: #FFFDF7;
  border-color: #0E8581;
}
html[data-theme="terminal"] .theme-toolbar {
  background: rgba(5,10,5,0.78);
  color: #7FFF7F;
  border-color: rgba(127,255,127,0.3);
  font-family: var(--font-mono);
  box-shadow: 0 0 12px rgba(127,255,127,0.15);
}
html[data-theme="terminal"] .theme-toolbar button.active {
  background: #7FFF7F;
  color: #050A05;
  border-color: #7FFF7F;
}

/* Tiny mobile tweaks */
@media (max-width: 540px) {
  .page { padding-top: 4.4rem; }

  /* On mobile, collapse theme labels to single letters so the toolbar
     stays out of the brand chip's way. The dark/light toggle stays as
     a glyph. */
  .theme-toolbar {
    font-size: 11px;
    padding: 0.25rem 0.3rem;
    gap: 0.2rem;
  }
  .theme-toolbar .group { padding: 0 0.15rem; }
  .theme-toolbar button { padding: 0.3rem 0.5rem; min-width: 1.8em; }
  .theme-toolbar [data-theme-pick="modern"]       { font-size: 0; }
  .theme-toolbar [data-theme-pick="modern"]::after       { content: "M"; font-size: 11px; font-weight: 700; }
  .theme-toolbar [data-theme-pick="paper"]        { font-size: 0; }
  .theme-toolbar [data-theme-pick="paper"]::after        { content: "P"; font-size: 11px; font-weight: 700; }
  .theme-toolbar [data-theme-pick="terminal"]     { font-size: 0; }
  .theme-toolbar [data-theme-pick="terminal"]::after     { content: "T"; font-size: 11px; font-weight: 700; }
  .theme-toolbar [data-theme-pick="skeuomorphic"] { font-size: 0; }
  .theme-toolbar [data-theme-pick="skeuomorphic"]::after { content: "S"; font-size: 11px; font-weight: 700; }

  .brand {
    font-size: 0.78rem;
    padding: 0.35rem 0.7rem;
    max-width: 50vw;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

@media (max-width: 360px) {
  /* Really narrow phones — drop the brand text to just a dot, keep the
     toolbar fully usable. */
  .brand { font-size: 0; padding: 0.5rem; }
  .brand::before { width: 11px; height: 11px; }
}
