/* PCS navy marble identity — visual layer only; reading surfaces stay quiet. */
:root {
  --bg: #051522;
  --marble-1: #092031;
  --marble-2: #102b3b;
  --card: #0a2030;
  --line: #29404a;
  --line-soft: #213642;
  --gold-line: #b99a60;
  --gold-border: rgba(199,167,106,.5);
  --gold: #d7b97b;
  --gold-bright: #eed59c;
  --gold-dim: #baa572;
  --gold-glow: rgba(199,167,106,.2);
  --gold-bg: rgba(199,167,106,.09);
  --on-gold: #10202a;
  --text: #f4f1e9;
  --muted: #b7c5ce;
  --faint: #9aadb8;
  --shadow: 0 12px 36px -20px rgba(0,0,0,.8);
  --brand-marble: url("navy-gold-background-wide.png");
  --brand-portrait: url("navy-gold-background-portrait.png");
}

:root[data-theme="light"] {
  --bg: #eeeae0;
  --marble-1: #f2eee4;
  --marble-2: #fffdf7;
  --card: #fffdf7;
  --line: #d2c9b5;
  --line-soft: #e1d9c9;
  --gold-line: #9f7d3f;
  --gold-border: #b39b6b;
  --gold: #806025;
  --gold-bright: #6e4f1b;
  --gold-dim: #846c3e;
  --gold-bg: rgba(158,122,58,.08);
  --gold-glow: rgba(115,91,45,.14);
  --on-gold: #fffdf7;
  --text: #142b39;
  --muted: #4b606b;
  --faint: #63717a;
  --edge: #c9b88f;
  --shadow: 0 12px 36px -22px rgba(38,48,49,.28);
}

