/* ============================================================
   Write it Right — page shell: nav, hero, courses, footer
   ============================================================ */

/* ---------- skip to content ---------- */
.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 400;
  transform: translateY(-160%);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold-foil);
  background: var(--navy-deep);
  border: 1.5px solid var(--gold-foil);
  padding: 10px 16px;
  transition: transform var(--d-fast) ease;
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
/* programmatic focus target only; no visible ring on the whole hero */
.hero:focus { outline: none; }

/* ---------- top nav ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: rgba(0, 16, 42, 0.0);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.site-nav.scrolled {
  background: rgba(0, 16, 42, 0.92);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}
.nav-brand {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-foil);
  text-decoration: none;
}
.nav-brand em { font-family: var(--font-serif); font-style: italic; color: var(--gold-bright); text-transform: none; letter-spacing: 0.02em; font-size: 14px; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 239, 224, 0.8);
  text-decoration: none;
  transition: color var(--d-fast) ease;
}
.nav-links a:hover { color: var(--gold-bright); }
.nav-links .nav-cta {
  border: 1px solid var(--gold-foil);
  color: var(--gold-foil);
  padding: 7px 14px;
}
.nav-links .nav-cta:hover { color: var(--gold-bright); box-shadow: 0 0 12px rgba(201, 169, 97, 0.4); }
@media (max-width: 719px) { .nav-links a:not(.nav-cta) { display: none; } }

/* ---------- journey bridge ---------- */
/* Fades the journey's near-black (#0F0F14) into the hero's darkest edge
   (#000408, the outer stop of the hero's radial gradient) so the intro
   hands off to the site without a visible seam. */
.journey-bridge {
  height: 22vh;
  background: linear-gradient(180deg, #0F0F14 0%, #000408 100%);
  margin-top: -1px;
}
/* the hero's grain otherwise starts as a hard edge right at the seam */
.hero > .grain {
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 26%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 26%);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px 24px 70px;
  /* desk at night: warm lamp pool upper left, vignette at the edges;
     top fade meets the journey bridge above so there is no visible seam */
  background:
    linear-gradient(180deg, #000408 0%, rgba(0, 4, 8, 0) 24%),
    radial-gradient(ellipse 920px 680px at 16% 6%, rgba(224, 188, 122, 0.17), transparent 62%),
    radial-gradient(ellipse 460px 340px at 16% 6%, rgba(245, 216, 138, 0.13), transparent 70%),
    radial-gradient(ellipse at center, var(--navy-mid) 0%, var(--navy-deep) 52%, #000408 100%);
  box-shadow: inset 0 0 190px 50px rgba(0, 3, 8, 0.6);
  overflow: hidden;
  perspective: 1800px;
}
.hero::before {
  content: "";
  position: absolute;
  top: -140px; left: 4%;
  width: 680px; height: 680px;
  background: radial-gradient(circle, rgba(224, 188, 122, 0.2), transparent 60%);
  pointer-events: none;
}
/* faint dust motes */
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 30%, rgba(245, 216, 138, 0.5), transparent 100%),
    radial-gradient(1.5px 1.5px at 78% 18%, rgba(245, 216, 138, 0.35), transparent 100%),
    radial-gradient(1px 1px at 64% 70%, rgba(245, 216, 138, 0.4), transparent 100%),
    radial-gradient(1px 1px at 30% 82%, rgba(245, 216, 138, 0.3), transparent 100%),
    radial-gradient(1.5px 1.5px at 88% 56%, rgba(245, 216, 138, 0.3), transparent 100%);
  pointer-events: none;
}

.hero-book {
  width: 600px;
  max-width: 94vw;
  aspect-ratio: 1 / 1;
  position: relative;
  transform-style: preserve-3d;
}

