/* Web UI kit — Royal Chronicles */
/* =========================================================================
   Milo's Royal Chronicles — Colors & Type
   Royal Scholar × Bold Vector × Bento
   ========================================================================= */

/* ---------- FONTS ----------------------------------------------------------
   Display (title slabs, "Milo's Royal Chronicles" wordmark, chapter headers):
     Cinzel — broad Roman-capitals serif, regal, pharaonic. Google Fonts.
   Editorial (body, long comic captions, didactic text):
     Fraunces — warm, playful old-style serif with soft swashes. Google Fonts.
   UI / meta (labels, pills, "TODAY'S MOOD", buttons, nav, microcopy):
     Space Grotesk — geometric sans w/ personality; sits well against serifs.
   Hand / comic (speech bubbles, captions on comic panels):
     Caveat Brush — rougher feel for "said by Milo" moments.
   NOTE: No webfont files were provided. All four are Google Fonts — easy to
   self-host later. Flagged as a substitution in README. */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800;900&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,500&family=Space+Grotesk:wght@400;500;600;700&family=Caveat+Brush&display=swap');

:root {
  /* ---------- ROYAL PALETTE (foundation) --------------------------------- */

  /* Gold — the crown, the wordmark, "Royal" everything */
  --royal-gold-50:  #FBF4DF;
  --royal-gold-100: #F5E4A8;
  --royal-gold-300: #E8C766;
  --royal-gold-500: #D4A537;  /* primary gold */
  --royal-gold-700: #A97E1F;
  --royal-gold-900: #6B4E10;

  /* Emerald / forest — the throne pillow, royal baize */
  --emerald-50:  #E4EDE2;
  --emerald-100: #BFD3B9;
  --emerald-300: #6E9A66;
  --emerald-500: #2F6B3A;  /* primary emerald */
  --emerald-700: #1E4A28;
  --emerald-900: #0F2A17;

  /* Oxblood / burgundy — accents, "error", royal carpet */
  --oxblood-50:  #F4E1DE;
  --oxblood-300: #B2574E;
  --oxblood-500: #8A2E24;  /* primary oxblood */
  --oxblood-700: #5C1C15;
  --oxblood-900: #350F09;

  /* Midnight — night-sky backgrounds, hero scrims, header */
  --midnight-50:  #D6DCEA;
  --midnight-300: #4E5A7F;
  --midnight-500: #1F2742;
  --midnight-700: #121733;  /* primary midnight */
  --midnight-900: #07091A;

  /* Parchment — page background, cards */
  --parchment-50:  #FEFAF0;  /* lightest paper */
  --parchment-100: #FAF1DC;  /* default page bg */
  --parchment-200: #F1E3C0;
  --parchment-300: #E4D1A0;  /* aged edges */
  --parchment-500: #C9B079;

  /* Tan / caramel — Milo's fur, warm neutrals */
  --milo-tan-100: #F6E6CC;
  --milo-tan-300: #E5BF8A;
  --milo-tan-500: #C98F55;
  --milo-tan-700: #8B5E2F;

  /* Ink — outlines on the bold-vector art */
  --ink-900: #1B1410;     /* warm near-black, never pure #000 */
  --ink-700: #3B2E26;
  --ink-500: #5F4B3E;

  /* ---------- SEMANTIC SURFACE TOKENS ------------------------------------ */

  --bg-page:       var(--parchment-100);
  --bg-page-dark:  var(--midnight-700);
  --bg-card:       var(--parchment-50);
  --bg-card-dark:  var(--midnight-500);
  --bg-royal:      var(--emerald-700);   /* royal green surfaces */
  --bg-accent:     var(--royal-gold-500);

  --fg-1:          var(--ink-900);       /* primary text */
  --fg-2:          var(--ink-700);       /* secondary text */
  --fg-3:          var(--ink-500);       /* tertiary / captions */
  --fg-on-dark-1:  var(--parchment-50);
  --fg-on-dark-2:  var(--parchment-300);
  --fg-on-royal:   var(--royal-gold-100);/* gold type on green/midnight */

  --border-1:      var(--ink-900);       /* bold-vector outlines */
  --border-2:      var(--parchment-300); /* subtle parchment dividers */
  --border-gold:   var(--royal-gold-500);

  --accent-gold:   var(--royal-gold-500);
  --accent-emerald:var(--emerald-500);
  --accent-oxblood:var(--oxblood-500);

  --status-success: var(--emerald-500);
  --status-warn:    var(--royal-gold-700);
  --status-error:   var(--oxblood-500);

  /* ---------- TYPE BASE -------------------------------------------------- */

  --font-display: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
  --font-serif:   'Fraunces', 'Georgia', 'Times New Roman', serif;
  --font-ui:      'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-hand:    'Caveat Brush', 'Comic Sans MS', cursive;

  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600;
  --fw-bold:    700;
  --fw-black:   900;

  /* ---------- SPACING / RADII / ELEVATION ------------------------------- */

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;     /* bento cards */
  --radius-xl: 32px;     /* hero bento */
  --radius-pill: 999px;

  /* Bold-vector: outlines behave like comic ink */
  --stroke-hair: 1px;
  --stroke-1: 2px;
  --stroke-2: 3px;
  --stroke-3: 4px;   /* the "Milo outline" weight */

  /* Elevation uses layered ink-shadows (no soft blur drop-shadows) */
  --shadow-stamp-sm: 2px 2px 0 var(--ink-900);
  --shadow-stamp-md: 4px 4px 0 var(--ink-900);
  --shadow-stamp-lg: 6px 6px 0 var(--ink-900);
  --shadow-soft:     0 8px 24px rgba(27, 20, 16, 0.12);
  --shadow-gold-glow:0 0 32px rgba(212, 165, 55, 0.45);

  /* ---------- MOTION ---------------------------------------------------- */

  --ease-royal: cubic-bezier(0.68, -0.4, 0.25, 1.35);   /* slight overshoot */
  --ease-soft:  cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast:   160ms;
  --dur-med:    280ms;
  --dur-slow:   520ms;
}

