/* Heavy Light — Stacked Studio
   Paper-craft editorial landing page.
   Theme tokens live here; pages consume them via var(--token).
*/

:root {
  --bone: #f4efe6;
  --bone-deep: #e9e1d1;
  --ink: #1a1915;
  --ink-rgb: 26, 25, 21;
  --ink-soft: #3a3832;
  --mushroom: #6d6457;
  --tangerine: #e84d18;
  --tangerine-soft: #ffb89c;

  --paper: #ffffff;
  --shadow-edge: 0 1px 0 rgba(var(--ink-rgb), 0.06);
  --shadow-card:
    var(--shadow-edge),
    0 2px 8px rgba(var(--ink-rgb), 0.04),
    0 18px 36px -20px rgba(var(--ink-rgb), 0.18);
  --shadow-card-hover:
    var(--shadow-edge),
    0 6px 12px rgba(var(--ink-rgb), 0.06),
    0 42px 64px -28px rgba(var(--ink-rgb), 0.32);

  --ease-out-soft: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Paper grain as a reusable background — declared once, referenced by name */
  --grain-heavy: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.09  0 0 0 0 0.08  0 0 0 0.25 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --grain-light: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.09  0 0 0 0 0.08  0 0 0 0.2 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

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

html,
body {
  background: var(--bone);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  overflow-x: hidden;
}
body {
  min-height: 100vh;
}

/* Custom cursor is only active on fine-pointer devices. */
@media (pointer: fine) {
  html.custom-cursor,
  html.custom-cursor * {
    cursor: none;
  }
}

/* Paper grain overlay + subtle top vignette. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain-heavy);
  opacity: 0.55;
  mix-blend-mode: multiply;
  z-index: 1;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 0%,
    transparent 55%,
    rgba(var(--ink-rgb), 0.12) 100%
  );
  z-index: 1;
}

main {
  position: relative;
  z-index: 2;
}

/* Cursor + ink smudge trail */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  background: var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease,
    opacity 0.2s ease;
  display: none;
}
.cursor.is-active {
  display: block;
}
.cursor.is-hover {
  width: 44px;
  height: 44px;
  background: var(--tangerine);
  mix-blend-mode: normal;
  opacity: 0.85;
}
.smudge {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 998;
  transform: translate(-50%, -50%);
  opacity: 0.22;
  mix-blend-mode: multiply;
  animation: smudge-fade 1.1s ease-out forwards;
}
@keyframes smudge-fade {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
}

/* Header */
.site-header {
  padding: 56px 72px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.wordmark {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.wordmark-dot {
  width: 10px;
  height: 10px;
  background: var(--tangerine);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--bone), 0 0 0 4px var(--tangerine-soft);
}
.site-nav {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mushroom);
  display: flex;
  gap: 32px;
}
.site-nav a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
.site-nav a:hover {
  color: var(--ink);
}

/* Hero */
.hero {
  padding: 88px 72px 56px;
  max-width: 1100px;
}
h1 {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-size: clamp(56px, 8vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
}
h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--tangerine);
}
.lede {
  font-size: 19px;
  line-height: 1.55;
  max-width: 540px;
  color: var(--ink-soft);
}

/* Cards */
.cards {
  padding: 40px 72px 120px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px;
  max-width: 1200px;
}
.card {
  position: relative;
  background: var(--paper);
  border-radius: 6px;
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.45s var(--ease-out-soft), box-shadow 0.45s ease;
  transform-origin: center 80%;
  text-decoration: none;
  color: inherit;
  display: block;
  isolation: isolate;
}
.card:nth-child(1) {
  transform: rotate(-1.2deg);
}
.card:nth-child(2) {
  transform: rotate(0.8deg);
  margin-top: 24px;
}
.card:hover {
  transform: rotate(0deg) translateY(-10px) scale(1.015);
  box-shadow: var(--shadow-card-hover);
}

.card-frame {
  border: 1px solid var(--bone-deep);
  border-radius: 3px;
  padding: 32px 20px 0;
  background: var(--bone);
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  display: flex;
  justify-content: center;
}
.card-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grain-light);
  opacity: 0.4;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 2;
}
.card-frame img {
  height: 100%;
  width: auto;
  max-width: 100%;
  border-radius: 22px 22px 0 0;
  display: block;
  filter: saturate(0.96);
  box-shadow:
    0 2px 4px rgba(var(--ink-rgb), 0.08),
    0 22px 40px -14px rgba(var(--ink-rgb), 0.35);
  transition: transform 0.5s var(--ease-out-soft);
  position: relative;
  z-index: 1;
}
.card:hover .card-frame img {
  transform: translateY(-6px);
}

.card-meta {
  margin-top: 22px;
}
.card-title {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: 38px;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: 8px;
}
.card-title em {
  font-style: italic;
  font-weight: 300;
}
.card-sub {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mushroom);
}

/* Footer */
.site-footer {
  padding: 32px 72px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mushroom);
  border-top: 1px solid var(--bone-deep);
  margin: 0 72px;
}

/* Responsive */
@media (max-width: 780px) {
  .site-header,
  .hero,
  .cards,
  .site-footer {
    padding-left: 28px;
    padding-right: 28px;
  }
  .site-footer {
    margin: 0 28px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .site-header {
    padding-top: 32px;
  }
  .hero {
    padding-top: 56px;
    padding-bottom: 32px;
  }
  .site-nav {
    gap: 18px;
    font-size: 11px;
  }
}

/* Reduce motion: drop the card tilts, image lifts, and smudges. */
@media (prefers-reduced-motion: reduce) {
  .card,
  .card:hover,
  .card:nth-child(1),
  .card:nth-child(2),
  .card:hover .card-frame img {
    transform: none;
    transition: none;
  }
  .smudge {
    display: none;
  }
}
