/* ============================================================
   +Plastic Electronics — shared stylesheet
   Editorial trade-magazine system: Instrument Serif display,
   Geist body, JetBrains Mono meta. Warm off-white canvas,
   1px hairlines, restrained polymer-green accent.
   ============================================================ */

:root {
  --canvas: #FBFBFA;
  --surface: #FFFFFF;
  --ink: #1A1A19;
  --muted: #787774;
  --hairline: #EAEAEA;
  --accent: #1D6E42;
  --accent-ink: #175837;
  --pale-green-bg: #EDF3EC; --pale-green-fg: #346538;
  --pale-blue-bg: #E1F3FE;  --pale-blue-fg: #1F6C9F;
  --pale-yellow-bg: #FBF3DB; --pale-yellow-fg: #956400;
  --pale-red-bg: #FDEBEC;   --pale-red-fg: #9F2F2D;
  --display: 'Instrument Serif', 'Newsreader', Georgia, serif;
  --sans: 'Geist', 'Switzer', 'SF Pro Display', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Geist Mono', ui-monospace, monospace;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--hairline); transition: text-decoration-color 160ms ease; }
a:hover { text-decoration-color: var(--ink); }
p a { text-decoration-color: #cfcfcb; }
p a:hover { text-decoration-color: var(--ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.wrap--narrow { max-width: 860px; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ============ TOP UTILITY BAR ============ */
.topbar { border-bottom: 1px solid var(--hairline); }
.topbar .wrap {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-top: 10px; padding-bottom: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.topbar .tagline { display: none; }
.topbar .links { display: flex; gap: 18px; }
.topbar a { color: var(--muted); text-decoration: none; }
.topbar a:hover { color: var(--ink); }
@media (min-width: 760px) { .topbar .tagline { display: block; } }

/* ============ MASTHEAD ============ */
.masthead { padding: 40px 0 0; }
.masthead .wrap {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0;
  text-decoration: none;
  display: inline-block;
}
.wordmark .plus { color: var(--accent); }
.masthead .meta {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  text-align: right; padding-bottom: 10px;
}
@media (max-width: 759px) { .masthead .meta { display: none; } }

/* ============ NAV ============ */
.nav { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--hairline); margin-top: 22px; position: sticky; top: 0; z-index: 40; background: rgba(251,251,250,0.92); backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px); }
.nav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-top: 0; padding-bottom: 0; }
.nav .wrap::-webkit-scrollbar { display: none; }
.nav a {
  font: 500 13.5px/1 var(--sans);
  text-decoration: none; white-space: nowrap;
  padding: 15px 14px; letter-spacing: 0.01em;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.nav a:hover { color: var(--muted); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.nav .home-link { font-family: var(--display); font-size: 16px; padding-right: 18px; }

/* ============ SECTION LABELS ============ */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 14px 0 6px;
}
.section-head h2 {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  margin: 0; color: var(--ink);
}
.section-head h2 .index { color: var(--muted); margin-right: 10px; }
.section-head .more { font: 500 13px/1 var(--sans); color: var(--muted); text-decoration: none; white-space: nowrap; }
.section-head .more:hover { color: var(--ink); }
.rule { border: none; border-top: 1px solid var(--ink); margin: 0; }

/* ============ LEAD GRID (homepage) ============ */
.lead-grid {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 0 56px; padding: 36px 0 48px;
}
.kicker {
  display: inline-block;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-ink);
  padding: 4px 10px; background: var(--pale-green-bg); border-radius: 999px;
  margin-bottom: 18px;
}
.lead-grid h1, .lead-article h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1.06; letter-spacing: -0.025em;
  margin: 0 0 16px;
}
.lead-grid h1 a, .lead-article h1 a { text-decoration: none; }
.lead-grid h1 a:hover, .lead-article h1 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--hairline); }
.deck {
  font-size: 18.5px; line-height: 1.5; color: var(--muted);
  max-width: 52ch; margin: 0 0 20px;
}
.byline {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
}
.byline .sep { color: var(--hairline); }
.figure { margin: 26px 0 0; }
.figure figcaption, .figcap {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em;
  color: var(--muted); padding-top: 10px; border-top: 1px solid var(--hairline); margin-top: 12px;
  line-height: 1.6;
}

/* Latest rail */
.latest { border-left: 1px solid var(--hairline); padding-left: 40px; }
.latest ol { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: latest; }
.latest li { counter-increment: latest; border-top: 1px solid var(--hairline); padding: 16px 0 18px; }
.latest li:first-child { border-top: none; padding-top: 4px; }
.latest .num {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.1em; display: block; margin-bottom: 6px;
}
.latest .num::before { content: counter(latest, decimal-leading-zero); margin-right: 8px; }
.latest h3 { font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1.18; letter-spacing: -0.01em; margin: 0 0 8px; }
.latest h3 a { text-decoration: none; }
.latest h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.latest .meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ============ ARTICLE ROWS (section blocks) ============ */
.story-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 56px; padding: 8px 0 40px;
}
.story-row--3 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.story-block { padding: 6px 0 18px; }
.story-block h3 { font-family: var(--display); font-weight: 400; font-size: 25px; line-height: 1.14; letter-spacing: -0.015em; margin: 12px 0 10px; }
.story-block h3 a { text-decoration: none; }
.story-block h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.story-block p { font-size: 15px; color: var(--muted); line-height: 1.6; margin: 0 0 12px; max-width: 46ch; }
.story-block .byline { font-size: 10.5px; }
.story-block .figure { margin: 14px 0 0; }
.story-block + .story-block { border-top: 1px solid var(--hairline); }

