/* =========================================================================
   THEME TOKENS
   Two switchable, minimalist themes driven by [data-theme] on <html>:
     • daylight: clean white canvas, near-black ink, electric-blue accent
     • midnight: near-black canvas, off-white ink, soft-azure accent
   Default (no attribute) = daylight, so the site renders correctly without JS.
   Components below only reference these semantic vars, never raw colors.
   ========================================================================= */
:root,
[data-theme="daylight"] {
  --bg: #ffffff;
  --bg-2: #f7f8fa;
  --surface: #ffffff;          /* cards, inputs, elevated panels */
  --ink: #0b0c0e;
  --ink-soft: #5a616b;
  --ink-mute: #6b7280;
  --line: #ebedf1;
  --line-strong: #d9dde3;
  --accent: #2b59ff;
  --accent-soft: #eef2ff;
  --btn-bg: #0b0c0e;
  --btn-ink: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-bg-solid: rgba(255, 255, 255, 0.98);
  --quote-bg: #0b0c0e;
  --quote-ink: #ffffff;
  --quote-mute: #9aa0ab;
  --portrait-1: #f3f5f8;
  --portrait-2: #e7eaef;
}

[data-theme="midnight"] {
  --bg: #0c0d10;
  --bg-2: #131519;
  --surface: #15171c;
  --ink: #f4f6f8;
  --ink-soft: #b3b9c2;
  --ink-mute: #8a909a;
  --line: #23262d;
  --line-strong: #31353d;
  --accent: #6ea8fe;
  --accent-soft: #16202e;
  --btn-bg: #f4f6f8;
  --btn-ink: #0c0d10;
  --nav-bg: rgba(12, 13, 16, 0.72);
  --nav-bg-solid: rgba(12, 13, 16, 0.98);
  --quote-bg: #06070a;
  --quote-ink: #f4f6f8;
  --quote-mute: #8a909a;
  --portrait-1: #1b1e24;
  --portrait-2: #23262d;
}

:root {
  --max: 1140px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }

h1, h2, h3 {
  font-family: "Inter", sans-serif;
  font-weight: 680;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0;
}
em { font-style: normal; color: var(--accent); }
a { color: inherit; text-decoration: none; }

/* Visible keyboard focus for accessibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

/* Skip-to-content link (visible only when focused) */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--btn-bg); color: var(--btn-ink); padding: 10px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 550; transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  display: inline-block;
  font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-mute); margin: 0 0 20px;
}
.eyebrow--center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--btn-bg); color: var(--btn-ink);
  padding: 13px 24px; border-radius: 10px; font-weight: 550; font-size: 15.5px;
  border: 1px solid var(--btn-bg); cursor: pointer;
  transition: transform .14s ease, opacity .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--bg-2); border-color: var(--ink); }