/* =========================================================================
   SEMANTIC TYPE ROLES
   ========================================================================= */

.display-xl,
h1.royal {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--royal-gold-500);
  text-shadow: 0 2px 0 var(--ink-900);
}

.display-l,
h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: clamp(36px, 4.5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: var(--fg-1);
}

.display-m,
h2 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--fg-1);
}

h3, .editorial-l {
  font-family: var(--font-serif);
  font-weight: var(--fw-semibold);
  font-size: 28px;
  line-height: 1.2;
  color: var(--fg-1);
}

h4, .editorial-m {
  font-family: var(--font-serif);
  font-weight: var(--fw-semibold);
  font-size: 22px;
  line-height: 1.25;
  color: var(--fg-1);
}

h5, .editorial-s {
  font-family: var(--font-serif);
  font-weight: var(--fw-semibold);
  font-size: 18px;
  line-height: 1.3;
  font-style: italic;
  color: var(--fg-2);
}

p, .body {
  font-family: var(--font-serif);
  font-weight: var(--fw-regular);
  font-size: 17px;
  line-height: 1.55;
  color: var(--fg-1);
  text-wrap: pretty;
}

.body-s, small {
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-2);
}

.caption {
  font-family: var(--font-ui);
  font-weight: var(--fw-medium);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* Eyebrow pill — "TODAY'S MOOD: SKEPTICAL", "CHAPTER XI" etc */
.eyebrow {
  font-family: var(--font-ui);
  font-weight: var(--fw-bold);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--royal-gold-500);
}

/* UI label (buttons, nav, menus) */
.ui-label, button, .btn {
  font-family: var(--font-ui);
  font-weight: var(--fw-semibold);
  font-size: 14px;
  letter-spacing: 0.04em;
}

/* Comic speech — hand-drawn, used sparingly */
.speech, .comic-caption {
  font-family: var(--font-hand);
  font-weight: var(--fw-regular);
  font-size: 22px;
  line-height: 1.15;
  color: var(--ink-900);
}

/* Mono / didactic "fact" inline */
code, .mono {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  font-size: 13px;
  background: var(--parchment-200);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--fg-1);
}

/* "Studia Canis" italic aside — a Milo signature */
.scholastic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--fw-medium);
  color: var(--oxblood-500);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--parchment-100); color: var(--fg-1); font-family: var(--font-serif); }

