/* ============================================================
   OFFCUT — a fictional web zine (Deploy Now showcase demo)
   B/W editorial base + vivid category accents
   ============================================================ */

:root {
  --paper: #ffffff;
  --ink: #111111;
  --ink-soft: #55554f;
  --line: #111111;
  --accent: #e63946;
  --font-display: "Archivo Black", sans-serif;
  --font-serif: "Instrument Serif", serif;
  --font-mono: "JetBrains Mono", monospace;
  --font-body: "Space Grotesk", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }

.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; }
.serif { font-family: var(--font-serif); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; background: none; border: none; color: inherit; }

/* ---------- grain overlay ---------- */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 999;
  opacity: 0.045;
  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.9' numOctaves='2'/%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(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(-1%, 2%); }
  100% { transform: translate(2%, -1%); }
}

/* ---------- custom cursor ---------- */
@media (pointer: fine) {
  body { cursor: none; }
  a, button { cursor: none; }
  .cursor {
    position: fixed; top: 0; left: 0; z-index: 1000;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--ink);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out),
                background 0.25s, opacity 0.2s;
    display: flex; align-items: center; justify-content: center;
    mix-blend-mode: exclusion;
  }
  .cursor.is-hover {
    width: 56px; height: 56px;
    background: #ffffff;
  }
  .cursor.has-label {
    width: 72px; height: 72px;
    background: #ffffff;
    mix-blend-mode: normal;
    outline: 2px solid var(--ink);
  }
  .cursor-label {
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--ink);
    opacity: 0;
    transition: opacity 0.15s;
  }
  .cursor.has-label .cursor-label { opacity: 1; }
  .cursor.is-down { transform: translate(-50%, -50%) scale(0.8); }
  /* small unobtrusive dot over busy UI (filter buttons, nav) —
     the element's own hover style does the talking there */
  .cursor.is-min {
    width: 6px; height: 6px;
    background: var(--ink);
    mix-blend-mode: normal;
  }
}
@media (pointer: coarse) { .cursor { display: none; } }