.btn--sm { padding: 9px 16px; font-size: 14px; border-radius: 8px; }
.btn--block { width: 100%; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background-color .35s ease, border-color .35s ease;
}
.nav__inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.brand { font-weight: 650; font-size: 18px; letter-spacing: -0.02em; }
.nav__links { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav__links a { font-size: 14.5px; font-weight: 480; color: var(--ink-soft); transition: color .2s ease; }
.nav__links a:hover { color: var(--ink); }
.nav .btn--sm { margin-left: 4px; }

/* Theme switcher: three swatches that toggle [data-theme] */
.theme-switch {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface);
}
.theme-switch__btn {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 1px solid var(--line-strong);
  position: relative; transition: transform .15s ease, box-shadow .2s ease;
}
.theme-switch__btn:hover { transform: scale(1.08); }
.theme-switch__btn[data-set="daylight"] { background: linear-gradient(135deg, #ffffff 50%, #2b59ff 50%); }
.theme-switch__btn[data-set="midnight"] { background: linear-gradient(135deg, #0c0d10 50%, #6ea8fe 50%); }
.theme-switch__btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); border-color: var(--accent); }

/* Hamburger toggle: hidden on desktop, shown on mobile */
.nav__toggle {
  display: none; margin-left: auto; width: 42px; height: 42px;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  background: transparent; border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
}
.nav__toggle span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav__cta { display: none; } /* CTA inside the dropdown: only on mobile */

/* Hero */
.hero { padding: 92px 0 72px; }
.hero__grid { display: grid; grid-template-columns: 1.3fr 0.85fr; gap: 60px; align-items: center; }
.hero h1 { font-size: clamp(40px, 6vw, 64px); letter-spacing: -0.04em; margin-bottom: 26px; }
.lede { font-size: 19px; color: var(--ink-soft); max-width: 42ch; margin: 0 0 32px; letter-spacing: -0.01em; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__proof { margin-top: 28px; font-size: 14.5px; color: var(--ink-mute); }
.hero__proof strong { color: var(--ink); font-weight: 600; }

.hero__portrait { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.portrait {
  width: 290px; height: 350px; border-radius: 18px;
  background: linear-gradient(165deg, var(--portrait-1), var(--portrait-2));
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.portrait--lg { width: 100%; max-width: 360px; height: 430px; }
.portrait__img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.portrait__ph { font-size: 60px; color: #c2c8d1; font-weight: 650; letter-spacing: -0.03em; }
.portrait__tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 15px; font-size: 12.5px; font-weight: 500; color: var(--ink-soft);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.14); }

/* Strip */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-2); }
.strip__inner { display: flex; align-items: center; gap: 32px; padding: 20px 28px; flex-wrap: wrap; }
.strip__label { font-size: 13px; color: var(--ink-mute); font-weight: 500; }
.strip__logos { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.strip__logos li { font-size: 15px; font-weight: 600; color: var(--ink-soft); letter-spacing: -0.01em; }

/* Insider view: the differentiator section (A's "calibration room") */
.insider__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: center; }
.insider__title { font-size: clamp(28px, 3.8vw, 42px); letter-spacing: -0.035em; margin-bottom: 22px; }
.insider__intro { color: var(--ink-soft); font-size: 18px; margin: 0 0 30px; max-width: 46ch; }
.insider__quote {
  margin: 0; padding: 22px 26px; border-left: 3px solid var(--accent);
  background: var(--bg-2); border-radius: 0 12px 12px 0;
}
.insider__quote p {
  margin: 0; font-size: clamp(19px, 2.4vw, 24px); line-height: 1.34;
  font-weight: 500; letter-spacing: -0.02em; color: var(--ink);
}
.insider__list { list-style: none; margin: 0; padding: 0; }
.insider__list li {
  position: relative; padding: 24px 0 24px 56px; border-bottom: 1px solid var(--line);
}
.insider__list li:first-child { padding-top: 0; }
.insider__list li:last-child { border-bottom: 0; padding-bottom: 0; }
.insider__k {
  position: absolute; left: 0; top: 24px; font-size: 13px; font-weight: 650;
  color: var(--accent); letter-spacing: 0.02em;
}
.insider__list li:first-child .insider__k { top: 0; }
.insider__list h3 { font-size: 19px; margin: 0 0 8px; letter-spacing: -0.02em; }
.insider__list p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }

/* Sections */
.section { padding: 100px 0; }
.section--alt { background: var(--bg-2); }
.section__title { font-size: clamp(30px, 4.2vw, 44px); text-align: center; margin-bottom: 22px; letter-spacing: -0.04em; }
.section__intro { text-align: center; max-width: 58ch; margin: 0 auto 56px; color: var(--ink-soft); font-size: 18px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 28px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -28px rgba(11,12,14,0.22); border-color: var(--line-strong); }
.card__num { font-size: 13px; color: var(--accent); font-weight: 650; letter-spacing: 0.02em; }
.card h3 { font-size: 21px; margin: 14px 0 12px; letter-spacing: -0.025em; }
.card p { margin: 0; color: var(--ink-soft); font-size: 16px; }

/* About */
.about__grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 60px; align-items: center; }
.about__media { display: flex; justify-content: center; }
.about__copy h2 { font-size: clamp(28px, 3.6vw, 38px); margin-bottom: 24px; letter-spacing: -0.035em; }
.about__copy p { color: var(--ink-soft); margin: 0 0 18px; }
.about__copy .about__lede { font-size: 19px; font-weight: 500; color: var(--ink); max-width: 54ch; margin-bottom: 26px; letter-spacing: -0.015em; }
.about__copy .btn { margin-top: 10px; }