@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.rc-shell { max-width: 1280px; margin: 0 auto; padding: 0 32px 64px; }

/* ---------------- HEADER ---------------- */
.rc-header {
  background: linear-gradient(180deg, var(--midnight-900) 0%, var(--midnight-700) 100%);
  border-bottom: 3px solid var(--ink-900);
  padding: 14px 32px;
  position: sticky; top: 0; z-index: 20;
}
.rc-header-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.rc-logo { display: flex; align-items: center; gap: 12px; }
.rc-logo-crown { font-size: 26px; color: var(--royal-gold-500); filter: drop-shadow(0 1px 0 var(--ink-900)); }
.rc-logo-text { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--royal-gold-500); letter-spacing: 0.02em; }
.rc-nav { display: flex; gap: 22px; }
.rc-nav a {
  font-family: var(--font-ui); font-weight: 600; font-size: 13px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--parchment-300);
  text-decoration: none; cursor: pointer;
}
.rc-nav a:hover { color: var(--royal-gold-300); }
.rc-nav a.active { color: var(--royal-gold-500); border-bottom: 2px solid var(--royal-gold-500); padding-bottom: 3px; }
.rc-mood-pill {
  background: var(--royal-gold-500); color: var(--ink-900);
  border: 2px solid var(--ink-900); box-shadow: 2px 2px 0 var(--ink-900);
  font-family: var(--font-ui); font-weight: 700; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 999px; display: inline-flex; gap: 8px; align-items: center;
  cursor: pointer;
}

/* ---------------- HERO BAND ---------------- */
.rc-hero {
  background: linear-gradient(180deg, var(--midnight-700) 0%, var(--midnight-500) 100%);
  padding: 48px 32px 72px;
  position: relative; overflow: hidden;
  border-bottom: 3px solid var(--ink-900);
}
.rc-hero-inner { max-width: 1280px; margin: 0 auto; text-align: center; }
.rc-hero h1 {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(48px, 7vw, 88px); line-height: 0.95;
  color: var(--royal-gold-500); margin: 12px 0 8px;
  text-shadow: 0 3px 0 var(--ink-900);
}
.rc-hero-sub {
  font-family: var(--font-serif); font-style: italic; font-size: 18px;
  color: var(--parchment-300); margin: 0 0 18px;
}

/* ---------------- BENTO GRID ---------------- */
.rc-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 180px;
  gap: 20px;
  margin-top: -48px;
  position: relative; z-index: 2;
}
.tile {
  border: 3px solid var(--ink-900);
  border-radius: 22px;
  box-shadow: 6px 6px 0 var(--ink-900);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform .2s var(--ease-royal), box-shadow .2s var(--ease-royal);
  cursor: pointer;
}
.tile:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink-900); }
.tile:active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink-900); }

.tile-eyebrow {
  font-family: var(--font-ui); font-weight: 700; font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.tile-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: 28px; line-height: 1.05; letter-spacing: 0.01em;
  margin: 8px 0 6px;
}
.tile-body {
  font-family: var(--font-serif); font-size: 14px; line-height: 1.4;
}

/* Size variants */
.tile-hero { grid-column: span 8; grid-row: span 2; }
.tile-sq { grid-column: span 4; grid-row: span 1; }
.tile-tall { grid-column: span 4; grid-row: span 2; }
.tile-wide { grid-column: span 8; grid-row: span 1; }
.tile-half { grid-column: span 6; grid-row: span 1; }
.tile-quarter { grid-column: span 3; grid-row: span 1; }

/* Color variants */
.tile-midnight { background: var(--midnight-700); color: var(--royal-gold-100); }
.tile-midnight .tile-title { color: var(--royal-gold-500); }
.tile-midnight .tile-eyebrow { color: var(--royal-gold-300); }
.tile-emerald { background: var(--emerald-700); color: var(--parchment-50); }
.tile-emerald .tile-title { color: var(--royal-gold-300); }
.tile-emerald .tile-eyebrow { color: var(--royal-gold-300); }
.tile-gold { background: var(--royal-gold-500); color: var(--ink-900); }
.tile-gold .tile-title { color: var(--ink-900); }
.tile-gold .tile-eyebrow { color: var(--oxblood-700); }
.tile-oxblood { background: var(--oxblood-500); color: var(--parchment-50); }
.tile-oxblood .tile-title { color: var(--royal-gold-300); }
.tile-oxblood .tile-eyebrow { color: var(--royal-gold-100); }
.tile-parchment { background: var(--parchment-50); color: var(--fg-1); }
.tile-parchment .tile-title { color: var(--fg-1); }
.tile-parchment .tile-eyebrow { color: var(--oxblood-500); }

