/* site.css — rhetoricalwriter.com page chrome + embedded presenter.
   Slide rendering itself lives in slides.css + writer-theme.css; this file
   styles everything around the slides, in the same "manuscript at night"
   palette so the page and the deck read as one surface. */

:root {
  --bg:    #0f1015;         /* page ground, a step darker than slides */
  --bg2:   #14151c;
  --card:  #1c1e27;
  --ink:   #ece9e2;
  --muted: #9a97a3;
  --line:  #32343f;
  --gilt:  #c9a45c;
  --rose:  #c887a0;
  --shadow: rgba(0, 0, 0, .5);

  --serif:   "Source Serif 4", Georgia, "Times New Roman", serif;
  --display: "Fraunces", Georgia, serif;
  --mono:    "IBM Plex Mono", Consolas, Menlo, monospace;
}

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

html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 60% at 10% 0%, rgba(201, 164, 92, .04), transparent 55%),
    repeating-linear-gradient(180deg, transparent 0 47px, rgba(236, 233, 226, .02) 47px 48px);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gilt); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- masthead ---------- */
.masthead {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 500; font-size: 1.5rem;
  letter-spacing: -.01em; color: var(--ink);
}
.wordmark:hover { text-decoration: none; }
.logo-mark {
  width: 52px; height: 52px; flex-shrink: 0;
  fill: currentColor; /* the SVG mark ships black-outline; recolored here
                          to the page's ink tone so it reads on the dark
                          masthead */
}
.masthead-meta {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}

/* ---------- hero text (sits below the picker now) ---------- */
.hero { padding: 48px 0 0; }
.hero-kicker {
  font-family: var(--mono); font-size: .78rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--gilt);
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--display); font-weight: 500; font-size: 2.6rem;
  line-height: 1.15; letter-spacing: -.015em; max-width: 22em;
}
.hero-sub {
  color: var(--muted); font-size: 1.15rem; margin-top: 12px; max-width: 40em;
}

/* ---------- deck picker ---------- */
#rs-picker {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 20px 0 0;
}
.rs-pick {
  font-family: var(--serif); text-align: left; cursor: pointer;
  background: var(--bg2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px 12px;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.rs-pick:hover { border-color: var(--gilt); transform: translateY(-2px); }
.rs-pick.active { border-color: var(--gilt); background: var(--card); }
.rs-pick-tag {
  display: block; font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--gilt);
  margin-bottom: 6px;
}
.rs-pick-title {
  display: block; font-family: var(--display); font-weight: 500;
  font-size: 1.05rem; line-height: 1.25;
}
.rs-pick-sub {
  display: block; font-size: .85rem; color: var(--muted);
  font-style: italic; margin-top: 3px;
}

/* ---------- presenter (first thing under the masthead) ---------- */
#rs-viewer { margin-top: 28px; }

#rs-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #0a0b0f;
  border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; cursor: pointer; outline: none;
}
#rs-stage:focus-visible { border-color: var(--gilt); }
#rs-scale {
  position: absolute; left: 50%; top: 50%;
  width: 1280px; height: 720px;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(1);
}
#rs-stage .slide { box-shadow: none; }

#rs-stage:fullscreen { background: #0a0b0f; aspect-ratio: auto; border-radius: 0; cursor: default; }

/* control bar */
#rs-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 4px 0;
}
.rs-bar-left { flex: 1 1 0; min-width: 0; }
.rs-bar-mid { display: flex; align-items: center; gap: 6px; }
.rs-bar-right { flex: 1 1 0; display: flex; justify-content: flex-end; gap: 6px; }

.rs-deck-title {
  font-family: var(--display); font-weight: 500; font-size: 1.05rem;
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.rs-counter {
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  margin-left: 8px; min-width: 4.5em; text-align: center;
}
.rs-nav-btn, .rs-tool-btn {
  font-family: var(--mono); background: transparent;
  border: 1px solid var(--line); color: var(--ink);
  border-radius: 6px; cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.rs-nav-btn {
  width: 2.1rem; height: 2.1rem; font-size: 1.25rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.rs-tool-btn { height: 2.1rem; padding: 0 .8rem; font-size: .8rem; }
.rs-nav-btn:hover, .rs-tool-btn:hover { border-color: var(--gilt); color: var(--gilt); }
.rs-nav-btn:disabled { opacity: .3; cursor: default; }
.rs-nav-btn:disabled:hover { border-color: var(--line); color: var(--ink); }
.rs-tool-btn[aria-pressed="true"] { background: var(--gilt); color: #14151c; border-color: var(--gilt); }
#rs-btn-play[aria-pressed="true"]::before { content: "❚❚"; }
#rs-btn-play[aria-pressed="true"] { font-size: .7rem; }

/* progress */
#rs-progress { height: 3px; background: var(--line); margin-top: 10px; border-radius: 2px; }
#rs-progress-fill {
  height: 100%; width: 0; background: var(--gilt);
  border-radius: 2px; transition: width .35s ease;
}

/* notes */
#rs-notes {
  display: none;
  background: var(--bg2); border: 1px solid var(--line);
  border-left: 3px solid var(--gilt); border-radius: 0 10px 10px 0;
  padding: 18px 24px; margin-top: 14px;
}
#rs-viewer.rs-notes-open #rs-notes { display: block; }
.rs-notes-head {
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .16em; color: var(--gilt);
  margin-bottom: 10px;
}
#rs-notes-body { font-size: 1rem; color: var(--muted); }
#rs-notes-body p { margin-bottom: 10px; }
#rs-notes-body p:last-child { margin-bottom: 0; }
#rs-notes-body code {
  font-family: var(--mono); font-size: .85em;
  background: var(--card); padding: 1px 5px; border-radius: 3px;
}
.rs-notes-empty { font-style: italic; }

/* error */
#rs-error { display: none; text-align: center; padding: 60px 0; color: var(--muted); }

/* toast */
.rs-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #14151c;
  font-family: var(--mono); font-size: .85rem;
  padding: .55rem 1.1rem; border-radius: 6px; z-index: 200;
  box-shadow: 0 8px 24px var(--shadow);
}