/* open page */
.hero-page {
  position: absolute; inset: 0;
  background: var(--paper-cream);
  background-image:
    linear-gradient(90deg, transparent 60px, rgba(201, 169, 97, 0.25) 60px 61px, transparent 61px),
    repeating-linear-gradient(transparent 0 28px, var(--ruled-blue) 28px 29px);
  border-radius: 2px 8px 8px 2px;
  padding: clamp(28px, 5vw, 50px) clamp(22px, 4vw, 40px) clamp(22px, 4vw, 40px) clamp(46px, 9vw, 80px);
  box-shadow: inset 4px 0 12px rgba(0, 28, 63, 0.18), 0 40px 70px rgba(0, 0, 0, 0.55), 0 12px 28px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  opacity: 0;
  animation: hero-show 0.6s ease forwards 1.2s;
}
@keyframes hero-show { to { opacity: 1; } }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-emboss);
  margin: 0 0 14px;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(30px, 5.5vw, 40px);
  font-weight: 500;
  line-height: 1.12;
  color: var(--navy-deep);
  margin: 0 0 12px;
}
.hero-title em { font-style: italic; color: var(--gold-emboss); }
.hero-stamp {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--navy-deep);
  border: 1.5px solid var(--navy-deep);
  padding: 4px 10px;
  text-transform: uppercase;
  transform: rotate(-3deg);
  background: rgba(232, 238, 248, 0.5);
  margin: 2px 0 16px;
  opacity: 0;
  animation: stamp-on var(--d-stamp) var(--ease-stamp) forwards 1.8s;
}
@keyframes stamp-on {
  0% { transform: rotate(-25deg) scale(2.5); opacity: 0; }
  70% { transform: rotate(-1deg) scale(0.95); opacity: 1; }
  100% { transform: rotate(-3deg) scale(1); opacity: 1; }
}
.hero-lede {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.8vw, 16.5px);
  font-weight: 400;
  line-height: 1.75;
  color: var(--navy-deep);
  margin: 0 0 16px;
}
.hero-cta-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin: 6px 0 10px;
  opacity: 0;
  animation: hero-show 0.5s ease forwards 2s;
}
.hero-credits {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--brown-ink);
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px dashed rgba(0, 28, 63, 0.2);
}
.hero-credits strong { font-weight: 500; color: var(--navy-deep); }
.hero-paperclip {
  position: absolute;
  top: 18px; right: 26px;
  width: 26px;
  opacity: 0;
  animation: hero-show 0.4s ease forwards 2.2s;
}

/* navy hardcover that flips open */
.hero-cover {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy-deep) 50%, var(--navy-shadow) 100%);
  border-radius: 8px 2px 2px 8px;
  transform-origin: left center;
  transform: rotateY(0deg);
  animation: cover-open 1.4s var(--ease-page) forwards 0.3s;
  box-shadow: var(--sh-modal), var(--sh-emboss-on-cover);
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  z-index: 2;
}
@keyframes cover-open { to { transform: rotateY(-165deg); } }
.hero-cover::before {
  content: "";
  position: absolute; inset: 14px;
  border: 1.5px solid rgba(201, 169, 97, 0.5);
  border-radius: 4px;
  pointer-events: none;
}
.hero-cover::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 2px, rgba(0, 0, 0, 0.1) 2px 4px),
    repeating-linear-gradient(135deg, transparent 0 3px, rgba(201, 169, 97, 0.04) 3px 6px);
  opacity: 0.6;
  pointer-events: none;
}
.cover-emboss {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--gold-foil);
  text-transform: uppercase;
  margin: 0 0 24px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
  position: relative; z-index: 1;
}
.cover-title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 6vw, 46px);
  font-weight: 500;
  text-align: center;
  line-height: 1.05;
  margin: 0;
  position: relative; z-index: 1;
  /* gold foil catching the light */
  background: linear-gradient(105deg, var(--gold-light) 0%, var(--gold-light) 40%, #FFF3C9 48%, var(--gold-bright) 50%, #FFF3C9 52%, var(--gold-light) 60%, var(--gold-light) 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px rgba(201, 169, 97, 0.3));
  animation: foil-sweep 1.7s ease-in-out 0.1s both;
}
.cover-title em { font-style: italic; -webkit-text-fill-color: transparent; }
@keyframes foil-sweep {
  0%, 58% { background-position: 100% 0; }
  78%, 100% { background-position: 0% 0; }
}
.cover-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--gold-foil);
  text-align: center;
  margin: 18px 0 0;
  opacity: 0.85;
  position: relative; z-index: 1;
}
.cover-seal {
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 2px solid var(--gold-foil);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--gold-foil);
  text-align: center;
  line-height: 1.4;
  position: relative; z-index: 1;
}
.cover-seal::before {
  content: "";
  position: absolute; inset: 5px;
  border-radius: 50%;
  border: 0.5px dashed rgba(201, 169, 97, 0.4);
}

