/* ==========================================================================
   CreativeSlop — Editorial Stylesheet
   Where art meets speculation.
   ========================================================================== */

:root {
  --bg: #f6f4ef;
  --bg-alt: #ece8df;
  --surface: #ffffff;
  --ink: #141414;
  --ink-soft: #2b2b2b;
  --mute: #5e5a52;
  --line: #d9d4c7;
  --accent: #b5301b;
  --accent-ink: #8a230f;
  --serif: "Canela", "GT Sectra", "Source Serif Pro", "Georgia", serif;
  --sans: "Inter", "Söhne", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
  --max: 1240px;
  --gutter: clamp(16px, 3vw, 32px);
  --shadow: 0 1px 0 var(--line);
}

[data-theme="dark"] {
  --bg: #0e0e0e;
  --bg-alt: #161513;
  --surface: #1a1a1a;
  --ink: #f3efe6;
  --ink-soft: #ddd7c8;
  --mute: #9c9689;
  --line: #2a2926;
  --accent: #e1694f;
  --accent-ink: #f08064;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  line-height: 1.6;
  font-size: 17px;
  transition: background-color .2s ease, color .2s ease;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
a:hover { border-bottom-color: var(--accent); color: var(--accent-ink); }

img { max-width: 100%; display: block; }

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.brand {
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 22px;
}
.brand .dot { color: var(--accent); }
.brand small {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: 2px;
}

.primary-nav {
  display: flex; gap: 22px; align-items: center;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.primary-nav a { color: var(--ink-soft); }
.primary-nav a.is-active { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 36px; height: 36px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 14px;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-ink); }

.menu-toggle { display: none; }

@media (max-width: 820px) {
  .primary-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .primary-nav.is-open {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter);
  }
  .primary-nav.is-open a { padding: 10px 0; border-bottom: 1px solid var(--line); }
}

/* Hero / Masthead */
.masthead {
  border-bottom: 1px solid var(--line);
  padding: 44px 0 32px;
}
.masthead .eyebrow {
  font-family: var(--sans);
  letter-spacing: .22em;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.masthead h1 {
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.02;
  font-size: clamp(36px, 6vw, 64px);
  margin: 0 0 14px;
}
.masthead .dek {
  font-family: var(--serif);
  font-size: clamp(17px, 1.4vw, 20px);
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 0 18px;
}

/* Grid layouts */
.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Card */
.card {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.card .kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.card h3 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.18;
  font-size: clamp(20px, 1.6vw, 24px);
  margin: 0 0 8px;
}
.card .excerpt {
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.55;
  margin: 0 0 10px;
}
.card .meta {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--mute);
  margin-top: auto;
  letter-spacing: .04em;
}
.card .meta strong { color: var(--ink-soft); font-weight: 600; }

/* Lead story (big card) */
.lead-story { border-top: none; padding-top: 0; }
.lead-story h2 {
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: clamp(32px, 4.2vw, 48px);
  margin: 0 0 12px;
}
.lead-story .excerpt { font-size: 18px; max-width: 56ch; }

/* Section label */
.section-label {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 48px 0 18px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 8px;
}
.section-label h2 {
  font-family: var(--serif);
  font-weight: 800;
  letter-spacing: -0.015em;
  font-size: 24px; margin: 0;
}
.section-label a {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mute);
}

