/* The Drawn Films blog (drawnfilms.com/blog). The landing page's look in a small file: the same
   tokens, nav, buttons and footer as site/src/style.css (keep them in step), plus a readable
   article column. Static on purpose: no build step, nothing from the landing's bundle, so a post
   can't break the landing page and the pages stay fast. */

@font-face {
  font-family: 'Instrument Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url(./fonts/instrument-sans-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url(./fonts/instrument-sans-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 400 700;
  src: url(./fonts/instrument-sans-latin-ext-wght-italic.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Sans Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 400 700;
  src: url(./fonts/instrument-sans-latin-wght-italic.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --text: #111113;
  --text-2: #55555c;
  --text-3: #8a8a92;
  --line: #e4e4e8;
  --line-2: #cfcfd6;
  --accent: #3a5bff;
  --accent-hover: #2d4ae6;
  --accent-text: #3a5bff;
  --pale: #c9d2ff;
  --shadow-sm: 0 1px 2px rgb(17 17 19 / 0.06);

  --sans: 'Instrument Sans Variable', 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 3.4vw, 40px);
  --max: 1320px;
  --top: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b0b0d;
    --surface: #141417;
    --text: #ffffff;
    --text-2: #a9a9b2;
    --text-3: #74747d;
    --line: #222227;
    --line-2: #34343b;
    --accent-text: #6f8cff;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0b0b0d;
  --surface: #141417;
  --text: #ffffff;
  --text-2: #a9a9b2;
  --text-3: #74747d;
  --line: #222227;
  --line-2: #34343b;
  --accent-text: #6f8cff;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
svg {
  display: block;
}
a {
  color: inherit;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 500;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}
.logo-dark,
.is-dark .logo-light {
  display: none;
}
.is-dark .logo-dark {
  display: block;
}
.eyebrow {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s var(--ease);
}
.btn:hover svg {
  transform: translateX(2px);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background: var(--accent-hover);
}
.btn-line {
  border-color: var(--line-2);
  color: var(--text);
}
.btn-line:hover {
  border-color: var(--text-3);
}
.btn-sm {
  padding: 8px 15px;
  font-size: 0.88rem;
}
.btn:active,
.icon-btn:active {
  scale: 0.97;
}
.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

/* a short note at the bottom: what just happened */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 80;
  max-width: min(440px, calc(100vw - 32px));
  margin: 0;
  padding: 11px 18px;
  border-radius: 16px;
  background: #111113;
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
  translate: -50% 16px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s,
    translate 0.35s var(--ease);
}
.is-dark .toast {
  background: #fff;
  color: #111113;
}
.toast.is-on {
  translate: -50% 0;
  opacity: 1;
}

/* ------------------------------------------------------------------- nav */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: box-shadow 0.3s;
}
.nav.scrolled {
  box-shadow: 0 1px 0 var(--line);
}
.nav-in {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  max-width: calc(var(--max) + 2 * var(--gutter));
  height: 64px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.brand {
  justify-self: start;
  display: block;
}
.brand .logo {
  width: auto;
  height: 22px;
}
.nav-links {
  display: flex;
  gap: 30px;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-2);
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a[aria-current] {
  color: var(--text);
}
.nav-cta {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i-sun,
.is-dark .i-moon {
  display: none;
}
.is-dark .i-sun {
  display: block;
}

/* ------------------------------------------------------------ blog index */

.blog,
.post {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: calc(var(--top) + clamp(40px, 6vw, 88px)) var(--gutter) 0;
}
.blog-head {
  max-width: 760px;
}
.blog-head h1 {
  font-size: clamp(2.4rem, 1.4rem + 3vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.blog-intro {
  max-width: 600px;
  margin: 20px 0 0;
  font-size: 1.1rem;
  color: var(--text-2);
}
.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.lead img,
.row img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.lead h2 {
  margin: 10px 0 12px;
  font-size: clamp(1.6rem, 1.1rem + 1.5vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lead:hover h2,
.row:hover h2,
.row:hover h3 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.lead-text,
.row-text {
  display: grid;
  align-content: start;
}
.row-section {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.row-desc {
  color: var(--text-2);
}
.lead time,
.row time {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-3);
}
.rows {
  display: grid;
}
.row {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 36px);
  align-items: start;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.row h2,
.row h3 {
  margin: 6px 0 8px;
  font-size: 1.3rem;
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* ------------------------------------------------------------------ post */

.post-head {
  max-width: 900px;
}
.crumbs {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 0.86rem;
  color: var(--text-3);
}
.crumbs a {
  color: var(--accent-text);
  text-decoration: none;
}
.crumbs a:hover {
  text-decoration: underline;
}
.post-head h1 {
  font-size: clamp(2.2rem, 1.3rem + 2.8vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.post-meta {
  margin: 20px 0 0;
  font-size: 0.92rem;
  color: var(--text-3);
}
.post-cover {
  max-width: 1080px;
  margin: clamp(28px, 4vw, 48px) 0 0;
}
.post-cover img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.post-cover figcaption {
  margin-top: 10px;
  font-size: 0.86rem;
  color: var(--text-3);
}
.post-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 720px);
  gap: clamp(32px, 6vw, 96px);
  margin-top: clamp(36px, 5vw, 64px);
  align-items: start;
}
.post-toc {
  position: sticky;
  top: calc(var(--top) + 24px);
  display: grid;
  gap: 2px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.post-toc p {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.post-toc a {
  padding: 5px 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}
.post-toc a:hover,
.post-toc a[aria-current] {
  color: var(--text);
}
.post-toc a[aria-current] {
  box-shadow: -15px 0 0 -13px var(--accent);
}

/* the article itself: a calm reading column */
.post-body {
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--text-2);
}
.post-body > * + * {
  margin-top: 0;
}
.post-body p,
.post-body ul,
.post-body ol {
  margin: 0 0 18px;
}
.post-body ul,
.post-body ol {
  padding-left: 22px;
}
.post-body li {
  margin-bottom: 8px;
}
.post-body li::marker {
  color: var(--text-3);
}
.post-body h2 {
  margin: 52px 0 16px;
  font-size: clamp(1.45rem, 1.2rem + 0.8vw, 1.85rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  text-wrap: balance;
  scroll-margin-top: calc(var(--top) + 24px);
}
.post-body h3 {
  margin: 30px 0 10px;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text);
}
.post-body strong,
.post-body b {
  font-weight: 600;
  color: var(--text);
}
.post-body a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-body a:hover {
  text-decoration-thickness: 2px;
}
.post-body figure {
  margin: 30px 0;
}
.post-body figure img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.post-body figcaption {
  margin-top: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-3);
}
.post-body blockquote {
  margin: 28px 0;
  padding: 2px 0 2px 20px;
  border-left: 2px solid var(--accent);
  color: var(--text);
}
.post-body blockquote p:last-child {
  margin-bottom: 0;
}
.post-body hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.post-body code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.92em;
}
.table-wrap {
  margin: 26px 0 30px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}
.post-body th,
.post-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.post-body tr:last-child td {
  border-bottom: 0;
}
.post-body th {
  font-weight: 600;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 3%, transparent);
}

/* the answer first, for readers and for search and AI answers alike */
.answer {
  margin: 0 0 36px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.answer p {
  margin: 0;
}
.answer .answer-label {
  margin-bottom: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* a note beside the text, written as :::tip in a post (a div with class="note") */
.note {
  margin: 26px 0;
  padding: 16px 20px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  color: var(--text);
}
.note p:last-child {
  margin-bottom: 0;
}

.faq {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.faq h2 {
  margin-top: 36px;
}
.faq-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.faq-item:last-child {
  border-bottom: 0;
}
.faq-item h3 {
  margin: 0 0 6px;
}
.faq-item p {
  margin: 0;
}

/* the story box at the end of every post: paste a story, go straight to the app */
.cta {
  margin: 48px 0 0;
  padding: clamp(22px, 3vw, 32px);
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}
.cta h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 1.1rem + 0.9vw, 1.8rem);
}
.cta > p {
  margin: 0 0 18px;
  color: var(--text-2);
}
.cta textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--bg);
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
}
.cta textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 14px;
}
.cta-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-3);
}

.sources {
  margin-top: 48px;
  font-size: 0.92rem;
}
.sources h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}
.sources ol {
  padding-left: 20px;
}
.sources li {
  margin-bottom: 6px;
}

