/* ==========================================================================
   UNBO — design tokens
   ========================================================================== */
:root {
  --background: 40 20% 97%;
  --foreground: 220 15% 15%;
  --card: 40 15% 95%;
  --card-foreground: 220 15% 15%;
  --primary: 150 15% 40%;
  --primary-foreground: 40 20% 97%;
  --secondary: 35 25% 88%;
  --secondary-foreground: 220 15% 15%;
  --muted: 35 15% 92%;
  --muted-foreground: 220 10% 50%;
  --accent: 150 12% 85%;
  --accent-foreground: 220 15% 15%;
  --border: 35 15% 88%;
  --input: 35 15% 88%;
  --ring: 150 15% 40%;
  --destructive: 0 60% 50%;
  --destructive-foreground: 40 20% 97%;

  /* palette aliases */
  --sage: 150 15% 40%;
  --sage-light: 150 12% 85%;
  --sand: 35 25% 88%;
  --sand-dark: 35 20% 75%;

  --radius: 0.375rem;
  --radius-lg: 0.375rem;
  --radius-md: 0.25rem;
  --radius-sm: 0.125rem;

  --container-max: 1400px;
  --container-pad: 2rem;

  --font-heading: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "DM Sans", ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: 220 15% 10%;
    --foreground: 40 15% 90%;
    --card: 220 15% 13%;
    --card-foreground: 40 15% 90%;
    --primary: 150 15% 50%;
    --primary-foreground: 220 15% 10%;
    --secondary: 220 10% 20%;
    --secondary-foreground: 40 15% 90%;
    --muted: 220 10% 18%;
    --muted-foreground: 40 10% 60%;
    --accent: 150 10% 20%;
    --accent-foreground: 40 15% 90%;
    --border: 220 10% 20%;
    --input: 220 10% 20%;
    --ring: 150 15% 50%;
    --destructive: 0 62.8% 30.6%;
    --sage: 150 15% 50%;
    --sage-light: 150 10% 20%;
    --sand: 220 10% 20%;
    --sand-dark: 220 10% 26%;
  }
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

::selection { background: hsl(var(--sage) / 0.25); }

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
@media (max-width: 640px) { .container { padding-inline: 1.25rem; } }

.wrap-5xl { max-width: 64rem; margin-inline: auto; }
.wrap-2xl { max-width: 42rem; margin-inline: auto; }

main { flex: 1 1 auto; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
}

.meta {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.meta .dot { width: 3px; height: 3px; border-radius: 999px; background: hsl(var(--muted-foreground) / 0.6); }

.fade-in { animation: fade-in 0.5s ease-out both; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fade-in { animation: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(var(--background) / 0.9);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid hsl(var(--border));
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 3.5rem;
}
.brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.06em;
}
.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav a {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease;
}
.nav a:hover, .nav a[aria-current="page"] { color: hsl(var(--sage)); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-size: 0.75rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 3.5rem;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: hsl(var(--background));
    border-bottom: 1px solid hsl(var(--border));
    padding: 0.5rem var(--container-pad) 1rem;
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: 0.6rem 0; font-size: 0.9375rem; width: 100%; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { margin-top: 2rem; }
.hero__frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 21 / 9;
  background: hsl(var(--muted));
}
.hero__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms ease;
}
.hero:hover .hero__frame img { transform: scale(1.05); }
.hero__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsl(220 15% 8% / 0.85) 0%, hsl(220 15% 8% / 0.45) 45%, hsl(220 15% 8% / 0.05) 100%);
}
.hero__body {
  position: absolute;
  z-index: 1;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  color: hsl(40 20% 97%);
  max-width: 44rem;
}
.hero__body .eyebrow { color: hsl(40 20% 97% / 0.75); }
.hero__title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-top: 0.75rem;
}
.hero__dek {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: hsl(40 20% 97% / 0.8);
  max-width: 34rem;
}
.hero__meta { margin-top: 1rem; font-size: 0.75rem; color: hsl(40 20% 97% / 0.65); }
.hero__meta .dot { background: hsl(40 20% 97% / 0.5); }

@media (min-width: 768px) {
  .hero__title { font-size: 2.25rem; }
  .hero__body { padding: 2.5rem; }
}
@media (min-width: 1024px) {
  .hero__title { font-size: 3rem; }
  .hero__body { padding: 3rem; }
}
@media (max-width: 640px) {
  .hero__frame { aspect-ratio: 4 / 3; }
  .hero__body { padding: 1.25rem; }
}

/* ==========================================================================
   Sections & cards
   ========================================================================== */
.section { margin-top: 4rem; }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
}
.section__head h2 { font-size: 1.25rem; font-weight: 600; }
.section__link {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease;
}
.section__link:hover { color: hsl(var(--sage)); }

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card { display: block; }
.card__frame {
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 4 / 3;
  background: hsl(var(--muted));
  margin-bottom: 1rem;
}
.card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms ease;
}
.card:hover .card__frame img { transform: scale(1.05); }
.card__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 0.5rem;
  transition: color 0.2s ease;
}
.card:hover .card__title { color: hsl(var(--sage)); }
.card__dek {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
}
.card__meta { margin-top: 0.75rem; }