/* ============ NEWSLETTER ============ */
.newsletter { border-top: 1px solid var(--ink); padding: 64px 0 72px; }
.newsletter .inner {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 48px; align-items: center;
}
.newsletter h2 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 12px; }
.newsletter p { color: var(--muted); font-size: 15.5px; margin: 0; max-width: 44ch; }
.newsletter form { display: flex; gap: 10px; }
.newsletter input[type="email"] {
  flex: 1; min-width: 0; font: 400 14.5px/1 var(--sans); color: var(--ink);
  padding: 13px 14px; border: 1px solid var(--hairline); border-radius: 8px;
  background: var(--surface);
}
.newsletter input[type="email"]::placeholder { color: #A5A4A0; }
.newsletter input[type="email"]:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: transparent; }
.btn {
  font: 500 14px/1 var(--sans); letter-spacing: 0.01em;
  padding: 13px 22px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: var(--canvas);
  transition: transform 180ms cubic-bezier(0.16,1,0.3,1), background 160ms ease;
}
.btn:hover { background: #2A2A28; }
.btn:active { transform: scale(0.98); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn--ghost:hover { background: var(--surface); }

/* ============ ABOUT STRIP ============ */
.about-strip { border-top: 1px solid var(--hairline); padding: 48px 0 56px; }
.about-strip .cols { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 40px; }
.about-strip h3 { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.about-strip p { font-size: 14.5px; color: var(--muted); line-height: 1.65; margin: 0 0 10px; }
.about-strip a { color: var(--ink); }

/* ============ FOOTER ============ */
footer { border-top: 1px solid var(--ink); }
footer .cols {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; padding: 44px 0;
}
footer h3 { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
footer p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0 0 10px; max-width: 34ch; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 9px; }
footer a { color: var(--muted); text-decoration: none; font-size: 14px; }
footer a:hover { color: var(--ink); text-decoration: underline; }
footer .brandline { font-family: var(--display); font-size: 22px; letter-spacing: -0.01em; }
footer .brandline .plus { color: var(--accent); }
footer .bottom {
  border-top: 1px solid var(--hairline); padding: 18px 0 26px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
}

/* ============ ARTICLE PAGE ============ */
.crumbs {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  padding: 26px 0 22px;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { margin: 0 8px; color: #C9C8C4; }

.article-head { max-width: 760px; padding-bottom: 8px; }
.article-head h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(36px, 5vw, 58px); line-height: 1.05; letter-spacing: -0.025em;
  margin: 14px 0 18px;
}
.article-head .deck { font-size: 19.5px; }
.article-head .byline { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 12px 2px; margin-top: 22px; }

.article-body { max-width: 68ch; margin: 0 auto; padding: 40px 0 24px; font-size: 17px; line-height: 1.7; }
.article-body p { margin: 0 0 1.5em; }
.article-body h2 { font-family: var(--display); font-weight: 400; font-size: 27px; line-height: 1.15; letter-spacing: -0.015em; margin: 2em 0 0.6em; }
.article-body h2:first-child { margin-top: 0; }
.article-body ul, .article-body ol { margin: 0 0 1.5em; padding-left: 1.3em; }
.article-body li { margin-bottom: 0.6em; }
.article-body .figure { margin: 34px 0 38px; }
.article-body .figure svg { border: 1px solid var(--hairline); background: var(--surface); border-radius: 8px; }

.pullquote {
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: clamp(24px, 3vw, 30px); line-height: 1.3; letter-spacing: -0.01em;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  padding: 30px 0; margin: 44px 0 44px;
  max-width: 34ch;
}

.keynumbers { border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface); padding: 22px 24px 8px; margin: 34px 0; }
.keynumbers h3 { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.keynumbers dl { display: grid; grid-template-columns: auto 1fr; gap: 12px 22px; margin: 0; padding: 0 0 14px; }
.keynumbers dt { font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; }
.keynumbers dd { font-size: 14px; color: var(--muted); margin: 0; align-self: center; }

.sources { border-top: 1px solid var(--ink); margin: 46px 0 0; padding-top: 18px; }
.sources h3 { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.sources ol { margin: 0; padding-left: 1.4em; font-size: 14px; color: var(--muted); line-height: 1.7; }
.sources li { margin-bottom: 4px; }
.sources a { word-break: break-word; }

.author-box { border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface); padding: 22px 24px; margin: 34px 0 0; display: flex; gap: 18px; align-items: flex-start; }
.author-box .avatar {
  width: 46px; height: 46px; border-radius: 999px; flex: none;
  background: var(--ink); color: var(--canvas);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 19px;
}
.author-box h3 { font-family: var(--display); font-weight: 400; font-size: 19px; margin: 0 0 6px; letter-spacing: -0.01em; }
.author-box p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.6; }

/* ============ TRUST PAGES ============ */
.page-head { padding: 44px 0 8px; max-width: 760px; }
.page-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 4.6vw, 52px); line-height: 1.05; letter-spacing: -0.025em; margin: 0 0 14px; }
.page-head .deck { margin-bottom: 0; }
.page-body { max-width: 68ch; margin: 0 auto; padding: 30px 0 60px; font-size: 16.5px; line-height: 1.7; }
.page-body h2 { font-family: var(--display); font-weight: 400; font-size: 25px; line-height: 1.15; letter-spacing: -0.015em; margin: 2em 0 0.6em; }
.page-body p { margin: 0 0 1.4em; }
.page-body ul { margin: 0 0 1.4em; padding-left: 1.3em; }
.page-body li { margin-bottom: 0.5em; }

/* ============ SVG FIGURES (charts) ============ */
.chart text { font-family: var(--mono); }
.chart .axis { stroke: var(--hairline); stroke-width: 1; }
.chart .gridline { stroke: #F0F0EE; stroke-width: 1; }
.chart .bar { fill: var(--ink); }
.chart .bar--accent { fill: var(--accent); }
.chart .val { font-size: 13px; font-weight: 500; fill: var(--ink); }
.chart .lbl { font-size: 11px; fill: var(--muted); letter-spacing: 0.04em; }
.chart .note { font-size: 10.5px; fill: var(--muted); }
.chart .trend { stroke: var(--muted); stroke-width: 1.25; fill: none; stroke-dasharray: 4 4; }

/* ============ MOTION ============ */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms cubic-bezier(0.16,1,0.3,1), transform 600ms cubic-bezier(0.16,1,0.3,1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============ AUTHOR PAGES & MASTHEAD ============ */
.author-head { display: flex; gap: 26px; align-items: flex-start; padding: 44px 0 8px; max-width: 860px; }
.author-head .avatar-lg {
  width: 92px; height: 92px; border-radius: 999px; flex: none;
  background: var(--ink); color: var(--canvas);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 38px;
}
.author-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 4vw, 46px); line-height: 1.05; letter-spacing: -0.025em; margin: 6px 0 10px; }
.author-head .role { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink); display: block; margin-bottom: 12px; }
.author-head .bio { font-size: 16px; color: var(--muted); line-height: 1.65; max-width: 60ch; margin: 0; }
.author-articles { padding: 26px 0 40px; }
.author-articles h2 { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 6px; }
.author-articles .story-block { border-top: 1px solid var(--hairline); padding: 18px 0; }
.author-articles .story-block:first-of-type { border-top: none; }

