/* The Mind of Simon
   Palette: hero blue, cape red, sun yellow on a midnight sky */
:root {
  --sky: #0b1f4d;
  --sky-deep: #061433;
  --blue: #1450a3;
  --blue-bright: #2e7be6;
  --red: #d2202f;
  --red-deep: #9e1220;
  --gold: #ffc72c;
  --gold-soft: #ffe08a;
  --paper: #fff8e7;
  --paper-2: #f3ead2;
  --ink: #0a1633;
  --ink-soft: #3a4766;
  --white: #ffffff;

  --font-display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(6, 20, 51, 0.25);
  --max: 1100px;
}

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

html { scroll-behavior: smooth; }

[id] { scroll-margin-top: 80px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--blue); }
a:hover { color: var(--red); }

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--gold);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--sky-deep);
  border-bottom: 4px solid var(--red);
}
/* Keep the sticky header below the WordPress admin bar when logged in */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand:hover { color: var(--gold); }
.brand .emblem { width: 38px; height: 38px; flex: none; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 2px solid var(--gold);
  border-radius: 10px;
  color: var(--gold);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  padding: 12px 14px;
  border-radius: 8px;
}
.site-nav a:hover { color: var(--gold); }
.site-nav a[aria-current="page"] {
  background: var(--red);
  color: var(--white);
}

@media (max-width: 759px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--sky-deep);
    border-bottom: 4px solid var(--red);
    padding: 8px 16px 16px;
    display: none;
  }
  .site-nav.open { display: block; }
}
@media (min-width: 760px) {
  .nav-toggle { display: none; }
  .site-nav ul { display: flex; gap: 6px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 50% 120%, rgba(46, 123, 230, 0.55), transparent 60%),
    repeating-conic-gradient(from 0deg at 50% 110%, rgba(255, 255, 255, 0.05) 0 6deg, transparent 6deg 12deg),
    linear-gradient(180deg, var(--sky-deep), var(--sky) 55%, var(--blue));
  padding: 64px 0 96px;
  text-align: center;
}
.hero::after {
  /* the cape */
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -40px;
  height: 90px;
  background: var(--red);
  transform: rotate(-3deg);
  box-shadow: 0 -6px 0 var(--gold);
}
.hero .emblem {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
}
.eyebrow {
  display: inline-block;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--gold);
  margin-bottom: 10px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 9vw, 5.2rem);
  line-height: 1;
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  text-shadow: 3px 3px 0 var(--red-deep), 6px 6px 0 rgba(0, 0, 0, 0.25);
}
.hero h1 .gold { color: var(--gold); }
.hero p.lead {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 28px;
  color: #dbe6ff;
}
.hero.small { padding: 48px 0 84px; }
.hero.small h1 { font-size: clamp(2.2rem, 7vw, 4rem); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  text-decoration: none;
  border: 3px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-row.left { justify-content: flex-start; }
.btn:hover { transform: translateY(-2px); }
.btn-gold {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 4px 0 #c99400;
}
.btn-gold:hover { color: var(--ink); }
.btn-outline {
  border-color: var(--white);
  color: var(--white);
  background: transparent;
}
.btn-outline:hover { color: var(--gold); border-color: var(--gold); }
.btn-red {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 4px 0 var(--red-deep);
}
.btn-red:hover { color: var(--white); }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.05;
  margin: 0 0 8px;
  color: var(--sky);
}
.section-title .red { color: var(--red); }
.section-intro {
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 0 32px;
}
.center { text-align: center; }
.center .section-intro { margin-left: auto; margin-right: auto; }

