/* ============================================================
   KidVerse — three ways it could look
   ============================================================

   What is wrong with the current one is not the colour. It is that
   every surface in the app is the same rounded rectangle, with the
   same soft shadow, in the same navy, with an emoji in it — and one
   saturated orange doing every job. Dark plus a hot accent plus a
   glow is a neon sign, which is why it reads as cyberpunk, and the
   sameness is why it reads as generated.

   So none of these three is a repaint. Each is a different idea about
   what kind of thing KidVerse is, and each gets its own paper, its
   own light, its own depth and its own display face.

   ------------------------------------------------------------
   Where the idea comes from
   ------------------------------------------------------------
   Of the references, the one nobody else would have sent is the
   photograph of a pile of real picture books. Children's publishing
   has been solving our exact problem for eighty years: delight a
   four-year-old and be taken seriously by a school librarian, at the
   same time, on the same object. It does it with flat inks on warm
   paper, wide margins, confident lettering and real pictures — never
   with glow.

     PRESS       the app as a children's book press. Warm uncoated
                 paper, four flat printing inks, depth from paper
                 lifted off paper rather than from blur.

     CUT PAPER   the app as layered cut paper. Pale calm grounds,
                 shapes with real thickness, light from one direction.

     LAMPLIGHT   the app in the evening. A warm dark — ink brown, not
                 navy — and an amber lamp, not a neon tube. Surfaces
                 that look lit rather than surfaces that glow.

   ------------------------------------------------------------
   What all three fix
   ------------------------------------------------------------
   · One radius for everything is why the old one looked like a
     template. Radius is information here: a pill is something you
     press, a card is a surface, a chip is a printed label.
   · No glow anywhere. The old nav item had an orange halo behind it;
     that single shadow did more to make this look like a neon sign
     than the colour did.
   · No gradient used as decoration.
   · Colour never carries meaning alone — present, late and absent in
     the register each have a mark as well.
   ============================================================ */

/* ============================================================
   Shared: the things that were wrong whichever palette wins
   ============================================================ */

html[data-kvtheme] body,
html[data-kvtheme] button,
html[data-kvtheme] input,
html[data-kvtheme] select,
html[data-kvtheme] textarea,
html[data-kvtheme] * {
  font-family: var(--font-ui);
  /* The old sheet put a colour transition on every element on the
     page. Everything faded into everything, which is the look of a
     thing assembled rather than designed. Motion now belongs to the
     handful of places where something actually changed. */
  transition: none;
}

html[data-kvtheme] h1, html[data-kvtheme] h2, html[data-kvtheme] h3,
html[data-kvtheme] .section-title, html[data-kvtheme] .kvr-qp,
html[data-kvtheme] #kvGate h2 {
  font-family: var(--font-display);
  letter-spacing: var(--display-track, -0.02em);
  font-weight: var(--display-weight, 800);
}

/* What a child reads is set in the literacy face, at a size and
   measure a book would use. */
html[data-kvtheme] .kvl-page,
html[data-kvtheme] .kvr-qp,
html[data-kvtheme] .kvbd-say,
html[data-kvtheme] .kvb-card h4 {
  font-family: var(--font-read);
}
html[data-kvtheme] .kvl-page {
  font-size: 18px; line-height: 1.75; max-width: 62ch;
}

/* Radius by role, so the shape of a thing says what it is. */
html[data-kvtheme] {
  --radius-lg: var(--r-card);
  --radius-md: var(--r-card);
  --radius-sm: var(--r-input);
}
html[data-kvtheme] .nav-item,
html[data-kvtheme] .btn-primary,
html[data-kvtheme] .btn-secondary,
html[data-kvtheme] .kvr-btn,
html[data-kvtheme] .kvr-face,
html[data-kvtheme] .kvl-btn { border-radius: 999px; }
html[data-kvtheme] .kv-tag,
html[data-kvtheme] .kvr-tag,
html[data-kvtheme] .status-badge,
html[data-kvtheme] .tag { border-radius: var(--r-chip); }
html[data-kvtheme] input,
html[data-kvtheme] select,
html[data-kvtheme] textarea,
html[data-kvtheme] .kvr-in { border-radius: var(--r-input); }

/* No halo. This one shadow did more than the palette to make the old
   screen look like a neon sign. */
html[data-kvtheme] .nav-item.active {
  background: var(--accent); color: var(--on-accent); box-shadow: none;
}
html[data-kvtheme] .profile-badge,
html[data-kvtheme] .search-bar { box-shadow: var(--shadow-soft); }