/* ============ ARCHIVE TIMELINE ============ */
.timeline { list-style: none; margin: 0; padding: 8px 0 30px; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 30px; padding: 22px 0; border-top: 1px solid var(--hairline); }
.timeline li:first-child { border-top: none; }
.timeline .year { font-family: var(--display); font-size: 30px; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }
.timeline .era { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: block; margin-top: 6px; }
.timeline h3 { font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 8px; }
.timeline p { font-size: 14.5px; color: var(--muted); line-height: 1.65; margin: 0; max-width: 62ch; }
.timeline p a { color: var(--ink); }

/* ============ RESPONSE ============ */
@media (max-width: 960px) {
  .lead-grid { grid-template-columns: 1fr; gap: 36px 0; }
  .latest { border-left: none; padding-left: 0; border-top: 1px solid var(--ink); padding-top: 18px; }
  .story-row, .story-row--3 { grid-template-columns: 1fr; gap: 0; }
  .newsletter .inner { grid-template-columns: 1fr; gap: 28px; }
  .about-strip .cols { grid-template-columns: 1fr; gap: 30px; }
  footer .cols { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  footer .cols { grid-template-columns: 1fr; }
  .newsletter form { flex-direction: column; }
  .newsletter .btn { width: 100%; }
  .article-body, .page-body { font-size: 16.5px; }
  .keynumbers dl { grid-template-columns: 1fr; gap: 4px 0; }
  .keynumbers dd { margin-bottom: 10px; }
  .author-box { flex-direction: column; }
  .author-head { flex-direction: column; gap: 18px; }
  .timeline li { grid-template-columns: 1fr; gap: 8px; }
  .timeline .year { font-size: 24px; }
}

/* ============ ARTICLE HERO IMAGE ============ */
figure.hero { margin: 0 0 34px; }
figure.hero img {
  width: 100%; height: auto; aspect-ratio: 16 / 9;
  border: 1px solid var(--hairline); border-radius: 2px; background: var(--surface);
}
figure.hero figcaption {
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  color: var(--muted); margin-top: 10px; padding-left: 2px;
}
