/* ============================================================
   D + D — vintage polaroid / muted brown + grey palette
   ============================================================ */
:root {
  --bone: #ece6da;
  --paper: #f5f1e9;
  --paper-2: #efe9de;
  --ash: #d8d3ca;
  --sand: #cbbca5;
  --taupe: #a08d77;
  --clay: #7d6753;
  --mocha: #4c3d32;
  --espresso: #2a221d;
  --concrete: #a6a29b;
  --slate: #6d6964;
  --ink: #2f2925;

  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --hand: "Homemade Apple", "Bradley Hand", cursive;
  --poster: "Oswald", "Arial Narrow", sans-serif;
  --typed: "Courier Prime", "Courier New", monospace;
  --serif: "Cormorant Garamond", Georgia, serif;

  --shadow-1: 0 1px 1px rgba(42, 34, 29, .08), 0 6px 14px -6px rgba(42, 34, 29, .35);
  --shadow-2: 0 2px 2px rgba(42, 34, 29, .08), 0 24px 40px -16px rgba(42, 34, 29, .55);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* film grain over everything */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 200;
  opacity: .16; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .15 0 0 0 0 .12 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); } 60% { transform: translate(-1%, 3%); }
  80% { transform: translate(3%, 1%); } 100% { transform: translate(0, 0); }
}

/* ---------- type helpers ---------- */
.typed { font-family: var(--typed); font-size: 13px; letter-spacing: .14em; text-transform: lowercase; color: var(--slate); margin: 0; }
.hand { font-family: var(--hand); }
.script-h { font-family: var(--script); font-weight: 400; margin: 0; line-height: 1; }

/* ---------- buttons ---------- */
.btn {
  --bg: transparent; --fg: var(--ink); --bd: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .7em 1.3em; border-radius: 999px;
  border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  font-family: var(--typed); font-size: 13px; letter-spacing: .12em; text-transform: lowercase;
  text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease), background .25s, color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(0); }
.btn--ink { --bg: var(--mocha); --fg: var(--paper); --bd: var(--mocha); }
.btn--ink:hover { --bg: var(--espresso); }
.btn--ghost { --bd: rgba(47, 41, 37, .4); }
.btn--bone { --bg: var(--bone); --fg: var(--espresso); --bd: var(--bone); }
.btn--ghost-light { --fg: var(--bone); --bd: rgba(236, 230, 218, .45); }
.btn--text { border: 0; padding: .5em .6em; text-decoration: underline; text-underline-offset: 3px; }
.btn--text:hover { box-shadow: none; }
.btn--big { padding: 1em 1.8em; font-size: 14px; }
.link-btn { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; display: inline-block; margin-top: 18px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px clamp(16px, 4vw, 48px);
  transition: background .4s, box-shadow .4s, transform .4s var(--ease);
}
.nav.is-solid { background: rgba(236, 230, 218, .82); backdrop-filter: blur(10px) saturate(1.1); box-shadow: 0 1px 0 rgba(47, 41, 37, .08); }
.nav__logo { font-family: var(--script); font-size: 34px; text-decoration: none; line-height: 1; }
.nav__logo span { color: var(--taupe); }
.nav__links { display: flex; gap: 22px; margin-left: auto; }
.nav__links a { font-family: var(--typed); font-size: 13px; letter-spacing: .14em; text-decoration: none; color: var(--slate); position: relative; }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav__links a:hover::after { transform: scaleX(1); }

