/* arkemedics.com — Structural Modernism v1
   ===================================================
   Editorial / modernist design system.
   References: late Vignelli (Knoll catalogs, IBM manuals),
   early n+1, Lapham's Quarterly, NYRB.
   The visual language makes structure visible — section
   numbers as marginalia, generous grids, restraint as the point.

   - Variable type: Fraunces (serif, display) + Inter (sans, UI)
   - One accent: Prussian blue
   - Full-bleed accent section (the ARKTBP "Start here" — page's visual climax)
   - Intersection-observer fade-in (in motion.js)
   - Dark mode via prefers-color-scheme
   - Respects prefers-reduced-motion throughout
*/

:root {
  /* Light palette */
  --paper: #F4F1EA;
  --ink: #161616;
  --accent: #1A365D;
  --accent-soft: #2C4E7F;
  --muted: #6B6B66;
  --faint: #A5A399;
  --rule: #D9D5CC;
  --paper-tint: #ECE7DC;

  /* Type stacks */
  --serif: "Fraunces", "Iowan Old Style", "Charter", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --measure: 36rem;
  --margin: 1.5rem;
  --section-gap: 6rem;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121212;
    --ink: #ECE7DC;
    --accent: #6FA8DC;
    --accent-soft: #4F87B9;
    --muted: #8A8A85;
    --faint: #555550;
    --rule: #2A2A28;
    --paper-tint: #1A1A18;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

html { font-size: 17px; }
@media (min-width: 700px)  { html { font-size: 18px; } }
@media (min-width: 1100px) { html { font-size: 19px; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 14, "SOFT" 30;
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

/* ===================================================
   HEADINGS
   =================================================== */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
  font-variation-settings: "opsz" 144, "SOFT" 60;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}

h3 {
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-variation-settings: "opsz" 48, "SOFT" 40;
}

p { margin: 0 0 1.25rem; }
p:last-child { margin-bottom: 0; }
em { font-style: italic; }
strong { font-weight: 600; }

/* ===================================================
   SITE NAV — top-right on hero, top strip on inner pages
   =================================================== */

.site-nav {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.site-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.site-nav-hero {
  position: absolute;
  top: 2rem;
  right: var(--margin);
}

@media (min-width: 700px) {
  .site-nav-hero { top: 3rem; right: 3rem; }
}

/* Top strip used on non-home pages */
.page-header {
  padding: 2rem var(--margin);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

@media (min-width: 700px) {
  .page-header { padding: 2.5rem 3rem; }
}

.page-wordmark {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  font-variation-settings: "opsz" 36, "SOFT" 50;
}

.page-wordmark:hover { color: var(--accent); }

/* Inner-page hero — smaller than the home hero */
.page-hero {
  padding: 5rem var(--margin) 3rem;
  max-width: 64rem;
  margin: 0 auto;
}

@media (min-width: 700px) {
  .page-hero { padding: 7rem 0 4rem; }
}

.page-hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  margin-bottom: 1.25rem;
}

.page-hero-lede {
  max-width: var(--measure);
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0;
}

/* ===================================================
   HERO — full viewport, bottom-aligned content
   =================================================== */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem var(--margin) 2rem;
  position: relative;
}

@media (min-width: 700px) {
  .hero { padding: 3rem 3rem 3rem; }
}

.hero-inner {
  max-width: 50rem;
  margin-top: auto;
}

.tagline {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  margin: 0 0 2.5rem;
  line-height: 1.3;
  font-variation-settings: "opsz" 36, "SOFT" 70;
}

.lede {
  max-width: var(--measure);
  font-size: 1.1rem;
  line-height: 1.55;
  margin-bottom: 2.5rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  padding-top: 2rem;
}

/* ===================================================
   CTA BUTTONS
   =================================================== */

.cta {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  border-radius: 0;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}

.cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .cta:hover { transform: none; }
}

.cta-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.cta-secondary:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.bleed .cta-bleed {
  background: var(--paper);
  color: var(--accent);
  border-color: var(--paper);
}

.bleed .cta-bleed:hover {
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
}

/* ===================================================
   SECTIONS — section number as marginalia
   =================================================== */

main {
  padding: 0 var(--margin);
}

.section {
  max-width: 64rem;
  margin: 0 auto;
  padding: var(--section-gap) 0;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--rule);
}

.section:first-of-type { border-top: none; }

@media (min-width: 900px) {
  .section {
    grid-template-columns: 7rem 1fr;
    gap: 3rem;
  }
}

.section-number {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.1em;
}

@media (min-width: 900px) {
  .section-number {
    position: sticky;
    top: 2rem;
    align-self: start;
  }
}

.section-body {
  max-width: var(--measure);
}

.section-intro {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 3rem;
}

.inline-cta { margin-top: 2rem; }

/* Drop cap on first paragraph of section */
.section-body .drop::first-letter {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 90;
  font-size: 4.5rem;
  line-height: 0.85;
  float: left;
  padding: 0.5rem 0.65rem 0 0;
  color: var(--accent);
  margin-top: 0.15rem;
}