/* Offers */
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; align-items: start; }
.offer {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px 28px; display: flex; flex-direction: column;
}
.offer--featured { border-color: var(--accent); box-shadow: 0 24px 50px -34px rgba(11,12,14,0.32); }
.offer__flag {
  position: absolute; top: -12px; left: 28px; background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; padding: 5px 12px; border-radius: 999px;
}
.offer h3 { font-size: 22px; margin-bottom: 6px; letter-spacing: -0.025em; }
.offer__price { color: var(--accent); font-weight: 600; margin: 0 0 14px; font-size: 15px; }
.offer > p { color: var(--ink-soft); font-size: 16px; }
.offer ul { list-style: none; padding: 0; margin: 18px 0 26px; flex: 1; }
.offer li { position: relative; padding-left: 24px; margin-bottom: 11px; font-size: 15px; color: var(--ink-soft); }
.offer li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 600; }

/* Quote */
.section--quote { background: var(--quote-bg); color: var(--quote-ink); padding: 92px 0; transition: background-color .35s ease; }
.quote { margin: 0 auto; text-align: center; max-width: 52ch; }
.quote p { font-size: clamp(23px, 3.2vw, 32px); line-height: 1.32; font-weight: 600; letter-spacing: -0.03em; }
.quote footer { margin-top: 24px; font-size: 13.5px; color: var(--quote-mute); }

/* Letter */
.letter__inner { text-align: center; }
.signup { display: flex; gap: 10px; justify-content: center; max-width: 460px; margin: 0 auto; flex-wrap: wrap; }
.signup input {
  flex: 1; min-width: 240px; padding: 13px 17px; font-size: 15.5px; font-family: inherit;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink);
}
.signup input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.letter__fine { margin-top: 16px; font-size: 13.5px; color: var(--ink-mute); }
.letter__tiers { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.tier { font-size: 13.5px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 7px; }
.tier b { color: var(--ink); font-weight: 600; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 56px 0 32px; }
.footer__inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.brand--footer { font-size: 19px; }
.footer__tag { color: var(--ink-soft); font-size: 14.5px; margin: 12px 0 0; max-width: 34ch; }
.footer__links { display: flex; flex-direction: column; gap: 10px; text-align: right; }
.footer__links a { color: var(--ink-soft); font-size: 14.5px; transition: color .2s ease; }
.footer__links a:hover { color: var(--ink); }
.footer__legal { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-mute); }

/* Responsive */
@media (max-width: 880px) {
  .hero { padding: 64px 0 48px; }
  .section { padding: 72px 0; }
  .hero__grid, .about__grid, .insider__grid { grid-template-columns: 1fr; }
  .insider__grid { gap: 40px; }
  .hero__portrait { order: -1; }
  .cards, .offers { grid-template-columns: 1fr; }
  .footer__links { text-align: left; }

  /* Mobile nav: hamburger reveals a dropdown menu */
  .nav__toggle { display: flex; }
  .nav__cta--desktop { display: none; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: 66px;
    flex-direction: column; align-items: flex-start; gap: 0; margin: 0;
    background: var(--nav-bg-solid);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 8px 28px 20px;
    /* collapsed by default; toggled open via .nav-open */
    display: none;
  }
  body.nav-open .nav__links { display: flex; }
  .nav__links a { padding: 13px 0; font-size: 16px; border-bottom: 1px solid var(--line); width: 100%; }
  .theme-switch { margin: 16px 0 4px; }
  .nav__cta { display: inline-flex; align-self: flex-start; margin: 16px 0 0; border-bottom: none; }
}