.hero-spine-thread {
  position: absolute;
  top: 0; bottom: 0; left: -2px;
  width: 4px;
  background: linear-gradient(180deg, transparent 0%, var(--gold-foil) 15%, var(--gold-light) 50%, var(--gold-foil) 85%, transparent 100%);
  box-shadow: 0 0 10px rgba(201, 169, 97, 0.4);
  opacity: 0;
  animation: hero-show 0.8s ease forwards 1s;
  z-index: 6;
}

.hero-handnote {
  position: absolute;
  font-family: var(--font-hand);
  font-size: 19px;
  line-height: 1.25;
  color: var(--gold-foil);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
.hero-handnote-1 { top: 84px; left: 4vw; transform: rotate(-8deg); max-width: 170px; animation: hero-show 0.6s ease forwards 2.6s; }
.hero-handnote-2 { bottom: 64px; right: 4vw; transform: rotate(4deg); max-width: 180px; text-align: right; animation: hero-show 0.6s ease forwards 2.8s; }
@media (max-width: 900px) { .hero-handnote { display: none; } }

.hero-scrollhint {
  position: absolute;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-foil);
  opacity: 0;
  animation: hero-show 0.6s ease forwards 3s;
  text-decoration: none;
}
.hero-scrollhint span { display: block; text-align: center; font-size: 16px; animation: hint-bob 2s ease-in-out infinite 3.2s; }
@keyframes hint-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* phones: let the page grow with its content, fade the cover instead of flipping */
@media (max-width: 719px) {
  .hero { padding: 84px 20px 56px; }
  .hero-book { aspect-ratio: auto; }
  .hero-page { position: relative; inset: auto; padding: 26px 20px 22px 44px; animation-delay: 0.7s; }
  .hero-cover {
    position: absolute;
    border-radius: 6px;
    animation: cover-fade 0.7s ease forwards 0.8s;
  }
  .hero-spine-thread { display: none; }
  .hero-scrollhint { display: none; }
  .hero-stamp { animation-delay: 1.3s; }
  .hero-cta-row { animation-delay: 1.5s; }
  .hero-paperclip { animation-delay: 1.6s; }
}
@keyframes cover-fade { to { opacity: 0; visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .hero-cover { animation: none; opacity: 0; }
  .hero-page, .hero-cta-row, .hero-stamp, .hero-spine-thread,
  .hero-handnote, .hero-paperclip, .hero-scrollhint { animation: none; opacity: 1; }
  .hero-stamp { transform: rotate(-3deg); }
}

/* ---------- torn-paper section divider ---------- */
.tear { height: 36px; margin: -18px 0; position: relative; z-index: 5; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4)); }
.tear svg { display: block; width: 100%; height: 100%; }

