/* Shared editorial chrome for the portfolio.
   Case-study pages that already ship their own editorial stylesheet
   keep it; this file is for the rest of the site. */

:root {
  --accent: #ea5a58;
  --bg: #fff;
  --canvas: #fff;
  --figure: #f2f2f0;
  --gutter: 1.25rem;
  --ink: #181817;
  --ink-50: #6c6c67;
  --line: #deded9;
  --measure: 42rem;
  --muted: #6c6c67;
  --reading: 42rem;
  --rule: #deded9;
  --soft: #fafaf8;
  --type-display: clamp(3rem, 6.5vw, 6rem);
  --type-feature: clamp(2.75rem, 6.5vw, 6rem);
  --type-section: clamp(2rem, 4vw, 3.25rem);
  --type-section-compact: clamp(1.9rem, 3.5vw, 3rem);
  --u: 1rem;
  --underline: #181817;
  --wide: 68rem;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  background: var(--canvas);
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li,
figure,
blockquote,
figcaption,
dl,
dd,
dt {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

strong {
  font-weight: 500;
}

/* A width attribute plus a width constraint has to be met by a free height,
   or the image renders at its HTML height attribute and stretches. */
img {
  height: auto;
  max-width: 100%;
}

::selection {
  background: var(--ink);
  color: var(--canvas);
}

a {
  border-bottom: 0;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #a3a39d;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentcolor;
}

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

.skip {
  background: var(--ink);
  color: #fff;
  left: 1rem;
  padding: 0.75rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 20;
}

.skip:focus {
  top: 1rem;
}

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

.dim {
  color: var(--muted);
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ── Header / footer ──────────────────────────────────── */

.site-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  font-size: 0.82rem;
  gap: 1.25rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 90rem;
  padding: 0.625rem clamp(1.25rem, 4vw, 3rem);
}

.site-header a {
  text-decoration: none;
}

.site-header strong {
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: flex-end;
}

.site-nav a {
  align-items: center;
  display: inline-flex;
  min-height: 2.75rem;
}

.site-header > a {
  align-items: center;
  display: inline-flex;
  min-height: 2.75rem;
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: currentcolor;
  text-underline-offset: 0.18em;
}

.page-footer {
  align-items: baseline;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8rem;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 90rem;
  padding: 2rem clamp(1.25rem, 4vw, 3rem);
}

.page-footer a {
  text-decoration: none;
}

.page-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

/* ── Article chrome ───────────────────────────────────── */

.article-head,
.cs-head {
  margin: 0 auto;
  max-width: 58rem;
  padding: clamp(5rem, 12vw, 10rem) 1.25rem clamp(4rem, 9vw, 7rem);
  text-align: center;
}

.article-head h1,
.cs-head h1 {
  font-size: var(--type-display);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.92;
  margin: 0;
  text-wrap: balance;
}

.dek {
  color: #4c4c48;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  letter-spacing: -0.02em;
  line-height: 1.45;
  margin: 2.25rem auto 0;
  max-width: 38rem;
  text-wrap: balance;
}

.byline {
  align-items: center;
  display: flex;
  font-size: 0.84rem;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 2rem;
}

.byline-org::before {
  content: "\2022";
  margin-right: 0.65rem;
}

.article {
  margin: 0 auto;
  max-width: var(--reading);
  padding: 0 1.25rem 8rem;
}

.article > p,
.article .tight p,
.article .tight li {
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  letter-spacing: -0.012em;
  line-height: 1.66;
}

.article > p {
  margin: 0 0 1.15em;
}

.article .lead {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  letter-spacing: -0.025em;
  line-height: 1.45;
}

.article h2 {
  font-size: var(--type-section);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
  margin: 3em 0 0.4em;
  text-wrap: balance;
}

.article h3 {
  font-size: 1.35rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 2.75em 0 0.8em;
}

.article h2:first-child,
.article > .lead + h2 {
  margin-top: 0;
}

.article figure {
  margin: 2.5em 0 2.75em;
}

.article figcaption,
figcaption {
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.45;
  margin: 0.8rem auto 0;
  max-width: var(--reading);
}

.article ul,
.article ol {
  margin: 0 0 1.15em;
}

.article li {
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  line-height: 1.66;
  padding-inline-start: 1.15rem;
  position: relative;
}

.article li + li {
  margin-top: 0.55em;
}

.article ul li::before {
  color: var(--muted);
  content: "•";
  inset-inline-start: 0;
  line-height: inherit;
  position: absolute;
  top: 0.06em;
}

.facts {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 4rem 0 5rem;
}

.fact {
  padding: 1.3rem 0;
}

.fact:nth-child(odd) {
  border-right: 1px solid var(--line);
  padding-right: 1.3rem;
}

.fact:nth-child(even) {
  padding-left: 1.3rem;
}

.fact:nth-child(-n + 2) {
  border-bottom: 1px solid var(--line);
}

.fact strong {
  display: block;
  font-size: 2.2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.06em;
}

.fact span {
  color: var(--muted);
  font-size: 0.75rem;
}

blockquote {
  border-left: 0.28rem solid var(--ink);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin: 2.25em 0;
  padding-left: 1.25rem;
}

.article blockquote p {
  font-size: inherit;
  line-height: inherit;
  margin-bottom: 0;
}

blockquote cite,
.quote figcaption {
  color: var(--muted);
  display: block;
  font-size: 0.75rem;
  font-style: normal;
  letter-spacing: 0;
  margin-top: 1rem;
}

.closing {
  border-top: 1px solid var(--line);
  margin-top: 7rem;
  padding-top: 2rem;
}

.closing p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.next {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  justify-content: space-between;
  margin: 5rem auto 0;
  max-width: var(--reading);
  padding: 0 1.25rem 4rem;
}

/* ── Figures ──────────────────────────────────────────── */

.hero-figure,
.wide-figure {
  margin: 0 auto;
  max-width: var(--wide);
  padding-inline: 1.25rem;
}

.hero-stage,
.piece-stage {
  align-items: center;
  background: #eeeeeb;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 4rem);
  position: relative;
}

.hero-stage {
  min-height: clamp(22rem, 56vw, 40rem);
  padding: clamp(2rem, 7vw, 6rem);
}

.hero-stage::before,
.piece-stage::before {
  background:
    linear-gradient(#ffffffb8, #ffffffb8),
    repeating-linear-gradient(
      90deg,
      transparent 0 4.8rem,
      #d7d7d1 4.8rem calc(4.8rem + 1px)
    );
  content: "";
  inset: 0;
  opacity: 0.55;
  position: absolute;
}

.hero-stage img,
.piece-stage img,
.article .frame--photo {
  display: block;
  height: auto;
  max-width: 100%;
  outline: 1px solid oklch(0 0 0 / 0.1);
  outline-offset: -1px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.hero-stage img {
  filter: drop-shadow(0 2.2rem 2.5rem rgb(25 25 20 / 0.15));
  max-height: 38rem;
  object-fit: contain;
  width: auto;
}

.figure-stage {
  background: var(--figure);
  padding: clamp(1.5rem, 5vw, 4rem);
}

/* ── Home ─────────────────────────────────────────────── */

.home-head {
  margin: 0 auto;
  max-width: 58rem;
  padding: clamp(1rem, 5.5vw, 5rem) 1.25rem 0;
}

.home-kicker {
  font-size: 1rem;
  margin: 0 0 1.5rem;
}

.home-head h1 {
  font-size: clamp(3.1rem, 6.6vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.92;
  margin: 0;
  text-wrap: balance;
}

.home-head .dek {
  margin-left: 0;
  margin-top: 1.5rem;
  max-width: 36rem;
  text-align: left;
}

.home-copy {
  color: #4c4c48;
  font-size: clamp(1.08rem, 1.6vw, 1.25rem);
  letter-spacing: -0.012em;
  line-height: 1.55;
  margin: 1.25rem 0 0;
  max-width: 36rem;
}

.home-copy + .home-copy {
  margin-top: 0.75rem;
}

.work-head {
  font-size: var(--type-section);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
  margin: 0 auto;
  max-width: var(--wide);
  padding: clamp(3.5rem, 7vw, 6rem) 1.25rem 2.5rem;
  text-wrap: balance;
}

.work {
  display: grid;
  gap: 4.5rem 1.5rem;
  grid-template-columns: 1fr;
  margin: 0 auto;
  max-width: var(--wide);
  padding: 0 1.25rem 8rem;
}

.piece {
  color: inherit;
  display: grid;
  text-decoration: none;
}

.piece h2,
.piece h3 {
  font-size: clamp(1.85rem, 4vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin: 1.35rem 0 0.65rem;
  text-wrap: balance;
}

.piece p {
  color: #4c4c48;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  line-height: 1.5;
  max-width: 34rem;
}

.piece-stage {
  min-height: 16rem;
}

.piece-stage img {
  filter: drop-shadow(0 1.4rem 1.8rem rgb(25 25 20 / 0.12));
  object-fit: cover;
}

@media (hover: hover) and (pointer: fine) {
  .piece .piece-stage img {
    transform: scale(1);
    transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1);
  }

  .piece:hover .piece-stage img {
    transform: scale(1.02);
  }

  .piece:hover h3 {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.14em;
  }
}

@media (min-width: 52rem) {
  .work {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .piece--feature {
    grid-column: 1 / -1;
  }

  .piece--feature h2,
  .piece--feature h3 {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
  }

  .piece--feature .piece-stage {
    min-height: clamp(22rem, 48vw, 34rem);
  }
}

.cycle {
  display: inline-grid;
  height: 1.2em;
  place-items: center;
  vertical-align: middle;
  width: 1.35em;
}

.cycle span {
  animation: cycle 14s infinite;
  grid-area: 1 / 1;
  line-height: 1;
  opacity: 0;
}

.cycle span:nth-child(2) {
  animation-delay: 3.5s;
}

.cycle span:nth-child(3) {
  animation-delay: 7s;
}

.cycle span:nth-child(4) {
  animation-delay: 10.5s;
}

.cycle .star {
  color: #e4002b;
  font-size: 1.2em;
}

@keyframes cycle {
  0%,
  1% {
    opacity: 0;
  }
  3%,
  22% {
    opacity: 1;
  }
  24%,
  100% {
    opacity: 0;
  }
}

.copy-email {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: #a3a39d;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.copy-email:hover {
  text-decoration-color: currentcolor;
}

/* ── Gallery ──────────────────────────────────────────── */

.grid-shots {
  display: grid;
  gap: 1px;
  grid-template-columns: 1fr;
  margin: 0 auto;
  max-width: 90rem;
  padding: 1.25rem 1.25rem 6rem;
}

.tile {
  aspect-ratio: 3 / 2;
  background: var(--figure);
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

@media (min-width: 34rem) {
  .grid-shots {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 52rem) {
  .grid-shots {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Reviews ──────────────────────────────────────────── */

.quotes {
  display: grid;
  gap: 0;
  margin: 0 auto;
  max-width: var(--reading);
  padding: 0 1.25rem 8rem;
}

.quote {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0;
}

.quote blockquote {
  border: 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin: 0;
  padding: 0;
}

.quote p {
  text-indent: -0.42em;
}

/* ── Resume / about blocks ────────────────────────────── */

.page-article {
  margin: 0 auto;
  max-width: var(--reading);
  padding: 0 1.25rem 8rem;
}

.page-article .lead {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  letter-spacing: -0.025em;
  line-height: 1.45;
  margin: 0 0 3em;
}

.page-article .block {
  border: 0;
  display: block;
  padding: 0;
}

.page-article .block ~ .block {
  margin-top: 4.5rem;
}

.page-article h2,
.page-article h3 {
  font-size: var(--type-section-compact);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
  margin: 0 0 0.4em;
  text-wrap: balance;
}

.page-article h2 .dim,
.page-article h3 .dim {
  display: block;
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  margin-top: 0.7rem;
}

.page-article h4,
.page-article .role {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0;
}

.page-article .chapter {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  margin: 0;
}

.page-article p,
.page-article li {
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  letter-spacing: 0;
  line-height: 1.58;
}

.page-article p + p {
  margin-top: 1.15em;
}

.page-article .tight > * + * {
  margin-top: 1.15em;
}

.page-article .tight > .role + p {
  margin-top: 0.4em;
}

.page-article .tight > p + ul,
.page-article .tight > p + .chapter {
  margin-top: 1.6em;
}

.page-article .tight > .chapter {
  margin-top: 2rem;
}

.page-article .tight > .chapter + ul {
  margin-top: 0.55em;
}

.page-article ul {
  display: grid;
  gap: 1rem;
  margin: 0.7rem 0 0;
}

.page-article li {
  padding-inline-start: 0;
  position: relative;
}

.page-article li::before {
  color: var(--muted);
  content: "•";
  inset-inline-start: -0.9rem;
  line-height: inherit;
  position: absolute;
  top: 0.06em;
}

.page-article .shot {
  margin: 0 0 1.75rem;
}

.page-article .spec {
  display: grid;
  row-gap: 0;
}

.page-article .spec dt {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  margin: 0;
}

.page-article .spec dt:not(:first-child) {
  margin-top: 2rem;
}

.page-article .spec dd {
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  letter-spacing: 0;
  line-height: 1.55;
  margin: 0.45rem 0 0;
}

.page-article .frame--photo {
  background: var(--figure);
}

.resume .article-head h1 {
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.resume .dek {
  max-width: 36rem;
}

.print-contact {
  display: none;
}

/* ── Case-study overlay (savings card and similar) ────── */

.study .cs-head,
.study .article-head {
  margin: 0 auto;
  max-width: 58rem;
  padding: clamp(5rem, 12vw, 10rem) 1.25rem 0;
  text-align: center;
}

.study .cs-head h1,
.study .article-head h1 {
  font-size: var(--type-display);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.92;
  text-wrap: balance;
}

.study .gist {
  margin: 0 auto;
  max-width: 40rem;
  padding: 2.25rem 1.25rem clamp(4rem, 9vw, 7rem);
  text-align: center;
}

.study .gist p {
  color: #4c4c48;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  letter-spacing: -0.02em;
  line-height: 1.45;
  text-indent: 0;
  text-wrap: balance;
}

.study .gist p + p {
  margin-top: 1.4rem;
}

.study .gist strong {
  color: var(--ink);
  font-weight: 500;
}

.study .statbar {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0 auto;
  max-width: var(--reading);
  padding: 0 1.25rem;
}

.study .statbar div {
  display: block;
  padding: 1.3rem 0;
}

.study .statbar div:nth-child(odd) {
  border-right: 1px solid var(--line);
  padding-right: 1.3rem;
}

.study .statbar div:nth-child(even) {
  padding-left: 1.3rem;
}

.study .statbar div:nth-child(-n + 2) {
  border-bottom: 1px solid var(--line);
}

.study .statbar .dim {
  color: var(--muted);
  display: block;
  font-size: 0.75rem;
}

.study .statbar .stat {
  display: block;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin-top: 0.3rem;
}

.study .block {
  border: 0;
  display: block;
  margin: 0 auto;
  max-width: var(--reading);
  padding: clamp(4.5rem, 9vw, 7rem) 1.25rem 0;
}

.study .block h2 {
  font-size: var(--type-section);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
  margin: 0 0 0.4em;
  text-wrap: balance;
}

.study .tight {
  max-width: none;
}

.study .tight p,
.study .tight li {
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  letter-spacing: -0.012em;
  line-height: 1.66;
}

.study .tight > * + * {
  margin-top: 1.15em;
}

.study .tight blockquote {
  border-left: 0.28rem solid var(--ink);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin: 2.25em 0;
  padding-left: 1.25rem;
}

.study .diagram,
.study .savings-hero,
.study .sj {
  background: var(--figure);
  border: 0;
  margin: clamp(4rem, 9vw, 7rem) auto 0;
  max-width: var(--wide);
  overflow-x: auto;
  padding: clamp(1.5rem, 5vw, 4rem);
  width: calc(100% - 2.5rem);
}

.study figcaption {
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.45;
  margin: 0.8rem auto 0;
  max-width: var(--reading);
}

.study .next {
  margin-top: 5rem;
}

.study .note {
  font-size: 0.92rem;
}

/* ── Gate ─────────────────────────────────────────────── */

.gate {
  background: var(--canvas);
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font-family: inherit;
  max-height: calc(100dvh - 4rem);
  overflow-y: auto;
  padding: 1.5rem;
  width: min(23rem, calc(100vw - 2.5rem));
}

.gate::backdrop {
  background: rgb(255 255 255 / 0.88);
}

.gate-open {
  overflow: hidden;
}

.gate-form {
  display: grid;
  gap: 1rem;
}

.gate-form h2 {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.gate-intro {
  margin-top: -0.5rem;
}

.gate-field {
  display: grid;
  gap: 4px;
}

.gate-field label {
  color: var(--muted);
}

.gate-field input {
  appearance: none;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 0;
  color: inherit;
  font: inherit;
  padding: 9px 10px;
  width: 100%;
}

.gate-field input:focus-visible {
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.gate-field input[aria-invalid="true"] {
  border-color: var(--ink);
  border-width: 2px;
  padding: 8px 9px;
}

.gate-error {
  color: var(--ink);
}

.gate-error:empty {
  display: none;
}

.gate-actions {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.gate-go {
  background: var(--canvas);
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 9px 14px;
}

@media (hover: hover) and (pointer: fine) {
  .gate-go:hover {
    background: var(--ink);
    color: var(--canvas);
  }
}

.gate-go:active {
  transform: scale(0.96);
}

.gate-off,
.gate-fix {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: #a3a39d;
  text-underline-offset: 0.18em;
}

.gate-wall {
  display: none;
}

.gate-locked
  main
  > *:not(.article-head):not(.cs-head):not(.gate-wall):not(.home-head) {
  display: none;
}

.gate-locked .gate-secret {
  display: none;
}

.gate-locked .gate-wall {
  display: grid;
  gap: 1rem;
  justify-items: start;
  margin: 0 auto;
  max-width: var(--reading);
  padding: clamp(4rem, 10vw, 8rem) 1.25rem 7rem;
}

.gate-locked .article-head + .gate-wall,
.gate-locked .cs-head + .gate-wall {
  padding-top: 0;
}

.gate-wall h1 {
  font-size: var(--type-display);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.92;
  text-wrap: balance;
}

.gate-locked .gate-wall p {
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  line-height: 1.66;
}

.gate-locked .article-head {
  padding-bottom: 2rem;
}

.gate-ask {
  display: none;
}

.has-gate-ask .gate-ask {
  display: inline-block;
}

@keyframes gate-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.gate[open] {
  animation: gate-in 160ms ease-out;
}

/* ── Breakpoints ──────────────────────────────────────── */

@media (max-width: 45rem) {
  .site-header.site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .site-header .site-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .article-head,
  .cs-head,
  .home-head,
  .study .cs-head,
  .study .gist {
    text-align: left;
  }

  .dek,
  .home-head .dek,
  .study .gist p {
    margin-left: 0;
    text-wrap: pretty;
  }

  .byline {
    justify-content: flex-start;
  }

  .facts,
  .study .statbar {
    grid-template-columns: 1fr;
  }

  .fact:nth-child(odd),
  .study .statbar div:nth-child(odd) {
    border-right: 0;
    padding-right: 0;
  }

  .fact:nth-child(even),
  .study .statbar div:nth-child(even) {
    padding-left: 0;
  }

  .fact:not(:last-child),
  .study .statbar div:not(:last-child) {
    border-bottom: 1px solid var(--line);
  }
}

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

  .cycle span {
    animation: none;
    opacity: 0;
  }

  .cycle span:first-child {
    opacity: 1;
  }

  .gate[open],
  .piece .piece-stage img {
    animation: none;
    transition: none;
  }

  .gate-go:active,
  .piece:hover .piece-stage img {
    transform: none;
  }
}

@media print {
  @page {
    margin: 14mm 14mm;
  }

  html {
    font-size: 10.5pt;
  }

  .site-nav,
  .skip,
  .page-footer-links {
    display: none !important;
  }

  .site-header,
  .page-footer {
    border: 0;
    padding: 0 0 8pt;
  }

  .article-head {
    padding: 0 0 12pt;
    text-align: left;
  }

  .article-head h1,
  .page-article h2,
  .page-article h3 {
    font-size: 18pt;
    letter-spacing: -0.03em;
  }

  .print-contact {
    display: block !important;
    margin: 0 0 12pt;
  }

  .page-article .block,
  li {
    break-inside: avoid;
  }

  a {
    text-decoration: none;
  }
}
