/* ============================================================
   Grain Archive — demo styles
   Design tokens extracted from the Figma Community file
   "Gritty Culture Blog / Grain Archive"
   ============================================================ */

:root {
  --black: #0c0b0a;
  --ink: #171310;
  --paper: #efe7d8;
  --cream: #f5f1e8;
  --cream-dim: rgba(245, 241, 232, 0.72);
  --rust: #7c2418;
  --rust-deep: #4d150e;
  --brass: #c89b5a;

  --orange: #ff5a1f;
  --green: #3fb45a;
  --blue: #a4c4f2;

  --frame: 10px;
  --gutter: clamp(20px, 4vw, 56px);
  --maxw: 1320px;

  --font-grotesque: "Archivo", "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-grotesque);
  background: var(--black);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }
em { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

::selection { background: var(--orange); color: var(--black); }

/* thin warm scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: #3a211b; border: 2px solid var(--black); }

/* ---------- film grain + black frame overlays ---------- */
.grain {
  position: fixed;
  inset: -100px;
  z-index: 80;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-40px, 30px); }
  50%  { transform: translate(30px, -45px); }
  75%  { transform: translate(-25px, -20px); }
  100% { transform: translate(0, 0); }
}

.frame {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  border: var(--frame) solid var(--black);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--rust-deep);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  will-change: transform;
}

.hero__bg img {
  object-position: center 22%;
  filter: saturate(1.05) contrast(1.08) brightness(0.92);
}

/* rust-red colour grade over the photo */
.hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 90% at 78% 18%, rgba(124, 36, 24, 0.05) 0%, rgba(77, 21, 14, 0.55) 55%, rgba(20, 8, 5, 0.9) 100%),
    linear-gradient(180deg, rgba(60, 16, 10, 0.55) 0%, rgba(60, 16, 10, 0.05) 30%, rgba(40, 10, 6, 0.35) 62%, rgba(12, 9, 8, 0.95) 100%),
    linear-gradient(90deg, rgba(90, 24, 15, 0.75) 0%, rgba(124, 36, 24, 0.15) 45%, rgba(60, 15, 10, 0.7) 100%);
}

/* ---------- topbar ---------- */
.topbar {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: clamp(18px, 2.6vw, 30px) var(--gutter);
  gap: 16px;
}

.logo__circle {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--black);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  transition: transform 0.3s ease;
}
.logo:hover .logo__circle { transform: rotate(-8deg) scale(1.05); }
.logo__circle--sm { width: 42px; height: 42px; font-size: 14px; }

/* coloured pill navigation */
.navpills {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.navpill {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 12px;
  color: var(--black);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.navpill--orange { background: var(--orange); }
.navpill--green  { background: var(--green); }
.navpill--blue   { background: var(--blue); }

.navpill:hover { transform: translateY(-2px); filter: brightness(1.06); }
.navpill.is-active {
  box-shadow: inset 0 0 0 2px var(--black), 0 4px 0 rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.issue {
  justify-self: end;
  text-align: right;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-dim);
  line-height: 1.7;
  font-weight: 600;
}
.issue span { letter-spacing: 0.14em; }

/* ---------- hero inner ---------- */
.hero__inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--gutter) clamp(14px, 2.4vh, 30px);
}

.hero__title {
  font-weight: 900;
  text-transform: none;
  color: var(--cream);
  font-size: clamp(64px, 15.2vw, 248px);
  line-height: 0.82;
  letter-spacing: -0.045em;
  white-space: nowrap;
  transform-origin: 0 100%;
  will-change: transform;
}

.scrollcue {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(26px, 4vh, 48px);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cream-dim);
  writing-mode: vertical-rl;
  transition: color 0.25s ease, transform 0.25s ease;
}
.scrollcue:hover { color: var(--orange); transform: translateY(-4px); }
.scrollcue svg { transform: rotate(-90deg); }

/* ============================================================
   TICKER
   ============================================================ */
.ticker {
  background: var(--orange);
  color: var(--black);
  border-top: 2px solid var(--black);
  border-bottom: 2px solid var(--black);
  overflow: hidden;
  padding: 10px 0;
}
.ticker__track {
  display: flex;
  align-items: baseline;
  gap: 28px;
  white-space: nowrap;
  font-weight: 800;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  animation: ticker 26s linear infinite;
  width: max-content;
}
.ticker__track i {
  font-style: normal;
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--rust-deep);
}
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   ARCHIVE
   ============================================================ */
.archive {
  background: var(--ink);
  color: var(--cream);
  padding: clamp(72px, 10vw, 140px) var(--gutter) clamp(80px, 10vw, 130px);
}

.section-head {
  max-width: var(--maxw);
  margin: 0 auto clamp(44px, 6vw, 80px);
  position: relative;
}

.kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.kicker::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--orange);
  display: inline-block;
}
.kicker--cream { color: var(--brass); }
.kicker--cream::before { background: var(--brass); }

