/*
 * basemorning.com
 *
 * Blue palette sampled from art/basemorning-logo-source.jpg by
 * scripts/build_assets.py. The warm sunrise range is layered on top of it.
 * Every text pair is verified by scripts/contrast.py.
 *
 * House style: chunky sticker type, thick borders, hard offset shadows, and a
 * sunrise that actually looks like a sunrise. Every animation is gated behind
 * prefers-reduced-motion.
 */
:root {
  --ink: #00081f;
  --deep: #000c48;
  --surface: #071a4e;
  --surface-2: #0b2168;
  --line: #1e3d94;
  --royal: #0030fc;
  --royal-bright: #2f63ff;
  --sky: #33a6fd;
  --mist: #8ecbff;
  --pale: #cfdcf8;
  --foam: #f2f6ff;

  /* Sunrise */
  --sun: #ffd84d;
  --sun-deep: #ffa92e;
  --coral: #ff6b4a;
  --cream: #fff4d6;
  --up: #5fe3a1;

  --wrap: 1120px;
  --radius: 20px;
  --border: 3px;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sun: 6px 6px 0 var(--sun-deep);

  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--foam);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--sun);
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.wrap.narrow {
  width: min(100% - 2.5rem, 800px);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--sun);
  color: var(--ink);
  padding: 0.75rem 1rem;
  font-weight: 900;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 4px solid var(--sun);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0, 8, 31, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: var(--border) solid var(--sun);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--foam);
}

.brand-mark {
  border-radius: 50%;
  border: 2px solid var(--sun);
}

.brand-name {
  font-family: var(--display);
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}

.brand-ticker {
  font-family: var(--display);
  font-size: 0.8rem;
  color: var(--ink);
  background: var(--sun);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  transform: rotate(-4deg);
}

.nav-links {
  display: flex;
  gap: 1.4rem;
  margin-left: auto;
  font-size: 0.95rem;
  font-weight: 700;
}

.nav-links a {
  color: var(--pale);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--sun);
}

/* Buttons: chunky sticker with a hard shadow that presses in on hover */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 1rem;
  text-decoration: none;
  border: var(--border) solid var(--ink);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  border-width: 2px;
}

.btn-primary {
  background: var(--sun);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-ghost {
  background: var(--surface);
  color: var(--foam);
  border-color: var(--sun);
  box-shadow: 6px 6px 0 var(--surface-2);
}

.btn-ghost:hover {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--surface-2);
}

.nav .btn-primary {
  box-shadow: 3px 3px 0 var(--ink);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3rem, 8vw, 5.5rem);
}

/* An actual sunrise: warm core bleeding up into the blue. */
.sunrise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      42% 46% at 62% 78%,
      rgba(255, 216, 77, 0.5) 0%,
      rgba(255, 169, 46, 0.34) 34%,
      rgba(255, 107, 74, 0.16) 58%,
      transparent 76%
    ),
    radial-gradient(
      90% 70% at 50% 100%,
      rgba(51, 166, 253, 0.3) 0%,
      transparent 70%
    );
}

/* Sun rays that turn very slowly behind the hero. */
.sunrise::after {
  content: "";
  position: absolute;
  left: 62%;
  top: 78%;
  width: 150vmax;
  height: 150vmax;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 216, 77, 0.09) 0deg 6deg,
    transparent 6deg 18deg
  );
  mask-image: radial-gradient(closest-side, #000 0%, transparent 62%);
  -webkit-mask-image: radial-gradient(closest-side, #000 0%, transparent 62%);
  animation: spin 140s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--up);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  transform: rotate(-2deg);
}

.hero-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(5rem, 17vw, 11rem);
  line-height: 0.82;
  letter-spacing: -0.05em;
  color: var(--cream);
  text-shadow:
    0 0 60px rgba(255, 216, 77, 0.55),
    5px 6px 0 var(--sun-deep),
    10px 12px 0 var(--royal);
  padding-bottom: 0.12em;
}

.hero-title .mug {
  font-size: 0.42em;
  vertical-align: 0.5em;
  text-shadow: none;
  display: inline-block;
  animation: tilt 3.5s ease-in-out infinite;
}

@keyframes tilt {
  0%,
  100% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(8deg);
  }
}

.hero-lede {
  margin: 2.1rem 0 2rem;
  font-size: clamp(1.1rem, 2.1vw, 1.35rem);
  font-weight: 600;
  color: var(--foam);
  max-width: 42ch;
}

.hero-lede b {
  color: var(--sun);
}

.hero-art {
  position: relative;
}

.hero-art img {
  display: block;
  margin-inline: auto;
  filter: drop-shadow(0 20px 50px rgba(255, 169, 46, 0.4));
  animation: bob 6s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-1.5deg);
  }
  50% {
    transform: translateY(-14px) rotate(1.5deg);
  }
}

/* Contract pill */
.ca {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: var(--border) solid var(--sun);
  border-radius: 999px;
  padding: 0.45rem 0.45rem 0.45rem 1.15rem;
  margin-bottom: 1.75rem;
  max-width: 100%;
  box-shadow: var(--shadow);
}