/* ---------- Quote of the day ---------- */
.qotd {
  margin-top: -40px;
  position: relative;
  z-index: 2;
  padding: 0;
}
.qotd-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 8px solid var(--gold);
  padding: 28px 24px;
  text-align: center;
}
.qotd-card .eyebrow { color: var(--red); }
.qotd-card blockquote {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  line-height: 1.15;
  color: var(--sky);
  text-transform: uppercase;
}
.qotd-card cite {
  font-style: normal;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.qotd-card .btn { margin-top: 18px; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  gap: 32px;
}
@media (min-width: 860px) {
  .about-grid { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
}
.about-copy p { margin: 0 0 16px; }
.about-copy p.big {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--sky);
}
.fact-card {
  background: var(--sky);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-left: 8px solid var(--red);
}
.fact-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 12px;
  font-size: 1.5rem;
}
.fact-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.fact-card li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  gap: 12px;
}
.fact-card li:last-child { border-bottom: 0; }
.fact-card li strong { color: var(--gold-soft); min-width: 92px; }

/* ---------- Journey timeline ---------- */
.journey { background: var(--paper-2); }
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: linear-gradient(var(--blue), var(--red));
  border-radius: 4px;
}
.timeline li {
  position: relative;
  padding: 0 0 32px 60px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline .dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sky);
  border: 4px solid var(--gold);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.timeline li.now .dot { background: var(--red); color: var(--white); }
.timeline .stage {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red);
}
.timeline h3 {
  margin: 2px 0 6px;
  font-size: 1.25rem;
  color: var(--sky);
}
.timeline p { margin: 0; color: var(--ink-soft); }

@media (min-width: 860px) {
  .timeline::before { left: 50%; transform: translateX(-50%); }
  .timeline li {
    width: 50%;
    padding: 0 48px 40px 0;
    text-align: right;
  }
  .timeline li .dot { left: auto; right: -21px; }
  .timeline li:nth-child(even) {
    margin-left: 50%;
    padding: 0 0 40px 48px;
    text-align: left;
  }
  .timeline li:nth-child(even) .dot { right: auto; left: -21px; }
}

/* ---------- Ironman ---------- */
.ironman {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 14px, transparent 14px 28px),
    var(--sky);
  color: var(--white);
}
.ironman .section-title { color: var(--white); }
.ironman .section-intro { color: #c8d6f5; }
.stats {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 32px;
}
.stat {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 199, 44, 0.5);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat .num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--gold);
}
.stat .unit { font-size: 1rem; color: var(--gold-soft); }
.stat .label {
  margin-top: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  color: #dbe6ff;
}
.stat.total { background: var(--red); border-color: var(--gold); }
.stat.total .num, .stat.total .unit { color: var(--white); }
.pull {
  border-left: 6px solid var(--red);
  padding: 4px 0 4px 18px;
  margin: 0 0 24px;
  font-size: 1.3rem;
  font-weight: 600;
  max-width: 640px;
}

/* ---------- Note board ---------- */
.board-section { background: var(--sky); padding-top: 40px; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}
.chip {
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--font-body);
}
.chip:hover { background: rgba(255, 199, 44, 0.15); }
.chip[aria-pressed="true"] { background: var(--gold); color: var(--ink); }

.board {
  background:
    radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1.5px) 0 0 / 22px 22px,
    linear-gradient(160deg, #123a7a, #0d2c63);
  border: 10px solid var(--red-deep);
  outline: 4px solid var(--gold);
  border-radius: 8px;
  padding: 32px 18px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35), var(--shadow);
  display: grid;
  gap: 28px 20px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.note {
  position: relative;
  padding: 30px 20px 18px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
  transform: rotate(var(--tilt, -1.5deg));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  border: 0;
  text-align: left;
  font-family: var(--font-body);
  width: 100%;
}
.note:hover,
.note:focus-visible {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.45);
  z-index: 3;
}
.note::before {
  /* the pin */
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 2px, var(--pin, var(--red)) 3px);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
}
.note .q {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 14px;
}
.note .src {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.8;
}
.note.yellow { background: var(--gold); color: var(--ink); }
.note.paper { background: var(--paper); color: var(--ink); --pin: var(--blue); }
.note.red { background: var(--red); color: var(--white); --pin: var(--gold); }
.note.blue { background: var(--blue-bright); color: var(--white); --pin: var(--gold); }
.note[hidden] { display: none; }

