/* AI University User Guides
   Layout: slim masthead, title + search, one deep-peacock guide player (the memorable part),
   then a quiet library grouped by module. Colours follow the AIU magenta identity (aiu-theme.css). */
@font-face { font-family: "Lexend"; src: url("/fonts/lexend-latin.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face { font-family: "Lexend"; src: url("/fonts/lexend-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;}
:root {
  --paper: #fbf8fa;
  --paper-2: #f4eef2;
  --ink: #24161f;
  --muted: #6b5264;
  --line: rgba(90, 15, 71, 0.16);
  --accent: #b8208f;
  --accent-deep: #5a0f47;
  --gold: #f28be4;
  --gold-soft: #fce6fb;
  --emerald: #1f7a4d;
  --stage: #5a0f47;
  --stage-2: #951a78;
  --stage-ink: #fdfaf2;
  --stage-muted: #e5cfdf;
  --screen: #ffffff;
  --screen-ink: #24161f;
  --screen-line: rgba(90, 15, 71, 0.16);
  --screen-side: #f4eef2;
  --focus: #c406bc;

  --serif: "Lexend", system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Tamil", sans-serif;
  --sans: "Lexend", system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Tamil", sans-serif;
  --radius-lg: 22px;
  --radius-sm: 10px;
  --gutter: clamp(16px, 4vw, 48px);
  --measure: 68ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #26071e;
    --paper-2: #330c29;
    --ink: #f5eef3;
    --muted: #c5a9bd;
    --line: rgba(238, 205, 229, 0.16);
    --accent: #c95cac;
    --accent-deep: #f0cde7;
    --gold: #f28be4;
    --gold-soft: #3f1036;
    --emerald: #5fd0a0;
    --stage: #1b0415;
    --stage-2: #5a0f47;
    --stage-ink: #fdfaf2;
    --stage-muted: #d9b9d0;
    --screen: #380f2d;
    --screen-ink: #f5eef3;
    --screen-line: rgba(238, 205, 229, 0.16);
    --screen-side: #3f1233;
    --focus: #f28be4;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #26071e;
  --paper-2: #330c29;
  --ink: #f5eef3;
  --muted: #c5a9bd;
  --line: rgba(238, 205, 229, 0.16);
  --accent: #c95cac;
  --accent-deep: #f0cde7;
  --gold: #f28be4;
  --gold-soft: #3f1036;
  --emerald: #5fd0a0;
  --stage: #1b0415;
  --stage-2: #5a0f47;
  --stage-ink: #fdfaf2;
  --stage-muted: #d9b9d0;
  --screen: #380f2d;
  --screen-ink: #f5eef3;
  --screen-line: rgba(238, 205, 229, 0.16);
  --screen-side: #3f1233;
  --focus: #f28be4;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}
main, .masthead, .foot { max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
strong, b, th, h4, h5, h6, dt, summary { font-weight: 600; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 12px; }

/* Masthead */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
/* The AIU logo; white on the dark theme. */
.brandLogo { display: block; flex: none; height: 36px; width: auto; }
:root[data-theme="dark"] .brandLogo { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brandLogo { filter: brightness(0) invert(1); } }
.brand-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.mast-links { display: flex; gap: 8px; align-items: center; }
.mast-links a { color: var(--ink); text-decoration: none; padding: 8px 14px; border-radius: 999px; }
.mast-links a:hover { background: var(--paper-2); }
.mast-links .mast-signin { border: 1px solid var(--line); }

/* Intro */
.intro { padding-block: clamp(24px, 6vw, 64px) clamp(24px, 4vw, 40px); }
.intro-copy { max-width: 760px; display: grid; gap: 18px; }
h1 { font-size: clamp(2.25rem, 5vw, 3rem); letter-spacing: -0.02em; color: var(--accent-deep); }
.lede { font-size: clamp(1.08rem, 2vw, 1.25rem); color: var(--muted); max-width: 52ch; }
.search {
  display: flex; align-items: center; gap: 10px; max-width: 560px;
  background: var(--screen); border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 18px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 6px; font-size: 1.02rem; color: var(--ink); }
.search input:focus { outline: none; }
.counts { color: var(--muted); font-size: 0.95rem; }

/* Player: the one bold element */
.player {
  background: radial-gradient(120% 140% at 100% 0%, var(--stage-2), var(--stage) 60%);
  color: var(--stage-ink);
  border-radius: 28px;
  padding: clamp(18px, 3.5vw, 36px);
  display: grid; gap: 24px;
  scroll-margin-top: 16px;
}
.player-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.player-head > div { display: grid; gap: 6px; max-width: 60ch; min-width: 0; }
.player-module { color: var(--gold); font-weight: 600; font-size: 0.95rem; }
.player h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); color: var(--stage-ink); }
.player-summary { color: var(--stage-muted); }
.role-pill {
  border: 1px solid rgba(255, 240, 220, 0.3); color: var(--stage-ink); border-radius: 999px;
  padding: 6px 14px; font-size: 0.9rem; white-space: nowrap;
}
.player-body { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: clamp(16px, 3vw, 32px); align-items: start; }

.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: step; }
.step-list button {
  width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer;
  display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start;
  padding: 10px 12px; border-radius: 14px; color: var(--stage-muted); line-height: 1.35;
}
.step-list button:hover { background: rgba(255, 246, 234, 0.07); color: var(--stage-ink); }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(255, 240, 220, 0.35); font-size: 0.85rem; font-variant-numeric: tabular-nums;
}
.step-list .is-done .step-num { background: rgba(255, 246, 234, 0.14); border-color: transparent; }
.step-list .is-current { background: rgba(255, 246, 234, 0.12); color: var(--stage-ink); font-weight: 600; }
.step-list .is-current .step-num { background: var(--gold); border-color: var(--gold); color: #3a0a2e; }

.stage { display: grid; gap: 16px; min-width: 0; }
.step-card {
  background: rgba(255, 246, 234, 0.07); border: 1px solid rgba(255, 240, 220, 0.16);
  border-radius: 18px; padding: 18px 20px; display: grid; gap: 8px;
}
.step-count { color: var(--gold); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.step-card h3 { font-size: 1.35rem; color: var(--stage-ink); }
.step-card p:not(.step-count) { color: var(--stage-muted); max-width: var(--measure); }
.progress { height: 4px; background: rgba(255, 246, 234, 0.14); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.35s ease; }
.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.btn { border-radius: 999px; padding: 10px 20px; cursor: pointer; border: 1px solid transparent; font-weight: 600; }
.btn.solid { background: var(--gold); color: #3a0a2e; }
.btn.solid:hover { filter: brightness(1.06); }
.player .btn.ghost { background: transparent; border-color: rgba(255, 240, 220, 0.35); color: var(--stage-ink); }
.btn:disabled { opacity: 0.4; cursor: default; }
.screen-note { color: var(--stage-muted); font-size: 0.88rem; }

/* The drawn app screen */
.screen {
  background: var(--screen); color: var(--screen-ink);
  border-radius: 16px; overflow: hidden; min-height: 320px;
  box-shadow: 0 30px 60px rgba(20, 0, 8, 0.35);
  font-size: 0.86rem; line-height: 1.35;
}
.scr-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--screen-line); }
.scr-dot { width: 40px; height: 22px; border-radius: 0; background: url("/brand/aiu-logo.svg") center / contain no-repeat; color: transparent; font-size: 0 !important; display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: 0.62rem; flex: none; }
.scr-name { font-family: var(--serif); font-weight: 600; }
.scr-sub { color: var(--muted); font-size: 0.78rem; }
.scr-top .scr-spacer { flex: 1; }
.scr-pill { border: 1px solid var(--screen-line); border-radius: 999px; padding: 4px 12px; font-size: 0.78rem; position: relative; }
.scr-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); min-height: 280px; }
.scr-side { background: var(--screen-side); padding: 12px 10px; display: grid; gap: 4px; align-content: start; }
.scr-nav { padding: 7px 10px; border-radius: 9px; color: var(--muted); position: relative; }
.scr-nav.is-active { background: var(--screen); color: var(--screen-ink); font-weight: 600; box-shadow: 0 1px 0 var(--screen-line); }
.scr-main { padding: 16px 18px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.scr-h { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.scr-block { position: relative; }
.scr-label { font-size: 0.74rem; color: var(--muted); margin-bottom: 4px; }
.scr-input { border: 1px solid var(--screen-line); border-radius: 9px; padding: 8px 10px; color: var(--muted); background: var(--paper); overflow-wrap: anywhere; }
.scr-area { min-height: 64px; white-space: pre-line; }
.scr-btn { display: inline-block; border-radius: 999px; padding: 8px 16px; font-weight: 600; border: 1px solid var(--screen-line); }
.scr-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--screen); }
.scr-btn.warn { border-color: #c23b3b; color: #c23b3b; }
.scr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.scr-chip { border: 1px solid var(--screen-line); border-radius: 999px; padding: 4px 10px; font-size: 0.78rem; }
.scr-chip.on { background: var(--gold-soft); border-color: var(--gold); }
.scr-list { display: grid; gap: 6px; }
.scr-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--screen-line); border-radius: 9px; padding: 7px 10px; }
.scr-row .tick { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--muted); flex: none; }
.scr-row .tick.done { background: var(--emerald); border-color: var(--emerald); }
.scr-row .meta { margin-left: auto; color: var(--muted); font-size: 0.74rem; }
.scr-text { color: var(--muted); }
.scr-drop { border: 1.5px dashed var(--screen-line); border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); }
.scr-status { display: flex; gap: 8px; flex-wrap: wrap; }
.scr-status span { border-radius: 8px; padding: 5px 10px; font-size: 0.78rem; background: color-mix(in srgb, var(--emerald) 14%, transparent); color: var(--emerald); font-weight: 600; }
.scr-center { display: grid; place-items: center; padding: 26px 16px; }
.scr-card { width: min(320px, 100%); display: grid; gap: 10px; }