/* The accent is one colour doing one job: the thing to press. */
html[data-kvtheme] .btn-primary,
html[data-kvtheme] .kvr-btn,
html[data-kvtheme] .kvr-face.on,
html[data-kvtheme] #kvGate .go {
  background: var(--accent); color: var(--on-accent); box-shadow: none;
}
html[data-kvtheme] .kvr-btn.ghost,
html[data-kvtheme] .btn-secondary {
  background: var(--quiet); color: var(--text-main); box-shadow: none;
}

/* The (i) borrows the theme's own caution ink rather than carrying a
   hard-coded orange around with it. */
html[data-kvtheme] .kvi {
  background: var(--inset); border-color: var(--line);
}
html[data-kvtheme] .kvi.warn {
  background: var(--warn-wash); border-color: var(--warn-line);
}
html[data-kvtheme] .kvi-mark { background: var(--quiet); color: var(--text-main); }
html[data-kvtheme] .kv-new { background: var(--accent); color: var(--on-accent); }
html[data-kvtheme] .nav-grown { border-top-color: var(--hair); }
html[data-kvtheme] .kvi.warn .kvi-mark { background: var(--warn); color: var(--on-accent); }

/* The register's five states, in this theme's inks. */
html[data-kvtheme] .kvr-code.on.present          { background: var(--yes);   color: var(--on-accent); }
html[data-kvtheme] .kvr-code.on.authorised       { background: var(--maybe); color: var(--on-accent); }
html[data-kvtheme] .kvr-code.on.unauthorised     { background: var(--no);    color: var(--on-accent); }
html[data-kvtheme] .kvr-code.on.approved_offsite { background: var(--away);  color: var(--on-accent); }
html[data-kvtheme] .kvr-code.on.not_counted      { background: var(--quiet); color: var(--text-main); }
html[data-kvtheme] .kvr-tag.marked, html[data-kvtheme] .kvr-opt.yes { background: var(--yes);  color: var(--on-accent); }
html[data-kvtheme] .kvr-tag.late,   html[data-kvtheme] .kvr-opt.no  { background: var(--no);   color: var(--on-accent); }
html[data-kvtheme] .kvr-tag.in                                      { background: var(--away); color: var(--on-accent); }
html[data-kvtheme] .kvr-tag.todo                                    { background: var(--quiet); color: var(--text-main); }
html[data-kvtheme] .kvr-fb { background: var(--inset); border-color: var(--line); }
html[data-kvtheme] .kvs-owned, html[data-kvtheme] .kvr-saved { color: var(--yes-ink); }

html[data-kvtheme] .card,
html[data-kvtheme] .kvr-card,
html[data-kvtheme] .settings-panel,
html[data-kvtheme] .modal-content,
html[data-kvtheme] .baby-card,
html[data-kvtheme] .live-class-card,
html[data-kvtheme] .assignment-card,
html[data-kvtheme] .admin-table {
  background: var(--card-bg);
  border: var(--card-edge);
  box-shadow: var(--shadow-soft);
}
html[data-kvtheme] .kvr-line,
html[data-kvtheme] .kvr-day,
html[data-kvtheme] .stat-box,
html[data-kvtheme] .timetable-slot { background: var(--inset); }

html[data-kvtheme] .sidebar { background: var(--sidebar); border-right: var(--card-edge); }
html[data-kvtheme] body { background: var(--surface); color: var(--text-main); }

/* Keyboard focus has to survive a repaint, so it is set once here and
   in the theme's own ink rather than left to the browser. */
html[data-kvtheme] :focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  html[data-kvtheme] * { animation: none !important; }
}