.section-title {
  font-size: clamp(40px, 6.4vw, 96px);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.section-title em { color: var(--brass); }

.filters {
  position: absolute;
  right: 0;
  bottom: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(245, 241, 232, 0.35);
  font-weight: 700;
  font-size: 14px;
  color: var(--cream-dim);
  transition: all 0.22s ease;
}
.filter:hover { border-color: var(--cream); color: var(--cream); transform: translateY(-1px); }
.filter.is-active {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--black);
}
.filter--orange.is-active { background: var(--orange); border-color: var(--orange); }
.filter--blue.is-active   { background: var(--blue); border-color: var(--blue); }
.filter--green.is-active  { background: var(--green); border-color: var(--green); }

/* cinematic asymmetric grid */
.archive-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(20px, 2.4vw, 32px);
}

.card {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
}
.card--feature { grid-column: span 7; }
.card--feature + .card { grid-column: span 5; }

.card__media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 4 / 3;
  background: #2a1a15;
}
.card--feature .card__media { aspect-ratio: 16 / 10; }

.card__media img {
  filter: grayscale(0.25) contrast(1.1) brightness(0.82) sepia(0.18);
  transition: transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), filter 0.7s ease;
}
/* rust tint over every thumbnail */
.card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(124, 36, 24, 0.22), rgba(20, 8, 5, 0.55));
  transition: opacity 0.5s ease;
}
.card:hover .card__media img {
  transform: scale(1.06);
  filter: grayscale(0) contrast(1.05) brightness(1) sepia(0);
}
.card:hover .card__media::after { opacity: 0.25; }

.card__body { padding-top: 18px; }

.card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 10px;
}

.tag {
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--black);
  font-weight: 800;
  font-size: 11px;
}
.tag--orange { background: var(--orange); }
.tag--blue   { background: var(--blue); }
.tag--green  { background: var(--green); }

.card__title {
  font-weight: 800;
  font-size: clamp(20px, 1.7vw, 26px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.card--feature .card__title { font-size: clamp(28px, 3vw, 42px); }
.card__title a { background-image: linear-gradient(var(--cream), var(--cream)); background-size: 0 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size 0.4s ease; }
.card__title a:hover { background-size: 100% 2px; color: var(--brass); background-image: linear-gradient(var(--brass), var(--brass)); }

.card__excerpt {
  margin-top: 12px;
  color: var(--cream-dim);
  font-size: 15px;
  max-width: 56ch;
}

.card.is-hidden { display: none; }

.archive-empty {
  max-width: var(--maxw);
  margin: 40px auto 0;
  color: var(--cream-dim);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  background:
    radial-gradient(120% 120% at 15% 0%, #93301f 0%, var(--rust) 38%, var(--rust-deep) 78%, #2a0d08 100%);
  padding: clamp(80px, 11vw, 160px) var(--gutter);
}

.about__inner { max-width: var(--maxw); margin: 0 auto; }

.about__manifesto {
  font-size: clamp(28px, 4.2vw, 62px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 22ch;
  color: var(--cream);
}
.about__manifesto strong { font-weight: 900; }
.about__manifesto em { color: #f0c98c; }

.principles {
  margin-top: clamp(48px, 7vw, 96px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 48px);
  border-top: 1px solid rgba(245, 241, 232, 0.25);
  padding-top: clamp(32px, 4vw, 56px);
}
.principle__no {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--brass);
  display: block;
  margin-bottom: 14px;
}
.principle h3 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.principle p { color: rgba(245, 241, 232, 0.78); font-size: 15.5px; max-width: 34ch; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--black);
  padding: clamp(36px, 5vw, 56px) var(--gutter) 30px;
}
.footer__row {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(245, 241, 232, 0.18);
}
.footer nav { display: flex; gap: clamp(16px, 3vw, 36px); flex-wrap: wrap; }
.footer nav a {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-dim);
  transition: color 0.2s ease;
}
.footer nav a:hover { color: var(--orange); }
.footer__credit {
  max-width: var(--maxw);
  margin: 22px auto 0;
  font-size: 12.5px;
  color: rgba(245, 241, 232, 0.45);
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.65, 0.25, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .ticker__track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card__media img, .card__media::after, .navpill, .scrollcue { transition: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .card,
  .card--feature,
  .card--feature + .card { grid-column: span 6; }
  .principles { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --frame: 7px; }

  .topbar {
    grid-template-columns: auto 1fr;
    row-gap: 18px;
  }
  .navpills {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
  .navpill { padding: 9px 18px; font-size: 15px; }
  .issue { display: none; }

  .hero__title { font-size: clamp(46px, 12.8vw, 96px); }
  .scrollcue { display: none; }

  .card,
  .card--feature,
  .card--feature + .card { grid-column: span 12; }
  .card--feature .card__media { aspect-ratio: 4 / 3; }

  .filters { position: static; margin-top: 26px; }

  .footer__row { flex-direction: column; align-items: flex-start; }
}
