/* ==========================================================================
   Bytewise — editorial monochrome
   Direction: stark black & white, oversized grotesque headlines, serif reading
   copy, generous white space, hairline rules, small-caps labels.
   ========================================================================== */

/* 1. Tokens ------------------------------------------------------------- */
:root {
  --bg:          #ffffff;
  --band:        #f4f4f4;
  --ink:         #000000;
  --ink-soft:    #333333;
  --muted:       #5a5a5a;
  --faint:       #8c8c8c;
  --rule:        #e2e2e2;

  --sans: "Helvetica Neue", Helvetica, Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --wrap: 1180px;
  --gutter: 40px;
}

/* A true inverse rather than a tinted dark theme — it suits the monochrome. */
[data-theme="dark"] {
  --bg:       #000000;
  --band:     #0d0d0d;
  --ink:      #ffffff;
  --ink-soft: #e0e0e0;
  --muted:    #a8a8a8;
  --faint:    #6e6e6e;
  --rule:     #262626;
}

/* 2. Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.02;
  margin: 0 0 .4em;
}
h1 { font-size: clamp(2.6rem, 7vw, 5rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: 1.1rem; letter-spacing: -.01em; line-height: 1.25; }
p  { margin: 0 0 1.15em; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 16px; top: 16px; z-index: 999;
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; font-family: var(--sans); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .12em;
}

/* The recurring editorial device: small, wide-tracked, uppercase labels. */
.eyebrow, .pill, .section-head h2, .widget h4, .footer-grid h5, .meta .tag {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
}

/* 3. Header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex; align-items: center; gap: 28px;
  height: 76px;
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
}
.logo {
  font-family: var(--sans); font-weight: 800; font-size: 1.15rem;
  letter-spacing: -.04em; color: var(--ink); flex-shrink: 0;
}

.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a {
  font-family: var(--sans); font-size: .82rem; font-weight: 500;
  color: var(--muted);
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.is-active { color: var(--ink); font-weight: 700; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--rule); background: transparent; color: var(--muted);
  cursor: pointer; font-size: .95rem; line-height: 1;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink); }
.nav-toggle { display: none; }

/* 4. Hero --------------------------------------------------------------- */
.hero { padding: 78px 0 0; }
/* Width in px, not ch: `ch` here would resolve against this element's 17px
   font size rather than the 5rem headline, crushing the column to ~180px. */
.hero-copy { max-width: 780px; }
.hero-copy h1 { margin-bottom: .28em; }
.hero-copy h1 .light {
  font-weight: 200; display: block;
  letter-spacing: -.03em; white-space: nowrap;
}
.hero-copy p {
  font-family: var(--serif); font-size: 1.1rem; color: var(--ink-soft);
  max-width: 46ch; margin: 0 0 34px;
}
.pill { display: inline-block; color: var(--muted); margin-bottom: 20px; }

/* Full-bleed monochrome ridge, drawn in SVG rather than shipped as a photo. */
.hero-figure { position: relative; margin: 40px 0 0; border-bottom: 1px solid var(--rule); }
.hero-figure svg { display: block; width: 100%; height: auto; }
.hero-figure figcaption {
  position: absolute; right: 0; bottom: 14px;
  background: var(--ink); color: var(--bg);
  font-family: var(--sans); font-size: .66rem;
  letter-spacing: .04em; padding: 5px 10px;
}

/* 5. Buttons ------------------------------------------------------------ */
.btn {
  display: inline-block;
  font-family: var(--sans); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em;
  padding: 16px 30px;
  background: var(--ink); color: var(--bg);
  border: 1px solid var(--ink); cursor: pointer;
}
.btn:hover { background: transparent; color: var(--ink); text-decoration: none; }

.btn-ghost {
  background: transparent; color: var(--ink); border: 0;
  padding: 16px 0; margin-left: 26px;
  border-bottom: 1px solid var(--ink);
}
.btn-ghost:hover { background: transparent; opacity: .55; }