/* Latest — horizontal list */
.stack { display: flex; flex-direction: column; }
.stream-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 2rem 0;
  border-top: 1px solid hsl(var(--border));
  align-items: center;
}
.stream-item:first-child { border-top: 0; padding-top: 0.5rem; }
@media (min-width: 768px) {
  .stream-item { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: 2.5rem; }
}
.stream-item__frame {
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 16 / 10;
  background: hsl(var(--muted));
}
.stream-item__frame img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 700ms ease;
}
.stream-item:hover .stream-item__frame img { transform: scale(1.05); }
.stream-item__title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 0.5rem;
}
.stream-item:hover .stream-item__title { color: hsl(var(--sage)); }

/* ==========================================================================
   Article
   ========================================================================== */
.article-hero {
  width: 100%;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: hsl(var(--muted));
}
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .article-hero { aspect-ratio: 3 / 2; } }

.article-head { padding-top: 3rem; }
.article-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-top: 0.75rem;
}
@media (min-width: 768px) { .article-title { font-size: 2.25rem; } }
.article-dek {
  margin-top: 1rem;
  font-size: 1rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
}
.article-meta { margin-top: 1.5rem; }

.article-body {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-top: 3rem;
}
.article-body > p { margin-bottom: 1.5rem; }
.article-body h2 { font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 1rem; }
.article-body h3 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: 0.75rem; }
.article-body ul, .article-body ol { margin: 0 0 1.5rem 1.25rem; padding: 0; }
.article-body li { margin-bottom: 0.5rem; }
.article-body a {
  color: hsl(var(--sage));
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.article-body strong { font-weight: 600; }
.article-body em { font-style: italic; }
.article-body img { border-radius: var(--radius-lg); margin: 2rem 0; }
.article-body figure { margin: 2rem 0; }
.article-body figcaption {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.5rem;
}
.article-body hr {
  border: 0;
  border-top: 1px solid hsl(var(--border));
  margin: 3rem 0;
}
.article-body blockquote {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid hsl(var(--sage) / 0.5);
  color: hsl(var(--muted-foreground));
  font-style: italic;
}

/* Components */
.pull-quote {
  font-size: 1.5rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.5;
  color: hsl(var(--sage));
  text-align: center;
  margin: 3rem 0;
}

.info-box {
  background: hsl(var(--accent) / 0.5);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
  font-size: 1rem;
  line-height: 1.7;
}
.info-box__title {
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.info-box p:last-child, .disclaimer-box p:last-child { margin-bottom: 0; }

.disclaimer-box {
  background: hsl(var(--muted));
  border-left: 4px solid hsl(var(--sage));
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-size: 0.875rem;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
}

/* Prev / next */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
  font-size: 0.8125rem;
}
.article-nav__item { max-width: 18rem; }
.article-nav__item--next { margin-left: auto; text-align: right; }
.article-nav .eyebrow { display: block; margin-bottom: 0.35rem; }
.article-nav a:hover { color: hsl(var(--sage)); }

.more-in {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid hsl(var(--border));
}
.more-in h2 { font-size: 1.125rem; margin-bottom: 1.5rem; }

/* ==========================================================================
   Category / section page
   ========================================================================== */
.page-head { padding: 3rem 0 2.5rem; }
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0.5rem;
}
@media (min-width: 768px) { .page-title { font-size: 2.25rem; } }
.page-dek {
  margin-top: 0.75rem;
  color: hsl(var(--muted-foreground));
  max-width: 34rem;
  font-size: 0.9375rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding-bottom: 4rem;
}
@media (min-width: 1024px) {
  .split { grid-template-columns: 1fr 300px; }
}

.sidebar-block {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: hsl(var(--card));
}
.sidebar-block h3 {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}
.sidebar-list { list-style: none; margin: 0; padding: 0; }
.sidebar-list li + li { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid hsl(var(--border)); }
.sidebar-list a { font-size: 0.875rem; line-height: 1.45; display: block; }
.sidebar-list a:hover { color: hsl(var(--sage)); }
.sidebar-list .meta { margin-top: 0.3rem; font-size: 0.6875rem; }

/* ==========================================================================
   Newsletter strip
   ========================================================================== */
.newsletter-strip {
  background: hsl(var(--sand));
  padding: 3rem 0;
  margin-top: 5rem;
  text-align: center;
}
.newsletter-strip h2 { font-size: 1.25rem; }
.newsletter-strip p {
  margin: 0.75rem auto 0;
  max-width: 30rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
}
.subscribe {
  margin: 1.5rem auto 0;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  max-width: 26rem;
}
.subscribe input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  padding: 0.55rem 0.75rem;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius-sm);
}
.subscribe input::placeholder { color: hsl(var(--muted-foreground)); }
.btn {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  cursor: pointer;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}
.btn:hover { opacity: 0.88; }
.form-note {
  margin-top: 0.85rem;
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: hsl(var(--muted) / 0.4);
  border-top: 1px solid hsl(var(--border));
  padding: 3rem 0 2rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px) {
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; gap: 3rem; }
}
.site-footer .brand { font-size: 1rem; }
.site-footer p {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
  max-width: 18rem;
}
.footer-col h3 {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--foreground));
  margin-bottom: 0.85rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.footer-col a:hover { color: hsl(var(--sage)); }
.site-footer__base {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border));
  text-align: center;
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