/* Decorative hieroglyph strip used on dark tiles */
.tile-hieroglyphs::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 10% 90%, rgba(212,165,55,0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 25% 85%, rgba(212,165,55,0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 45% 92%, rgba(212,165,55,0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 65% 88%, rgba(212,165,55,0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 85% 94%, rgba(212,165,55,0.08) 0 2px, transparent 3px);
  pointer-events: none;
}

/* ---------------- BUTTONS ---------------- */
.btn {
  font-family: var(--font-ui); font-weight: 700; font-size: 13px;
  letter-spacing: 0.06em; padding: 10px 18px; border-radius: 14px;
  border: 2px solid var(--ink-900); cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink-900);
  transition: transform .16s var(--ease-royal), box-shadow .16s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ink-900); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink-900); }
.btn-gold { background: var(--royal-gold-500); color: var(--ink-900); }
.btn-emerald { background: var(--emerald-700); color: var(--royal-gold-100); }
.btn-ghost { background: var(--parchment-50); color: var(--ink-900); }
.btn-dark { background: var(--midnight-700); color: var(--royal-gold-100); }

/* ---------------- SECTIONS ---------------- */
.rc-section { margin-top: 48px; }
.rc-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.rc-section-title { font-family: var(--font-display); font-weight: 800; font-size: 36px; color: var(--fg-1); letter-spacing: 0.02em; margin: 0; }
.rc-section-eyebrow { font-family: var(--font-ui); font-weight: 700; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--oxblood-500); }

/* ---------------- COMIC READER ---------------- */
.comic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.comic-panel {
  position: relative; border: 3px solid var(--ink-900); border-radius: 14px;
  overflow: hidden; aspect-ratio: 1 / 1; box-shadow: 4px 4px 0 var(--ink-900);
  background: var(--midnight-500);
}
.comic-caption {
  position: absolute; top: 10px; left: 10px;
  background: var(--royal-gold-100); border: 2px solid var(--ink-900);
  padding: 6px 12px; border-radius: 4px;
  font-family: var(--font-serif); font-weight: 600; font-size: 14px;
  color: var(--ink-900); max-width: 62%;
}
.comic-bubble {
  position: absolute; background: var(--parchment-50); border: 2px solid var(--ink-900);
  padding: 8px 14px; border-radius: 24px;
  font-family: var(--font-hand); font-size: 20px; color: var(--ink-900); line-height: 1.1;
  max-width: 55%;
}

/* ---------------- MISSION FORM ---------------- */
.mission-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-ui); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--oxblood-500); }
.field input, .field textarea {
  background: var(--parchment-50); border: 2px solid var(--ink-900); border-radius: 12px;
  padding: 10px 14px; font-family: var(--font-serif); font-size: 15px; color: var(--fg-1);
  box-shadow: inset 0 2px 0 rgba(27,20,16,0.06);
  outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--royal-gold-500); box-shadow: 0 0 0 3px rgba(212,165,55,0.3); }

/* ---------------- FOOTER ---------------- */
.rc-footer {
  background: var(--emerald-700); color: var(--royal-gold-100);
  border-top: 3px solid var(--ink-900);
  margin-top: 80px; padding: 40px 32px;
}
.rc-footer-inner { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.rc-footer h4 { font-family: var(--font-display); color: var(--royal-gold-500); margin: 0 0 10px; font-size: 18px; letter-spacing: 0.04em; }
.rc-footer a { color: var(--parchment-100); text-decoration: none; display: block; font-family: var(--font-serif); font-size: 14px; padding: 3px 0; }
.rc-footer a:hover { color: var(--royal-gold-300); }
