:root,
[data-theme="light"] {
  --bg: #f2f4f7;
  --bg-elev: #ffffff;
  --ink: #141821;
  --muted: #5b6472;
  --line: rgba(20, 24, 33, 0.1);
  --accent: #0e6b63;
  --accent-soft: rgba(14, 107, 99, 0.12);
  --shadow: 0 16px 36px rgba(20, 28, 40, 0.07);
  --font-ui: Manrope, ui-sans-serif, system-ui, sans-serif;
  --font-display: Newsreader, Georgia, serif;
  --font-body: Lora, Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --bg: #14110e;
  --bg-elev: #1d1915;
  --ink: #f4efe6;
  --muted: #b3a89c;
  --line: rgba(244, 239, 230, 0.12);
  --accent: #e07a3d;
  --accent-soft: rgba(224, 122, 61, 0.16);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

.wrap {
  width: min(1080px, calc(100% - 1.5rem));
  margin: 0 auto;
}

.home {
  padding: 1.25rem 0 3.5rem;
}

.home-kicker {
  margin: 0 0 1.1rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.story-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.story-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.story-card-link:hover {
  color: inherit;
}

.story-card-link:hover h2,
.story-card-link:hover h2 a {
  color: var(--accent);
}

.story-card-body h2 a,
.story-card-body .lede a {
  color: inherit;
  text-decoration: none;
}

.story-category {
  display: inline-block;
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-decoration: none;
}

.story-category:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.story-card-media {
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  color: inherit;
  text-decoration: none;
}

.story-card-media img,
.story-card-fallback {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.story-card-fallback {
  background:
    radial-gradient(circle at 28% 30%, var(--accent), transparent 42%),
    var(--bg-elev);
}

.story-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.05rem 1.1rem 1.2rem;
}

.story-card-body h2 {
  font-size: 1.28rem;
  margin: 0;
}

.story-card-body .lede {
  margin: 0;
  font-size: 0.98rem;
  max-width: none;
}

.story-card-body .meta {
  margin: auto 0 0;
}

.story-card.is-featured {
  margin-bottom: 2rem;
}

.story-card.is-featured h2 {
  font-size: clamp(1.55rem, 6.4vw, 2.45rem);
}

.story-card.is-featured .lede {
  font-size: 1.05rem;
}

.story-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

.feed {
  padding-bottom: 1rem;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 40;
  transform-origin: left;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.logo-text {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.95rem;
}

.logo-text strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.mark {
  width: 1.35rem;
  height: 1.35rem;
  border: 1.5px solid var(--accent);
  border-radius: 99px;
  box-shadow: inset 0 0 0 3.5px var(--bg), inset 0 0 0 5px var(--accent);
  background: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.45rem 0.85rem 0.45rem 0.7rem;
  white-space: nowrap;
}

.chat-btn:hover {
  color: #fff;
  filter: brightness(1.08);
}

.chat-btn-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.theme-toggle {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

[data-theme="light"] .theme-toggle .moon,
[data-theme="dark"] .theme-toggle .sun {
  display: none;
}

.hero {
  padding: 4.5rem 0 3rem;
  max-width: 42rem;
}

.hero.compact {
  padding: 3rem 0 1.5rem;
}

.eyebrow,
.section-label,
.kicker,
.meta,
.chip,
.btn,
.chat-btn,
.theme-toggle,
.react,
.reactions-label,
.site-footer {
  font-family: var(--font-ui);
}

.eyebrow,
.section-label,
.kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.7rem;
}

h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
}

.lede {
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 40rem;
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.btn {
  display: inline-flex;
  margin-top: 1.4rem;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn:hover {
  background: var(--accent);
  color: #fff;
}

.feed {
  padding-bottom: 4rem;
}

.section-label {
  margin-bottom: 1.2rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.card-media,
.card-image {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
}

.card-image.placeholder {
  background:
    radial-gradient(circle at 30% 30%, var(--accent), transparent 45%),
    var(--bg-elev);
}

.card-body {
  padding: 1.15rem 1.2rem 1.3rem;
}

.card-body h2 {
  font-size: 1.35rem;
}

.card-body h2 a {
  text-decoration: none;
}

.story-card-body .chips {
  margin-top: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.chip {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  color: var(--muted);
}

.article-wrap {
  width: min(760px, calc(100% - 2rem));
  padding-bottom: 5rem;
}

.article-header {
  padding: 2.4rem 0 1.2rem;
}

.article-header h1 {
  font-size: clamp(2.2rem, 7vw, 3.4rem);
}

.article-category {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-category a {
  color: var(--accent);
  text-decoration: none;
}

.article-category a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.feature {
  margin: 0 0 2rem;
}

.feature img {
  width: 100%;
  border-radius: 1.1rem;
  max-height: 28rem;
  object-fit: cover;
}

.prose {
  font-size: 1.12rem;
  max-width: 68ch;
}

.prose > * + * {
  margin-top: 1.15em;
}

.prose h2,
.prose h3 {
  margin-top: 1.8em;
}

.prose p {
  margin: 0;
}

.prose a {
  color: var(--accent);
}

.prose blockquote {
  margin: 1.6rem 0;
  padding: 0 0 0 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose img {
  border-radius: 0.8rem;
  margin: 1.5rem 0;
}

.prose [data-youtube-video],
.prose .embed-frame,
.prose .html-embed {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 1.6rem 0;
  overflow: hidden;
  border-radius: 0.9rem;
  background: #111;
}

.prose [data-youtube-video],
.prose .embed-frame {
  aspect-ratio: 16 / 9;
}

.prose [data-youtube-video] iframe,
.prose .embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.prose .html-embed {
  aspect-ratio: auto;
}

.prose .html-embed iframe {
  position: static;
  height: auto;
  min-height: 12rem;
  aspect-ratio: 16 / 9;
}

.prose pre,
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.prose pre {
  overflow-x: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 1rem;
}

.reactions {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.reactions-label {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.react {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.react.is-on,
.react[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.react-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.empty {
  color: var(--muted);
  padding: 1rem 0 4rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner {
  min-height: 4.8rem;
}

@media (min-width: 760px) {
  .wrap {
    width: min(1080px, calc(100% - 2.5rem));
  }

  .home {
    padding-top: 1.75rem;
  }

  .story-card.is-featured .story-card-link {
    display: grid;
    grid-template-columns: 1.2fr 0.95fr;
    min-height: 22rem;
  }

  .story-card.is-featured .story-card-media,
  .story-card.is-featured .story-card-media img,
  .story-card.is-featured .story-card-fallback {
    height: 100%;
    min-height: 22rem;
    aspect-ratio: auto;
  }

  .story-card.is-featured .story-card-body {
    padding: 1.6rem 1.5rem 1.7rem;
    justify-content: center;
  }

  .story-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 17px;
  }

  .hero {
    padding-top: 2.8rem;
  }

  .react-label {
    display: none;
  }

  .chat-btn-extra {
    display: none;
  }
}
