@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #120d09;
  --bg-soft: #1b140f;
  --panel: rgba(29, 21, 16, 0.92);
  --panel-strong: rgba(19, 13, 9, 0.96);
  --panel-faint: rgba(255, 244, 229, 0.05);
  --text: #f4ead9;
  --muted: #d0bda1;
  --faint: #9e8569;
  --line: rgba(225, 190, 138, 0.18);
  --gold: #d7b06d;
  --gold-soft: #9a7340;
  --amber: #ffb14f;
  --ember: #ff7a2f;
  --blue: #8ed7ff;
  --blue-strong: #62c7ff;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
  --radius: 24px;
}

[data-theme="light"] {
  --bg: #120d09;
  --bg-soft: #1b140f;
  --panel: rgba(29, 21, 16, 0.92);
  --panel-strong: rgba(19, 13, 9, 0.96);
  --panel-faint: rgba(255, 244, 229, 0.05);
  --text: #f4ead9;
  --muted: #d7c2a5;
  --faint: #b79d80;
  --line: rgba(225, 190, 138, 0.18);
  --gold: #d7b06d;
  --gold-soft: #9a7340;
  --amber: #ffb14f;
  --ember: #ff7a2f;
  --blue: #8ed7ff;
  --blue-strong: #62c7ff;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 168, 76, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(89, 199, 255, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(44, 25, 10, 0.82), rgba(15, 10, 7, 0.98));
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.02), rgba(255,255,255,0.02)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 0, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 90px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 70px);
  opacity: 0.22;
  pointer-events: none;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--blue); }
img { max-width: 100%; display: block; }
.container { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(18, 13, 9, 0.92), rgba(18, 13, 9, 0.68));
  border-bottom: 1px solid var(--line);
}


.site-header .container,
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.logo,
.brand-mark {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.04em;
  min-height: 44px;
}

.logo-mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.25), transparent 30%), linear-gradient(135deg, #1f160f, #45311d 58%, #a87634 140%);
  display: inline-grid;
  place-items: center;
  box-shadow: inset 0 0 22px rgba(255, 191, 96, 0.14), 0 0 24px rgba(255, 177, 79, 0.1);
  color: var(--blue-strong);
  text-shadow: 0 0 12px rgba(98, 199, 255, 0.75);
  font-size: 1.05rem;
}

.brand-text { display: flex; flex-direction: column; }
.brand-kicker {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.28em;
}
.brand-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.7rem, 2vw, 2.25rem);
  font-weight: 700;
  line-height: 1;
}

nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--muted);
  padding: 0.8rem 1rem;
  border-radius: 999px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

nav a:hover,
nav a:focus-visible {
  background: rgba(255, 244, 229, 0.06);
  color: var(--text);
}


.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.theme-toggle,
.search-toggle,
button,
.reaction-button {
  min-height: 44px;
  min-width: 44px;
}

.theme-toggle,
.search-toggle,
button {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: var(--text);
  border-radius: 999px;
  padding: 0.85rem 1rem;
  font: inherit;
  cursor: pointer;
  transition: 160ms ease;
}