/* ---------- intro curtain ---------- */
.intro {
  position: fixed; inset: 0; z-index: 998;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  animation: intro-lift 0.7s var(--ease-out) 1.35s forwards;
}
.intro-word { display: flex; overflow: hidden; }
.intro-word span {
  font-family: var(--font-display);
  font-size: clamp(48px, 10vw, 120px);
  color: var(--paper);
  line-height: 1;
  transform: translateY(110%);
  animation: intro-pop 0.55s var(--ease-out) forwards;
}
.intro-word span:nth-child(1) { animation-delay: 0.05s; }
.intro-word span:nth-child(2) { animation-delay: 0.11s; }
.intro-word span:nth-child(3) { animation-delay: 0.17s; }
.intro-word span:nth-child(4) { animation-delay: 0.23s; color: #ffb100; }
.intro-word span:nth-child(5) { animation-delay: 0.29s; }
.intro-word span:nth-child(6) { animation-delay: 0.35s; }
@keyframes intro-pop { to { transform: translateY(0); } }
@keyframes intro-lift { to { transform: translateY(-100%); visibility: hidden; } }
body.intro-done .intro { display: none; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 18px 32px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.logo {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
}
.logo-cut {
  display: inline-block;
  margin-left: 4px;
  color: #e63946;
  transition: transform 0.4s var(--ease-out), color 0.3s;
}
.logo:hover .logo-cut { transform: rotate(-135deg) scale(1.2); color: #2d7dff; }
.nav { display: flex; gap: 28px; }
.nav a {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em;
  position: relative;
  padding: 2px 0;
}
.nav a::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 3px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav a:nth-child(1):hover { color: #e63946; }
.nav a:nth-child(2):hover { color: #2d7dff; }
.nav a:nth-child(3):hover { color: #00a878; }
.head-meta { color: var(--ink-soft); }

/* ---------- hero ---------- */
.hero {
  padding: 11vh 32px 8vh;
  text-align: center;
}
.hero-kicker { color: var(--ink-soft); margin-bottom: 3vh; }
.hero-word {
  font-family: var(--font-display);
  font-size: clamp(64px, 16.5vw, 230px);
  line-height: 0.92;
  letter-spacing: -0.01em;
  user-select: none;
}
.hero-word .ltr {
  display: inline-block;
  transition: transform 0.35s var(--ease-out), color 0.2s;
}
.hero-word .ltr:hover {
  color: var(--pop, #e63946);
  transform: translateY(-0.06em) rotate(var(--tilt, -4deg)) scale(1.04);
}
.ltr-outline {
  color: transparent;
  -webkit-text-stroke: 3px var(--ink);
}
.ltr-outline:hover { -webkit-text-stroke-color: var(--pop, #e63946); }
.hero-tag {
  font-size: clamp(20px, 2.6vw, 30px);
  margin-top: 4vh;
}
.hero-tag em { font-style: italic; }
.hero-note { color: var(--ink-soft); margin-top: 2.5vh; }

/* ---------- ticker ---------- */
.ticker {
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  overflow: hidden;
  padding: 12px 0;
  background: var(--paper);
}
.ticker-track {
  display: flex; width: max-content;
  animation: ticker-run 22s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}
.ticker-track i { font-style: normal; padding: 0 14px; }
@keyframes ticker-run { to { transform: translateX(-50%); } }

/* ---------- section rules ---------- */
.section-rule {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 40px;
}
.section-rule .mono { font-weight: 700; }

/* ---------- chips ---------- */
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em;
  padding: 5px 10px 4px;
  border: 2px solid var(--accent);
  color: var(--accent);
  background: var(--paper);
  transition: background 0.25s, color 0.25s;
}

/* ---------- featured ---------- */
.featured { padding: 9vh 32px 4vh; max-width: 1280px; margin: 0 auto; }
.featured-card {
  display: grid;
  grid-template-columns: minmax(280px, 34%) 1fr;
  gap: 48px;
  align-items: center;
}
.featured-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.featured-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 0.14em;
  background-position: 0 92%;
  transition: background-size 0.5s var(--ease-out);
}
.featured-card:hover .featured-title { background-size: 100% 0.14em; }
.featured-excerpt { font-size: 21px; color: var(--ink-soft); }
.featured-date { color: var(--ink-soft); }
.read-line { font-weight: 700; color: var(--accent); }
.read-line i { font-style: normal; display: inline-block; transition: transform 0.3s var(--ease-out); }
.featured-card:hover .read-line i { transform: translateX(8px); }
.featured-card:hover .chip { background: var(--accent); color: var(--paper); }

.featured-img {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--line);
  aspect-ratio: 16 / 10;
}
.featured-img img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transform: scale(1.01);
  transition: filter 0.55s ease, transform 0.9s var(--ease-out);
}
.featured-card:hover .featured-img img { filter: grayscale(0); transform: scale(1.06); }
.sticker {
  position: absolute; top: 18px; right: 18px;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px; line-height: 1.15;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  transform: rotate(10deg);
  transition: transform 0.4s var(--ease-out);
  animation: sticker-wobble 3.2s ease-in-out infinite;
}
.featured-card:hover .sticker { transform: rotate(-8deg) scale(1.12); animation-play-state: paused; }
@keyframes sticker-wobble {
  0%, 100% { rotate: 0deg; }
  50% { rotate: 8deg; }
}

/* ---------- grid ---------- */
.grid-section { padding: 8vh 32px; max-width: 1280px; margin: 0 auto; }
.cat-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 44px; }
.fbtn {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em;
  padding: 8px 14px;
  border: 2px solid var(--accent);
  color: var(--accent);
  transition: background 0.25s, color 0.25s, transform 0.25s var(--ease-out);
}
.fbtn:hover { transform: translateY(-3px); }
.fbtn.is-on { background: var(--accent); color: var(--paper); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 28px;
}
.card {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  transition: opacity 0.35s, transform 0.45s var(--ease-out);
}
.card.is-hidden { display: none; }
.card-img {
  overflow: hidden;
  border: 2px solid var(--line);
  aspect-ratio: 4 / 3;
  position: relative;
}
.card-img img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.5s ease, transform 0.8s var(--ease-out);
}
.card:hover .card-img img { filter: grayscale(0); transform: scale(1.07) rotate(0.6deg); }
.card-index {
  position: absolute; top: -18px; right: 2px;
  font-family: var(--font-display);
  font-size: 58px; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  transition: color 0.3s, -webkit-text-stroke-color 0.3s, transform 0.4s var(--ease-out);
  pointer-events: none;
}
.card:hover .card-index {
  color: var(--accent);
  -webkit-text-stroke-color: var(--accent);
  transform: rotate(-6deg) scale(1.1);
}
.card-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.card-title {
  font-family: var(--font-display);
  font-size: 20px; line-height: 1.25;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 0.14em;
  background-position: 0 92%;
  transition: background-size 0.45s var(--ease-out);
}
.card:hover .card-title { background-size: 100% 0.14em; }
.card:hover .chip { background: var(--accent); color: var(--paper); }
.card-excerpt { font-size: 14px; color: var(--ink-soft); }
.card-date { color: var(--ink-soft); }

/* ---------- about ---------- */
.about { padding: 8vh 32px 12vh; max-width: 1280px; margin: 0 auto; }
.about-inner { max-width: 820px; }
.about-lead { font-size: clamp(22px, 2.8vw, 32px); line-height: 1.55; }
.about-lead em { font-style: italic; }
.about-small { color: var(--ink-soft); margin-top: 28px; }
.demo-note {
  display: flex; align-items: flex-start; gap: 14px;
  margin-top: 44px;
  padding: 20px 22px;
  border: 2px solid var(--line);
  background: #fff;
  box-shadow: 6px 6px 0 var(--line);
}
.demo-note .mono { line-height: 2; color: var(--ink-soft); }
.demo-note a { color: var(--ink); border-bottom: 2px solid #ffb100; }
.demo-note a:hover { background: #ffb100; }
.foot-demo a { color: var(--paper); text-decoration: underline; }

/* ---------- rotating badge ---------- */
.spin-badge {
  position: fixed; right: 28px; bottom: 28px; z-index: 90;
  width: 96px; height: 96px;
  display: block;
}
.spin-badge svg { width: 100%; height: 100%; overflow: visible; }
.spin-badge text {
  font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.18em;
  fill: var(--ink);
}
.spin-badge svg { animation: spin 14s linear infinite; }
.spin-badge:hover svg { animation-duration: 3.5s; }
.spin-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  transition: transform 0.3s var(--ease-out);
}
.spin-badge:hover .spin-center { transform: translateY(5px); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- footer ---------- */
.site-foot {
  background: var(--ink);
  color: var(--paper);
  border-top: 2px solid var(--line);
}
.foot-marquee { overflow: hidden; padding: 5vh 0 4vh; }
.foot-track {
  display: flex; width: max-content;
  animation: ticker-run 26s linear infinite;
}
.foot-track span {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 96px);
  line-height: 1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 2px var(--paper);
  transition: color 0.4s;
}
.foot-marquee:hover .foot-track span { color: var(--paper); }
.foot-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 20px 32px 26px;
  border-top: 1px solid rgba(250, 250, 247, 0.25);
  color: rgba(250, 250, 247, 0.7);
}
.foot-row a { color: var(--paper); font-weight: 700; }
.foot-row a:hover { text-decoration: underline; }

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px) rotate(0.4deg);
  transition: opacity 0.7s ease, transform 0.7s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: translateY(0) rotate(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track, .foot-track, .spin-badge svg, .grain, .sticker { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.progress {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 4px; width: 0%;
  background: var(--accent);
}
.article { max-width: 760px; margin: 0 auto; padding: 9vh 32px 6vh; }
.kicker { color: var(--ink-soft); margin-bottom: 26px; display: flex; align-items: center; }
.article-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.04;
  margin-bottom: 24px;
}
.article-excerpt { font-size: 23px; color: var(--ink-soft); font-style: italic; }
.article-figure { margin: 6vh 0; }
.article-figure img {
  width: 100%;
  border: 2px solid var(--line);
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.6s ease;
}
.article-figure:hover img { filter: grayscale(0); }
.article-figure figcaption { color: var(--ink-soft); margin-top: 10px; }
.article-body p { margin-bottom: 1.7em; font-size: 17px; }
.article-body .has-dropcap::first-letter {
  font-family: var(--font-display);
  font-size: 4.1em;
  float: left;
  line-height: 0.82;
  padding: 0.04em 0.12em 0 0;
  color: var(--accent);
}
.pull {
  margin: 3.5em 0;
  padding-left: 26px;
  border-left: 6px solid var(--accent);
}
.pull span {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1.35;
}
.article-end {
  display: flex; align-items: center; gap: 14px;
  color: var(--ink-soft);
  margin: 7vh 0 5vh;
}
.end-scissors { color: var(--accent); font-size: 20px; display: inline-block; animation: sticker-wobble 2.6s ease-in-out infinite; }
.article-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  border-top: 2px solid var(--line);
  padding-top: 28px;
}
.article-nav a {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px;
  border: 2px solid var(--line);
  transition: background 0.3s, transform 0.3s var(--ease-out);
}
.article-nav a strong { font-family: var(--font-display); font-size: 16px; line-height: 1.3; }
.article-nav a .mono { color: var(--accent); font-weight: 700; }
.article-nav a:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-4px); }
.article-nav a:hover .mono { color: #fff; }
.article-nav .next { text-align: right; align-items: flex-end; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .featured-card { grid-template-columns: 1fr; gap: 28px; }
  .featured-img { order: -1; }
}
@media (max-width: 600px) {
  .site-head { padding: 14px 18px; }
  .head-meta { display: none; }
  .nav { gap: 16px; }
  .hero, .featured, .grid-section, .about, .article { padding-left: 18px; padding-right: 18px; }
  .grid { grid-template-columns: 1fr; }
  .spin-badge { width: 72px; height: 72px; right: 16px; bottom: 16px; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav .next { text-align: left; align-items: flex-start; }
}
