/* One stylesheet for the whole site. Nothing private lives here. */

:root {
  --bg: #f6f4ee;
  --card: #fffdf8;
  --ink: #1b1a17;
  --muted: #625e56;
  --line: #dcd8cd;
  --accent: #1f4a3a;
  --accent-ink: #f6f4ee;
  --error: #9b2c1f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131311;
    --card: #1c1c19;
    --ink: #eceae3;
    --muted: #a5a197;
    --line: #302f2a;
    --accent: #a8d5bd;
    --accent-ink: #11201a;
    --error: #ff9d8f;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- The public page ---------- */

.landing {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(1.25rem, 6vw, 4rem);
}

.landing main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 4rem 0 3rem;
}

.landing h1 {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.75rem, 11vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.landing p {
  margin: 0;
}

.landing .lede {
  font-size: clamp(1.2rem, 3.4vw, 1.5rem);
  line-height: 1.4;
  max-width: 28rem;
  text-wrap: balance;
}

.landing .ask {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  max-width: 28rem;
}

.email-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.email-button:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.landing footer {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ---------- The private area: sign-in ---------- */

.gate {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.gate-box {
  width: 100%;
  max-width: 21rem;
}

.gate-box h1 {
  margin: 0 0 1.5rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2rem;
  line-height: 1.1;
}

.gate-box label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.gate-box input[type="password"] {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* 16px keeps phones from zooming in */
}

.gate-box button {
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 0.6rem;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.gate-box button:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.gate-error {
  margin: 0.75rem 0 0;
  color: var(--error);
  font-weight: 600;
}

.gate-note {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ---------- The private area: notes ---------- */

.notes {
  width: 100%;
  max-width: 43rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 5vw, 2rem) 3rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notes-head {
  padding: 1.5rem 0 1rem;
}

.notes h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 7vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.note-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.note-list a {
  display: block;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
}

.note-list a:hover {
  border-color: var(--accent);
}

.note-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.25;
}

.note-summary {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.975rem;
  line-height: 1.45;
}

.note-date {
  display: block;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.back {
  margin: 0;
  font-size: 0.9375rem;
}

.back a {
  display: inline-block;
  padding: 0.5rem 0;
  text-decoration: none;
}

.note header {
  padding: 0.75rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.note h2 {
  margin: 2.75rem 0 0.75rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1.2;
  text-wrap: balance;
}

.note h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.note p {
  margin: 0 0 1rem;
}

.note ul,
.note ol {
  margin: 0 0 1.25rem;
  padding-left: 1.3rem;
}

.note li {
  margin-bottom: 0.55rem;
}

.note li > ul,
.note li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.note em {
  color: var(--muted);
}

.note blockquote {
  margin: 0 0 1.25rem;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

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

.note code {
  padding: 0.1em 0.35em;
  border-radius: 0.3em;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.9em;
}

.note a {
  overflow-wrap: anywhere;
}

/* A link to the saved video a line came from: small, so the lines stay readable. */
.note a.src,
.note a[href*="tiktok.com"] {
  font-size: 0.85em;
  white-space: nowrap;
}

.notes-foot {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.notes-foot p {
  margin: 0 0 0.5rem;
}

.sign-out button {
  padding: 0.5rem 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.sign-out button:hover {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
