/* The Monday Signal — shared styles */

:root {
  --bg: #fbfaf7;
  --bg-alt: #f3f0e9;
  --surface: #ffffff;
  --ink: #1b1a15;
  --ink-soft: #5b574b;
  --ink-faint: #8b8678;
  --line: #e6e1d5;
  --accent: #c49a3c;
  --accent-deep: #9a7728;
  --accent-wash: #f7efdd;
  --dark: #16150f;
  --dark-soft: #24221a;
  --dark-ink: #ece7da;
  --dark-ink-soft: #a39d8c;
  --radius: 14px;
  --radius-sm: 9px;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --shadow-card: 0 1px 2px rgba(27, 26, 21, 0.05), 0 8px 28px rgba(27, 26, 21, 0.07);
  --shadow-card-hover: 0 2px 4px rgba(27, 26, 21, 0.06), 0 14px 40px rgba(27, 26, 21, 0.12);
  --ease-snap: cubic-bezier(0.25, 0.9, 0.3, 1);
  --ease-slide: cubic-bezier(0.32, 0.72, 0.28, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-wash); color: var(--accent-deep); }

a { color: inherit; }

button { font-family: var(--font-body); }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(22, 21, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(196, 154, 60, 0.22);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--dark-ink);
}

.logo-icon {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.logo-text {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.logo-text .amp { color: var(--accent); font-weight: 800; }

.nav-links {
  display: flex;
  gap: 26px;
  align-items: center;
}

.nav-links a {
  color: var(--dark-ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover { color: var(--accent); }

/* ---------- Hero (homepage) ---------- */

.hero {
  background: var(--dark);
  background-image:
    radial-gradient(1100px 420px at 78% -10%, rgba(196, 154, 60, 0.14), transparent 62%),
    radial-gradient(700px 320px at 8% 112%, rgba(196, 154, 60, 0.07), transparent 60%);
  color: var(--dark-ink);
  padding: 158px 24px 88px;
  border-bottom: 1px solid rgba(196, 154, 60, 0.22);
}

.hero-inner { max-width: 1080px; margin: 0 auto; }

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-kicker::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1.5px;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.028em;
  max-width: 780px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  margin-top: 22px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--dark-ink-soft);
  max-width: 620px;
}

.hero-meta {
  margin-top: 30px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--dark-ink-soft);
  letter-spacing: 0.04em;
}

.hero-actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s var(--ease-snap), box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #171407;
}

.btn-primary:hover {
  background: #d3ab4e;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(196, 154, 60, 0.35);
}

.btn-ghost {
  border: 1px solid rgba(236, 231, 218, 0.28);
  color: var(--dark-ink);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Homepage sections ---------- */

.section { padding: 72px 24px; }

.section-inner { max-width: 1080px; margin: 0 auto; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
}

.section-heading h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-heading .section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.featured-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 38px 40px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s var(--ease-snap), box-shadow 0.18s ease;
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.edition-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.edition-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
  background: var(--accent-wash);
  border: 1px solid #ecd9ae;
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.edition-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.featured-card h3 {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 14px;
}

.featured-card p {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.65;
  max-width: 760px;
}

.card-cta {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-deep);
  font-weight: 600;
  font-size: 14.5px;
}

.card-cta svg { transition: transform 0.15s var(--ease-snap); }

.featured-card:hover .card-cta svg,
.archive-card:hover .card-cta svg { transform: translateX(4px); }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.archive-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s var(--ease-snap), box-shadow 0.18s ease, border-color 0.18s ease;
}

.archive-card:hover {
  transform: translateY(-3px);
  border-color: #dcd2ba;
  box-shadow: var(--shadow-card-hover);
}

.archive-card h3 {
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 12px 0 10px;
}

.archive-card p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.archive-card .card-cta { margin-top: 18px; font-size: 13.5px; }

.about-strip {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 34px;
}

.about-item h3 {
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.about-item h3 .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.about-item p { color: var(--ink-soft); font-size: 14.5px; line-height: 1.62; }

/* ---------- Edition reader app ---------- */

body.app-mode { overflow: hidden; }

.edition-app-wrap {
  padding: 76px 16px 16px;
  height: 100vh;
  height: 100dvh;
}

.edition-app {
  position: relative;
  height: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Sidebar */

.app-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #fdfcf9;
}

.sidebar-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.sidebar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn-back {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.14s ease;
}

.btn-back:hover { color: var(--accent-deep); }

.mode-toggle {
  display: flex;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
  margin-top: 12px;
}

.mode-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mode-toggle button.active {
  background: var(--surface);
  color: var(--accent-deep);
  box-shadow: 0 1px 4px rgba(27, 26, 21, 0.12);
}

.app-nav {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 10px 20px;
}

.nav-indicator {
  position: absolute;
  left: 4px;
  top: 0;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
  transition: transform 0.28s var(--ease-snap), height 0.2s ease;
  will-change: transform;
}

.nav-group {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 18px 8px 6px;
}

.nav-group:first-child { margin-top: 6px; }

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 9px 12px 9px 15px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.42;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease;
}

.nav-item:hover { background: var(--bg-alt); color: var(--ink); }

.nav-item.active {
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-weight: 600;
}

.nav-item.nav-overview {
  font-weight: 600;
  color: var(--ink);
  margin-top: 4px;
}

.nav-item.nav-overview.active { color: var(--accent-deep); }

.nav-item-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Article pane */

.app-article {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
}

.article-back {
  display: none;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  margin: 12px 16px 0;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease;
}

.article-back:hover { color: var(--accent-deep); border-color: #dcc98e; }

.article-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
}

.article-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 38px 48px 56px;
}