.theme-toggle:hover,
.search-toggle:hover,
button:hover {
  transform: translateY(-1px);
  border-color: rgba(142, 215, 255, 0.35);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.theme-toggle-corner {
  margin-left: auto;
}

.theme-toggle .icon {
  display: none;
}

.theme-toggle[data-mode="day"] .icon-sun,
.theme-toggle[data-mode="night"] .icon-moon {
  display: inline;
}

.nav-search-button {
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-search-shell {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 180ms ease, opacity 180ms ease, padding-top 180ms ease;
}

.site-header.search-open .header-search-shell {
  max-height: 90px;
  opacity: 1;
  padding-top: 0.45rem;
}

.search-input {
  width: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 0.8rem 1rem;
  font: inherit;
}

.search-input::placeholder { color: var(--faint); }
.site-header.search-open .search-input,
.search-input.visible {
  opacity: 1;
  pointer-events: auto;
}

.hero-shell,
.hero {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.5rem auto 0;
  position: relative;
}

.home-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.3rem;
  align-items: stretch;
}

.hero-copy,
.hero-visual,
.article-full,
article.content,
main > article.hero {
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

[data-theme="light"] .article-card,
[data-theme="light"] .article-full,
[data-theme="light"] article.content,
[data-theme="light"] main > article.hero,
[data-theme="light"] .feature-panel,
[data-theme="light"] .form-panel,
[data-theme="light"] .info-panel,
[data-theme="light"] .hero-copy {
  background: linear-gradient(180deg, rgba(245, 233, 209, 0.98), rgba(231, 214, 183, 0.98));
  border-color: rgba(122, 86, 42, 0.18);
  color: #2b1c12;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .article-card h3,
[data-theme="light"] .article-card .meta,
[data-theme="light"] .article-card .hook,
[data-theme="light"] .article-card .expanded,
[data-theme="light"] .feature-panel h3,
[data-theme="light"] .feature-panel p,
[data-theme="light"] .hero-copy h1,
[data-theme="light"] .hero-copy p,
[data-theme="light"] .hero-copy .eyebrow,
[data-theme="light"] .hero-stat,
[data-theme="light"] .hero-stat span,
[data-theme="light"] .hero-stat strong,
[data-theme="light"] .article-full h1,
[data-theme="light"] .article-full h2,
[data-theme="light"] .article-full h3,
[data-theme="light"] .article-full p,
[data-theme="light"] .article-full li,
[data-theme="light"] article.content h1,
[data-theme="light"] article.content h2,
[data-theme="light"] article.content h3,
[data-theme="light"] article.content p,
[data-theme="light"] article.content li,
[data-theme="light"] main > article.hero h1,
[data-theme="light"] main > article.hero h2,
[data-theme="light"] main > article.hero h3,
[data-theme="light"] main > article.hero p,
[data-theme="light"] main > article.hero li {
  color: #2b1c12;
}

[data-theme="light"] .article-card .meta,
[data-theme="light"] .article-card .hook,
[data-theme="light"] .article-card .expanded,
[data-theme="light"] .hero-copy .eyebrow,
[data-theme="light"] .article-full .meta,
[data-theme="light"] article.content .meta,
[data-theme="light"] .section-label {
  color: #6f5235;
}

[data-theme="light"] .primary-link,
[data-theme="light"] .secondary-link {
  color: #2b1c12;
}

.hero-copy {
  padding: clamp(1.6rem, 3vw, 3.25rem);
  position: relative;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 177, 79, 0.18), transparent 36%);
  pointer-events: none;
}

.eyebrow,
.meta,
.section-label {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

.hero h1,
.hero-copy h1,
.article-full h1,
main > article.hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3rem, 6vw, 5.6rem);
  line-height: 0.92;
  margin: 0.5rem 0 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero p,
.hero-copy p,
.article-content p,
article.content p,
.article-full li,
article.content li,
main > article.hero p {
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-actions,
.hero-metrics {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.primary-link,
.secondary-link {
  padding: 0.95rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.primary-link {
  background: linear-gradient(135deg, rgba(215,176,109,0.22), rgba(255,177,79,0.08));
  color: var(--text);
}

.secondary-link {
  background: rgba(255,255,255,0.03);
  color: var(--muted);
}

.hero-stat {
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  min-width: 148px;
}
.hero-stat strong {
  display: block;
  color: var(--text);
  font-size: 1.15rem;
}
.hero-stat span { color: var(--faint); font-size: 0.88rem; }

.hero-visual {
  min-height: 520px;
  background:
    linear-gradient(180deg, rgba(10,8,6,0.08), rgba(10,8,6,0.55)),
    url('assets/butler-lounge.png') center/cover no-repeat;
  position: relative;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: auto 1.25rem 1.25rem 1.25rem;
  height: 130px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(12,10,7,0), rgba(12,10,7,0.86));
}

.hero-caption {
  position: absolute;
  left: 1.4rem;
  bottom: 1.4rem;
  right: 1.4rem;
  z-index: 1;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(17, 12, 9, 0.7);
  border: 1px solid rgba(255,255,255,0.08);
}
.hero-caption strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.hero-caption span { color: var(--muted); font-size: 0.92rem; }

main.container { padding: 2rem 0 4rem; }
section { margin-top: 2rem; }
h2,
.article-content h2,
article.content h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  margin: 0 0 1rem;
  color: var(--text);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.section-head p { margin: 0; color: var(--muted); max-width: 620px; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.article-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(31, 22, 16, 0.96), rgba(18, 13, 9, 0.98));
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.article-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255,177,79,0.14), transparent 36%, rgba(98,199,255,0.08));
  opacity: 0.7;
  pointer-events: none;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(142, 215, 255, 0.32);
  box-shadow: 0 20px 44px rgba(0,0,0,0.28);
}

.article-card .content { padding: 1.4rem; position: relative; z-index: 1; }
.article-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  line-height: 1.02;
  margin: 0.45rem 0 0.75rem;
  color: var(--text);
}
.article-card .meta { font-size: 0.73rem; }
.article-card .hook,
.article-card .expanded { color: var(--muted); }
.article-card .expanded { display: none; margin-top: 0.9rem; }
.article-card .read-more {
  display: inline-flex;
  margin-top: 1rem;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
}
.article-card.preview .hook { display: none; }
.article-card.preview .expanded { display: block; }
.article-card.preview .read-more::before { content: 'Click again to open · '; color: var(--gold); }