/* ============================================================
   PRESS — flat inks on warm paper
   ============================================================
   Depth comes from a sheet of paper sitting on another sheet: a hard
   offset, no blur, the colour of the ink rather than black. The
   display face is a serif, which no children's app uses, and is the
   single thing this direction is betting on.
*/
html[data-kvtheme="press"] {
  --surf-1: rgba(62, 48, 38, .045);
  --surf-2: rgba(62, 48, 38, .085);
  --hair:   rgba(62, 48, 38, .16);
  --edge:   rgba(62, 48, 38, .26);
  --sunk:   rgba(62, 48, 38, .06);
  --surface:    #F4EADC;
  --bg-color:   #EFE2D0;
  --card-bg:    #FCF6ED;
  --inset:      #F2E7D7;
  --sidebar:    #EADBC6;
  --quiet:      #E6D7C2;
  --line:       rgba(62, 48, 38, .16);
  --card-edge:  1px solid rgba(62, 48, 38, .14);
  --text-main:  #33281F;
  --text-muted: #5B4D40;
  /* Measured, not chosen by eye: the first tomato was #D1452F, which
     is 4.33:1 against the cream that sits on it — close enough to look
     right and under the 4.5 a school's accessibility report needs. */
  --accent:     #C13D28;
  --on-accent:  #FFF8EF;
  --yes:        #3C8C62;  --yes-ink: #2F6E4D;
  --maybe:      #E0A024;
  --no:         #C13D28;
  --away:       #2F6FB3;
  --warn:       #C13D28;
  --warn-wash:  rgba(209, 69, 47, .10);
  --warn-line:  rgba(209, 69, 47, .30);
  --pastel-blue: #2F6FB3; --pastel-pink: #C2466E; --pastel-teal: #3C8C62;
  --pastel-yellow: #E0A024; --pastel-purple: #7A5AA6; --pastel-orange: #C13D28;
  --shadow-soft:  2px 3px 0 rgba(62, 48, 38, .13);
  --shadow-hover: 3px 5px 0 rgba(62, 48, 38, .18);
  --r-card: 14px; --r-input: 10px; --r-chip: 4px;
  --font-display: "Fraunces", Georgia, serif;
  --display-weight: 700;
  --display-track: -0.015em;
}
/* The welcome panel. In Press it is a printed block: one flat ink, the
   greeting set like a chapter opening. No gradient. */
html[data-kvtheme="press"] .hero {
  --hero-bg: #2F6FB3; --hero-ink: #FCF6ED;
  --hero-cta-bg: #FCF6ED; --hero-cta-ink: #23527F;
  border-radius: 14px;
  box-shadow: 3px 4px 0 rgba(62, 48, 38, .18);
}
html[data-kvtheme="press"] h1,
html[data-kvtheme="press"] h2,
html[data-kvtheme="press"] .section-title {
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 48;
}

/* ============================================================
   CUT PAPER — layers with thickness, one light source
   ============================================================
   Everything here is a shape cut out and laid on top of another, so
   the shadow is soft, directional and warm, and the corners are
   generous. The palette is the calmest of the three, on purpose: it
   is the one that would suit a four-year-old and a bedtime.
*/
html[data-kvtheme="cutpaper"] {
  --surf-1: rgba(39, 51, 44, .04);
  --surf-2: rgba(39, 51, 44, .075);
  --hair:   rgba(39, 51, 44, .13);
  --edge:   rgba(39, 51, 44, .22);
  --sunk:   rgba(39, 51, 44, .05);
  --surface:    #E9EDE2;
  --bg-color:   #E0E6D7;
  --card-bg:    #FBFAF5;
  --inset:      #EFF2E9;
  --sidebar:    #F4F6EE;
  --quiet:      #E2E7D8;
  --line:       rgba(39, 51, 44, .12);
  --card-edge:  0;
  --text-main:  #26322C;
  --text-main:  #22302A;
  --text-muted: #4A574E;
  /* The coral stays — it is the warmest thing in this palette — but
     white on it is 2.95:1. Dark ink on coral is 4.8 and is what a
     cut-paper label would be anyway. */
  --accent:     #E07A5F;
  --on-accent:  #22302A;
  --yes:        #5E8C61;  --yes-ink: #4A7350;
  --maybe:      #E3A845;
  --no:         #D06A6A;
  --away:       #8A6A9E;
  --warn:       #E07A5F;
  --warn-wash:  rgba(224, 122, 95, .12);
  --warn-line:  rgba(224, 122, 95, .32);
  --pastel-blue: #6D8FB8; --pastel-pink: #D98BA0; --pastel-teal: #5E8C61;
  --pastel-yellow: #E3A845; --pastel-purple: #8A6A9E; --pastel-orange: #E07A5F;
  --shadow-soft:  0 10px 20px -8px rgba(39, 51, 44, .22);
  --shadow-hover: 0 18px 30px -10px rgba(39, 51, 44, .28);
  --r-card: 26px; --r-input: 16px; --r-chip: 999px;
  --font-display: "Grandstander", system-ui, sans-serif;
  --display-weight: 700;
  --display-track: -0.005em;
}

/* The welcome panel as the topmost sheet of cut paper: the card
   colour, lifted, with the shadow doing the work. */