.more {
  margin-top: clamp(64px, 8vw, 110px);
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.more > h2 {
  margin: 28px 0 4px;
  font-size: 1.4rem;
  letter-spacing: -0.025em;
}

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

.foot {
  margin-top: clamp(100px, 12vw, 160px);
  padding: 64px var(--gutter) 28px;
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.foot-in {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  max-width: var(--max);
  margin: 0 auto;
}
.foot .logo {
  width: auto;
  height: 20px;
}
.foot-brand p {
  max-width: 300px;
  margin: 14px 0 20px;
  font-size: 0.92rem;
  color: var(--text-3);
}
.foot-col p {
  margin: 0 0 12px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.foot-col a {
  display: block;
  padding: 4px 0;
  font-size: 0.92rem;
  color: var(--text-2);
  text-decoration: none;
}
.foot-col a:hover {
  color: var(--text);
}
.foot-mark {
  max-width: var(--max);
  margin: clamp(56px, 8vw, 104px) auto 0;
  -webkit-mask-image: linear-gradient(180deg, #000 35%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 35%, transparent 100%);
  opacity: 0.9;
}
.foot-mark img {
  width: 100%;
  height: auto;
}
.foot-copy {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  max-width: var(--max);
  margin: 8px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--text-3);
}
.foot-copy p {
  margin: 0;
}

/* ------------------------------------------------------------- smaller */

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }
  .nav-in {
    grid-template-columns: 1fr auto;
  }
  .post-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-toc {
    display: none;
  }
  .foot-in {
    grid-template-columns: 1fr 1fr;
  }
  .foot-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  .lead {
    grid-template-columns: 1fr;
  }
  .row {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
    padding: 20px 0;
  }
  .row img {
    border-radius: 10px;
  }
  .row h2,
  .row h3 {
    font-size: 1.08rem;
  }
  .row .row-desc {
    display: none;
  }
}
@media (max-width: 640px) {
  .nav-login {
    display: none;
  }
  .brand .logo {
    height: 20px;
  }
  .post-body {
    font-size: 1.02rem;
  }
  .post-body table {
    font-size: 0.88rem;
  }
  .post-body th,
  .post-body td {
    padding: 10px 12px;
  }
  .cta-row .btn {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
