/* Stock Dialogues — author site for Jacques Plaut
   Night sky over Johannesburg, Hillbrow Tower, a line of dawn, red for "Red". */
:root {
  --sky-top: #02040F;
  --sky: #071542;
  --sky-low: #0F2A7A;
  --building: #4466B0;
  --window: #F8F371;
  --red: #C8102E;
  --red-on-dark: #F2334F;
  --paper: #EEF1F8;
  --ink: #0D1630;
  --ink-soft: #4B5675;
  --serif: "Newsreader", "Georgia", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: #A50C25; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #F0862A; outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(72rem, 100% - 2rem); margin-inline: auto; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.05; margin: 0; }
h2 { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.2rem); letter-spacing: 0.01em; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* ---------- Header ---------- */
.site-header { padding: 1.25rem 0; background: var(--sky-top); color: #fff; }
.site-header .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.wordmark { font-size: 1.3rem; letter-spacing: .06em; color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: .6rem; }
.wordmark:hover { color: #fff; }
.light { display: inline-block; width: 11px; height: 11px; background: var(--window); flex: none; }
.site-nav { display: flex; gap: .6rem 1.4rem; flex-wrap: wrap; font-size: 1rem; }
.site-nav a { color: #D6DEF5; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; text-decoration: underline; }

/* ---------- Hero: the cover's night sky and Hillbrow Tower ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; background: var(--sky-top);
  height: max(640px, calc(100vw * 1680 / 2500));
}
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.hero .wrap { position: relative; z-index: 1; padding-top: clamp(3rem, 6.5vw, 6.5rem); padding-bottom: 3rem; text-align: right; }
.hero .actions { justify-content: flex-end; }
.hero-series { color: #B9C5E8; letter-spacing: .08em; margin-bottom: .75rem; }
.hero h1 { font-size: clamp(3.2rem, 1.2rem + 7vw, 7.75rem); line-height: 1; letter-spacing: .03em; }
.hero h1 .red { color: var(--red-on-dark); }
.hero-sub { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.125rem); line-height: 1.25; letter-spacing: .02em; margin: 1.4rem 0 .5rem; }
.byline { color: #B9C5E8; margin-bottom: 2rem; }
.actions { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-block; font-family: var(--serif); font-size: 1.0625rem; font-weight: 600; line-height: 1.2;
  padding: .75rem 1.4rem; border: 2px solid rgba(255,255,255,.7); color: #fff; text-decoration: none;
}
.btn:hover { background: #fff; color: var(--ink); border-color: #fff; text-decoration: none; }
.btn[aria-disabled="true"] { border: 2px dashed rgba(185,197,232,.6); color: #B9C5E8; cursor: default; background: transparent; }

/* ---------- Content sections ---------- */
.section { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.section.ruled { border-top: 1px solid rgba(13,22,48,.12); }
.section.flush-top { padding-top: 0; }
.cols { display: flex; flex-wrap: wrap; gap: 2rem 5rem; }
.cols > .side { flex: 1 1 300px; max-width: 460px; min-width: 0; }
.cols > .main { flex: 999 1 420px; max-width: 34rem; min-width: 0; }
.side-stack { display: flex; flex-direction: column; gap: 2.5rem; }

.questions { margin: 0 0 1.5rem; padding-left: 1.4rem; }
.questions li { margin-bottom: .5rem; }

.page {
  background: #fff; padding: clamp(1.75rem, 4vw, 3.5rem); max-width: 38rem;
  box-shadow: 0 0 0 1px rgba(13,22,48,.08), 0 20px 40px -30px rgba(13,22,48,.4);
}
.cols > .page { flex: 999 1 420px; min-width: 0; }
.page h3 { font-size: 1.125rem; font-style: italic; color: var(--ink-soft); margin-bottom: 1.25rem; }
.page p { margin: 0; text-indent: 1.5em; }
.page p:first-of-type { text-indent: 0; }

/* ---------- Contact ---------- */
.contact { background: linear-gradient(to bottom, var(--sky) 0%, var(--sky-top) 100%); color: #DCE4F8; padding: clamp(4rem, 7vw, 6rem) 0; }
.contact .cols { align-items: baseline; gap: 1.5rem 5rem; }
.contact h2 { color: #fff; }
.email { flex: 999 1 420px; min-width: 0; font-size: clamp(1.5rem, 1rem + 2.4vw, 2.625rem); color: var(--window); word-break: break-word; }
.email:hover { color: #fff; }

/* ---------- Footer ---------- */
.site-footer { padding: 2rem 0 3rem; font-size: .95rem; color: #8A97C0; background: var(--sky-top); }
.site-footer a { color: #C9D3F0; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Inner pages ---------- */
.inner { padding: clamp(3rem, 6vw, 5rem) 0 clamp(4rem, 8vw, 7.5rem); }
.inner .cols { align-items: flex-start; gap: 3rem 5rem; }
.inner .cols > .main { flex: 6 1 360px; }
.inner .cols > .art { flex: 5 1 340px; min-width: 0; }
.inner h1 { font-size: clamp(2.6rem, 1.6rem + 4vw, 4.5rem); margin-bottom: 1.5rem; }
.src { font-style: italic; font-size: 1rem; color: var(--ink-soft); margin-top: -.6em; }
.placeholder { background: #FFF7C2; outline: 1px dashed #B9962A; padding: .1em .35em; }

/* ---------- Notes page ---------- */
.notes-page h1 { margin-bottom: 1.25rem; }
.chapter-jump { margin: 0 0 3rem; padding: 1.25rem 0; border-top: 1px solid rgba(13,22,48,.12); border-bottom: 1px solid rgba(13,22,48,.12); }
.chapter-jump p { margin: 0 0 .6rem; font-style: italic; color: var(--ink-soft); font-size: 1rem; }
.chapter-jump ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chapter-jump a {
  display: inline-grid; place-items: center; min-width: 2.75rem; height: 2.75rem; padding: 0 .5rem;
  border: 1px solid rgba(13,22,48,.25); color: var(--ink); text-decoration: none; font-size: 1.05rem; background: #fff;
}
.chapter-jump a:hover { border-color: var(--red); color: var(--red); }
.notes-body { max-width: 40rem; }
.notes-body h2 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem); margin: 3rem 0 1rem; scroll-margin-top: 1rem; }
.notes-body p { hyphens: auto; }
.notes-body a { overflow-wrap: anywhere; }
.notes-body blockquote { margin: 0 0 1em; padding-left: 1.25rem; border-left: 3px solid rgba(13,22,48,.18); }
.to-top { margin-top: 3rem; }

/* Phones: taller hero, text kept clear of the tower */
@media (max-width: 600px) {
  .hero { height: 860px; }
  .hero .wrap { padding-left: 128px; padding-top: 2.5rem; }
  .hero h1 { font-size: 2.75rem; }
  .hero-sub { font-size: 1.4rem; }
}