/* Ticker */
.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-track {
  display: inline-block;
  padding: 10px 0;
  animation: marq 60s linear infinite;
}
.ticker-track span { margin: 0 24px; color: var(--ink-soft); }
.ticker-track .up { color: #1f8a4c; }
.ticker-track .dn { color: var(--accent); }
@keyframes marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Filters */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-family: var(--sans); font-size: 13px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.filter-bar button, .filter-bar a.chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 11.5px;
}
.filter-bar button.is-active, .filter-bar a.chip.is-active {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.filter-bar .search {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}
.filter-bar .search input {
  border: none; outline: none; background: transparent;
  color: var(--ink); font-family: var(--sans); font-size: 13px; padding: 4px 0;
  min-width: 180px;
}

/* Article page */
.article-hero { padding: 44px 0 22px; border-bottom: 1px solid var(--line); }
.article-hero .kicker {
  font-family: var(--sans); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.article-hero h1 {
  font-family: var(--serif); font-weight: 800; letter-spacing: -0.025em;
  line-height: 1.02; font-size: clamp(34px, 5vw, 56px); margin: 0 0 14px;
}
.article-hero .dek {
  font-family: var(--serif); font-size: clamp(17px, 1.4vw, 22px);
  color: var(--ink-soft); max-width: 62ch; margin: 0 0 18px;
}
.article-hero .byline {
  font-family: var(--sans); font-size: 13px; color: var(--mute);
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
}
.article-hero .byline a { color: var(--ink-soft); }
.article-hero .byline .persona {
  display: inline-block; padding: 2px 8px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}

.article-body {
  max-width: 720px; margin: 0 auto; padding: 40px var(--gutter);
  font-family: var(--serif); font-size: 19px; line-height: 1.7;
}
.article-body p { margin: 0 0 1.1em; }
.article-body p.first::first-letter {
  font-family: var(--serif); font-weight: 800; float: left; font-size: 4.2em;
  line-height: .88; margin: 6px 10px 0 0; color: var(--accent);
}
.article-body h2 {
  font-family: var(--serif); font-weight: 800; letter-spacing: -0.015em;
  font-size: 28px; margin: 1.6em 0 .5em;
}
.article-body h3 {
  font-family: var(--sans); font-weight: 700; letter-spacing: .02em;
  font-size: 17px; text-transform: uppercase; margin: 1.4em 0 .4em;
  color: var(--accent);
}
.article-body ul { margin: 0 0 1.1em 1.2em; padding: 0; }
.article-body li { margin-bottom: .4em; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.3em 0; padding: .4em 1.1em;
  font-style: italic; color: var(--ink-soft);
}
.article-body .pull {
  font-family: var(--serif); font-weight: 700;
  font-size: 28px; line-height: 1.2;
  letter-spacing: -0.01em; color: var(--accent-ink);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  padding: 24px 0; margin: 32px 0; text-align: center;
}

/* Placeholder art */
.art-placeholder {
  width: 100%; aspect-ratio: 16/10;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 50%, transparent), transparent 60%),
    repeating-linear-gradient(45deg, var(--bg-alt) 0 12px, var(--line) 12px 14px);
  border: 1px solid var(--line);
  position: relative; overflow: hidden; margin-bottom: 14px;
}
.art-placeholder::after {
  content: attr(data-label);
  position: absolute; bottom: 10px; left: 12px;
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-soft); background: color-mix(in srgb, var(--bg) 80%, transparent);
  padding: 4px 8px; border: 1px solid var(--line);
}
.art-placeholder.sq { aspect-ratio: 1/1; }
.art-placeholder.wide { aspect-ratio: 21/9; }
.art-placeholder.tall { aspect-ratio: 3/4; }
.art-placeholder.a { background: linear-gradient(135deg, #b5301b 0%, #1a1a1a 70%); }
.art-placeholder.b { background: linear-gradient(200deg, #142a4f 0%, #c5b9a2 90%); }
.art-placeholder.c { background: linear-gradient(90deg, #283a2b 0%, #d4c28f 100%); }
.art-placeholder.d { background: linear-gradient(160deg, #7a2e2a 10%, #2a2625 90%); }
.art-placeholder.e { background: linear-gradient(45deg, #e7d9bd 0%, #7a6a48 80%); }
.art-placeholder.f { background: linear-gradient(320deg, #1b1f2a 0%, #b18c5c 100%); }

/* Newsletter */
.newsletter {
  background: var(--ink); color: var(--bg);
  padding: 48px var(--gutter); margin: 64px 0 0;
}
.newsletter .inner {
  max-width: 880px; margin: 0 auto; display: grid;
  grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center;
}
@media (max-width: 720px) { .newsletter .inner { grid-template-columns: 1fr; } }
.newsletter h2 {
  font-family: var(--serif); font-weight: 800; font-size: 30px;
  letter-spacing: -0.02em; margin: 0 0 10px;
}
.newsletter p { color: color-mix(in srgb, var(--bg) 78%, #888 22%); margin: 0; }
.newsletter form { display: flex; gap: 8px; }
.newsletter input[type=email] {
  flex: 1; background: transparent; border: 1px solid #444;
  color: var(--bg); padding: 12px 14px; font-family: var(--sans); font-size: 14px;
  border-radius: 0;
}
.newsletter button {
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--bg); padding: 12px 18px; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 13px;
  letter-spacing: .05em; text-transform: uppercase;
}
.newsletter button:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 24px; margin-top: 48px;
  font-family: var(--sans); font-size: 13px;
  color: var(--mute);
}
.site-footer .row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px;
}
@media (max-width: 820px) { .site-footer .row { grid-template-columns: 1fr 1fr; } }
.site-footer h4 {
  font-family: var(--sans); font-weight: 700; font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink);
  margin: 0 0 12px;
}
.site-footer a { display: block; margin-bottom: 8px; color: var(--ink-soft); }
.site-footer .fine {
  border-top: 1px solid var(--line);
  margin-top: 28px; padding-top: 16px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* Article meta / related */
.related {
  border-top: 1px solid var(--ink);
  margin-top: 48px; padding: 28px 0 8px;
}
.related h3 {
  font-family: var(--serif); font-weight: 800; font-size: 22px;
  margin: 0 0 18px;
}

/* About / contact */
.prose {
  max-width: 680px; margin: 0 auto; padding: 40px var(--gutter);
}
.prose h1 {
  font-family: var(--serif); font-weight: 800; letter-spacing: -0.02em;
  font-size: 42px; margin: 0 0 6px;
}
.prose .dek {
  font-family: var(--serif); font-size: 19px;
  color: var(--ink-soft); margin: 0 0 28px;
}
.prose h2 {
  font-family: var(--serif); font-weight: 700; font-size: 22px;
  margin: 1.6em 0 .4em;
}
.prose p { font-family: var(--serif); font-size: 18px; line-height: 1.65; }
.prose label {
  display: block; font-family: var(--sans); font-size: 12px;
  text-transform: uppercase; letter-spacing: .12em; color: var(--mute);
  margin: 14px 0 4px;
}
.prose input, .prose textarea, .prose select {
  width: 100%; padding: 12px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.prose button {
  margin-top: 16px;
  background: var(--ink); color: var(--bg);
  padding: 13px 24px; border: none; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 13px;
  text-transform: uppercase; letter-spacing: .1em;
}
.prose button:hover { background: var(--accent); }

/* Author box */
.author-box {
  display: grid; grid-template-columns: 140px 1fr; gap: 22px;
  padding: 28px 0; border-top: 1px solid var(--line);
  align-items: start;
}
@media (max-width: 560px) { .author-box { grid-template-columns: 1fr; } }
.author-box .avatar {
  width: 140px; height: 140px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--ink));
  display: flex; align-items: center; justify-content: center;
  color: var(--bg); font-family: var(--serif); font-weight: 800;
  font-size: 48px; letter-spacing: -0.02em;
}
.author-box h3 {
  font-family: var(--serif); font-weight: 800; font-size: 22px; margin: 0 0 4px;
}
.author-box .role {
  font-family: var(--sans); font-size: 11.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }

/* Print */
@media print {
  .site-header, .site-footer, .newsletter, .related, .filter-bar { display: none; }
  body { background: #fff; color: #000; }
}
