/* ============================================================
   Posthaste Media — stylesheet
   ============================================================
   Everything that controls how the site looks lives in this
   single file. Read top-to-bottom; sections are labeled.
   ============================================================ */


/* ---------- 1. DESIGN TOKENS ---------------------------------
   "Tokens" are the colors, fonts, and sizes used throughout.
   Define them once here, reuse them everywhere via var(--name).
   To change the whole site's color, change it once, here.
------------------------------------------------------------ */
:root {
  /* Color: deep space navy with cream */
  --navy:        #0d1b2a;   /* page background */
  --navy-light:  #1a2a3f;   /* subtle surface lift, e.g. cards */
  --cream:       #f4ead5;   /* primary text */
  --cream-dim:   #c9c0ad;   /* secondary text, captions */
  --accent:      #e8d8a8;   /* warm accent for links on hover */

  /* Type */
  --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing rhythm — multiples of a single base unit */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;

  /* Reading width — research-backed sweet spot ~65 characters */
  --measure: 38rem;
}


/* ---------- 2. RESET & BASELINE ------------------------------
   A minimal reset. No CSS framework — full control, full
   transparency, nothing you can't see and edit.
------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;             /* Respect user's browser font-size setting */
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.125rem;          /* 18px base */
  line-height: 1.7;
  color: var(--cream);
  background-color: var(--navy);
  -webkit-font-smoothing: antialiased;
}


/* ---------- 3. ACCESSIBILITY HELPERS -------------------------
   Skip link: hidden until keyboard-focused, then visible.
   Sight-impaired users with screen readers and keyboard-only
   users rely on this to bypass the nav on every page.
------------------------------------------------------------ */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-2);
  background: var(--cream);
  color: var(--navy);
  padding: var(--space-1) var(--space-2);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.95rem;
  border-radius: 4px;
  z-index: 100;
}
.skip-link:focus {
  top: var(--space-2);
}

/* Visually hidden but available to screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* High-contrast focus ring on every focusable element.
   We make it *more* visible than browser defaults, not less. */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}


/* ---------- 4. LINKS -----------------------------------------
   Underlined by default for clarity. Color shifts on hover
   and focus so the change is obvious. Never rely on color
   alone to indicate a link.
------------------------------------------------------------ */
a {
  color: var(--cream);
  text-decoration: underline;
  text-decoration-color: rgba(244, 234, 213, 0.4);
  text-underline-offset: 4px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
a:hover, a:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}


/* ---------- 5. PAGE LAYOUT -----------------------------------
   Header sits at the top of every page (except homepage).
   Main content centered to a comfortable reading width.
   Footer is plain and quiet.
------------------------------------------------------------ */
.site-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(244, 234, 213, 0.1);
  text-align: center;
}
.site-header .wordmark {
  display: block;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: lowercase;
  color: var(--cream-dim);
  text-decoration: none;
  margin-bottom: var(--space-2);
}
.site-header .wordmark:hover {
  color: var(--cream);
}

.site-nav {
  margin-top: 0;
}
.site-nav ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-3);
  font-family: var(--sans);
  font-size: 1rem;
}
.site-nav a {
  text-decoration: none;
  border-bottom: 1px solid rgba(244, 234, 213, 0.3);
  padding-bottom: 2px;
}
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-6) var(--space-3);
}

.site-footer {
  text-align: center;
  padding: var(--space-6) var(--space-3) var(--space-4);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--cream-dim);
  border-top: 1px solid rgba(244, 234, 213, 0.1);
  margin-top: var(--space-8);
}


/* ---------- 6. HOMEPAGE ("BOOK COVER") -----------------------
   Full-viewport, centered, no header chrome. Earth photo
   loads behind everything at low opacity. If the photo fails
   to load, the navy fallback below is still beautiful.
------------------------------------------------------------ */
.home {
  min-height: 100vh;
  min-height: 100dvh;          /* better mobile behavior */
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.home-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--navy);
  background-image: url('https://www.nasa.gov/wp-content/uploads/2026/04/art002e021278orig.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.28;               /* the "hint" — image is atmosphere, not subject */
}