/* ---------- header "settle in" motion (live viewer only) ----------
   Scoped under #rs-scale: PNG export inlines slides.css/writer-theme.css
   (not this file) and PDF renders into .rs-print-page, so exports never
   catch a mid-animation frame. */
@keyframes rs-settle-up {
  0%   { opacity: 0; transform: translateY(16px); }
  70%  { opacity: 1; transform: translateY(-2px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes rs-settle-ghost {
  0%   { opacity: 0; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes rs-settle-fade {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
#rs-scale .type-header .ghost-num { animation: rs-settle-ghost .7s cubic-bezier(.22,1,.36,1) both; }
#rs-scale .type-header .h-xl      { animation: rs-settle-up .62s cubic-bezier(.22,1,.36,1) .08s both; }
#rs-scale .type-header .h-sub     { animation: rs-settle-up .62s cubic-bezier(.22,1,.36,1) .2s both; }
#rs-scale .type-header .sec-dots  { animation: rs-settle-fade .55s ease-out .34s both; }
@media (prefers-reduced-motion: reduce) {
  #rs-scale .type-header .ghost-num,
  #rs-scale .type-header .h-xl,
  #rs-scale .type-header .h-sub,
  #rs-scale .type-header .sec-dots { animation: none; }
}

/* ---------- page sections below the presenter ---------- */
.section { padding: 56px 0 0; }
.section-kicker {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--gilt);
  margin-bottom: 10px;
}
.section h2 {
  font-family: var(--display); font-weight: 500; font-size: 1.7rem;
  letter-spacing: -.01em; margin-bottom: 14px;
}
.section p { color: var(--muted); max-width: 44em; margin-bottom: 14px; }
.section p strong { color: var(--ink); font-weight: 600; }

/* CTA */
.cta-box {
  margin-top: 24px; padding: 28px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
}
.cta-box h2 { font-size: 1.45rem; margin-bottom: 6px; }
.cta-box .cta-note { font-size: .95rem; }
.cta-form { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.cta-form input[type="email"] {
  flex: 1 1 260px; min-width: 0;
  font-family: var(--mono); font-size: .95rem;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px;
  padding: .7rem .9rem; outline: none;
}
.cta-form input[type="email"]:focus { border-color: var(--rose); }
.cta-form button {
  font-family: var(--mono); font-weight: 600; font-size: .9rem;
  letter-spacing: .05em; cursor: pointer;
  background: var(--rose); color: #14151c;
  border: none; border-radius: 6px; padding: .7rem 1.4rem;
  box-shadow: 0 14px 34px -10px var(--shadow);
  transition: filter .2s ease;
}
.cta-form button:hover { filter: brightness(1.1); }
.cta-secondary { font-size: .9rem; margin-top: 14px; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 72px; padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.site-footer p {
  font-family: var(--mono); font-size: .75rem;
  letter-spacing: .06em; color: var(--muted);
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  #rs-picker { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2rem; }
}
@media (max-width: 560px) {
  #rs-bar { flex-wrap: wrap; }
  .rs-bar-left { flex-basis: 100%; }
  .rs-tool-btn { padding: 0 .55rem; font-size: .72rem; }
}

/* ---------- print: deck → PDF, one slide per 16:9 page ----------
   Off-screen, NOT display:none — background-images in display:none
   subtrees are never fetched (split panels/washes/banners would race the
   print snapshot and lose). */
#rs-print-root { position: absolute; left: -20000px; top: 0; }

@media print {
  .masthead, .hero-kicker, .hero h1, .hero-sub, #rs-picker, #rs-bar,
  #rs-progress, #rs-notes, #rs-error, .section, .site-footer { display: none !important; }
  #rs-stage { display: none !important; }
  body, main { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  .wrap { max-width: none !important; padding: 0 !important; }

  #rs-print-root { display: block !important; position: static !important; left: auto !important; }
  .rs-print-page {
    width: 1280px; height: 720px; overflow: hidden;
    page-break-after: always; break-after: page;
  }
  .rs-print-page:last-child { page-break-after: auto; break-after: auto; }
  .rs-print-page .slide { box-shadow: none !important; }

  @page { size: 1280px 720px; margin: 0; }
}