.card-tag {
  display: inline-flex;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.feature-panel {
  padding: 1.2rem;
  border-radius: 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
.feature-panel h3 {
  margin: 0 0 0.6rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
}
.feature-panel p { margin: 0; color: var(--muted); }

.article-full,
article.content,
main > article.hero {
  padding: clamp(1.35rem, 3vw, 2.6rem);
}

main > article.hero {
  margin-bottom: 1rem;
  background:
    linear-gradient(135deg, rgba(215,176,109,0.12), transparent 42%),
    linear-gradient(180deg, var(--panel), var(--panel-strong));
}

main > article.hero .hook { font-size: 1.08rem; max-width: 900px; }
article.content { margin-top: 1rem; }

.article-hero-media {
  position: relative;
  margin: 1.5rem 0 0;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(225, 190, 138, 0.2);
  background:
    radial-gradient(circle at top left, rgba(255, 177, 79, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(19, 13, 9, 0.28), rgba(19, 13, 9, 0.72));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  isolation: isolate;
}

.article-hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 224, 182, 0.28), rgba(215, 176, 109, 0.08) 45%, rgba(98, 199, 255, 0.16));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.article-hero-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}

.article-hero-media figcaption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 11, 8, 0.18), rgba(15, 11, 8, 0.8));
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

