:root {
  /* Editorial hierarchy inspired by quiet documentation UIs */
  --ink: #1c1c1c;
  --muted: #6e6a63;
  --line: rgba(0, 0, 0, 0.08);
  --panel: rgba(255, 255, 255, 0.35);

  /* Single accent used only on key positive emphasis */
  --accent: #3f5f4a;

  --font-sans: "Lato", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Type scale */
  --fs-h1: clamp(2.45rem, 6.3vw, 4.8rem);
  --fs-h2: clamp(1.24rem, 2.2vw, 1.62rem);
  --fs-h3: clamp(1.08rem, 1.9vw, 1.24rem);
  --fs-body: 1.03rem;
  --fs-meta: 0.9rem;

  /* Vertical rhythm */
  --space-1: 0.35rem;
  --space-2: 0.55rem;
  --space-3: 0.8rem;
  --space-4: 1rem;
  --space-5: 1.35rem;
  --space-6: 1.9rem;
  --space-7: 2.5rem;
  --space-8: 3.45rem;
  --space-9: 4.2rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.74;
  /* Subtle paper gradient: intentionally low-contrast */
  background: linear-gradient(180deg, #faf9f6 0%, #f3f1ec 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.page {
  max-width: 56rem;
  margin: 0 auto;
  padding: var(--space-6) 1.25rem var(--space-9);
}

.hero {
  padding-top: var(--space-2);
  text-align: center;
}

.hero-inner {
  max-width: 49rem;
  margin: 0 auto;
}

@media (min-width: 980px) {
  .hero-inner {
    max-width: 54rem;
  }
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.hero-title {
  margin-top: var(--space-3);
  font-size: var(--fs-h1);
  line-height: 1.01;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero-spike {
  margin-top: var(--space-4);
  font-size: clamp(1.02rem, 1.7vw, 1.2rem);
  line-height: 1.5;
  font-weight: 500;
  max-width: 33rem;
  margin-left: auto;
  margin-right: auto;
}

section {
  margin-top: var(--space-8);
}

.reading-flow {
  max-width: 43rem;
  margin: var(--space-9) auto 0;
  text-align: left;
}

.reading-flow section,
.reading-flow footer {
  text-align: left;
}

.reading-flow section:first-child {
  margin-top: 0;
}

h2 {
  font-size: var(--fs-h2);
  line-height: 1.28;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
  font-weight: 700;
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.28;
  letter-spacing: -0.005em;
  margin-bottom: var(--space-2);
}

.chat-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  margin-bottom: var(--space-4);
}

.chat {
  margin-top: var(--space-7);
}

.messages {
  width: clamp(2.8rem, 8.6vw, 3.9rem);
  height: auto;
  flex: 0 0 auto;
  opacity: 0.82;
  border: 0;
  outline: 0;
  box-shadow: none;
}

.chat-heading-text {
  display: grid;
  gap: 0.04rem;
  line-height: 1.12;
}

.chat-heading-setup {
  font-size: 0.94em;
  font-weight: 500;
  color: var(--muted);
}

.chat-heading-punch {
  font-size: 1em;
  font-weight: 600;
}

.chat-heading-hook {
  font-weight: 700;
  color: var(--accent);
}

.section-illustration {
  color: var(--muted);
  opacity: 0.82;
}

.section-illustration--hero {
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
  display: flex;
  justify-content: center;
  opacity: 0.7;
}

.section-illustration--hero picture {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.inline-illustration {
  display: block;
  width: clamp(8.5rem, 33vw, 12.6rem);
  height: auto;
}

.hero-illustration-image {
  display: block;
  width: min(100%, 12.8rem);
  height: auto;
  margin-left: auto;
  margin-right: auto;
  border: 0;
  outline: 0;
  box-shadow: none;
}

.section-illustration--comic {
  margin-top: var(--space-3);
  margin-bottom: var(--space-5);
}

.closing {
  margin-top: var(--space-9);
  padding-top: var(--space-8);
  border-top: 1px solid var(--line);
  text-align: center;
}

.closing-comic-responsive {
  width: min(92vw, 38rem);
  margin-left: 50%;
  transform: translateX(-50%);
  opacity: 0.88;
}

.closing-comic-responsive picture {
  display: block;
  width: 100%;
}

.closing-comic-image {
  width: 100%;
  height: auto;
  border: 0;
  outline: 0;
  box-shadow: none;
}

.closing-final-line {
  margin: var(--space-5) auto 0;
  max-width: 36ch;
  font-family: var(--font-mono);
  font-size: clamp(0.98rem, 1.6vw, 1.1rem);
  line-height: 1.55;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
}

.inline-illustration--micro {
  width: clamp(3.2rem, 9vw, 4.1rem);
  flex: 0 0 auto;
  opacity: 0.82;
  margin-top: 0.05rem;
}

.chat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 760px) {
  .chat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Card treatment stays document-like: light outline, minimal rounding */
.chat-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.2rem 1.2rem;
  background: var(--panel);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
  transition:
    border-color 150ms ease-out,
    background-color 150ms ease-out;
}

.chat-card.is-blunt {
  background: var(--panel);
}

.chat-card.is-polite {
  background: var(--panel);
  border-color: rgba(63, 95, 74, 0.26);
}

.chat-label {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

.chat-impact {
  margin-bottom: var(--space-5);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

.chat-aside {
  margin-top: var(--space-5);
  max-width: 40ch;
  font-size: var(--fs-meta);
  line-height: 1.58;
  color: var(--muted);
}

.chat-earned-aside {
  margin-top: var(--space-4);
  max-width: 42ch;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
  opacity: 0.9;
}

.chat-line {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 1.08rem;
  line-height: 1.64;
}

.tips ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.62rem;
  margin-bottom: var(--space-3);
}

.check-icon {
  width: 1.16rem;
  height: 1.16rem;
  margin-top: 0.15rem;
  color: var(--muted);
  flex: 0 0 auto;
}

.check-list li span {
  display: block;
  max-width: 35ch;
}

.rule-title {
  display: block;
  font-size: 1.01em;
  font-weight: 560;
  line-height: 1.35;
}

.rule-detail {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.96em;
  line-height: 1.5;
}

.tips-aside {
  max-width: 35ch;
  margin-top: var(--space-6);
}

.tips-reassure {
  font-size: var(--fs-meta);
  line-height: 1.58;
  color: var(--muted);
  opacity: 0.92;
}

.tips-reassure + .tips-reassure {
  margin-top: var(--space-1);
}

.reading-flow p + p {
  margin-top: var(--space-3);
}

.site-footer {
  margin-top: var(--space-8);
  margin-bottom: 0;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
  border-top: 1px solid var(--line);
  padding: var(--space-5) clamp(1.25rem, 4vw, 2.75rem) var(--space-6);
  font-size: 0.88rem;
  line-height: 1.72;
  color: var(--muted);
  text-align: left;
}

.site-footer p {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

.site-footer p + p {
  margin-top: var(--space-2);
}

.site-footer-line2 {
  margin-top: var(--space-1);
}

.site-footer-earned {
  margin-top: var(--space-4);
  color: var(--ink);
  opacity: 0.9;
}

.site-footer-attribution {
  margin-top: var(--space-4);
}

.site-footer-video {
  margin-top: var(--space-2);
}

.site-footer-languages {
  margin-top: var(--space-5);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.site-footer a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.accent-word {
  color: var(--accent);
}

.signoff-emoji {
  margin-left: 0.3rem;
}

@media (max-width: 760px) {
  .closing-comic-responsive {
    width: 100%;
    margin-left: 0;
    transform: none;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7e5e0;
    --muted: #b6b2a8;
    --line: rgba(255, 255, 255, 0.14);
    --panel: rgba(255, 255, 255, 0.04);
    --accent: #9bb8a4;
  }

  body {
    /* Dark counterpart of the same paper-like vertical gradient */
    background: linear-gradient(180deg, #0f1110 0%, #141614 100%);
  }

  .site-footer a {
    color: #eeece6;
  }

  .chat-card {
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow:
      2px 2px 0 rgba(236, 232, 224, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  .chat-card.is-blunt {
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(255, 255, 255, 0.24);
  }

  .chat-card.is-polite {
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(255, 255, 255, 0.24);
  }

  .chat-label {
    color: #c3beb4;
  }

  .chat-heading .inline-illustration--micro {
    opacity: 0.72;
  }

  .messages {
    opacity: 0.74;
  }
}