/* ---------- courses section ---------- */
.courses {
  background: var(--paper-cream);
  background-image:
    linear-gradient(90deg, transparent 49.8%, rgba(201, 169, 97, 0.25) 49.8% 50%, transparent 50%),
    repeating-linear-gradient(transparent 0 24px, rgba(0, 28, 63, 0.07) 24px 25px);
  padding: 84px 24px 90px;
}
.courses .header-row { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.courses .eyebrow { color: var(--gold-emboss); }
.courses .section-title { color: var(--navy-deep); }
.courses .section-title em { color: var(--gold-emboss); }
.courses .section-sub { color: #5C3A1E; }

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  max-width: 1060px;
  margin: 0 auto;
}
.course-card {
  background: var(--paper-warm);
  padding: 22px 20px 18px;
  /* full hairline border, not a colored side-stripe; the gold course number
     carries the accent */
  border: 1px solid rgba(201, 169, 97, 0.45);
  position: relative;
  transform: rotate(var(--r, -1deg));
  box-shadow: 2px 4px 12px rgba(0, 28, 63, 0.14);
  transition: transform var(--d-quick) ease, box-shadow var(--d-quick) ease;
  display: flex;
  flex-direction: column;
}
.course-card:hover { transform: rotate(0deg) translateY(-4px); box-shadow: 4px 10px 22px rgba(0, 28, 63, 0.2); }
.course-num { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em; color: var(--gold-emboss); margin: 0 0 6px; }
.course-name { font-family: var(--font-serif); font-size: 22px; font-weight: 500; color: var(--navy-deep); margin: 0 0 6px; }
.course-desc { font-family: var(--font-body); font-size: 14.5px; line-height: 1.6; color: #4A3018; margin: 0 0 14px; }
.course-cast { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 16px; }
.cast-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  background: var(--paper-cream);
  border: 0.5px solid rgba(0, 28, 63, 0.3);
  color: var(--navy-deep);
}
.cast-chip.core { background: var(--navy-deep); border-color: var(--gold-foil); color: var(--gold-foil); }
.course-open {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--navy-deep);
  border-bottom: 1.5px solid var(--gold-foil);
  align-self: flex-start;
  padding-bottom: 2px;
  transition: color var(--d-fast) ease;
}
.course-open:hover { color: var(--gold-emboss); }

.courses-bundle { text-align: center; margin-top: 44px; }
.courses-bundle .hint {
  font-family: var(--font-hand);
  font-size: 20px;
  color: var(--gold-emboss);
  display: block;
  margin-bottom: 12px;
  transform: rotate(-2deg);
}

/* ---------- final CTA ---------- */
.finale {
  background: linear-gradient(135deg, var(--navy-deep) 0%, #000814 100%);
  padding: 96px 24px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.finale::before {
  content: "";
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 420px;
  background: radial-gradient(ellipse, rgba(201, 169, 97, 0.16), transparent 70%);
  pointer-events: none;
}
.finale .eyebrow { color: var(--gold-foil); }
.finale .section-title { color: var(--gold-bright); }
.finale .section-title em { color: var(--gold-light); }
.finale .section-sub { color: rgba(201, 169, 97, 0.85); margin-bottom: 34px; }
.finale .cta-btn { font-size: 13px; padding: 16px 34px; }
.finale-note {
  font-family: var(--font-hand);
  font-size: 20px;
  color: var(--gold-foil);
  margin-top: 26px;
  transform: rotate(-1.5deg);
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--navy-shadow);
  border-top: 1px solid rgba(201, 169, 97, 0.25);
  padding: 36px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.footer-brand { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--gold-foil); }
.footer-byline { font-family: var(--font-body); font-size: 13.5px; color: rgba(245, 239, 224, 0.85); }
.footer-byline strong { font-style: normal; font-weight: 500; color: var(--paper-cream); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(245, 239, 224, 0.7); text-decoration: none; padding: 8px 0; }
.footer-links a:hover { color: var(--gold-bright); }

/* gold-ink signature, wiped on like handwriting when scrolled into view.
   The clip lives on the child span: a clip-path on the observed element
   itself makes IntersectionObserver report 0% visible and never fire. */
.footer-signature-wrap {
  margin: 12px 0 0;
  opacity: 1 !important;
  transform: rotate(-3deg) !important;
}
.footer-signature {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 36px;
  line-height: 1.1;
  color: var(--gold-light);
  text-shadow: 0 0 14px rgba(201, 169, 97, 0.35);
  clip-path: inset(-25% 100% -25% 0);
  transition: clip-path 1.8s cubic-bezier(0.3, 0, 0.4, 1) 0.25s;
}
.footer-signature-wrap.is-visible .footer-signature { clip-path: inset(-25% -5% -25% 0); }

/* film grain overlay for navy sections (insert as first child so it sits under content) */
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  .cover-title { animation: none; background-position: 50% 0; }
  .footer-signature { clip-path: inset(-25% -5% -25% 0); transition: none; }
}
