:root {
  --ink: #14161a;
  --charcoal: #20252b;
  --cream: #fff8ec;
  --paper: #f7f1e6;
  --line: #dfd2bd;
  --red: #d83a1f;
  --orange: #f26a2e;
  --eucalypt: #5c7c63;
  --sky: #6ea6b8;
  --heading: "Space Grotesk", sans-serif;
  --body: "Inter", sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--body); line-height: 1.65; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.skip-link { position: fixed; z-index: 100; top: .8rem; left: .8rem; padding: .7rem 1rem; transform: translateY(-180%); background: var(--cream); color: var(--ink); font-weight: 800; }
.skip-link:focus { transform: none; }
.notes-shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }

.notes-header { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid #ffffff1f; background: #14161af5; color: var(--cream); backdrop-filter: blur(14px); }
.header-row { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.notes-brand { display: inline-flex; align-items: center; gap: .75rem; color: inherit; font-family: var(--heading); font-size: .84rem; font-weight: 700; letter-spacing: .12em; line-height: 1.05; text-decoration: none; }
.notes-brand small { display: block; margin-top: .28rem; font-family: var(--mono); font-size: .52rem; font-weight: 500; letter-spacing: .2em; opacity: .64; }
.brand-mark { display: grid; width: 42px; aspect-ratio: 1; place-items: center; border: 2px solid var(--red); color: var(--orange); font-family: var(--heading); font-weight: 700; letter-spacing: -.08em; transform: rotate(-2deg); }
.notes-header nav { display: flex; align-items: center; gap: clamp(1rem, 2vw, 1.55rem); font-size: .88rem; font-weight: 700; }
.notes-header nav a { color: #fff8ecc2; text-decoration: none; }
.notes-header nav a:hover, .notes-header nav a[aria-current="page"] { color: #ffb18c; }

.notes-hero { overflow: hidden; padding: clamp(4.5rem, 8vw, 7.5rem) 0 clamp(3.5rem, 7vw, 6rem); color: var(--cream); background: var(--ink); position: relative; }
.notes-hero::after { content: ""; position: absolute; right: -10vw; bottom: 20%; width: 42vw; height: 1px; background: var(--red); box-shadow: 0 14px var(--orange), 0 28px var(--eucalypt); transform: rotate(-12deg); opacity: .65; }
.notes-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); align-items: end; gap: 7vw; }
.signal-label { margin: 0 0 1.25rem; color: var(--red); font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.signal-label span { margin-left: .5rem; color: var(--orange); letter-spacing: .24em; }
.notes-hero h1 { max-width: 820px; margin: 0; font-family: var(--heading); font-size: clamp(3.2rem, 7.5vw, 6.6rem); font-weight: 600; letter-spacing: -.055em; line-height: .91; }
.notes-intro { padding: 0 0 .6rem 1.5rem; border-left: 1px solid #fff8ec38; }
.notes-intro p { margin: 0 0 2rem; color: #fff8ecbd; font-size: clamp(1rem, 1.45vw, 1.18rem); }
.issue-stamp { color: var(--sky); font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; }

.notes-index { padding: 0 0 clamp(5rem, 9vw, 9rem); }
.note-filters { display: flex; gap: 0; overflow-x: auto; margin-bottom: clamp(3.5rem, 7vw, 6.5rem); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.note-filter { flex: none; padding: 1.25rem 1.5rem 1rem; border-bottom: 3px solid transparent; font-family: var(--mono); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.note-filter:hover, .note-filter.is-active { border-color: var(--red); color: var(--red); }

.featured-story { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); min-height: 480px; margin-bottom: clamp(4rem, 8vw, 7rem); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.featured-visual { min-height: 420px; overflow: hidden; background: var(--charcoal); }
.featured-visual img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.84) contrast(1.06); transition: transform .65s cubic-bezier(.2,.7,.2,1); }
.featured-visual:hover img { transform: scale(1.025); }
.signal-field { height: 100%; min-height: 420px; display: grid; align-content: center; gap: 1.5rem; padding: 10%; background: radial-gradient(circle at 70% 15%, #6ea6b829, transparent 30%), var(--charcoal); }
.signal-field i { display: block; height: 2px; background: var(--red); }
.signal-field i:nth-child(2) { width: 76%; background: var(--orange); }
.signal-field i:nth-child(3) { width: 44%; background: var(--eucalypt); }
.signal-field b { margin-top: 3rem; color: #fff8ec10; font-family: var(--heading); font-size: clamp(8rem, 20vw, 17rem); font-weight: 600; line-height: .7; }
.featured-copy { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 5vw, 4.7rem); background: var(--paper); }
.featured-copy .issue-number { position: absolute; top: 2rem; right: 2rem; }
.issue-number { color: var(--red); font-family: var(--mono); font-size: .76rem; font-weight: 700; letter-spacing: .08em; }
.story-meta { display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; color: #4f555b; font-family: var(--mono); font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.story-meta span:not(:last-child)::after { content: "/"; margin-left: 1.2rem; color: var(--orange); }
.featured-copy h2 { max-width: 560px; margin: 1.7rem 0 1.1rem; font-family: var(--heading); font-size: clamp(2.15rem, 4vw, 3.5rem); font-weight: 600; letter-spacing: -.045em; line-height: 1; }
.featured-copy h2 a, .story-card h2 a { text-decoration: none; }
.featured-copy h2 a:hover, .story-card h2 a:hover { color: var(--red); }
.featured-copy p { margin: 0 0 1.7rem; color: #44494f; }
.text-link { width: fit-content; padding-bottom: .15rem; border-bottom: 2px solid var(--red); font-family: var(--mono); font-size: .76rem; font-weight: 700; letter-spacing: .05em; text-decoration: none; text-transform: uppercase; }
.text-link span { color: var(--red); transition: margin .2s; }
.text-link:hover span { margin-left: .3rem; }

.story-grid { display: grid; grid-template-columns: repeat(12, 1fr); border-top: 1px solid var(--line); }
.story-card { grid-column: span 4; display: flex; min-height: 390px; flex-direction: column; padding: 2rem clamp(1.3rem, 2.7vw, 2.2rem) 1.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.story-card:nth-child(3n) { border-right: 0; }
.story-index { display: flex; align-items: center; gap: 1rem; margin-bottom: 3rem; color: var(--red); font-family: var(--mono); font-size: .72rem; font-weight: 700; }
.story-index i { width: 42px; height: 1px; background: var(--orange); }
.story-card h2 { margin: 1.2rem 0 .8rem; font-family: var(--heading); font-size: clamp(1.45rem, 2.5vw, 2rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.12; }
.story-card > p { margin: 0 0 2rem; color: #50545a; font-size: .94rem; }
.story-card footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; color: #555a5e; font-family: var(--mono); font-size: .68rem; text-transform: uppercase; }
.story-card footer a { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--ink); color: var(--red); text-decoration: none; transition: .2s; }
.story-card footer a:hover { background: var(--ink); color: var(--cream); }

.notes-empty { max-width: 740px; padding: clamp(4rem, 10vw, 8rem) 0; }
.notes-empty .issue-number { display: block; margin-bottom: 1.5rem; font-size: 1rem; }
.notes-empty h1, .notes-empty h2 { margin: 0 0 1.2rem; font-family: var(--heading); font-size: clamp(2.3rem, 5vw, 4.4rem); letter-spacing: -.05em; line-height: 1; }
.notes-empty p { max-width: 600px; margin: 0 0 2rem; color: #4b5054; font-size: 1.1rem; }
.notes-empty-page { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }

.article-head { padding: clamp(4.5rem, 9vw, 8rem) 0 clamp(3rem, 6vw, 5rem); background: var(--ink); color: var(--cream); }
.article-head-grid { display: grid; grid-template-columns: 130px minmax(0, 900px); gap: 4vw; }
.article-index { display: flex; flex-direction: column; gap: .7rem; padding-top: .55rem; color: #fff8ec70; font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; }
.article-index .issue-number { font-size: 1.1rem; }
.article-head h1 { max-width: 980px; margin: 0; font-family: var(--heading); font-size: clamp(3rem, 7vw, 6.2rem); font-weight: 600; letter-spacing: -.055em; line-height: .94; }
.article-deck { max-width: 760px; margin: 2rem 0 0; color: #fff8ecc2; font-size: clamp(1.12rem, 2vw, 1.35rem); }
.article-byline { display: flex; flex-wrap: wrap; gap: .7rem 1.6rem; margin-top: 2.4rem; color: var(--sky); font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.article-byline span:not(:last-child)::after { content: "/"; margin-left: 1.6rem; color: var(--orange); }
.article-image { margin-top: -1px; }
.article-image img { width: 100%; max-height: 700px; object-fit: cover; }
.article-image figcaption { padding: .8rem 0; border-bottom: 1px solid var(--line); color: #5b6064; font-family: var(--mono); font-size: .67rem; }
.article-layout { display: grid; grid-template-columns: 170px minmax(0, 720px); gap: clamp(2rem, 7vw, 7rem); padding-top: clamp(4rem, 8vw, 7rem); padding-bottom: clamp(5rem, 10vw, 9rem); }
.article-rail { color: #666b6e; font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; }
.article-rail .rail-line { display: block; width: 100%; height: 2px; margin-bottom: 1.2rem; background: var(--red); box-shadow: 0 7px var(--orange); }
.article-rail p { margin: 1.6rem 0 .2rem; }
.article-rail strong { color: var(--ink); }
.article-prose { min-width: 0; font-size: clamp(1.02rem, 1.4vw, 1.12rem); }
.article-prose > p:first-child { margin-top: 0; font-size: 1.15em; }
.article-prose p { margin: 0 0 1.6em; }
.article-prose h2, .article-prose h3, .article-prose h4 { margin: 2.1em 0 .65em; font-family: var(--heading); letter-spacing: -.035em; line-height: 1.1; }
.article-prose h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
.article-prose h3 { font-size: clamp(1.45rem, 3vw, 2rem); }
.article-prose a { color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.article-prose blockquote { margin: 2.5rem 0; padding: .5rem 0 .5rem 2rem; border-left: 4px solid var(--red); font-family: var(--heading); font-size: 1.35em; font-weight: 600; line-height: 1.35; }
.article-prose pre { max-width: 100%; overflow: auto; padding: 1.4rem; border-left: 4px solid var(--eucalypt); background: var(--charcoal); color: #eef1eb; font: .82rem/1.7 var(--mono); }
.article-prose code { font-family: var(--mono); font-size: .86em; }
.article-prose :not(pre) > code { padding: .12em .35em; background: #e8ddcc; }
.article-prose table { width: 100%; margin: 2rem 0; border-collapse: collapse; font-size: .9rem; }
.article-prose th, .article-prose td { padding: .7rem; border: 1px solid var(--line); text-align: left; }
.article-prose img { margin: 2rem 0; }
.article-sources { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--ink); }
.article-sources ol { padding-left: 1.4rem; }
.article-sources li { margin: .7rem 0; }
.article-tags { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.5rem; color: var(--eucalypt); font-family: var(--mono); font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.related-notes { padding: clamp(4rem, 8vw, 7rem) 0; background: var(--paper); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2.5rem; }
.section-heading h2 { margin: 0; font-family: var(--heading); font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.05em; }

.studio-cta { padding: clamp(4rem, 8vw, 7rem) 0; background: var(--red); color: var(--cream); }
.studio-cta .signal-label { color: #14161abf; }
.studio-cta .signal-label span { color: var(--cream); }
.studio-cta .notes-shell > div { display: flex; align-items: flex-end; justify-content: space-between; gap: 3rem; }
.studio-cta h2 { margin: 0; font-family: var(--heading); font-size: clamp(2.8rem, 7vw, 6rem); letter-spacing: -.06em; line-height: .9; }
.studio-cta a { flex: none; padding: .9rem 0; border-bottom: 2px solid var(--cream); font-family: var(--mono); font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; }
.notes-footer { padding: 4rem 0; background: var(--ink); color: var(--cream); }
.footer-grid { display: grid; grid-template-columns: 1.4fr .8fr .6fr; gap: 4rem; align-items: end; }
.notes-footer p { color: #fff8ec8f; font-size: .84rem; }
.notes-footer nav { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1.5rem; }
.notes-footer nav a { color: #fff8ecc2; font-size: .82rem; font-weight: 600; text-decoration: none; }
.footer-code { font-family: var(--mono); font-size: .65rem !important; letter-spacing: .08em; text-align: right; }

@media (max-width: 820px) {
  .header-row { min-height: auto; flex-wrap: wrap; gap: .65rem; padding-top: .7rem; }
  .notes-header nav { order: 3; width: 100%; gap: 1.25rem; overflow-x: auto; padding: .6rem 0 .75rem; border-top: 1px solid #fff8ec1f; white-space: nowrap; scrollbar-width: thin; }
  .notes-header nav a { flex: none; }
  .notes-hero-grid, .featured-story, .article-head-grid, .article-layout { grid-template-columns: 1fr; }
  .notes-hero-grid { gap: 2.5rem; }
  .notes-intro { max-width: 580px; }
  .featured-visual, .signal-field { min-height: 320px; }
  .story-card { grid-column: span 6; }
  .story-card:nth-child(3n) { border-right: 1px solid var(--line); }
  .story-card:nth-child(2n) { border-right: 0; }
  .article-index { flex-direction: row; }
  .article-rail { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-code { text-align: left; }
}

@media (max-width: 560px) {
  .notes-shell { width: min(100% - 28px, 1160px); }
  .notes-header nav { gap: .95rem; padding-right: 1rem; font-size: .8rem; scroll-padding-inline: 1rem; }
  .notes-hero { padding-top: 4rem; }
  .notes-hero h1, .article-head h1 { overflow-wrap: anywhere; }
  .note-filter { padding-inline: 1rem; }
  .featured-story { display: block; }
  .featured-copy { min-height: 400px; }
  .story-card { grid-column: 1 / -1; min-height: 340px; border-right: 0 !important; }
  .studio-cta .notes-shell > div { align-items: flex-start; flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .article-byline span::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
