/* v5 — Furniture Magazine / Editorial */

:root {
  --paper: #faf9f7;
  --ink: #2a2a2a;
  --charcoal: #1f1f1f;
  --mute: #6b6560;
  --red: #c41e3a;
  --rule: #ddd9d3;
  --serif: 'Libre Baskerville', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --rail: 960px;
  --gutter: clamp(20px, 4vw, 48px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.rail {
  width: 100%;
  max-width: calc(var(--rail) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--mute);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ── Scroll progress ── */
.progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--rule);
  z-index: 200;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--red);
  transition: width 0.08s linear;
}

.trust-ribbon {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px;
  padding: 9px var(--gutter);
  font-size: 11px; letter-spacing: 0.06em;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  color: var(--mute);
}
.trust-ribbon .dot { opacity: 0.4; }

/* ── Masthead header ── */
.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 3px;
  z-index: 100;
}

.masthead__logo {
  justify-self: start;
}

.masthead__logo img {
  height: 24px;
  width: auto;
}

.masthead__nav {
  display: flex;
  gap: clamp(16px, 2.5vw, 32px);
  justify-self: center;
}

.masthead__nav a {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--charcoal);
  transition: color 0.2s;
}

.masthead__nav a:hover {
  color: var(--red);
}

.masthead__issue {
  justify-self: end;
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  color: var(--charcoal);
  white-space: nowrap;
}

/* ── Magazine cover hero ── */
.cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 90vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.cover__media {
  position: absolute;
  inset: 0;
}

.cover__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.cover__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(15, 12, 10, 0.82) 0%, rgba(15, 12, 10, 0.35) 45%, rgba(15, 12, 10, 0.08) 100%),
    linear-gradient(to right, rgba(15, 12, 10, 0.55) 0%, transparent 60%);
}

.cover__copy {
  position: relative;
  z-index: 2;
  padding: clamp(32px, 6vw, 72px);
  max-width: 720px;
}

.cover__copy h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  font-weight: 400;
  line-height: 1.12;
  color: #fff;
  margin-bottom: 16px;
}
.cover__kicker {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,.75); margin-bottom: 12px;
}
.cover__sub {
  font-size: 15px; line-height: 1.65; color: rgba(255,255,255,.85);
  max-width: 42ch; margin-bottom: 16px;
}
.cover__chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px;
}
.cover__chips span {
  padding: 6px 12px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #fff; border: 1px solid rgba(255,255,255,.35);
}

.cover__cta {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.65);
  padding-bottom: 4px;
  transition: opacity 0.2s, border-color 0.2s;
}

.cover__cta:hover {
  opacity: 0.85;
  border-color: #fff;
}

/* ── Scroll-snap chapters ── */
.chapters {
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  height: 100vh;
  position: relative;
}

.chapter {
  position: relative;
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}

.chapter__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapter__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(40px, 8vw, 96px);
  background: linear-gradient(to top, rgba(20, 18, 16, 0.78) 0%, rgba(20, 18, 16, 0.2) 55%, transparent 100%);
}

.chapter__num {
  font-family: var(--serif);
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 400;
  line-height: 1;
  color: rgba(255, 255, 255, 0.18);
  margin-bottom: -0.15em;
}

.chapter__title {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  color: #fff;
  max-width: 14ch;
  margin-bottom: 10px;
}
.chapter__meta {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); margin-bottom: 8px; display: block;
}
.chapter__sub {
  font-size: 14px; line-height: 1.5; color: rgba(255,255,255,.8);
  max-width: 32ch; margin-bottom: 16px;
}

.chapter__link {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  align-self: flex-start;
  border-bottom: 1px solid var(--red);
  padding-bottom: 3px;
  transition: opacity 0.2s;
}

.chapter__link:hover {
  opacity: 0.75;
}

/* ── Editorial spread ── */
.spread {
  padding: clamp(64px, 10vw, 120px) clamp(20px, 5vw, 48px);
  max-width: 960px;
  margin: 0 auto;
}

.spread__intro {
  text-align: center;
  margin-bottom: clamp(48px, 8vw, 80px);
}

.spread__kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}

.spread__heading {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 400;
  color: var(--charcoal);
  line-height: 1.25;
  margin-bottom: 8px;
}
.spread__sub { font-size: 14px; color: var(--mute); max-width: 42ch; margin-inline: auto; }

.spread__item {
  margin-bottom: clamp(48px, 7vw, 88px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
html.js .spread__item:not(.vis) { opacity: 0; transform: translateY(28px); }
.spread__item.vis { opacity: 1; transform: none; }

.spread__item--offset {
  padding-left: clamp(0px, 8vw, 80px);
}

.spread__item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin-bottom: 16px;
}

.spread__item figcaption {
  font-family: var(--serif);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: var(--charcoal);
  line-height: 1.5;
  max-width: 52ch;
}
.spread__item figcaption strong {
  display: block; font-style: normal; font-weight: 700; font-size: 1rem;
  margin-bottom: 2px;
}
.spread__item figcaption em {
  display: block; font-style: normal; font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--red); margin-bottom: 8px;
}
.spread__item figcaption span {
  display: block; font-style: italic; font-size: clamp(0.95rem, 1.8vw, 1.05rem);
}

.spread__item--offset figcaption span {
  text-align: right;
}