.ca-label {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sun);
}

.ca-value {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--foam);
  overflow-wrap: anywhere;
}

.ca-copy {
  font-family: var(--display);
  font-size: 0.82rem;
  color: var(--ink);
  background: var(--sun);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.45rem 1.05rem;
  cursor: pointer;
}

.ca-copy:hover {
  background: var(--cream);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Marquee */
.marquee {
  border-block: var(--border) solid var(--ink);
  background: var(--sun);
  color: var(--ink);
  overflow: hidden;
  padding: 0.7rem 0;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: slide 26s linear infinite;
}

.marquee span {
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding-inline: 1.1rem;
  white-space: nowrap;
}

@keyframes slide {
  to {
    transform: translateX(-50%);
  }
}

/* Sections */
.section {
  position: relative;
  padding: clamp(3rem, 7vw, 5rem) 0;
  scroll-margin-top: 88px;
}

.section-quiet {
  background: var(--deep);
  border-block: var(--border) solid var(--line);
}

.section-title {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--foam);
}

.section-title .hl {
  color: var(--ink);
  background: var(--sun);
  padding: 0 0.28em;
  border-radius: 6px;
  display: inline-block;
  transform: rotate(-1.5deg);
}

.section-note {
  margin: 0 0 2rem;
  color: var(--pale);
  font-size: 1rem;
  font-weight: 600;
}

.prose {
  color: var(--pale);
  font-size: 1.1rem;
  margin: 0 0 1.1rem;
}

.prose b,
.pair-inline {
  color: var(--sun);
  font-weight: 800;
}

/* #pair-symbol lives inside .hl, which is dark-on-yellow. Never recolour it
   here: an id selector would beat .hl and paint yellow on yellow. */

/* Stats */
.stat-grid {
  /* Six figures: 3x2 reads as a block, auto-fit orphans the last card. */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
  margin: 1.75rem 0 1.4rem;
}

.stat {
  background: var(--surface);
  border: var(--border) solid var(--sun);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow);
}

.stat:nth-child(2n) {
  transform: rotate(-0.8deg);
}

.stat:nth-child(3n) {
  transform: rotate(0.9deg);
}

.stat-label {
  display: block;
  font-family: var(--display);
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sun);
  margin-bottom: 0.45rem;
}

.stat-value {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--foam);
}

.stat-value.is-up {
  color: var(--up);
}

.citation {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mist);
}

.citation.is-stale {
  color: var(--sun);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.15rem;
}

.card {
  background: var(--surface);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sun);
}

.card-wide {
  grid-column: 1 / -1;
  background: var(--surface-2);
  border-color: var(--sun);
  box-shadow: var(--shadow);
}

.card-title {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sun);
}

.card-value {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-size: 2.1rem;
  letter-spacing: -0.03em;
  color: var(--foam);
}

.card-note {
  margin: 0;
  font-size: 0.92rem;
  color: var(--pale);
}

/* Steps */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: grid;
  gap: 1.15rem;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 4rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.9rem;
  height: 2.9rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sun);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.25rem;
  border: var(--border) solid var(--ink);
  box-shadow: 3px 3px 0 var(--royal);
}

.steps h3 {
  margin: 0.35rem 0 0.3rem;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--foam);
}

.steps p {
  margin: 0;
  color: var(--pale);
}

/* Footer */
.footer {
  border-top: var(--border) solid var(--sun);
  padding: 3rem 0 4rem;
  background: var(--ink);
}

.footer-top {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.footer-mark {
  border-radius: 50%;
  border: 2px solid var(--sun);
}

.footer-gm {
  font-family: var(--display);
  font-size: 1.6rem;
  color: var(--sun);
  letter-spacing: -0.02em;
}

.socials {
  display: flex;
  gap: 1rem;
  margin-left: auto;
}

.socials a {
  color: var(--sun);
  text-decoration: none;
  font-weight: 800;
}

.footer-cite,
.footer-risk,
.footer-legal {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--mist);
  max-width: 72ch;
}

.footer-risk {
  color: var(--pale);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  background: var(--sun);
  color: var(--ink);
  font-family: var(--display);
  padding: 0.85rem 1.5rem;
  border: var(--border) solid var(--ink);
  border-radius: 999px;
  z-index: 60;
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
  }

  .stat,
  .stat:nth-child(2n),
  .stat:nth-child(3n) {
    transform: none;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-art {
    order: -1;
  }

  .hero-art img {
    width: min(64vw, 300px);
  }

  .nav-links {
    display: none;
  }

  :root {
    --shadow: 4px 4px 0 var(--ink);
    --shadow-sun: 4px 4px 0 var(--sun-deep);
  }
}

@media (max-width: 560px) {
  /* The badge carries the brand at phone width; the wordmark wrapped to two
     lines and crowded out the buy button. Hide it visually rather than with
     display:none, which would strip the accessible name off the brand link. */
  .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .brand-ticker {
    display: none;
  }

  .nav-inner {
    min-height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .sunrise::after,
  .hero-art img,
  .hero-title .mug,
  .marquee-track {
    animation: none;
  }

  .btn:hover {
    transform: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
