/* Study the Game: a warm, hand-annotated notebook page. Light only. */

:root {
  color-scheme: light;
  --paper: #f7eedd;
  --paper-deep: #efe2c9;
  --ink: #2b2118;
  --ink-2: #5e4f40;
  --muted: #94826d;
  --accent: #c4532d;            /* terracotta */
  --marker: rgba(244, 196, 88, 0.55);

  --head: "Fraunces", Georgia, serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --hand: "Caveat", "Bradley Hand", cursive;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-optical-sizing: auto;
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

.wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px 120px;
}

.hand {
  font-family: var(--hand);
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

/* Hand-drawn wobbly line, used for underlines and dividers. */
.squiggle {
  display: block;
  width: 100%;
  height: 10px;
  color: var(--accent);
}

/* ---------- masthead ---------- */

.masthead { padding: 30px 0 0; }

.masthead-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  font-family: var(--head);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 800;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink);
}
.wordmark:hover { color: var(--ink); }

#meta { font-size: 21px; transform: rotate(-2deg); white-space: nowrap; }

.masthead .squiggle { margin-top: 12px; opacity: 0.85; }

/* ---------- issue header ---------- */

.issue-head { padding: 52px 0 4px; }

.issue-title {
  margin: 0;
  font-family: var(--head);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 700;
  font-size: clamp(40px, 11vw, 58px);
  line-height: 1;
  letter-spacing: -0.025em;
}
.issue-title .under { position: relative; display: inline-block; font-style: italic; font-weight: 500; color: var(--accent); }
.issue-title .under svg { position: absolute; left: -2%; bottom: -10px; width: 104%; height: 14px; }

.deck { margin: 24px 0 0; color: var(--ink-2); font-size: 20px; line-height: 1.55; }

/* ---------- ideas ---------- */

.idea { margin-top: 30px; }

.divider { width: 64px; margin: 56px 0 34px; }

.idea-top {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 6px;
}

.idea-num { font-size: 40px; }
.idea-pick { font-size: 24px; }

.idea-hook {
  margin: 0 0 12px;
  font-family: var(--head);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 650;
  font-size: clamp(26px, 7vw, 31px);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.idea-body { margin: 0; }

.steal { margin: 22px 0 0; }
.steal-label { display: inline-block; margin-bottom: 4px; font-size: 24px; }
.steal p { margin: 0; font-style: italic; font-size: 20px; line-height: 1.5; }
.steal mark {
  padding: 0.05em 0.2em;
  margin: 0 -0.2em;
  color: inherit;
  background: var(--marker);
  border-radius: 0.6em 0.2em 0.7em 0.25em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.video { display: inline-block; margin-top: 14px; font-size: 17px; color: var(--ink-2); }

/* ---------- sign-off ---------- */

.signoff { margin-top: 72px; }
.signoff p { margin: 0; font-style: italic; color: var(--ink-2); }
.signoff .hand { display: inline-block; margin-top: 4px; font-size: 40px; color: var(--ink); transform: rotate(-3deg); }

/* Fallback when the issue doesn't parse into ideas: plain markdown. */
.raw { padding-top: 48px; }
.raw p { margin: 0 0 24px; }
.raw h1 { font-family: var(--head); font-weight: 700; font-size: 38px; line-height: 1.05; }

/* ---------- empty state ---------- */

.soon { display: inline-block; margin: 44px 0 0; font-size: 34px; transform: rotate(-2.5deg); }

/* ---------- footer ---------- */

.foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 88px;
  font-size: 15px;
  color: var(--muted);
}
.foot .squiggle { flex-basis: 100%; margin-bottom: 8px; opacity: 0.5; }
.foot button {
  padding: 0;
  border: none;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 14px 20px;
  border: none;
  border-radius: 3px 6px 4px 7px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--head);
  font-variation-settings: "SOFT" 100;
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
}
.btn:hover { background: var(--accent); }
.btn[disabled] { opacity: 0.6; cursor: default; }

.subscribe-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  padding: 10px 16px;
  font-size: 15px;
  transform: rotate(-2deg);
  box-shadow: 0 6px 18px rgba(43, 33, 24, 0.22);
}

/* ---------- signup popup ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(43, 33, 24, 0.45);
}
.modal[hidden] { display: none; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 34px 24px 24px;
  background: var(--paper);
  border-radius: 4px 8px 5px 9px;
  box-shadow: 0 20px 50px rgba(43, 33, 24, 0.3);
  transform: rotate(-0.6deg);
}

.modal-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.modal-card .hand { display: inline-block; font-size: 26px; transform: rotate(-3deg); }

.modal-card h2 {
  margin: 8px 0 10px;
  font-family: var(--head);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 700;
  font-size: 31px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.modal-card h2 mark { padding: 0 0.15em; margin: 0 -0.15em; color: inherit; background: var(--marker); border-radius: 0.5em 0.2em 0.6em 0.25em; }
.modal-card .lede { margin: 0 0 22px; color: var(--ink-2); font-size: 18px; line-height: 1.5; }

.modal-card input[type="email"] {
  display: block;
  width: 100%;
  padding: 13px 12px;
  margin-bottom: 10px;
  border: 1.5px solid #dccbb0;
  border-radius: 3px 6px 4px 7px;
  background: #fffaf1;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px; /* 16px+ stops iOS zooming on focus */
  -webkit-appearance: none;
  appearance: none;
}
.modal-card input[type="email"]:focus { outline: none; border-color: var(--accent); }

.modal-card .btn { width: 100%; }

.form-note { margin-top: 12px; min-height: 1.4em; font-size: 15px; color: var(--muted); font-style: italic; }
.form-note:empty { display: none; }