/* 6. Sections ----------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 72px;
  align-items: start;
  padding: 76px 0 90px;
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin: 0 0 34px;
}
.section-head h2 { margin: 0; color: var(--muted); }
.section-head span, .section-head a { font-family: var(--sans); font-size: .76rem; color: var(--faint); }

.band { background: var(--band); padding: 84px 0; }

/* 7. Cards -------------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 52px 44px; }

.card { display: flex; flex-direction: column; background: transparent; border: 0; }
.card-thumb {
  aspect-ratio: 3 / 2;
  background: var(--band);
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  filter: grayscale(1);
  margin-bottom: 20px;
}
.card-body { padding: 0; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin: 10px 0; font-size: 1.22rem; }
.card-body h3 a { color: var(--ink); }
.card-body p { font-family: var(--serif); color: var(--muted); font-size: .96rem; margin: 0 0 16px; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--sans); font-size: .72rem; color: var(--faint); }
.meta .tag { color: var(--ink); }
.meta .dot { opacity: .4; }
.card-body .meta:last-child { margin-top: auto; }

/* Feature triplet: rule-underlined icon, label, copy. */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.feature .ico {
  width: 44px; height: 44px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 2px solid var(--ink);
  font-size: 1.5rem; filter: grayscale(1);
}
.feature h3 { font-size: 1.05rem; margin-bottom: 12px; }
.feature p { font-family: var(--serif); color: var(--muted); font-size: .95rem; margin: 0; }

.textlink {
  display: inline-block; margin-top: 8px;
  font-family: var(--sans); font-size: .72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .13em;
  color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 3px;
}
.textlink:hover { text-decoration: none; opacity: .55; }

/* 8. Article ------------------------------------------------------------ */
.breadcrumb { font-family: var(--sans); font-size: .72rem; color: var(--faint); padding: 34px 0 0; }
.breadcrumb a { color: var(--muted); }

.article-head { padding: 26px 0 34px; border-bottom: 1px solid var(--rule); margin-bottom: 40px; }
.article-head h1 { font-size: clamp(2.2rem, 5.2vw, 3.7rem); margin-bottom: .3em; }
.article-head .lede { font-family: var(--serif); font-size: 1.24rem; line-height: 1.5; color: var(--ink-soft); margin-bottom: 1.1em; max-width: 54ch; }

.prose { font-family: var(--serif); font-size: 1.14rem; line-height: 1.72; max-width: 68ch; }
.prose h2 { font-size: 1.7rem; margin: 2.1em 0 .55em; }
.prose h3 { font-size: 1.2rem; margin: 1.7em 0 .45em; }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose strong { font-weight: 700; }
.prose code { font-family: ui-monospace, Menlo, monospace; font-size: .85em; background: var(--band); padding: 2px 6px; }
.prose blockquote {
  margin: 2em 0; padding: 0 0 0 28px;
  border-left: 2px solid var(--ink);
  font-size: 1.32rem; line-height: 1.45; font-style: italic;
}
.callout {
  font-family: var(--sans); font-size: .92rem; line-height: 1.6;
  background: var(--band); border: 0; border-top: 2px solid var(--ink);
  padding: 22px 24px; margin: 2em 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; }

/* 9. Sidebar ------------------------------------------------------------ */
.sidebar { position: sticky; top: 100px; display: grid; gap: 40px; }
.widget { background: transparent; border: 0; border-top: 2px solid var(--ink); padding: 18px 0 0; }
.widget h4 { margin: 0 0 16px; color: var(--muted); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 11px 0; border-bottom: 1px solid var(--rule); font-family: var(--serif); font-size: .97rem; }
.widget li:last-child { border-bottom: 0; }
.widget li a { color: var(--ink); }
.widget-ad { border-top: 0; padding: 0; }