/* =========================================================================
   BLOG: listing + article. Reuses the theme tokens above, so the blog
   inherits daylight/midnight automatically. Pages live in /blog/.
   ========================================================================= */

/* Blog listing hero */
.blog-hero { padding: 84px 0 36px; }
.blog-hero__inner { max-width: 64ch; }
.blog-hero h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.04em; margin-bottom: 20px; }
.blog-hero p { font-size: 19px; color: var(--ink-soft); margin: 0; max-width: 52ch; }

/* Lane tag: small pill used on cards and post headers */
.lane {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; letter-spacing: 0.03em; text-transform: uppercase; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  padding: 5px 11px; border-radius: 999px; border: 1px solid transparent;
}
.lane::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* Post grid */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding-bottom: 100px; }
.post-card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -28px rgba(11,12,14,0.22); border-color: var(--line-strong); }
.post-card h2 { font-size: 21px; letter-spacing: -0.03em; line-height: 1.18; }
.post-card__dek { color: var(--ink-soft); font-size: 15.5px; margin: 0; flex: 1; }
.post-card__meta { font-size: 13px; color: var(--ink-mute); margin-top: 2px; }
.post-card__more { font-size: 14.5px; font-weight: 550; color: var(--accent); }

/* Article */
.post { padding: 72px 0 8px; }
.post__head { max-width: 62ch; margin: 0 auto 40px; }
.post__head h1 { font-size: clamp(32px, 4.6vw, 50px); letter-spacing: -0.04em; margin: 18px 0 18px; line-height: 1.06; }
.post__dek { font-size: 20px; color: var(--ink-soft); margin: 0 0 24px; letter-spacing: -0.01em; }
.post__meta { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-mute); flex-wrap: wrap; }
.post__meta .sep { opacity: 0.5; }

.prose { max-width: 62ch; margin: 0 auto; font-size: 18px; line-height: 1.72; }
.prose > * + * { margin-top: 24px; }
.prose h2 { font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.03em; margin-top: 48px; }
.prose h3 { font-size: 21px; letter-spacing: -0.02em; margin-top: 36px; }
.prose p { color: var(--ink-soft); margin: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { color: var(--ink-soft); padding-left: 22px; margin: 0; }
.prose li { margin-bottom: 10px; }
.prose blockquote {
  margin: 32px 0; padding: 20px 26px; border-left: 3px solid var(--accent);
  background: var(--bg-2); border-radius: 0 12px 12px 0;
}
.prose blockquote p { font-size: clamp(19px, 2.2vw, 23px); line-height: 1.38; font-weight: 500; color: var(--ink); letter-spacing: -0.02em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 44px 0; }

/* End-of-post subscribe CTA: canonical/Substack nudge on every post */
.post-cta {
  max-width: 62ch; margin: 64px auto 0; padding: 40px 36px; text-align: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.post-cta .eyebrow { margin-bottom: 12px; }
.post-cta h2 { font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -0.03em; margin-bottom: 12px; }
.post-cta p { color: var(--ink-soft); margin: 0 auto 22px; max-width: 44ch; font-size: 16px; }
.post-canonical { max-width: 62ch; margin: 28px auto 0; font-size: 13.5px; color: var(--ink-mute); text-align: center; }
.post-canonical a { color: var(--accent); }

/* Back link */
.post-back { max-width: 62ch; margin: 0 auto 0; padding-top: 8px; }
.post-back a { font-size: 14.5px; color: var(--ink-mute); font-weight: 500; }
.post-back a:hover { color: var(--ink); }

@media (max-width: 880px) {
  .posts { grid-template-columns: 1fr; padding-bottom: 64px; }
  .post { padding: 48px 0 8px; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .btn:hover, .card:hover { transform: none; }
}
