/* Aetherstar identity.

   This file is the ONLY place that decides how the site feels: colors,
   fonts, the dusk-sky background, the title banner and the header.
   styles.css (loaded first) holds layout and components and reads the
   variables defined here, so re-skinning the site means editing this file.

   The look comes from the Aetherstar presentation: a dusk gradient, an
   arrow-shaped title banner with the logo overlapping its end, scattered
   rhombus "starshards", and light small-caps display type. The palette is
   blue and gold: blue sky, gold logo and trim.

   Sections:
     1. Tokens        2. Sky background   3. Header     4. Title banner
     5. Home hero     6. Content sheet    7. Footer     8. Type and details
*/

/* ------------------------------------------------------------------ 1. Tokens */
:root {
  /* The content sheet that floats over the sky */
  --bg: #f4f7fd;
  --surface: #ffffff;
  --ink: #14275a;
  --muted: #566486;
  --line: #d5def0;
  --accent: #2b4fd8;
  --accent-ink: #ffffff;
  --accent-soft: #e4ebfc;

  /* Warm accent, kept small: "deadline soon" warnings and rating stars */
  --star: #9a6700;
  --star-soft: #fbf0d0;

  --good: #1b7a52;
  --good-soft: #def3ea;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;

  /* The dusk sky, top to bottom */
  --dusk-top: #18336f;
  --dusk-mid: #4a66ad;
  --dusk-low: #8fabdc;
  --dusk-bottom: #b4c9f0;

  --gold: #e8b64c;         /* the logo's gold: accents on the sky */
  --gold-soft: #f6dc95;
  --ice: #deecff;
  --ice-strong: #eaf2ff;   /* banner tip, header button */
  --on-dusk: #f1f6ff;      /* text that sits directly on the sky */

  --font-display: "Julius Sans One", "Segoe UI", system-ui, sans-serif;
  --font-body: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Lato", system-ui, sans-serif;   /* numbers: see tabular-nums below */

  --radius: 10px;
  --shadow: 0 1px 2px rgb(20 39 90 / 6%), 0 4px 14px rgb(20 39 90 / 6%);
  --sheet-shadow: 0 12px 40px rgb(8 20 60 / 35%);
}

/* Dark mode follows the visitor's device setting. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1836;
    --surface: #142046;
    --ink: #e6edfc;
    --muted: #9fb0d3;
    --line: #243462;
    --accent: #8fb0ff;
    --accent-ink: #0b1634;
    --accent-soft: #1c2d5e;
    --star: #f0c15a;
    --star-soft: #3a2d0e;
    --good: #5fd3a0;
    --good-soft: #12352a;
    --bad: #ff8d84;
    --bad-soft: #3d1815;
    --dusk-top: #0b1a3f;
    --dusk-mid: #263f82;
    --dusk-low: #4663a8;
    --dusk-bottom: #6f8fd0;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    --sheet-shadow: 0 12px 40px rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ 2. Sky background */
html { background: var(--dusk-top); }

body { position: relative; overflow-x: hidden; }

/* The gradient is fixed to the window, so the sheet scrolls over it. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--dusk-top) 0%, var(--dusk-mid) 38%,
    var(--dusk-low) 74%, var(--dusk-bottom) 100%);
}

/* Rhombus shapes (static/diamonds-*.svg), purely decorative. */
.sky span { position: absolute; pointer-events: none; background-repeat: no-repeat; }
.sky-top {
  top: 0; left: 0; width: min(100%, 1600px); height: 240px;
  background-image: url("diamonds-top.svg"); background-size: 100% 100%;
}
.sky-bottom {
  bottom: 0; left: 0; width: 100%; height: 220px;
  background-image: url("diamonds-bottom.svg"); background-size: 100% 100%;
}
.sky-right {
  position: fixed !important; top: 0; right: 0; width: 90px; height: 100vh;
  background-image: url("diamonds-right.svg"); background-size: 100% 100%;
  display: none;
}
@media (min-width: 1240px) { .sky-right { display: block; } }

/* Everything real sits above the decoration. */
.site-header, .banner-wrap, .hero-wrap, main.wrap, .site-footer {
  position: relative; z-index: 1;
}

/* ------------------------------------------------------------------ 3. Header */
.header-inner {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding-block: 0.9rem;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem; text-decoration: none;
  color: var(--gold-soft);
  font: 400 1.55rem/1 var(--font-display);
  font-variant-caps: small-caps; letter-spacing: 0.06em;
}
.brand img { width: 40px; height: 40px; display: block; }

.main-nav { display: flex; gap: 0.2rem; flex-wrap: wrap; flex: 1; }
.main-nav a {
  color: var(--on-dusk); text-decoration: none; padding: 0.4rem 0.75rem;
  border-radius: 8px; font-size: 0.95rem; font-weight: 700;
  border: 1px solid transparent;
}
.main-nav a:hover { background: rgb(255 255 255 / 12%); }
.main-nav a[aria-current="page"] {
  background: rgb(255 255 255 / 12%); border-color: var(--gold);
  color: #fff;
}