/* ============================================================
   HERO — wrapped like a gift
   ============================================================ */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 40%, transparent 40%, rgba(76, 61, 50, .18) 100%),
    linear-gradient(180deg, #e9e3d6 0%, #e2dbcc 100%);
  perspective: 1200px;
}
.hero__ribbon {
  position: absolute; z-index: 1;
  background:
    linear-gradient(90deg, rgba(0,0,0,.18), transparent 12%, rgba(255,255,255,.22) 30%, transparent 46%, rgba(0,0,0,.08) 70%, rgba(255,255,255,.14) 84%, rgba(0,0,0,.2)),
    linear-gradient(var(--clay), var(--clay));
  box-shadow: 0 0 0 1px rgba(42,34,29,.08), 0 10px 30px -10px rgba(42,34,29,.45);
}
.hero__ribbon::before, .hero__ribbon::after { content: ""; position: absolute; background: rgba(245, 241, 233, .25); }
.hero__ribbon--v { top: 0; bottom: 0; left: 50%; width: 64px; transform: translateX(-50%); }
.hero__ribbon--v::before, .hero__ribbon--v::after { top: 0; bottom: 0; width: 1px; }
.hero__ribbon--v::before { left: 6px; } .hero__ribbon--v::after { right: 6px; }
.hero__ribbon--h { left: 0; right: 0; top: 26%; height: 64px;
  background:
    linear-gradient(180deg, rgba(0,0,0,.18), transparent 12%, rgba(255,255,255,.22) 30%, transparent 46%, rgba(0,0,0,.08) 70%, rgba(255,255,255,.14) 84%, rgba(0,0,0,.2)),
    linear-gradient(var(--clay), var(--clay)); }
.hero__ribbon--h::before, .hero__ribbon--h::after { left: 0; right: 0; height: 1px; }
.hero__ribbon--h::before { top: 6px; } .hero__ribbon--h::after { bottom: 6px; }

.hero__bow {
  position: absolute; z-index: 3;
  left: 50%; top: 26%;
  width: min(560px, 92vw); height: min(420px, 70vw);
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 22px 18px rgba(42, 34, 29, .38));
}
.hero__copy {
  position: relative; z-index: 4;
  margin-top: 36vh;
  text-align: center;
  padding: 40px clamp(20px, 5vw, 56px) 34px;
  background: var(--paper);
  box-shadow: var(--shadow-2);
  max-width: 640px; width: calc(100% - 40px);
  transform-style: preserve-3d;
}
.hero__copy::before { /* tag hole + string */
  content: ""; position: absolute; top: 14px; left: 50%; width: 12px; height: 12px; margin-left: -6px;
  border-radius: 50%; background: #e2dbcc; box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
}
.hero__title { font-family: var(--script); font-weight: 400; font-size: clamp(56px, 9vw, 104px); line-height: .92; margin: 18px 0 12px; color: var(--espresso); }
.hero__title em { font-style: normal; color: var(--clay); }
.hero__sub { margin: 0 auto 24px; max-width: 30ch; font-style: italic; color: var(--slate); font-size: 20px; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.torn {
  background: #f8f5ef;
  box-shadow: var(--shadow-1);
  clip-path: polygon(0 4%, 6% 0, 13% 3%, 22% 0, 31% 2%, 40% 0, 52% 3%, 61% 0, 72% 2%, 83% 0, 92% 3%, 100% 1%, 99% 30%, 100% 62%, 98% 100%, 88% 97%, 76% 100%, 64% 97%, 53% 100%, 41% 96%, 30% 100%, 19% 97%, 8% 100%, 0 97%, 2% 60%);
}
.hero__note { position: absolute; z-index: 5; right: clamp(12px, 7vw, 120px); bottom: 12vh; padding: 22px 26px; transform: rotate(4deg); font-size: 15px; line-height: 1.9; color: var(--mocha); max-width: 240px; }
.hero__scroll { position: absolute; z-index: 5; bottom: 24px; background: var(--paper); padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow-1); left: 50%; transform: translateX(-50%); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* ============================================================
   SECTION HEADS
   ============================================================ */
.section-head { text-align: center; padding: 0 20px; margin-bottom: 36px; perspective: 800px; }
.section-head .script-h { font-size: clamp(56px, 8vw, 96px); color: var(--espresso); margin-top: 6px; }
.section-head--light .script-h { color: var(--bone); }
.section-head--light .typed { color: var(--concrete); }
.section-head__count { margin-top: 8px; }

/* ============================================================
   IDEAS — the polaroid board
   ============================================================ */
.ideas { padding: 120px clamp(14px, 4vw, 56px) 140px; position: relative; }
.toolbar { max-width: 1280px; margin: 0 auto 40px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.toolbar__right { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  font-family: var(--typed); font-size: 12px; letter-spacing: .12em; text-transform: lowercase;
  padding: 8px 14px 8px 14px; border: 1px solid rgba(47, 41, 37, .25);
  background: var(--paper); cursor: pointer; position: relative;
  border-radius: 3px 3px 3px 3px;
  transition: background .25s, color .25s, transform .25s var(--ease);
}
.tab::before { content: ""; position: absolute; left: 7px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--c, var(--taupe)); opacity: 0; transition: opacity .2s; }
.tab:hover { transform: translateY(-2px); }
.tab[aria-selected="true"] { background: var(--mocha); color: var(--paper); border-color: var(--mocha); }
.tab .n { opacity: .55; margin-left: 4px; }
.search input { border: 0; border-bottom: 1px solid rgba(47, 41, 37, .35); background: transparent; padding: 6px 2px; width: 200px; font-family: var(--typed); font-size: 14px; outline: none; }
.search input:focus { border-bottom-color: var(--mocha); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-family: var(--typed); font-size: 12px; letter-spacing: .12em; color: var(--slate); cursor: pointer; }
.toggle input { accent-color: var(--mocha); }
.toggle--light { color: var(--concrete); margin-top: 12px; }
.toggle--light input { accent-color: var(--sand); }

.board {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 56px 40px;
  perspective: 1400px;
}
.empty { text-align: center; font-size: 18px; color: var(--clay); margin-top: 40px; }

/* the polaroid */
.polaroid {
  position: relative; margin: 0;
  background: var(--paper);
  padding: 12px 12px 0;
  box-shadow: var(--shadow-1);
  background-image: linear-gradient(160deg, rgba(255,255,255,.6), transparent 40%), linear-gradient(var(--paper), var(--paper-2));
}
.polaroid__photo {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  background: #3a312b; display: grid; place-items: center;
}
.polaroid__photo img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.28) saturate(.72) contrast(1.04) brightness(.97); }
.polaroid__photo::after { /* vignette + fade */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 120% at 50% 45%, transparent 55%, rgba(30, 22, 16, .35) 100%), linear-gradient(180deg, rgba(255, 238, 214, .08), rgba(60, 40, 25, .1));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.polaroid__cap { display: block; padding: 14px 4px 18px; text-align: center; }