/* Note dialog */
dialog.note-dialog {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  max-width: 560px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow);
  background: var(--white);
}
dialog.note-dialog::backdrop { background: rgba(6, 20, 51, 0.8); }
.dialog-inner {
  padding: 40px 28px 28px;
  border-top: 10px solid var(--red);
  text-align: center;
}
.dialog-inner blockquote {
  margin: 0 0 14px;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  line-height: 1.12;
  color: var(--sky);
}
.dialog-inner p { margin: 0 0 20px; color: var(--ink-soft); }
.dialog-inner .btn-row { gap: 10px; }

/* ---------- Stories ---------- */
.stories-list {
  display: grid;
  gap: 24px;
}
.story {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(6, 20, 51, 0.12);
  overflow: hidden;
  display: grid;
}
@media (min-width: 760px) {
  .story { grid-template-columns: 150px 1fr; }
}
.story-side {
  background: var(--sky);
  color: var(--gold);
  padding: 18px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
@media (min-width: 760px) {
  .story-side {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-right: 6px solid var(--red);
  }
}
.story-side .no {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
}
.story-side time {
  color: #dbe6ff;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.story-body { padding: 22px 22px 24px; }
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  margin-bottom: 10px;
}
.story h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  line-height: 1.25;
  color: var(--sky);
}
.story p { margin: 0 0 14px; color: var(--ink-soft); }
.story .pullquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--paper);
  border-left: 5px solid var(--red);
  font-weight: 700;
  color: var(--ink);
}
.story .lesson {
  font-size: 0.92rem;
  margin: 0 0 16px;
}
.story .lesson strong { color: var(--red); }
.read-link {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  text-decoration: none;
}
.story.featured { border: 3px solid var(--gold); }
.story.featured .story-side { background: var(--red); color: var(--white); border-right-color: var(--gold); }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--red);
  color: var(--white);
  text-align: center;
  padding: 48px 0;
  border-top: 6px solid var(--gold);
}
.cta-band h2 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  margin: 0 0 8px;
}
.cta-band p { margin: 0 0 22px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--sky-deep);
  color: #b9c7e8;
  padding: 36px 0;
  font-size: 0.9rem;
  text-align: center;
}
.site-footer .emblem { width: 44px; height: 44px; margin: 0 auto 10px; }
.site-footer a { color: var(--gold); }
.site-footer p { margin: 4px 0; }

/* ---------- Newsletter pop-up ---------- */
.site-nav a.nav-subscribe {
  background: var(--gold);
  color: var(--ink);
  border-radius: 999px;
}
.site-nav a.nav-subscribe:hover { background: var(--gold-soft); color: var(--ink); }

dialog.signup-dialog {
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  width: calc(100% - 32px);
  max-width: 480px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--sky);
  color: var(--white);
  box-shadow: var(--shadow);
}
dialog.signup-dialog::backdrop { background: rgba(6, 20, 51, 0.8); }
.signup-inner {
  position: relative;
  padding: 36px 20px 16px;
  text-align: center;
  border-top: 10px solid var(--red);
  background:
    repeating-conic-gradient(from 0deg at 50% 0%, rgba(255, 255, 255, 0.04) 0 6deg, transparent 6deg 12deg),
    var(--sky);
}
.signup-inner h2 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  line-height: 1.05;
  margin: 0 0 10px;
  text-shadow: 2px 2px 0 var(--red-deep);
}
.signup-inner h2 .gold { color: var(--gold); }
.signup-inner p { color: #dbe6ff; margin: 0 0 18px; }
.signup-frame {
  background: var(--white);
  border: 3px solid var(--gold);
  border-radius: 10px;
  overflow: hidden;
}
.signup-frame iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
  background: var(--white);
}
.signup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: var(--white);
  cursor: pointer;
}
.signup-close:hover { border-color: var(--gold); color: var(--gold); }
.signup-later {
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 14px;
  background: none;
  border: 0;
  color: #b9c7e8;
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}
.signup-later:hover { color: var(--gold); }

@media (prefers-reduced-motion: no-preference) {
  dialog.signup-dialog[open] { animation: mos-pop 0.25s ease-out; }
}
@keyframes mos-pop {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .note { transition: none; }
}