.account { display: flex; align-items: center; gap: 0.9rem; font-size: 0.95rem; }
.account form { margin: 0; }
.account a, .account .link-button { color: var(--on-dusk); text-decoration: none; }
.account a:hover, .account .link-button:hover { text-decoration: underline; }
.account .button.small {
  background: var(--gold); color: #1a2a55; border-color: transparent;
}

/* Phones: let the menu scroll sideways in its own row instead of wrapping. */
@media (max-width: 700px) {
  .header-inner { gap: 0.5rem 1rem; }
  .main-nav {
    order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto;
    padding-bottom: 0.2rem;
  }
  .main-nav a { white-space: nowrap; }
  .account { margin-left: auto; }
}

/* ------------------------------------------------------------------ 4. Title banner
   The signature element from the presentation: a translucent arrow with the
   logo overlapping its left end. Every page puts its title in one. */
.banner-wrap { margin-block: 2.2rem 1.6rem; }

.banner {
  position: relative; isolation: isolate; display: flex; align-items: center;
  min-height: 68px; padding: 0.6rem 24% 0.6rem 108px;
}
.banner::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(var(--gold), var(--gold)) top / 100% 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom / 100% 2px no-repeat,
    linear-gradient(90deg, rgb(255 255 255 / 8%) 0%,
      rgb(255 255 255 / 22%) 70%, var(--gold-soft) 100%);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%,
    calc(100% - 22px) 100%, 0 100%);
}
.banner-logo {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 92px; height: 92px; display: block;
  filter: drop-shadow(0 2px 6px rgb(8 20 60 / 35%));
}
.banner h1 {
  margin: 0; color: #fff;
  font: 400 clamp(1.5rem, 3.4vw, 2.25rem)/1.15 var(--font-display);
  font-variant-caps: small-caps; letter-spacing: 0.05em;
  text-shadow: 0 1px 10px rgb(10 24 64 / 60%);
  overflow-wrap: anywhere;
}
@media (max-width: 560px) {
  .banner { padding-left: 84px; padding-right: 18%; min-height: 60px; }
  .banner-logo { width: 74px; height: 74px; }
}

/* ------------------------------------------------------------------ 5. Home hero */
.hero-wrap { padding-block: 2.4rem 2.6rem; }
.hero {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2rem;
}
.hero h1 {
  margin: 0 0 0.3em; color: #fff;
  font: 400 clamp(2.8rem, 8vw, 4.8rem)/1 var(--font-display);
  font-variant-caps: small-caps; letter-spacing: 0.05em;
  text-shadow: 0 2px 16px rgb(10 24 64 / 45%);
}
.hero .tagline {
  margin: 0 0 0.9rem; max-width: 24ch; color: var(--gold-soft);
  font-size: clamp(1.25rem, 2.6vw, 1.8rem); line-height: 1.3;
}
.hero .lede { color: rgb(241 246 255 / 88%); margin-bottom: 0; }
.hero-logo {
  width: clamp(130px, 24vw, 290px); height: auto; display: block;
  filter: drop-shadow(0 4px 18px rgb(8 20 60 / 35%));
}
@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; gap: 1rem; }
  .hero-logo { order: -1; width: 110px; }
}

/* ------------------------------------------------------------------ 6. Content sheet
   Reading happens on a calm surface; the sky stays decorative. */
main.wrap {
  border-top: 3px solid var(--gold);
  width: min(1120px, calc(100% - 32px));
  min-height: 55vh;
  padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) 3rem;
  margin-bottom: 2.5rem;
  background: var(--bg);
  border-radius: 18px;
  box-shadow: var(--sheet-shadow);
}
@media (max-width: 560px) { main.wrap { border-radius: 14px; } }

/* ------------------------------------------------------------------ 7. Footer */
.site-footer {
  border-top: 2px solid var(--gold);
  padding-block: 1.5rem; font-size: 0.85rem; color: var(--on-dusk);
  background: rgb(11 26 63 / 55%);
}
.site-footer p { margin: 0; max-width: 70ch; }
.site-footer .wrap { background: none; }

/* ------------------------------------------------------------------ 8. Type and details */
h1, h2 {
  font-family: var(--font-display); font-weight: 400;
  font-variant-caps: small-caps; letter-spacing: 0.04em;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: 1.55rem; }
h3 {
  font-family: var(--font-body); font-weight: 700; letter-spacing: 0;
}
.section-label { font-family: var(--font-body); }
.deadline-big { font: 400 1.6rem var(--font-display); font-variant-caps: small-caps; }
.error-code { font-family: var(--font-display); }

/* Lato's default digits vary in width; make columns of numbers line up. */
.mono, .deadline, .day-number, .tile-count, .count, .chars {
  font-variant-numeric: tabular-nums;
}

/* Subject constellations use the accent blue; the warm star color is
   reserved for deadlines and ratings. */
.constellation circle { fill: var(--accent); }
.constellation line { stroke: var(--accent); opacity: 0.45; }
.tile.active .constellation line { opacity: 0.9; }