.article-inner.article-enter {
  animation: articleIn 0.24s var(--ease-snap) both;
}

@keyframes articleIn {
  from { opacity: 0; transform: translateY(12px) scale(0.992); }
  to { opacity: 1; transform: none; }
}

.article-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 10px;
}

.article-title {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.article-media { margin: 22px 0 2px; }

.article-body { padding-top: 8px; }

.article-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pager-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 48%;
  min-width: 0;
  text-align: left;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s var(--ease-snap), box-shadow 0.15s ease;
}

.pager-btn:hover {
  border-color: #dcc98e;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(27, 26, 21, 0.08);
}

.pager-next { margin-left: auto; text-align: right; align-items: flex-end; }

.pager-spacer { flex: 1; }

.pager-dir {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-deep);
}

.pager-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Edition typography ---------- */

.edition-content { font-size: 16px; }

.edition-content h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 34px 0 14px;
}

.edition-content h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 28px 0 10px;
}

.edition-content p { margin: 13px 0; color: #2c2a22; }

.edition-content blockquote {
  margin: 16px 0 22px;
  padding: 18px 24px;
  background: var(--accent-wash);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #43391f;
  font-size: 16px;
  line-height: 1.62;
}

.edition-content ul { margin: 13px 0 16px 22px; }

.edition-content li { margin: 8px 0; color: #2c2a22; }

.edition-content a {
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid #e0cd9e;
  transition: border-color 0.14s ease, color 0.14s ease;
}

.edition-content a:hover { color: var(--ink); border-color: var(--accent-deep); }

.edition-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 34px 0;
}

.edition-content strong { font-weight: 700; color: var(--ink); }

.edition-content code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1.5px 6px;
}

.edition-content pre {
  background: var(--dark);
  color: var(--dark-ink);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 13.5px;
  line-height: 1.6;
}

.edition-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.edition-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14.5px;
}

.edition-content th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 2px solid var(--line);
  padding: 9px 12px;
}

.edition-content td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
}

.edition-figure { margin: 22px 0; }

.edition-figure img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.edition-figure figcaption {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 8px;
  font-family: var(--font-mono);
}

/* ---------- Podcast player ---------- */

.podcast-player {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--dark);
  color: var(--dark-ink);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 14px 0;
}

.podcast-play-btn {
  width: 48px; height: 48px;
  min-width: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s var(--ease-snap);
}

.podcast-play-btn:hover { transform: scale(1.06); }

.podcast-play-btn svg { width: 18px; height: 18px; fill: #171407; }

.podcast-info { flex: 1; min-width: 0; }

.podcast-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.podcast-title {
  font-size: 14.5px;
  font-weight: 600;
  margin: 3px 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podcast-progress-wrap { display: flex; align-items: center; gap: 10px; }

.podcast-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dark-ink-soft);
  min-width: 34px;
}

.podcast-progress {
  flex: 1;
  height: 5px;
  background: rgba(236, 231, 218, 0.18);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
}

.podcast-progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
}

.podcast-speed-btn, .podcast-volume-btn {
  border: 1px solid rgba(236, 231, 218, 0.22);
  background: transparent;
  color: var(--dark-ink);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 10px;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease;
}

.podcast-speed-btn:hover, .podcast-volume-btn:hover { border-color: var(--accent); color: var(--accent); }

.podcast-volume-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; display: block; }

/* ---------- Video card ---------- */

.video-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 14px 0;
  background: var(--surface);
}

.video-card-header {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.video-card-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--accent-wash);
  border: 1px solid #ecd9ae;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-card-icon svg { width: 14px; height: 14px; fill: var(--accent-deep); }

.video-card-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.video-card-title { font-size: 14.5px; font-weight: 600; }

.video-card-body video { display: block; width: 100%; }

/* ---------- Footer (homepage) ---------- */

.site-footer {
  background: var(--dark);
  color: var(--dark-ink-soft);
  border-top: 1px solid rgba(196, 154, 60, 0.22);
  padding: 40px 24px;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-text { font-size: 13.5px; }

.footer-links { display: flex; gap: 22px; }

.footer-links a {
  color: var(--dark-ink-soft);
  text-decoration: none;
  font-size: 13.5px;
  transition: color 0.15s ease;
}

.footer-links a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */

@media (max-width: 899px) {
  .edition-app-wrap { padding: 68px 8px 8px; }

  .edition-app { display: block; }

  .app-sidebar {
    height: 100%;
    border-right: none;
    transition: transform 0.3s var(--ease-slide), opacity 0.3s ease;
  }

  .edition-app.article-open .app-sidebar {
    transform: translateX(-6%);
    opacity: 0.55;
  }

  .app-article {
    position: absolute;
    inset: 0;
    z-index: 3;
    transform: translateX(103%);
    transition: transform 0.3s var(--ease-slide);
    box-shadow: -14px 0 36px rgba(27, 26, 21, 0.16);
  }

  .edition-app.article-open .app-article { transform: none; }

  .article-back { display: inline-flex; }

  .article-inner { padding: 16px 20px 48px; }

  .article-title { font-size: 22px; }
}

@media (max-width: 720px) {
  .hero { padding: 128px 20px 64px; }
  .section { padding: 52px 20px; }
  .featured-card { padding: 26px 24px; }
  .featured-card h3 { font-size: 22px; }
  .nav-links { gap: 16px; }
  .podcast-player { flex-wrap: wrap; }
  .article-pager { flex-direction: column; }
  .pager-btn { max-width: 100%; }
  .pager-next { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .article-inner.article-enter { animation: none; }
  .app-article, .app-sidebar, .nav-indicator { transition: none; }
  html { scroll-behavior: auto; }
}
