/* Rung 0 reading page. Restrained, literary, email-client-ish.
   Palette echoes the story: ink on paper, with the orb's blue-green as accent. */

:root {
  --paper: #f7f4ec;
  --ink: #1f2421;
  --muted: #6b6f6a;
  --line: #d9d3c5;
  --accent: #2f6b66;       /* the orb's blue-green */
  --accent-warm: #b06a3a;  /* the lighthouse beam */
  --maxw: 720px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.62;
  display: flex;
  align-items: flex-start;
}

/* --- Layout: left sidebar + content column --- */
.sidebar {
  flex: 0 0 234px;
  width: 234px;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 2.6rem 1.5rem;
  border-right: 1px solid var(--line);
  background: #f2ece0;
}
.sidebar .brand {
  display: block;
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 2.2rem;
  text-decoration: none;
}
.menu { display: flex; flex-direction: column; gap: 0.15rem; }
.navitem {
  display: block;
  padding: 0.6rem 0.65rem;
  border-radius: 3px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.25;
}
.navitem:hover { background: #e7e0d0; }
.navitem.active { background: var(--accent); color: #fff; }
.navitem.disabled { color: var(--muted); opacity: 0.65; cursor: default; }
.navitem.disabled:hover { background: transparent; }
.navsub {
  display: block;
  font-size: 0.66rem;
  font-style: italic;
  color: var(--muted);
  margin-top: 0.15rem;
}
.content { flex: 1 1 auto; min-width: 0; width: 100%; }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 4rem; }

/* Mobile: stack the sidebar on top (not fussed over — desktop is the target) */
@media (max-width: 760px) {
  body { display: block; }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .brand { margin-bottom: 1rem; }
  .menu { flex-direction: row; flex-wrap: wrap; gap: 0.4rem; }
}

/* --- Masthead --- */
.masthead {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3.5rem 20px 2rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--accent);
}
.tagline { color: var(--muted); font-style: italic; margin: 0.6rem auto 0.5rem; max-width: 38ch; }
.positioning {
  margin: 0 auto 2.1rem;
  max-width: 46ch;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.masthead h1 { font-size: 1.9rem; margin: 0 0 0.2rem; font-weight: 600; }
.subtitle { color: var(--muted); margin: 0; font-size: 0.95rem; }

.actions { margin-top: 1.8rem; display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.btn {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--accent);
  color: #fff; background: var(--accent);
  border-radius: 2px;
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn:hover { opacity: 0.85; }

/* --- Email blocks --- */
.email {
  margin: 3rem 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fffdf8;
  overflow: hidden;
}
.email-head {
  background: #efe9dc;
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 1.1rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--muted);
}
.hrow { display: flex; gap: 0.6rem; }
.hkey { color: var(--accent); min-width: 4.5em; text-transform: uppercase; letter-spacing: 0.06em; }
.hval { color: var(--ink); }

.email-body { padding: 1.4rem 1.6rem 1.8rem; }
.email-body > p:first-child em { /* the "Beat N — author" line */
  display: inline-block;
  font-style: normal;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-warm);
}

/* --- Images / panels --- */
.email-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.4rem auto;
  border: 1px solid var(--line);
  box-shadow: 0 2px 14px rgba(0,0,0,0.18);
}
/* Side-by-side takes (markdown table of two images) */
.email-body table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; }
.email-body td { width: 50%; text-align: center; vertical-align: top; padding: 0 0.4rem; }
.email-body td img { margin: 0 auto 0.4rem; }
.email-body th { padding: 0; border: 0; }
.email-body td em { font-size: 0.78rem; color: var(--muted); }

/* Image captions (the line of italic text right after a panel) */
.email-body p em { color: var(--muted); }

/* Cameraman prompts (wrapped in <small>) — present but quiet */
.email-body small {
  display: block;
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border-left: 2px solid var(--line);
  background: #f3eee2;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
}

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* --- Status / awaiting block --- */
.status {
  margin: 3rem 0;
  text-align: center;
  padding: 2rem;
  border: 1px dashed var(--accent);
  border-radius: 3px;
}
.status h2 { color: var(--accent); font-family: ui-monospace, Consolas, monospace; font-size: 0.9rem; letter-spacing: 0.1em; }
.status em { color: var(--muted); }

/* --- Footer --- */
.foot {
  max-width: var(--maxw);
  margin: 0 auto; padding: 2rem 20px 4rem;
  text-align: center; color: var(--muted); font-style: italic; font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

/* --- Home / landing page --- */
.home-head {
  padding-top: 5rem;
  padding-bottom: 2.5rem;
}
.home-head .brand {
  font-size: 1.1rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 1.4rem;
}

/* "How it works" flow diagram */
.howitworks {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.6rem;
  max-width: 640px;
  margin: 0 auto 1rem;
  text-align: left;
}
.howitworks .step {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1rem 0.8rem;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-align: center;
}
.howitworks .step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
}
.howitworks .step p { margin: 0; font-size: 0.9rem; line-height: 1.35; }
.howitworks .arrow {
  display: flex;
  align-items: center;
  color: var(--accent);
  font-size: 1.4rem;
}
.loop {
  text-align: center;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.8rem;
}
@media (max-width: 560px) {
  .howitworks { flex-direction: column; }
  .howitworks .arrow { transform: rotate(90deg); justify-content: center; }
}
.prose {
  max-width: var(--maxw);
  margin: 1rem auto 0;
}
.prose h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2.4rem 0 0.6rem;
  color: var(--accent);
}
.prose p { margin: 0 0 1rem; }
.prose ul { padding-left: 1.1rem; }
.prose li { margin: 0.4rem 0; }
.prose strong { color: var(--ink); }

.cta {
  text-align: center;
  margin: 3rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

/* Contact / invite note on the join page */
.contact {
  margin-top: 2.6rem;
  padding: 1.1rem 1.3rem;
  border-left: 3px solid var(--accent);
  background: #efe9dc;
  border-radius: 2px;
}
.contact a { color: var(--accent); }

/* Back-to-home link on the story page */
.story-head .homelink {
  display: inline-block;
  margin-bottom: 1.4rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}
.story-head .homelink:hover { color: var(--accent); }

@media (max-width: 560px) {
  body { font-size: 17px; }
  .email-body { padding: 1.1rem 1rem 1.4rem; }
  .home-head { padding-top: 3rem; }
}