/* ===================================================
   FULL-BLEED ACCENT SECTION (ARKTBP "Start here")
   =================================================== */

.bleed {
  background: var(--accent);
  color: var(--paper);
  padding: 8rem var(--margin);
  margin: 0;
}

@media (min-width: 700px) {
  .bleed { padding: 10rem 3rem; }
}

@media (prefers-color-scheme: dark) {
  .bleed {
    background: var(--paper-tint);
    color: var(--ink);
  }
}

.bleed-inner {
  max-width: 56rem;
  margin: 0 auto;
}

.bleed-eyebrow {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.7;
  margin-bottom: 2rem;
}

.bleed-title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 0.75rem;
  font-variation-settings: "opsz" 144, "SOFT" 70;
}

.bleed-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  opacity: 0.85;
  margin-bottom: 2.5rem;
  max-width: 40rem;
}

.bleed-body {
  font-size: 1.15rem;
  max-width: 38rem;
  line-height: 1.55;
  margin-bottom: 2.5rem;
}

/* ===================================================
   LINKS
   =================================================== */

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.18s var(--ease);
}

a:hover { color: var(--accent-soft); }

a.cta, a.cta-secondary, a.cta-bleed { text-decoration: none; }

.bleed a { color: var(--paper); }
.bleed a:hover { color: var(--paper); opacity: 0.8; }

/* ===================================================
   PAPER ENTRIES — date as left-margin marginalia
   =================================================== */

.corpus .section-body {
  max-width: 44rem;
}

.paper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.paper.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .paper { opacity: 1; transform: none; transition: none; }
}

@media (min-width: 700px) {
  .paper {
    grid-template-columns: 5rem 1fr;
    gap: 2rem;
  }
  .paper > :not(.paper-date) { grid-column: 2; }
}

.paper:last-child { border-bottom: none; }

.paper-date {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
  padding-top: 0.5rem;
}

.paper-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.paper-meta {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin: 0.5rem 0 1rem;
}

.paper h3 + .paper-meta {
  margin-top: 0.25rem;
}

.paper-link {
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}

.paper-link a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: border-color 0.18s var(--ease);
}

.paper-link a:hover {
  border-bottom-color: var(--accent);
}

.paper-prep {
  opacity: 0.85;
}

.paper-prep h3 {
  color: var(--muted);
}

/* ===================================================
   VIDEO EMBED — responsive 16:9
   =================================================== */

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  margin: 0 0 2.5rem;
  overflow: hidden;
}

.video-embed iframe,
.video-embed > a {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Placeholder card used until a real video ID is wired in */
.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--paper);
  background: var(--accent);
  text-align: center;
  padding: 2rem;
  transition: background 0.18s var(--ease);
}

.video-placeholder:hover {
  background: var(--accent-soft);
}

.video-placeholder .placeholder-eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.75;
}

.video-placeholder .placeholder-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  max-width: 30rem;
  line-height: 1.15;
  font-variation-settings: "opsz" 96, "SOFT" 60;
}

.video-placeholder .placeholder-action {
  font-family: var(--sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 0.5rem;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* ===================================================
   EPISODE LIST
   =================================================== */

.episode-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.episode {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 700px) {
  .episode {
    grid-template-columns: 5rem 1fr;
    gap: 2rem;
  }
  .episode > :not(.episode-number) { grid-column: 2; }
}

.episode:last-child { border-bottom: none; }

.episode-number {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
  padding-top: 0.5rem;
}

.episode h3 { margin-bottom: 0.5rem; }

.episode-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.episode-meta {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin: 0 0 1rem;
}

.episode-link {
  font-family: var(--sans);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.episode-link a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: border-color 0.18s var(--ease);
}

.episode-link a:hover { border-bottom-color: var(--accent); }

.episode.episode-forthcoming {
  opacity: 0.7;
}

.episode-forthcoming h3 { color: var(--muted); }

/* ===================================================
   CORPUS TEASER — home page surface
   =================================================== */

.corpus-teaser {
  display: grid;
  gap: 2rem;
  margin: 1rem 0 2.5rem;
}

.corpus-teaser .paper {
  padding: 1.5rem 0;
  opacity: 1;
  transform: none;
}

/* ===================================================
   FOOTER
   =================================================== */

footer {
  padding: 6rem var(--margin) 3rem;
  border-top: 1px solid var(--rule);
  margin-top: var(--section-gap);
}

.footer-inner {
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

@media (min-width: 700px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.footer-meta, .footer-links {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.02em;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
}

.footer-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.footer-sep { margin: 0 0.5rem; color: var(--faint); }

/* ===================================================
   PRINT
   =================================================== */

@media print {
  .cta-row, .cta, .hero-meta, .section-number { display: none; }
  body { background: white; color: black; font-size: 11pt; }
  a { color: black; text-decoration: underline; }
  .bleed { background: white; color: black; padding: 2rem 0; }
}