/* The highlight on the thing to click */
.is-target { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 10px; z-index: 1; }
.target-tag {
  position: absolute; right: -6px; top: -14px; z-index: 2;
  background: var(--gold); color: #3a0a2e; font-size: 0.72rem; font-weight: 600;
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
@media (prefers-reduced-motion: no-preference) {
  .is-target { animation: glow 1.6s ease-in-out infinite; }
  @keyframes glow { 50% { outline-offset: 6px; outline-color: color-mix(in srgb, var(--gold) 55%, transparent); } }
}

/* Library */
.library { padding-block: clamp(40px, 7vw, 72px) 24px; display: grid; gap: 28px; scroll-margin-top: 16px; }
.library-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.library-head h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); color: var(--accent-deep); }
.roles { display: flex; flex-wrap: wrap; gap: 8px; }
.role-chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.role-chip:hover { background: var(--paper-2); }
.role-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--paper); }
#modules { display: grid; gap: 36px; }
.module { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 24px; border-top: 1px solid var(--line); padding-top: 22px; }
.module-head { display: grid; gap: 6px; align-content: start; }
.module-head h3 { font-size: 1.35rem; }
.module-head p { color: var(--muted); font-size: 0.95rem; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.guide-link {
  text-align: left; cursor: pointer; background: transparent; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; display: grid; gap: 6px; align-content: start;
}
.guide-link:hover { background: var(--paper-2); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.guide-link.is-playing { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.guide-title { font-weight: 650; font-size: 1.02rem; line-height: 1.3; }
.guide-sum { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.guide-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.guide-meta .tag { border-radius: 999px; padding: 2px 9px; background: var(--paper-2); color: var(--ink); }
.empty { border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 28px; display: grid; gap: 10px; justify-items: start; }
.empty p { color: var(--muted); }
.library .btn.ghost { border-color: var(--line); background: transparent; }

.request { border-top: 1px solid var(--line); padding-block: 32px 48px; display: grid; gap: 8px; }
.request h2 { font-size: 1.4rem; }
.request p { color: var(--muted); max-width: var(--measure); }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 20px 36px; color: var(--muted); font-size: 0.88rem; border-top: 1px solid var(--line); }

/* Narrow screens */
@media (max-width: 860px) {
  .player-body { grid-template-columns: 1fr; }
  .step-list { grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .module { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 560px) {
  .mast-links a:not(.mast-signin) { display: none; }
  .scr-body { grid-template-columns: 1fr; }
  .scr-side { display: flex; gap: 4px; overflow-x: auto; padding: 8px; }
  .scr-nav { white-space: nowrap; }
  .scr-nav:not(.is-active):not(.is-target) { display: none; }
  .scr-main { padding: 14px; }
  .step-nav .btn { flex: 1; }
}

/* Request a guide */
.request .btn { justify-self: start; margin-top: 6px; }
.request-form { display: grid; gap: 8px; max-width: 620px; margin-top: 10px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-2); }
.request-form[hidden] { display: none; }
.request-form label { font-weight: 600; margin-top: 4px; }
.request-form .optional { color: var(--muted); font-weight: 400; }
.request-form :is(input, textarea, select) { width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); font: inherit; }
.request-form textarea { resize: vertical; }
.request-form :is(input, textarea, select, button):focus-visible, .request-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.request-form #requestRoleWrap { display: grid; gap: 8px; }
.request-form #requestRoleWrap[hidden] { display: none; }
.request-note { font-size: .92rem; margin: 2px 0 0; }
.request-status { margin: 4px 0 0; font-weight: 600; }
.request-status:empty { display: none; }
.request-status[data-tone="good"] { color: var(--emerald); }
.request-status[data-tone="bad"] { color: #b4432f; }
.request-link { color: var(--accent-deep); font-weight: 600; }