/* placeholder "photo" for ideas without one */
.ph {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 18px;
  background:
    radial-gradient(80% 70% at 30% 25%, rgba(255,255,255,.22), transparent 60%),
    radial-gradient(90% 90% at 80% 90%, rgba(0,0,0,.35), transparent 60%),
    linear-gradient(135deg, var(--c1, var(--taupe)), var(--c2, var(--mocha)));
  color: rgba(245, 241, 233, .88);
}
.ph b { font-family: var(--script); font-weight: 400; font-size: 54px; line-height: .9; text-shadow: 0 2px 12px rgba(0,0,0,.25); }
.ph small { position: absolute; bottom: 10px; left: 0; right: 0; font-family: var(--typed); font-size: 10px; letter-spacing: .2em; opacity: .7; }

/* idea card on the board */
.card {
  --rz: 0deg; --rx: 0deg; --ry: 0deg; --tz: 0px; --lift: 0px;
  position: relative; cursor: pointer;
  transform-style: preserve-3d;
  --hx: 0deg; --hy: 0deg;
  transform: translateZ(var(--tz)) rotateX(calc(var(--rx) + var(--hx))) rotateY(calc(var(--ry) + var(--hy))) rotateZ(var(--rz)) translateY(var(--lift));
  transition: transform .45s var(--ease), box-shadow .4s, opacity .8s;
  will-change: transform;
  outline: none;
}
.card .polaroid { transition: box-shadow .4s var(--ease); }
.card:hover, .card:focus-visible { --lift: -10px; z-index: 5; }
.card:hover .polaroid, .card:focus-visible .polaroid { box-shadow: var(--shadow-2); }
.card:focus-visible .polaroid { outline: 2px solid var(--clay); outline-offset: 4px; }
.card__title { font-family: var(--hand); font-size: 16px; line-height: 1.5; color: var(--ink); display: block; min-height: 2.4em; }
.card__credits {
  display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; text-align: left;
  font-family: var(--typed); font-size: 10.5px; line-height: 1.45; color: var(--slate);
  margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(47, 41, 37, .12);
}
.card__credits dt { text-transform: lowercase; letter-spacing: .08em; color: var(--concrete); }
.card__credits dd { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__poster { /* tiny movie-poster stamp in the corner of the photo */
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  font-family: var(--poster); font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  font-size: 13px; color: var(--paper); text-shadow: 0 1px 6px rgba(0,0,0,.4);
}
.card__poster i { font-style: normal; font-family: var(--typed); font-weight: 400; font-size: 10px; letter-spacing: .1em; margin-left: 6px; opacity: .85; }
.tape {
  position: absolute; z-index: 3; top: -12px; left: 50%; width: 92px; height: 26px; margin-left: -46px;
  background: linear-gradient(90deg, rgba(214, 203, 184, .78), rgba(232, 224, 210, .72) 50%, rgba(214, 203, 184, .78));
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  transform: rotate(var(--tr, -3deg));
  clip-path: polygon(2% 0, 98% 4%, 100% 30%, 97% 52%, 100% 78%, 98% 100%, 3% 96%, 0 70%, 3% 48%, 0 22%);
}
.stamp {
  position: absolute; z-index: 4; right: -10px; top: 18px;
  font-family: var(--poster); font-weight: 700; font-size: 14px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--clay); border: 2px solid var(--clay); padding: 3px 10px 2px; border-radius: 3px;
  transform: rotate(12deg); background: rgba(245, 241, 233, .7); opacity: .92;
  mix-blend-mode: multiply;
}
.card.is-done .polaroid__photo img, .card.is-done .ph { filter: grayscale(.55) sepia(.3) brightness(.92); }
.card__us { /* mini polaroid of us peeking from behind */
  position: absolute; z-index: -1; right: -26px; bottom: 58px; width: 42%;
  transform: rotate(9deg) translateZ(-1px); background: var(--paper); padding: 5px 5px 16px; box-shadow: var(--shadow-1);
}
.card__us img { aspect-ratio: 1; object-fit: cover; filter: sepia(.25) saturate(.75); }