/* A subtle vignette so any text remains legible against the photo */
.home-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(13, 27, 42, 0.7) 100%);
}

/* Top bar on the homepage: wordmark above, nav centered below.
   Matches the layout on interior pages so navigation feels
   consistent across the whole site. */
.home-mark {
  position: relative;
  z-index: 1;
  padding: var(--space-3) var(--space-4);
  text-align: center;
}
.home-mark .wordmark {
  display: block;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: lowercase;
  color: var(--cream-dim);
  margin-bottom: var(--space-2);
}

.home-cover {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4);
}
.home-cover h1 {
  font-family: var(--serif);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
  color: var(--cream);
}
.home-cover .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--cream-dim);
  margin: 0;
  max-width: 30rem;
}

/* Nav inside the top bar — centered, matches interior page nav */
.home-nav ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-3);
  font-family: var(--sans);
  font-size: 1rem;
}
.home-nav a {
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid rgba(244, 234, 213, 0.4);
  padding-bottom: 3px;
}
.home-nav a:hover, .home-nav a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}


/* ---------- 7. TYPOGRAPHY ON INTERIOR PAGES ------------------ */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  color: var(--cream);
}
h1 { font-size: 2.5rem; margin: 0 0 var(--space-3); }
h2 { font-size: 1.75rem; margin: var(--space-6) 0 var(--space-2); }
h3 { font-size: 1.3rem;  margin: var(--space-4) 0 var(--space-2); }

p { margin: 0 0 var(--space-3); }

blockquote {
  border-left: 3px solid var(--accent);
  margin: var(--space-4) 0;
  padding: var(--space-1) 0 var(--space-1) var(--space-3);
  font-style: italic;
  color: var(--cream-dim);
}


/* ---------- 8. CARDS (Music 101 launchpad, blog index) ------- */
.card-list {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0;
  display: grid;
  gap: var(--space-3);
}

.card {
  background: var(--navy-light);
  padding: var(--space-3);
  border-radius: 6px;
  border: 1px solid rgba(244, 234, 213, 0.1);
  transition: border-color 0.2s, transform 0.2s, background-color 0.2s;
}
.card:hover, .card:focus-within {
  border-color: rgba(244, 234, 213, 0.3);
}
.card h3 {
  margin: 0 0 var(--space-1);
  font-size: 1.4rem;
}
.card h3 a {
  text-decoration: none;
}
.card p {
  margin: 0 0 var(--space-1);
  font-size: 1rem;
  color: var(--cream-dim);
}
.card .meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--cream-dim);
  margin: 0;
}

/* Card-as-link: when the WHOLE card is one big clickable element.
   Used on Music 101. Removes underline, brightens on hover so it's
   obvious the entire surface is interactive. */
.card-link {
  display: block;
  color: var(--cream);
  text-decoration: none;
}
.card-link:hover, .card-link:focus-visible {
  background: #233347;          /* slightly lighter navy on hover */
  border-color: var(--accent);
  color: var(--cream);           /* prevent the global link-hover color shift */
  outline: none;                 /* let the border act as the focus indicator */
}
/* Keep the focus ring on keyboard users for accessibility */
.card-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.card-link h3 {
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* External-link icon next to the title */
.external-icon {
  font-size: 1rem;
  color: var(--cream-dim);
  font-weight: normal;
}

/* Call-to-action line at the bottom of clickable cards */
.card-cta {
  margin-top: var(--space-2) !important;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
}


/* ---------- 9. CONTACT PAGE ---------------------------------- */
.contact-email {
  font-family: var(--sans);
  font-size: 1.5rem;
  display: inline-block;
  margin: var(--space-3) 0;
  word-break: break-all;
}
