:root {
  color-scheme: light;
  --font-sans: "DM Sans Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Tienne", Georgia, "Times New Roman", serif;
  font-family: var(--font-sans);
  color: #202725;
  background: #edeae2;
  font-synthesis: none;
  --paper: #f5f2ea;
  --ink: #202725;
  --copy: #454d4a;
  --muted: #626a67;
  --line: #c4cac6;
  --line-dark: #a7b0ab;
  --signal: #007c73;
  --signal-soft: #d8e7e4;
  --electric: #00675f;
  --electric-soft: #d1e4df;
  --shadow: 0 22px 70px rgba(32, 39, 37, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.98), transparent 35rem),
    radial-gradient(circle at 100% 24%, rgba(0, 124, 115, 0.1), transparent 30rem),
    radial-gradient(circle at 8% 68%, rgba(104, 113, 110, 0.08), transparent 32rem),
    #edeae2;
}

::selection {
  background: var(--signal);
  color: var(--paper);
}

button,
input,
textarea {
  font: inherit;
}

button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 124, 115, 0.42);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.site-header {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.wordmark-mark {
  display: block;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  overflow: hidden;
  background: transparent;
}

.wordmark-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.55);
  mix-blend-mode: multiply;
}

.page-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(62px, 9vw, 130px) 0 110px;
}

.article-hero {
  max-width: 980px;
  margin-bottom: clamp(70px, 10vw, 145px);
}

.article-kicker,
.toy-kicker,
.connection-label,
.fact-label {
  margin: 0;
  color: var(--signal);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.article-hero h1 {
  max-width: 940px;
  margin: 16px 0 30px;
  font-family: var(--font-serif);
  font-size: clamp(48px, 7.2vw, 102px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.91;
}

.article-hero h1 span {
  display: block;
  margin-top: 0.23em;
  color: var(--copy);
  font-size: 0.58em;
  letter-spacing: -0.02em;
  line-height: 1.04;
}

.article-hero h1 code {
  padding: 0;
  background: none;
  font-size: 0.78em;
  color: var(--electric);
}

.dek {
  max-width: 760px;
  margin: 0;
  color: var(--copy);
  font-family: var(--font-serif);
  font-size: clamp(21px, 2.5vw, 32px);
  line-height: 1.35;
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 700px) minmax(390px, 520px);
  column-gap: clamp(52px, 7vw, 112px);
  align-items: start;
}

.prose {
  grid-column: 1;
  min-width: 0;
  font-family: var(--font-serif);
  font-size: clamp(19px, 1.5vw, 22px);
  line-height: 1.68;
}

.prose-before-toy {
  grid-row: 1;
}

.prose-after-toy {
  grid-row: 2;
}

.prose p {
  margin: 0 0 1.4em;
}

.prose h2 {
  margin: 2.9em 0 0.7em;
  font-family: var(--font-sans);
  font-size: clamp(24px, 2.3vw, 34px);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.prose-before-toy h2 {
  margin-top: 3.2em;
}

.prose code {
  padding: 0.12em 0.32em;
  border-radius: 0.32em;
  background: #dfe3df;
  font: 0.8em/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.prose pre {
  max-width: 100%;
  margin: 2.1em 0;
  padding: 23px 25px;
  overflow: auto;
  border: 1px solid #202725;
  border-radius: 16px;
  background: #18201e;
  color: var(--paper);
  box-shadow: 7px 7px 0 var(--line);
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.prose pre code {
  padding: 0;
  background: transparent;
  font: inherit;
  overflow-wrap: normal;
}

.prose .flow-code {
  width: min(390px, 100%);
  padding-left: 35px;
  background: var(--electric);
  border-color: #004b45;
  box-shadow: 7px 7px 0 #b7d0ca;
}

.prose blockquote {
  margin: 2em 0;
  padding: 8px 0 8px 28px;
  border-left: 5px solid var(--signal);
  color: #38413e;
  font-size: 1.2em;
  font-style: normal;
  line-height: 1.5;
}

.prose blockquote::before {
  content: "Ask meta:";
  display: block;
  margin-bottom: 8px;
  color: var(--signal);
  font: 800 10px/1.4 var(--font-sans);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.aside-copy {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.82em;
  font-style: italic;
}

.mantra {
  margin: 2.3em 0 !important;
  color: var(--electric);
  font-family: var(--font-sans);
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.pull-quote {
  margin: 2.3em -0.5em !important;
  padding: 0.9em 0.5em;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  font-size: clamp(25px, 2.9vw, 37px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
}

/* The app owns its identity and surface. The publication supplies only
   placement and a quiet caption around the iframe. */
.prototype-frame {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: sticky;
  top: 22px;
  align-self: start;
  margin: 0;
}

.prototype-frame-iframe {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 560px;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.prototype-frame-caption {
  display: grid;
  gap: 10px;
  margin: 13px 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.prototype-frame-links {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
}

.prototype-frame-links a {
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.prototype-frame-links a:hover {
  color: var(--electric);
}

@media (max-width: 1080px) {
  .story-layout {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 440px);
    column-gap: 38px;
  }
}

@media (max-width: 860px) {
  .page-shell,
  .site-header,
  .site-footer {
    width: min(700px, calc(100% - 32px));
  }

  .page-shell {
    padding-top: 60px;
  }

  .article-hero {
    margin-bottom: 75px;
  }

  .story-layout {
    display: block;
  }

  .prototype-frame {
    position: relative;
    top: auto;
    margin: 42px 0 74px;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 17px 0;
  }

  .page-shell {
    padding: 48px 0 72px;
  }

  .article-hero h1 {
    font-size: clamp(44px, 14vw, 69px);
  }

  .article-hero h1 span {
    font-size: 0.54em;
  }

  .dek {
    font-size: 21px;
  }

  .prose {
    font-size: 19px;
    line-height: 1.62;
  }

  .prose h2 {
    font-size: 27px;
  }

  .prose pre {
    margin-right: -8px;
    margin-left: -8px;
    padding: 19px 17px;
    border-radius: 13px;
    font-size: 11px;
    box-shadow: 5px 5px 0 var(--line);
  }

  .prose blockquote {
    margin-left: 0;
    padding-left: 20px;
  }

  .pull-quote {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  .prototype-frame {
    margin-right: -8px;
    margin-left: -8px;
  }

  .prototype-frame-iframe {
    min-height: 500px;
    border-radius: 22px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