/* add-new card on the board */
.card--add .polaroid__photo { background: transparent; border: 1.5px dashed rgba(47, 41, 37, .3); }
.card--add .polaroid { background: rgba(245, 241, 233, .55); box-shadow: none; }
.card--add .plus { font-family: var(--script); font-size: 88px; color: var(--taupe); line-height: 1; }

/* reveal: initial state before 3D scroll takes over */
.reveal { opacity: 0; }
.reveal.is-in { opacity: 1; }

/* ============================================================
   GENERATOR
   ============================================================ */
.gen {
  position: relative; padding: 130px clamp(14px, 4vw, 56px) 150px; color: var(--bone);
  background:
    radial-gradient(70% 60% at 70% 40%, rgba(160, 141, 119, .22), transparent 70%),
    radial-gradient(60% 80% at 10% 90%, rgba(109, 105, 100, .25), transparent 70%),
    var(--espresso);
  overflow: hidden;
}
.gen::before { /* soft ribbon diagonal */
  content: ""; position: absolute; left: -10%; right: -10%; top: 58%; height: 46px; transform: rotate(-6deg);
  background: linear-gradient(180deg, rgba(0,0,0,.2), transparent 20%, rgba(255,255,255,.12) 40%, transparent 60%, rgba(0,0,0,.2)), var(--mocha);
  opacity: .55;
}
.gen__wrap { position: relative; max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: clamp(28px, 5vw, 70px); align-items: center; }
.gen__controls { display: grid; gap: 20px; background: rgba(42, 34, 29, .55); padding: 28px; border: 1px solid rgba(236, 230, 218, .12); backdrop-filter: blur(4px); }
.gen__controls fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gen__controls legend { width: 100%; margin-bottom: 8px; color: var(--concrete); }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(236, 230, 218, .3); font-family: var(--typed); font-size: 12.5px; letter-spacing: .08em; transition: all .2s; }
.chip:hover span { border-color: var(--sand); }
.chip input:checked + span { background: var(--bone); color: var(--espresso); border-color: var(--bone); }
.chip input:focus-visible + span { outline: 2px solid var(--sand); outline-offset: 2px; }
.chip--ink span { border-color: rgba(47, 41, 37, .3); }
.chip--ink:hover span { border-color: var(--mocha); }
.chip--ink input:checked + span { background: var(--mocha); color: var(--paper); border-color: var(--mocha); }
.select { appearance: none; padding: 9px 34px 9px 14px; border-radius: 999px; border: 1px solid rgba(236, 230, 218, .3); background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6' fill='%23a6a29b'/%3E%3C/svg%3E") no-repeat right 14px center; font-family: var(--typed); font-size: 13px; cursor: pointer; }
.gen .select option { color: var(--ink); }

.gen__stage { position: relative; min-height: 520px; display: grid; place-items: center; perspective: 1600px; }
.deck { position: relative; width: 290px; height: 380px; transform-style: preserve-3d; }
.deck .card { position: absolute; inset: 0; width: 290px; cursor: default; transition: transform .7s var(--ease), opacity .5s; }
.deck .card .polaroid { box-shadow: 0 30px 50px -20px rgba(0,0,0,.7); }
.deck .card.is-pick { cursor: pointer; }
.gen__result { position: absolute; bottom: -10px; left: 0; right: 0; text-align: center; }
.gen__why { color: var(--sand); font-size: 14px; line-height: 1.9; margin: 0 auto 14px; max-width: 46ch; }
.gen__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   MEMORIES — the frame with gingham
   ============================================================ */
.memories { padding: 130px clamp(14px, 4vw, 56px) 120px; }
.frame {
  max-width: 1180px; margin: 0 auto; padding: 18px;
  background: linear-gradient(145deg, #2f2722, #1f1915);
  box-shadow: 0 40px 80px -30px rgba(42, 34, 29, .6), inset 0 0 0 1px rgba(255,255,255,.05);
}
.frame__inner {
  position: relative; min-height: 520px; padding: 50px 40px 60px;
  display: flex; flex-wrap: wrap; gap: 34px 30px; justify-content: center; align-items: flex-start;
  background-color: #e6dfd2;
  background-image:
    linear-gradient(90deg, rgba(160, 141, 119, .38) 50%, transparent 50%),
    linear-gradient(rgba(160, 141, 119, .38) 50%, transparent 50%);
  background-size: 34px 34px;
  box-shadow: inset 0 0 60px rgba(42, 34, 29, .35);
  perspective: 1200px;
}
.memo { position: relative; width: 210px; cursor: pointer; transition: transform .5s var(--ease); }
.memo:hover { transform: rotate(0deg) translateY(-8px) scale(1.03) !important; z-index: 3; }
.memo .polaroid { padding: 10px 10px 0; }
.memo .polaroid__cap { font-family: var(--hand); font-size: 13px; padding: 10px 2px 14px; }
.memo__date { display: block; font-family: var(--typed); font-size: 10px; letter-spacing: .14em; color: var(--concrete); margin-top: 4px; }
.strip { /* photobooth strip */
  width: 150px; background: #f4efe6; padding: 10px 10px 34px; display: grid; gap: 8px; box-shadow: var(--shadow-2);
  position: relative;
}
.strip img { aspect-ratio: 4/3; object-fit: cover; filter: grayscale(.3) sepia(.35) contrast(1.05); }
.strip::after { content: "D + D"; position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-family: var(--script); font-size: 20px; color: var(--mocha); }
.memo-note { padding: 20px 22px; font-family: var(--hand); font-size: 14px; line-height: 1.9; color: var(--mocha); max-width: 250px; align-self: center; }
.flower { width: 120px; align-self: flex-end; opacity: .9; }

/* ============================================================
   FOOTER
   ============================================================ */
.foot { text-align: center; padding: 60px 20px 70px; border-top: 1px solid rgba(47, 41, 37, .1); }
.foot__sig { font-size: 64px; color: var(--clay); }

/* ============================================================
   MODALS
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; perspective: 1600px; }
.modal[hidden] { display: none; }
.modal__scrim { position: absolute; inset: 0; background: rgba(31, 25, 21, .62); backdrop-filter: blur(6px) grayscale(.3); animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; } }
.modal__x { position: absolute; z-index: 3; top: 10px; right: 14px; border: 0; background: transparent; font-size: 34px; line-height: 1; cursor: pointer; color: var(--slate); }
.modal__x:hover { color: var(--ink); }

.detail {
  position: relative; width: min(1040px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  display: grid; grid-template-columns: 1fr 1.08fr; gap: 44px;
  background: var(--bone); padding: 48px clamp(22px, 4vw, 52px);
  box-shadow: 0 50px 100px -30px rgba(0,0,0,.6);
  animation: flipIn .7s var(--ease);
  transform-origin: 50% 60%;
}
@keyframes flipIn { from { opacity: 0; transform: rotateX(18deg) rotateY(-14deg) translateY(40px) scale(.94); } }
.detail__left { text-align: center; }
.polaroid--big { padding: 16px 16px 0; transform: rotate(-2deg); box-shadow: var(--shadow-2); }
.polaroid--big .polaroid__cap { font-family: var(--hand); font-size: 20px; padding: 20px 6px 26px; }
.detail__cat { color: var(--clay); }
.detail__title { font-family: var(--poster); font-weight: 600; text-transform: uppercase; font-size: clamp(32px, 4.2vw, 50px); line-height: 1; letter-spacing: .01em; margin: 10px 0 8px; color: var(--espresso); }
.detail__meta { font-size: 12px; }
.detail__desc { font-style: italic; color: var(--mocha); margin: 18px 0 22px; font-size: 20px; }
.credits { display: grid; gap: 14px; padding: 18px 0; border-top: 1px solid rgba(47, 41, 37, .15); border-bottom: 1px solid rgba(47, 41, 37, .15); }
.credits > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: baseline; }
.credits span { font-family: var(--typed); font-size: 11px; letter-spacing: .14em; color: var(--concrete); }
.credits p { margin: 0; font-family: var(--typed); font-size: 14px; }
.credits a { text-underline-offset: 3px; }
.needs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-family: var(--typed); font-size: 14px; }
.needs li { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.needs li::before { content: ""; width: 13px; height: 13px; border: 1.5px solid var(--clay); border-radius: 2px; flex: none; }
.needs li.got { text-decoration: line-through; color: var(--concrete); }
.needs li.got::before { background: var(--clay); box-shadow: inset 0 0 0 2px var(--bone); }

.us-slot { margin: 24px 0 26px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.us-slot .typed { grid-column: 1 / -1; }
.polaroid--us { width: 200px; cursor: pointer; transform: rotate(3deg); padding: 9px 9px 0; transition: transform .4s var(--ease); }
.polaroid--us:hover { transform: rotate(0deg) scale(1.03); }
.polaroid--us .polaroid__photo { background: rgba(160, 141, 119, .18); border: 1.5px dashed rgba(47, 41, 37, .25); }
.polaroid--us.has-photo .polaroid__photo { border: 0; background: #3a312b; }
.polaroid--us .polaroid__photo span { font-size: 12px; color: var(--clay); text-align: center; padding: 10px; }
.polaroid--us .polaroid__cap { font-size: 12px; padding: 10px 2px 14px; min-height: 40px; }
.detail__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.detail.is-done #dDone { --bg: transparent; --fg: var(--clay); --bd: var(--clay); }

/* add / edit form styled like an index card */
.card-form {
  position: relative; width: min(980px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background:
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(109, 105, 100, .14) 31px 32px),
    var(--paper);
  padding: 40px clamp(20px, 4vw, 48px) 30px;
  box-shadow: 0 50px 100px -30px rgba(0,0,0,.6);
  animation: flipIn .6s var(--ease);
}
.card-form::before { content: ""; position: absolute; top: 0; bottom: 0; left: clamp(10px, 2.4vw, 30px); width: 1px; background: rgba(125, 103, 83, .35); }
.card-form__head { font-size: 58px; color: var(--espresso); margin-bottom: 20px; }
.card-form__grid { display: grid; grid-template-columns: 260px 1fr; gap: 36px; }
.drop { display: block; cursor: pointer; }
.polaroid--form { transform: rotate(-2.5deg); transition: transform .4s var(--ease); }
.drop:hover .polaroid--form, .drop.is-over .polaroid--form { transform: rotate(0) scale(1.02); }
.polaroid--form .polaroid__photo { background: rgba(160, 141, 119, .16); border: 1.5px dashed rgba(47, 41, 37, .25); }
.polaroid--form .polaroid__photo.has-img { border: 0; }
.polaroid--form .polaroid__photo span { color: var(--clay); font-size: 13px; text-align: center; line-height: 1.9; }
.polaroid--form .polaroid__cap { font-size: 14px; min-height: 52px; }
.card-form__fields { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; }
.field > span { font-family: var(--typed); font-size: 11px; letter-spacing: .14em; color: var(--slate); }
.field > span em { font-style: normal; color: var(--concrete); }
.field input, .field textarea {
  border: 0; border-bottom: 1px solid rgba(47, 41, 37, .3); background: transparent; padding: 6px 2px;
  font-family: var(--hand); font-size: 15px; line-height: 1.9; outline: none; resize: vertical;
}
.field input:focus, .field textarea:focus { border-bottom-color: var(--mocha); }
.field input::placeholder, .field textarea::placeholder { color: rgba(109, 105, 100, .5); }
.field .select { border-color: rgba(47, 41, 37, .3); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6' fill='%236d6964'/%3E%3C/svg%3E"); }
.field__row { display: flex; gap: 8px; align-items: center; }
.field--chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.field--chips > span { width: 100%; }
.card-form__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }

/* passcode gate */
.gate { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: var(--espresso); }
.gate[hidden] { display: none; }
.gate__card { background: var(--paper); padding: 40px 44px; text-align: center; display: grid; gap: 14px; width: min(360px, 90vw); box-shadow: var(--shadow-2); transform: rotate(-1.5deg); }
.gate__card .script-h { font-size: 64px; color: var(--mocha); }
.gate__card input { border: 0; border-bottom: 1px solid var(--slate); background: transparent; text-align: center; padding: 8px; font-family: var(--typed); outline: none; }
.gate__err { color: #8a4a3a; min-height: 1em; }

.toast {
  position: fixed; z-index: 400; left: 50%; bottom: 28px; transform: translate(-50%, 120px);
  background: var(--espresso); color: var(--bone); padding: 12px 20px; border-radius: 999px;
  transition: transform .5s var(--ease); pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .gen__wrap { grid-template-columns: 1fr; }
  .gen__stage { min-height: 560px; }
  .detail { grid-template-columns: 1fr; gap: 26px; padding-top: 54px; }
  .detail__left { max-width: 380px; margin: 0 auto; }
  .card-form__grid { grid-template-columns: 1fr; }
  .drop { max-width: 240px; margin: 0 auto; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .nav { gap: 12px; }
  .nav__links { display: none; }
  .nav__add { margin-left: auto; padding: .6em 1em; }
  .hero__ribbon--v { width: 44px; }
  .hero__ribbon--h { height: 44px; }
  .hero__note { display: none; }
  .board { grid-template-columns: repeat(2, 1fr); gap: 34px 16px; }
  .card__credits { display: none; }
  .card__title { font-size: 12px; }
  .card__poster { font-size: 11px; }
  .polaroid { padding: 8px 8px 0; }
  .search input { width: 150px; }
  .toolbar { gap: 14px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 28px); margin: 0 -14px; padding: 4px 14px 8px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; }
  .credits > div { grid-template-columns: 1fr; gap: 4px; }
  .us-slot { grid-template-columns: 1fr; justify-items: center; }
  .frame__inner { padding: 30px 14px; gap: 22px 14px; }
  .memo { width: 150px; }
  .strip { width: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
.card .ph small { display: none; }