/* Stats band */
.stats-band {
  border-block: 1px solid var(--rule);
  padding: 48px var(--gutter);
  background: var(--paper);
}
.stats-inner {
  max-width: var(--rail); margin-inline: auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  text-align: center;
}
.stats-inner strong {
  display: block; font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem); color: var(--red);
  line-height: 1.1; margin-bottom: 6px;
}
.stats-inner span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ── Journal / blog ── */
.journal {
  padding: clamp(64px, 10vw, 120px) clamp(20px, 5vw, 48px);
  border-top: 1px solid var(--rule);
}

.journal__pull {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.45;
  color: var(--charcoal);
  text-align: center;
  max-width: 820px;
  margin: 0 auto clamp(64px, 8vw, 96px);
  padding: 0 clamp(8px, 2vw, 24px);
}

.journal__pull::before {
  content: '\201C';
  color: var(--red);
}

.journal__body {
  max-width: 720px;
  margin: 0 auto;
}

.journal__label {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 400;
  margin-bottom: 40px;
}

.journal__list {
  list-style: none;
}

.journal__post {
  display: grid;
  grid-template-columns: 100px 3rem 1fr;
  gap: 12px 20px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.journal__thumb {
  grid-row: 1 / span 3;
  display: block; overflow: hidden; aspect-ratio: 1;
  border: 1px solid var(--rule);
}
.journal__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.journal__post:hover .journal__thumb img { transform: scale(1.04); }

.journal__post:last-child {
  border-bottom: 1px solid var(--rule);
}

.journal__index {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--red);
  line-height: 1.3;
}

.journal__meta {
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.journal__content h3 {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 400;
  line-height: 1.35;
  margin-bottom: 12px;
}

.journal__content h3 a {
  color: var(--red);
  transition: opacity 0.2s;
}

.journal__content h3 a:hover {
  opacity: 0.75;
}

.journal__content p {
  font-size: 14px;
  line-height: 1.75;
}

/* ── Colophon footer ── */
.colophon {
  text-align: center;
  padding: clamp(56px, 8vw, 96px) clamp(20px, 5vw, 48px) clamp(40px, 6vw, 64px);
  background: var(--charcoal);
  color: rgba(250, 249, 247, 0.65);
}
.colophon__grid {
  display: grid; grid-template-columns: 1.4fr repeat(2, 1fr);
  gap: 32px; max-width: 720px; margin: 0 auto 32px; text-align: left;
}
.colophon__col h3 {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--paper); margin-bottom: 12px;
}
.colophon__col a {
  display: block; font-size: 13px; margin-bottom: 8px; color: rgba(250,249,247,.65);
  transition: color 0.2s;
}
.colophon__col a:hover { color: var(--paper); }
.colophon__brand-block { text-align: left; }

.colophon__rule {
  width: 100%;
  max-width: 480px;
  height: 1px;
  background: rgba(250, 249, 247, 0.2);
  margin: 0 auto 28px;
}

.colophon__rule--short {
  max-width: 120px;
  margin-bottom: 32px;
}

.colophon__brand {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--paper);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.colophon__tagline {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.colophon__links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  margin-bottom: 20px;
}

.colophon__links a {
  color: var(--paper);
  transition: opacity 0.2s;
}

.colophon__links a:hover {
  opacity: 0.7;
}

.colophon__social {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.colophon__social a {
  transition: color 0.2s;
}

.colophon__social a:hover {
  color: var(--paper);
}

.colophon__copy {
  font-size: 11px;
  letter-spacing: 0.06em;
  opacity: 0.5;
}

/* ── Back link ── */
.back-link {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 150;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 10px 16px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--charcoal);
  transition: border-color 0.2s, color 0.2s;
}

.back-link:hover {
  border-color: var(--red);
  color: var(--red);
}

/* Motion — visible without JS */
.reveal { transition: opacity 0.75s var(--ease), transform 0.75s var(--ease); }
html.js .reveal:not(.vis) { opacity: 0; transform: translateY(24px); }
.reveal.vis { opacity: 1; transform: none; }
html.js .journal__post:not(.vis) { opacity: 0; transform: translateY(20px); }
.journal__post { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), border-color 0.2s; }
.journal__post.vis { opacity: 1; transform: none; }
.anim-item { transition: opacity 0.65s var(--ease), transform 0.65s var(--ease); }
html.js .anim-item:not(.vis) { opacity: 0; transform: translateY(18px); }
.anim-item.vis { opacity: 1; transform: none; }
.stagger-group > * { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
html.js .stagger-group > *:not(.vis) { opacity: 0; transform: translateY(16px); }
.stagger-group > *.vis { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal:not(.vis), html.js .anim-item:not(.vis), html.js .stagger-group > *:not(.vis) {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .masthead {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 12px 16px;
  }

  .masthead__logo {
    grid-column: 1;
  }

  .masthead__issue {
    grid-column: 2;
    grid-row: 1;
    font-size: 11px;
  }

  .masthead__nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    flex-wrap: wrap;
    gap: 12px 20px;
  }

  .masthead__nav a {
    font-size: 11px;
  }

  .cover {
    min-height: 85vh;
  }

  .chapters {
    height: auto;
    overflow-y: visible;
    scroll-snap-type: none;
  }

  .chapter {
    min-height: 70vh;
  }

  .spread__item--offset {
    padding-left: 0;
  }

  .spread__item--offset figcaption {
    text-align: left;
    margin-left: 0;
  }

  .journal__post {
    grid-template-columns: 80px 2.5rem 1fr;
  }

  .colophon__grid { grid-template-columns: 1fr; text-align: center; }
  .colophon__brand-block { text-align: center; }
  .stats-inner { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .masthead__nav a:nth-child(n+3) {
    display: none;
  }
}