html[data-kvtheme="cutpaper"] .hero {
  --hero-bg: #F3EFE4; --hero-ink: #26322C;
  --hero-cta-bg: #26322C; --hero-cta-ink: #F3EFE4;
  box-shadow: 0 16px 28px -12px rgba(39, 51, 44, .28);
}
html[data-kvtheme="cutpaper"] .hero #heroGreeting { color: #26322C; }

/* ============================================================
   LAMPLIGHT — the evening version
   ============================================================
   Warm dark rather than navy, and a lamp rather than a tube. The
   difference between this and what we have now is that nothing here
   emits light: cards are lifted into the light with a hairline along
   the top edge, and the shadow underneath is deep and soft.
*/
html[data-kvtheme="lamplight"] {
  --surf-1: rgba(243, 231, 213, .055);
  --surf-2: rgba(243, 231, 213, .10);
  --hair:   rgba(243, 231, 213, .12);
  --edge:   rgba(243, 231, 213, .20);
  --sunk:   rgba(0, 0, 0, .22);
  --surface:    #1C1815;
  --bg-color:   #241F1B;
  --card-bg:    #2C2520;
  --inset:      #231E1A;
  --sidebar:    #221D19;
  --quiet:      #3A322B;
  --line:       rgba(243, 231, 213, .13);
  --card-edge:  1px solid rgba(243, 231, 213, .08);
  --text-main:  #F2E7D6;
  --text-muted: #BBAB95;
  --accent:     #E29A3C;
  --on-accent:  #2A1C0B;
  --yes:        #6FA172;  --yes-ink: #93C295;
  --maybe:      #D9A441;
  --no:         #C9646A;
  --away:       #6E92C4;
  --warn:       #D9A441;
  --warn-wash:  rgba(217, 164, 65, .12);
  --warn-line:  rgba(217, 164, 65, .30);
  --pastel-blue: #6E92C4; --pastel-pink: #C9718C; --pastel-teal: #6FA172;
  --pastel-yellow: #D9A441; --pastel-purple: #9C83BC; --pastel-orange: #E29A3C;
  --shadow-soft:  0 12px 24px -12px rgba(0, 0, 0, .7);
  --shadow-hover: 0 20px 34px -14px rgba(0, 0, 0, .8);
  --r-card: 18px; --r-input: 12px; --r-chip: 999px;
  --font-display: "Bricolage", system-ui, sans-serif;
  --display-weight: 700;
  --display-track: -0.025em;
}
/* The one warm pool of light on the page. */
html[data-kvtheme="lamplight"] .hero {
  --hero-bg: #33291F; --hero-ink: #F6EBD8;
  --hero-cta-bg: #F6EBD8; --hero-cta-ink: #3A2B18;
  box-shadow: 0 18px 36px -16px rgba(0, 0, 0, .75);
}

/* The hairline that makes a card look lit from above rather than lit
   from within. */
html[data-kvtheme="lamplight"] .card,
html[data-kvtheme="lamplight"] .kvr-card,
html[data-kvtheme="lamplight"] .settings-panel {
  background-image: linear-gradient(rgba(255, 246, 232, .055), rgba(255, 246, 232, 0) 42%);
}

/* ============================================================
   The picker itself
   ============================================================
   Styled here rather than in the page's own sheet because it has to
   look right in all three, and because a swatch is the only honest
   way to name a palette.
*/
.kv-look{display:flex;gap:14px;align-items:center;width:100%;text-align:left;cursor:pointer;
  border:2px solid var(--hair);background:var(--surf-1);color:var(--text-main,#fff);
  border-radius:var(--r-input,14px);padding:13px 15px;font:inherit}
.kv-look.on{border-color:var(--accent);background:var(--surf-2)}
.kv-look b{display:block;font-size:15px;font-weight:800}
.kv-look em{display:block;font-style:normal;font-weight:600;font-size:12.5px;margin-top:3px;
  color:var(--text-muted,#A0A0B0);line-height:1.5}
.kv-look > span:nth-child(2){flex:1;min-width:0}
.kv-look-dots{display:flex;gap:4px;flex:0 0 auto}
.kv-look-dots i{width:16px;height:16px;border-radius:50%;display:block;
  box-shadow:inset 0 0 0 1px rgba(128,128,128,.35)}
.kv-look-tick{flex:0 0 auto;font-weight:900;font-size:17px;color:var(--accent);width:18px}
@media (hover:hover){ .kv-look:hover{border-color:var(--edge)} }