.mv {
  background: radial-gradient(ellipse at 50% 0, rgba(29,66,86,.32), transparent 780px), var(--bg);
}
:root[data-theme="light"] .mv {
  background: radial-gradient(ellipse at 50% 0, #fbf8ef, transparent 900px), var(--bg);
}
.doc { max-width: 1080px; padding: 26px 30px 80px; }
.bar { margin-bottom: 24px; gap: 18px; }
.brand { min-width: 0; gap: 10px; }
.brand .em {
  width: 52px; height: 52px; flex: none; background: #071c2c;
  border: 1px solid rgba(199,167,106,.35); border-radius: 12px;
  box-shadow: 0 5px 18px -12px #000;
}
.brand .em img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand b { font-size: 10px; line-height: 1.6; letter-spacing: .18em; color: var(--text); }
.barright { gap: 12px; }
.themebtn, .signout { min-height: 34px; color: var(--muted); background: var(--card); }
.stamp { color: var(--gold-dim); letter-spacing: .17em; }

/* An actual marble cover, including the supplied academy mark. */
.brand-cover {
  position: relative; isolation: isolate; display: grid; grid-template-columns: 240px minmax(0,1fr);
  gap: 24px; align-items: center; min-height: 360px; padding: 42px;
  border: 1px solid #b49b69; border-radius: 22px; overflow: hidden;
  background: linear-gradient(90deg, rgba(4,19,31,.16), rgba(4,19,31,.74) 48%, rgba(4,19,31,.65)), var(--brand-marble) center / cover, #071c2c;
  box-shadow: inset 0 1px 0 rgba(255,237,190,.16), 0 22px 54px -30px #000;
}
.brand-cover::after {
  content: ""; position: absolute; inset: 9px; z-index: -1;
  border: 1px solid rgba(199,167,106,.22); border-radius: 14px; pointer-events: none;
}
.emblem { margin: 0; }
.emblem .wrap { width: 240px; height: 240px; }
.emblem .mark {
  width: 100%; height: 100%; border: 0; border-radius: 0; background: none; box-shadow: none;
}
.emblem .mark img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0,0,0,.4)); }
.emblem .glow { inset: 10%; background: radial-gradient(circle, rgba(204,171,99,.16), transparent 70%); }
.brand-cover .center { text-align: left; min-width: 0; }
.brand-cover .banner {
  margin: 0 0 18px; padding: 0; border: 0; border-radius: 0; background: none;
  color: #c3ced5; font-size: 10px; letter-spacing: .035em; line-height: 1.5;
}
.brand-cover .banner::before { color: #d7b97b; }
.brand-cover .eyebrow {
  border: 0; border-radius: 0; border-left: 2px solid #c7a76a; background: none;
  padding: 0 0 0 12px; color: #e4c890; letter-spacing: .2em; font-size: 10px;
}
.brand-cover h1.title { color: #f4f1e9; font-size: clamp(52px,7vw,80px); margin: 15px 0 4px; }
.brand-cover .subtitle { color: #e0c18a; font-size: 27px; }
.brand-cover .lede { color: #c1ced6; font-size: 14px; line-height: 1.65; max-width: 47ch; margin: 18px 0 0; }

/* The books keep their existing routes and selection state. */
.books { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; border: 0; margin: 22px 0 30px; }
.book {
  text-align: left; min-height: 102px; padding: 20px 18px; white-space: normal;
  font-size: 15px; color: #c9d3d9; border: 1px solid #46545a; border-radius: 13px;
  background: linear-gradient(105deg, rgba(5,21,34,.75), rgba(5,21,34,.34)), var(--brand-marble) 0% 30% / 680px auto, #071c2c;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), var(--shadow);
  transition: border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.book:nth-child(2) { background-position: center, 30% 55%; }
.book:nth-child(3) { background-position: center, 65% 30%; }
.book:nth-child(4) { background-position: center, 100% 60%; }
.book .bn { display: block; color: #d0b77e; margin: 0 0 9px; font-size: 10px; letter-spacing: .15em; }
.book .bc { color: #becbd2; }
.book:hover { color: #fff9ed; border-color: #bca16b; }
.book.on { color: #fff6df; border-color: #d6b87a; box-shadow: inset 0 -3px 0 #c7a76a, 0 8px 24px -14px rgba(199,167,106,.5); }
.book.on .bn { color: #f0d9a3; }
.cchip {
  background: var(--card); border: 1px solid var(--edge); border-radius: 9px;
  font-size: 12px; color: var(--text); padding: 9px 13px;
}
.cchip b { color: var(--gold); }

/* Marble introduces a section; reading and editing happen on calm surfaces. */
.sec { margin-top: 52px; }
.seclabel { margin: 0 0 10px; }
.seclabel .n { font-size: 10px; letter-spacing: .17em; }
.seclabel .line { background: linear-gradient(90deg, var(--gold-line), transparent); opacity: .35; }
.sec > h2 {
  padding: 18px 24px; margin: 0 0 14px; border: 1px solid #4f5551; border-left: 3px solid #c7a76a;
  border-radius: 12px; color: #f4f1e9; font-size: 34px; line-height: 1.16;
  background: linear-gradient(95deg, rgba(5,21,34,.82), rgba(5,21,34,.38)), var(--brand-marble) center 48% / cover, #071c2c;
  box-shadow: var(--shadow);
}
.secnote { display: inline-block; color: var(--faint); margin-bottom: 14px; font-size: 13px; }
.dates { margin-top: 0; padding: 26px; background: var(--card); border-color: var(--gold-border); }
.dates .secnote { margin-bottom: 0; }
.card, .plan, .livebox, .mtg, .action-inline { background: var(--card); box-shadow: var(--shadow); }
.card { border-top-color: var(--gold-border); padding: 24px; }
.card p, .lesson p, .todo .t, .mtgtext { font-size: 14px; line-height: 1.65; }
.cards { gap: 16px; }
.lessons { gap: 10px; }
.lesson, .lesson:first-child {
  border: 1px solid var(--line); border-radius: 12px; padding: 22px 20px;
  background: var(--card); grid-template-columns: 36px minmax(0,1fr); gap: 16px;
}
.lessonacts .rowacts { top: 14px; right: 10px; }
.lesson h4 { padding-right: 50px; font-size: 23px; }
.lesson .num { font-size: 26px; }
.stream { background: var(--marble-1); }
.quote {
  background: linear-gradient(110deg, rgba(5,21,34,.91), rgba(5,21,34,.54)), var(--brand-marble) center / cover, #071c2c;
  border-color: rgba(199,167,106,.55); padding: 34px; text-align: center;
}
.quote p { color: #f4f1e9; max-width: 32ch; margin: auto; }
.quote .by { color: #ddc38c; }
.livebox { border-color: var(--gold-border); }
.livecell { background: var(--marble-1); }
.editcard { background: var(--card); }
.dinput, .dbody, .field input { background: var(--bg); }
.addbtn { color: var(--gold); }
.mkrow { background: var(--card); padding: 18px; }
.mkrow:first-child { border-radius: 12px 12px 0 0; }
.mkrow:last-child { border-radius: 0 0 12px 12px; }
.mkrow .rowacts { right: 10px; }
.action-inline { border-color: var(--gold-border); }
.action-slot { background: var(--card); border-color: var(--edge); }
.action-slot-head {
  color: #e7ce96; border-bottom-color: rgba(199,167,106,.3); padding: 12px 16px;
  background: linear-gradient(90deg,rgba(5,21,34,.75),rgba(5,21,34,.38)), var(--brand-marble) center / cover, #071c2c;
}
.action-slot-body { background: var(--card); }
.action-slot-icon { color: var(--gold); }
.action-guide { background: var(--card); }
.foot { color: var(--faint); letter-spacing: .1em; }

/* The gate carries the identity while retaining both theme choices and every control. */
.gate {
  background: linear-gradient(180deg,rgba(5,21,34,.24),rgba(5,21,34,.65)), var(--brand-marble) center / cover, #051522;
}
.gatecard {
  max-width: 460px; padding: 30px 38px 34px; background: var(--card);
  border: 1px solid #b99a60; box-shadow: 0 25px 65px -20px rgba(0,0,0,.75);
}
.gatecard .emblem { margin: -12px 0 10px; }
.gatecard .wrap { width: 174px; height: 174px; padding: 10px; border-radius: 50%; background: #071c2c; border: 1px solid rgba(199,167,106,.26); }
.gatecard .eyebrow { font-size: 9px; padding: 5px 12px; }
.gatecard h1 { font-size: 46px; }
.gatecard .sub { font-size: 14px; }
.gatecard .lock { font-size: 9px; letter-spacing: .09em; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 4px;
}
.book:focus-visible { outline-color: #f1d59b; }
@media (hover: none) { .rowacts { opacity: 1; } }
@media (max-width: 900px) {
  .brand-cover { grid-template-columns: 185px minmax(0,1fr); padding: 30px; gap: 20px; }
  .brand-cover .wrap { width: 185px; height: 185px; }
  .brand-cover h1.title { font-size: 62px; }
  .book { padding: 17px 14px; font-size: 14px; }
}
@media (max-width: 680px) {
  .doc { padding: 20px 18px 60px; }
  .bar { flex-wrap: wrap; gap: 13px; margin-bottom: 18px; }
  .brand b { font-size: 9px; letter-spacing: .13em; }
  .brand .em { width: 44px; height: 44px; }
  .barright { gap: 10px; flex-wrap: wrap; }
  .brand-cover { grid-template-columns: 1fr; gap: 6px; padding: 22px 24px 30px; }
  .brand-seal { display: grid; place-items: center; }
  .brand-cover .wrap { width: 158px; height: 158px; }
  .brand-cover .center { text-align: center; }
  .brand-cover .banner { display: none; }
  .brand-cover .eyebrow { border-left: 0; padding: 0; font-size: 9px; }
  .brand-cover h1.title { font-size: clamp(48px,11vw,66px); margin-top: 14px; }
  .brand-cover .subtitle { font-size: 25px; }
  .brand-cover .lede { font-size: 13px; margin: 14px auto 0; }
  .books { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 18px 0 24px; }
  .book { min-height: 88px; padding: 15px 16px; }
  .book .bn { margin-bottom: 5px; }
  .dates, .plan, .card { padding: 20px; }
  .dates-head { flex-wrap: wrap; }
  .sec > h2 { padding: 17px 18px; font-size: 29px; }
  .quote { padding: 28px 22px; }
  .lesson, .lesson:first-child { padding: 18px 14px; grid-template-columns: 28px minmax(0,1fr); gap: 12px; }
  .lesson h4 { font-size: 22px; }
  .action-layout { gap: 18px; }
  .gate { padding: 20px; background-image: linear-gradient(180deg,rgba(5,21,34,.2),rgba(5,21,34,.55)),var(--brand-portrait); }
  .gatecard { padding: 26px 24px 30px; }
  .gatecard .wrap { width: 148px; height: 148px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
