/* SOPs Nobody Reads
 * Lora for display and body; IBM Plex Sans for utility.
 * Forest green ink on warm cream; aubergine accent; warm gray utility.
 */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Sans:wght@400&display=swap');

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  font-size: 16px;
}

:root {
  --ink: #1f3a2e;          /* Forest green */
  --bg: #f4ede0;           /* Warm cream */
  --accent: #3a1f2e;       /* Dark aubergine */
  --utility: #6b5d4a;      /* Warm gray */
  --rule: rgba(31, 58, 46, 0.12);

  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;

  --measure: 36rem;        /* ~576px reading column */
  --page-max: 64rem;       /* 1024px page max */
  --gutter: 1.5rem;
}

body {
  font-family: var(--serif);
  font-size: 1.0625rem;    /* 17px */
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "kern", "liga";
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main { flex: 1; }

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

/* ---- Typography ---- */
h1, h2, h3 {
  font-weight: 500;
  line-height: 1.18;
  color: var(--ink);
}

h1 {
  font-size: clamp(1.875rem, 2vw + 1.25rem, 2.625rem); /* 30 → 42px */
  font-weight: 600;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.375rem, 1.5vw + 1rem, 1.875rem);  /* 22 → 30px */
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.125rem, 0.5vw + 1rem, 1.25rem);
  letter-spacing: -0.01em;
}

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; }
em { font-style: italic; }

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

a:hover { text-decoration-thickness: 2px; }

/* ---- Page layout ---- */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  width: 100%;
}

/* ---- Nav ---- */
.nav {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-logo:hover {
  text-decoration: none;
  color: var(--ink);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Dropdown via <details> */
.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink);
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.25rem 0;
  white-space: nowrap;
}

.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::marker { content: ''; }

.nav-dropdown summary::after {
  content: '';
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translate(-0.1em, -0.1em);
  transition: transform 0.15s ease;
}

.nav-dropdown[open] summary::after {
  transform: rotate(-135deg) translate(0.05em, 0.05em);
}

.nav-dropdown ul {
  list-style: none;
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  background: var(--bg);
  border: 1px solid var(--rule);
  min-width: 13rem;
  padding: 0.4rem 0;
  z-index: 20;
}

.nav-dropdown ul li a {
  display: block;
  padding: 0.55rem 1rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink);
  text-decoration: none;
}

.nav-dropdown ul li a:hover {
  background: rgba(31, 58, 46, 0.05);
  color: var(--accent);
}

.nav-book {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--accent);
  white-space: nowrap;
}

/* ---- Hero (homepage) ---- */
.hero {
  padding-top: 2.5rem;
  padding-bottom: 2rem;
}

.hero h1 {
  max-width: 17em;
  margin-bottom: 1rem;
}

.hero-sub {
  font-family: var(--serif);
  font-size: clamp(1.125rem, 1vw + 0.875rem, 1.3125rem);
  font-style: italic;
  color: var(--ink);
  max-width: 26em;
  font-weight: 400;
}

/* ---- Sections ---- */
.section {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.section h2 {
  margin-bottom: 1.25rem;
  max-width: 22em;
}

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

.prose p {
  text-wrap: pretty;
}

.prose p + p { margin-top: 1em; }

/* ---- Figure / image placeholders ---- */
.figure {
  margin: 2rem 0 0;
  max-width: var(--measure);
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 12px rgba(31, 58, 46, 0.08));
}

.section .figure {
  margin-top: 2.5rem;
}

.placeholder {
  width: 100%;
  background: rgba(31, 58, 46, 0.025);
  border: 1px solid rgba(31, 58, 46, 0.18);
  position: relative;
}

.placeholder--landscape { aspect-ratio: 3 / 2; }
.placeholder--square { aspect-ratio: 1 / 1; }

figcaption {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--utility);
  margin-top: 0.75rem;
  line-height: 1.5;
  max-width: var(--measure);
}

/* ---- CTA inline link ---- */
.cta-link {
  display: inline-block;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  padding: 0.35em 0;
  margin-top: 0.25rem;
}

.cta-link:hover { text-decoration-thickness: 2px; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-top: 2.5rem;
  padding-bottom: 3rem;
  margin-top: 3rem;
}

.site-footer p {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--utility);
  line-height: 1.6;
  max-width: var(--measure);
  margin-bottom: 0.4rem;
}

.site-footer p:last-child { margin-bottom: 0; }

.site-footer a {
  color: var(--utility);
  text-decoration-thickness: 1px;
}

.site-footer a:hover { color: var(--accent); }

/* ---- Segment-page specifics ---- */
.segment-hero {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.segment-hero h1 {
  max-width: 17em;
  margin-bottom: 1rem;
}

.segment-hero .hero-sub {
  margin-bottom: 1.5rem;
}

.segment-hero .scroll-cue {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--utility);
  text-decoration: none;
  display: inline-block;
  margin-top: 1.25rem;
}

.segment-hero .scroll-cue:hover { color: var(--accent); }

.scene {
  padding-top: 2.25rem;
  padding-bottom: 2.25rem;
}

.scene .figure {
  margin: 2.5rem 0 0;
}

.scene .prose,
.section .prose {
  font-size: 1.125rem;
  line-height: 1.6;
}

/* Narration: each beat sits on its own line, with breathing room */
.scene .prose p + p,
.section .prose p + p { margin-top: 1.4em; }

/* Half-page hairline divider between consecutive sections and scenes */
.scene + .scene::before,
.scene + .closing::before,
.hero + .section::before,
.section + .section::before {
  content: '';
  display: block;
  width: 50%;
  height: 1px;
  background: var(--rule);
  margin: 0 auto 2.5rem;
}

.closing {
  padding-top: 3.5rem;
  padding-bottom: 1.5rem;
}

.closing h2 {
  margin-bottom: 1.25rem;
  max-width: 22em;
}

.closing .prose {
  margin-bottom: 1.5rem;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  :root {
    --gutter: 1.5rem;
  }

  body { font-size: 1rem; }

  .nav { padding: 1rem 0; }
  .nav-right { gap: 1.25rem; }
  .nav-logo { font-size: 0.9375rem; }

  .hero { padding-top: 2.5rem; padding-bottom: 1.5rem; }
  .section { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .segment-hero { padding-top: 2.5rem; padding-bottom: 2rem; }
  .scene { padding-top: 1.75rem; padding-bottom: 1.75rem; }
  .closing { padding-top: 2.5rem; padding-bottom: 1rem; }

  .scene .prose,
  .section .prose { font-size: 1.0625rem; }

  .site-footer { padding-top: 2rem; padding-bottom: 2.5rem; margin-top: 2rem; }
}

@media (max-width: 460px) {
  .nav-book { display: none; }
}