.article-hero-media figcaption strong {
  color: var(--gold);
  margin-right: 0.35rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.article-full h1 { font-size: clamp(2.8rem, 5vw, 4.7rem); }
.article-full .meta,
main > article.hero .meta {
  margin: 0 0 1.35rem;
}
.article-content,
article.content {
  color: var(--text);
}
.article-content > *:first-child,
article.content > *:first-child { margin-top: 0; }
.article-content p,
article.content p { margin: 0 0 1.15rem; }
.article-content h2,
article.content h2 { margin-top: 2.2rem; }
.article-content h3,
article.content h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  margin: 1.6rem 0 0.7rem;
}
.article-content ul,
.article-content ol,
article.content ul,
article.content ol {
  margin: 0 0 1.25rem 1.3rem;
  color: var(--muted);
}
.article-content code,
article.content code {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--blue);
}
pre {
  overflow: auto;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(9, 8, 8, 0.72);
  border: 1px solid rgba(255,255,255,0.08);
}
.table-wrap {
  overflow-x: auto;
  margin: 1.4rem 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
th,
td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
thead th {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
tbody tr:last-child td {
  border-bottom: none;
}
td {
  color: var(--muted);
}
blockquote {
  margin: 1.4rem 0;
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--gold);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

.form-shell {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 1rem;
}
.form-panel,
.info-panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text);
  font-weight: 700;
}
.form-group input,
.form-group textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 0.95rem 1rem;
  font: inherit;
}
.form-group textarea { min-height: 160px; resize: vertical; }
.form-group input:focus,
.form-group textarea:focus,
.search-input:focus {
  outline: none;
  border-color: rgba(142, 215, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(98, 199, 255, 0.08);
}

.article-reactions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.reaction-button {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 0.8rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}
.reaction-button:hover {
  border-color: rgba(142, 215, 255, 0.35);
  color: var(--blue);
}
.count { font-weight: 700; }

footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12,9,7,0.12), rgba(12,9,7,0.44));
  margin-top: 3rem;
}
footer .container,
footer {
  color: var(--muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 1rem;
}
.footer-grid h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--text);
  margin: 0 0 0.7rem;
}
.footer-grid p,
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--blue); }
.footer-meta {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hidden { display: none !important; }

@media (max-width: 960px) {
  .home-hero,
  .form-shell,
  .feature-band,
  .footer-grid { grid-template-columns: 1fr; }

  .hero-visual {
    min-height: 360px;
    order: -1;
  }

  .hero-caption {
    max-width: min(92%, 28rem);
  }
}

@media (max-width: 720px) {
  html {
    font-size: 15px;
  }

  body {
    line-height: 1.6;
  }

  .container,
  .hero-shell,
  .hero {
    width: min(100% - 1rem, 100%);
  }

  .site-header {
    position: sticky;
    top: 0;
  }

  .site-header .container,
  header .container {
    position: relative;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.45rem 0 0.5rem;
  }

  .logo,
  .brand-mark {
    gap: 0.5rem;
    min-height: 36px;
  }

  .logo-mark {
    width: 32px;
    height: 32px;
    font-size: 0.82rem;
  }

  .brand-kicker {
    font-size: 0.5rem;
    letter-spacing: 0.16em;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .theme-toggle-corner {
    position: absolute;
    top: 0.35rem;
    right: 0;
    min-height: 34px;
    min-width: 34px;
    padding: 0.45rem 0.6rem;
    z-index: 2;
  }

  nav {
    width: 100%;
    order: 2;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.1rem;
    padding-right: 2.8rem;
    gap: 0.3rem;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  nav a,
  .nav-search-button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0.48rem 0.7rem;
    white-space: nowrap;
    background: rgba(255, 244, 229, 0.04);
    border: 1px solid rgba(255, 244, 229, 0.06);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  .header-search-shell {
    order: 3;
  }

  .site-header.search-open .container {
    padding-bottom: 0.75rem;
  }

  .search-input {
    font-size: 0.95rem;
    padding: 0.72rem 0.95rem;
  }

  .home-hero {
    gap: 0.9rem;
    margin-top: 0.9rem;
  }

  .hero-copy,
  .hero-visual,
  .article-full,
  article.content,
  main > article.hero {
    border-radius: 20px;
  }

  .hero-copy {
    padding: 1.25rem;
  }

  .hero h1,
  .hero-copy h1,
  .article-full h1,
  main > article.hero h1 {
    font-size: clamp(2.3rem, 11vw, 3.4rem);
    line-height: 0.96;
  }

  .hero p,
  .hero-copy p,
  .article-content p,
  article.content p,
  .article-full li,
  article.content li,
  main > article.hero p {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-link,
  .secondary-link,
  .form-panel button,
  .article-reactions .reaction-button {
    width: 100%;
    justify-content: center;
  }

  .hero-metrics {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-stat {
    min-width: 0;
  }

  .hero-visual {
    min-height: 300px;
    background-position: center top;
  }

  .hero-caption {
    left: 0.9rem;
    right: 0.9rem;
    bottom: 0.9rem;
    padding: 0.85rem 0.9rem;
  }

  main.container {
    padding: 1.35rem 0 3rem;
  }

  section {
    margin-top: 1.5rem;
  }

  .section-head {
    margin-bottom: 1rem;
  }

  .section-head p {
    font-size: 0.98rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 0.95rem;
  }

  .article-card .content {
    padding: 1.15rem;
  }

  .article-card h3 {
    font-size: 1.65rem;
  }

  .feature-panel,
  .form-panel,
  .info-panel {
    padding: 1.15rem;
  }

  .back-link {
    margin-bottom: 0.85rem;
  }

  .article-full,
  article.content,
  main > article.hero {
    padding: 1.15rem;
  }

  .article-hero-media {
    margin-top: 1.15rem;
    border-radius: 22px;
  }

  .article-hero-media figcaption {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 0.75rem 0.85rem;
    font-size: 0.88rem;
  }

  .article-content {
    font-size: 1rem;
  }

  .article-content h2,
  article.content h2 {
    margin-top: 1.7rem;
    line-height: 1.05;
  }

  .article-content h3,
  article.content h3 {
    font-size: 1.55rem;
  }

  .article-content ul,
  .article-content ol,
  article.content ul,
  article.content ol {
    margin-left: 1.1rem;
  }

  pre {
    padding: 0.9rem;
    border-radius: 16px;
    font-size: 0.84rem;
    -webkit-overflow-scrolling: touch;
  }

  .article-reactions {
    gap: 0.6rem;
  }

  .reaction-button {
    flex: 1 1 calc(50% - 0.3rem);
  }

  .footer-meta {
    flex-direction: column;
    gap: 0.45rem;
  }
}

@media (max-width: 480px) {
  .container,
  .hero-shell,
  .hero {
    width: min(100% - 0.75rem, 100%);
  }

  .site-header .container,
  header .container {
    padding: 0.38rem 0 0.45rem;
  }

  .brand-title {
    font-size: 1.12rem;
  }

  .brand-kicker {
    font-size: 0.46rem;
  }

  .logo-mark {
    width: 28px;
    height: 28px;
  }

  nav a,
  .nav-search-button {
    padding: 0.42rem 0.62rem;
    font-size: 0.68rem;
  }

  .theme-toggle-corner {
    top: 0.25rem;
    min-height: 32px;
    min-width: 32px;
    padding: 0.38rem 0.52rem;
  }

  .hero-copy {
    padding: 1.05rem;
  }

  .hero h1,
  .hero-copy h1,
  .article-full h1,
  main > article.hero h1 {
    font-size: clamp(2rem, 12vw, 2.8rem);
  }

  .hero-visual {
    min-height: 250px;
  }

  .article-hero-media img {
    aspect-ratio: 4 / 3;
    min-height: 250px;
  }

  .article-hero-media figcaption {
    position: static;
    margin: 0.7rem;
    margin-top: -4.2rem;
  }

  .hero-caption span,
  .section-head p,
  .article-content p,
  article.content p,
  .article-full li,
  article.content li {
    font-size: 0.97rem;
  }

  .article-card .content,
  .feature-panel,
  .form-panel,
  .info-panel,
  .article-full,
  article.content,
  main > article.hero {
    padding: 1rem;
  }

  .reaction-button {
    flex-basis: 100%;
  }
}