/* 10. Ad slots ---------------------------------------------------------- */
.ad-slot { display: flex; flex-direction: column; align-items: center; margin: 0 auto; overflow: hidden; }
.ad-slot iframe { border: 0; display: block; }
.ad-slot::before {
  content: attr(data-ad-label); display: block; margin-bottom: 8px;
  font-family: var(--sans); font-size: .6rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--faint);
}
.ad-slot[data-ad-label=""]::before { display: none; }

.ad-leaderboard { min-height: 106px; padding: 26px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.ad-rectangle   { min-height: 266px; }
.ad-inarticle   { min-height: 266px; margin: 2.6em auto; }
.ad-native      { min-height: 200px; margin: 44px 0; }

.ad-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; gap: 5px; padding: 16px;
  border: 1px solid var(--rule); background: var(--band);
  color: var(--faint); text-align: center;
  font-family: ui-monospace, Menlo, monospace; font-size: .7rem;
}
.ad-placeholder b { color: var(--muted); font-size: .76rem; }

/* 11. Footer ------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--rule); padding: 72px 0 40px; background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 56px; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.footer-grid h5 { margin: 0 0 18px; color: var(--muted); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 11px; font-family: var(--sans); font-size: .85rem; }
.footer-grid li a { color: var(--muted); }
.footer-grid li a:hover { color: var(--ink); }
.footer-about p { font-family: var(--serif); color: var(--muted); font-size: .97rem; max-width: 40ch; }
.footer-about .mark { font-family: var(--sans); font-weight: 800; font-size: 1.1rem; letter-spacing: -.04em; margin-bottom: 14px; display: block; }

.footer-bottom {
  max-width: var(--wrap); margin: 56px auto 0; padding: 26px var(--gutter) 0;
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  font-family: var(--sans); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint);
}
.ad-disclosure {
  font-family: var(--sans); font-size: .78rem; color: var(--faint);
  text-align: center; padding: 26px var(--gutter) 0; max-width: var(--wrap); margin: 0 auto;
}

/* 12. Responsive -------------------------------------------------------- */
@media (max-width: 1000px) {
  :root { --gutter: 28px; }
  .layout { grid-template-columns: 1fr; gap: 56px; padding-top: 48px; }
  .sidebar { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .features { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  :root { --gutter: 20px; }
  body { font-size: 16px; }
  .header-inner { height: 62px; }
  .hero { padding-top: 44px; }
  .hero-copy { max-width: none; }
  .prose { font-size: 1.06rem; }
  .btn { display: block; text-align: center; }
  .btn-ghost { margin-left: 0; margin-top: 14px; display: inline-block; }

  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 62px;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px;
    background: var(--bg); border-bottom: 1px solid var(--rule);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 13px 0; border-bottom: 1px solid var(--rule); font-size: .95rem; }

  .ad-leaderboard { min-height: 76px; padding: 18px 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 13. Icons --------------------------------------------------------------
   Inline SVG, currentColor, so every icon follows the theme — including the
   inverted dark mode — without a second asset. */
.icon { display: block; width: 100%; height: 100%; }
.icon-btn .icon { width: 17px; height: 17px; }
/* Article thumbnails: one large hairline icon centred in the grey plate */
.card-thumb .icon { width: 46px; height: 46px; color: var(--muted); }
.feature .ico { padding-bottom: 12px; }
.feature .ico .icon { width: 26px; height: 26px; }

/* 14. Sister-site strip --------------------------------------------------- */
.network {
  max-width: var(--wrap); margin: 48px auto 0; padding: 26px var(--gutter) 0;
  border-top: 1px solid var(--rule);
}
.network-label {
  display: block; margin-bottom: 16px;
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .16em; color: var(--faint);
}
.network-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.network-links a { font-family: var(--sans); font-size: .88rem; font-weight: 700; color: var(--ink); }
.network-links a span { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); margin-top: 3px; }
.network-links a:hover { text-decoration: none; opacity: .6; }
@media (max-width: 720px) { .network-links { grid-template-columns: 1fr 1fr; gap: 16px; } }
