/* ==========================================================================
   warm-cookbook / cookbook.css   --   Direction B "Warm Hand-Bound Cookbook"
   Cozy, lush, story-forward. Portrait masonry cards. Consumes only tokens.css.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* very faint warm paper texture (kept light) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .5;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(194,107,74,.05), transparent 40%),
    radial-gradient(circle at 88% 72%, rgba(156,174,139,.06), transparent 42%),
    repeating-linear-gradient(0deg, rgba(58,46,38,.012) 0 1px, transparent 1px 3px);
}

img { max-width: 100%; display: block; }
a { color: var(--rose-deep); text-decoration-thickness: 1px; text-underline-offset: .18em;
    transition: color var(--fast) var(--ease); }
a:hover { color: var(--terra-deep); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--r-sm); }

.bleed { width: 100%; }
.wrap  { width: var(--container); margin-inline: auto; }
.band--2 { background: var(--paper-2); }
.band--3 { background: var(--paper-3); }

h1, h2, h3 {
  font-family: var(--display); font-weight: 500; line-height: var(--lh-tight);
  letter-spacing: var(--tr-tight); color: var(--ink); margin: 0; font-optical-sizing: auto;
}
.script { font-family: var(--script); font-weight: 600; color: var(--terra); line-height: 1; }

/* tag / eyebrow */
.eyebrow {
  font-family: var(--body); font-size: var(--fs-tag); font-weight: 700;
  letter-spacing: var(--tr-wide); text-transform: uppercase; color: var(--terra);
  margin: 0;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.nav { background: var(--paper); border-bottom: 1px solid var(--hair); position: sticky; top: 0; z-index: 40; }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); padding-block: 1rem; }
.brand { font-family: var(--display); font-weight: 600; font-size: 1.35rem; color: var(--ink);
  text-decoration: none; letter-spacing: var(--tr-tight); display: inline-flex; align-items: baseline; }
.brand .dot { color: var(--rose-deep); }
.brand small { font-family: var(--script); font-weight: 600; font-size: 1.15rem; color: var(--sage-deep); margin-left: .5rem; }
.navlinks { display: flex; gap: clamp(1rem,2.4vw,2rem); align-items: center; }
.navlinks a { font-size: var(--fs-meta); font-weight: 600; color: var(--ink-2); text-decoration: none; }
.navlinks a:hover { color: var(--terra-deep); }
@media (max-width: 620px) { .navlinks .hide-sm { display: none; } }

/* ==========================================================================
   HERO (seasonal, full-bleed)
   ========================================================================== */

.hero { position: relative; background: var(--paper-2); overflow: hidden; }
.hero__grid {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
}
.hero__text { padding-block: clamp(2.6rem, 7vw, 5.5rem); display: grid; gap: clamp(1rem,2vw,1.6rem); }
.hero__season { display: inline-flex; align-items: center; gap: .6rem; }
.hero__season .line { width: 2.2rem; height: 2px; background: var(--terra); }
.hero__title { font-size: var(--fs-mast); font-weight: 500; line-height: .98; letter-spacing: -0.02em; }
.hero__title .script { display: block; font-size: var(--fs-script); color: var(--terra); transform: rotate(-2.5deg); transform-origin: left; margin-bottom: -.3rem; }
.hero__sub { font-size: var(--fs-md); color: var(--ink-2); max-width: 38ch; line-height: var(--lh-snug); margin: 0; }
.hero__cta { display: inline-flex; align-items: center; gap: .6rem; align-self: start;
  font-family: var(--body); font-weight: 700; font-size: var(--fs-sm); letter-spacing: .04em;
  color: var(--paper); background: var(--terra); border: 0; border-radius: var(--r-pill);
  padding: .8rem 1.5rem; text-decoration: none; cursor: pointer;
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease); }
.hero__cta:hover { background: var(--terra-deep); color: var(--paper); transform: translateY(-2px); }

/* hero photo cluster: a big portrait + a peeking second photo, polaroid-ish */
.hero__media { position: relative; min-height: clamp(20rem, 44vw, 34rem); align-self: stretch; }
.hero__photo {
  position: absolute; overflow: hidden; background: var(--paper-3);
  border: 8px solid var(--card); border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
}
.hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.hero__photo--main { inset: clamp(1rem,3vw,2.4rem) clamp(2rem,8vw,5rem) clamp(1rem,3vw,2.4rem) clamp(.5rem,3vw,2rem);
  transform: rotate(-2.2deg); z-index: 1; }
.hero__photo--peek { width: 42%; aspect-ratio: 2/3; right: clamp(.5rem,2vw,1.5rem); bottom: clamp(.5rem,2vw,1.5rem);
  transform: rotate(4deg); z-index: 2; }
.hero__note {
  position: absolute; z-index: 3; top: clamp(.5rem,2vw,1.2rem); right: clamp(.5rem,3vw,2rem);
  font-family: var(--script); font-weight: 700; font-size: clamp(1.1rem,2.2vw,1.5rem);
  color: var(--rose-deep); transform: rotate(6deg); text-align: center; line-height: 1;
}
.hero__note small { display:block; font-family: var(--body); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); transform: rotate(-6deg); margin-top:.2rem; }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: 0; }
  .hero__text { padding-bottom: clamp(1.5rem,5vw,2.5rem); order: 2; }
  .hero__media { order: 1; min-height: clamp(17rem, 70vw, 26rem); margin-top: clamp(1rem,4vw,2rem); }
}

/* ==========================================================================
   CHIP RAIL
   ========================================================================== */

.chips { display: flex; gap: .6rem; overflow-x: auto; padding-block: 1.2rem; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { height: 6px; }
.chips::-webkit-scrollbar-thumb { background: var(--hair-2); border-radius: 99px; }
.chip {
  flex: none; cursor: pointer; white-space: nowrap; font-family: var(--body); font-size: var(--fs-sm); font-weight: 600;
  color: var(--ink-2); background: var(--card); border: 1.5px solid var(--hair-2); border-radius: var(--r-pill);
  padding: .5rem 1.1rem; transition: all var(--fast) var(--ease);
}
.chip:hover { border-color: var(--terra); color: var(--terra-deep); }
.chip.is-active { background: var(--terra); color: var(--paper); border-color: var(--terra); }

/* ==========================================================================
   SECTION HEADERS
   ========================================================================== */

.sec { padding-block: var(--block); }
.sec__head { text-align: center; max-width: 60ch; margin: 0 auto clamp(1.6rem,4vw,2.6rem); display: grid; gap: .6rem; }
.sec__script { font-family: var(--script); font-weight: 700; font-size: var(--fs-script); color: var(--rose-deep); transform: rotate(-2deg); }
.sec__title { font-size: var(--fs-2xl); font-weight: 500; }
.sec__dek { font-size: var(--fs-md); color: var(--ink-2); line-height: var(--lh-snug); margin: 0; }
.sec__head--left { text-align: left; margin-inline: 0; }

/* ==========================================================================
   COLLECTION GRID (uniform portrait cards, equal width + height)
   ========================================================================== */

.masonry {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gap);
  align-items: stretch;
}
@media (max-width: 1100px) { .masonry { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 900px)  { .masonry { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 640px)  { .masonry { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 430px)  { .masonry { grid-template-columns: minmax(0,1fr); } }

.pin {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--hair);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--base) var(--ease), box-shadow var(--base) var(--ease);
}
.pin:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.pin__frame { position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: var(--paper-3); }
.pin__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--base) var(--ease); }
.pin:hover .pin__frame img { transform: scale(1.05); }
.pin__tag {
  position: absolute; left: .7rem; top: .7rem; z-index: 2;
  font-family: var(--body); font-size: var(--fs-tag); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); background: color-mix(in srgb, var(--paper) 92%, transparent);
  padding: .28rem .7rem; border-radius: var(--r-pill); backdrop-filter: blur(4px);
}
.pin__fav {
  position: absolute; right: .7rem; top: .7rem; z-index: 2; width: 2rem; height: 2rem;
  display: grid; place-items: center; border-radius: 50%; color: var(--rose-deep);
  background: color-mix(in srgb, var(--paper) 92%, transparent); box-shadow: var(--shadow-card);
}
.pin__fav svg { width: 1.05rem; height: 1.05rem; }
.pin__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.pin__title { font-family: var(--display); font-weight: 500; font-size: var(--fs-lg); line-height: var(--lh-snug); letter-spacing: var(--tr-tight);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pin__title::after { content: "."; color: var(--rose-deep); }
.pin__dek { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pin__meta { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; font-size: var(--fs-meta); color: var(--ink-3); margin-top: auto; }
.pin__meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--sage); }
.pin__note { display: none; }

/* ==========================================================================
   STORY STRIP (a wide editorial-ish row inside the cookbook)
   ========================================================================== */

.story { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(1.5rem,4vw,3.5rem); align-items: center; }
@media (max-width: 820px) { .story { grid-template-columns: 1fr; } }
.story__media { position: relative; aspect-ratio: 4/3; border-radius: var(--r-lg); overflow: hidden;
  border: 8px solid var(--card); box-shadow: var(--shadow-soft); transform: rotate(-1.5deg); }
.story__media img { width: 100%; height: 100%; object-fit: cover; }
.story__text { display: grid; gap: 1rem; }
.story__text .sec__script { text-align: left; }
.story__text h2 { font-size: var(--fs-xl); }
.story blockquote { margin: 0; font-family: var(--display); font-style: italic; font-size: var(--fs-md); color: var(--ink-2); line-height: var(--lh-snug); }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.foot { background: var(--paper-3); border-top: 1px solid var(--hair-2); }
.foot__inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem,4vw,3rem); padding-block: var(--block); }
@media (max-width: 760px) { .foot__inner { grid-template-columns: 1fr; } }
.foot__note { font-family: var(--display); font-style: italic; font-size: var(--fs-md); color: var(--ink-2); line-height: var(--lh-snug); max-width: 40ch; }
.foot__hand { font-family: var(--script); font-weight: 700; font-size: 1.6rem; color: var(--rose-deep); margin-top: .6rem; }
.foot__cats { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.foot__cats a { font-size: var(--fs-meta); color: var(--ink-2); text-decoration: none; border: 1px solid var(--hair-2);
  border-radius: var(--r-pill); padding: .35rem .8rem; background: var(--card); }
.foot__cats a:hover { border-color: var(--terra); color: var(--terra-deep); }
.foot__sig { padding-block: 1.4rem; border-top: 1px solid var(--hair); text-align: center; color: var(--ink-3); font-size: var(--fs-meta); }

/* ==========================================================================
   reveal + skeleton
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .reveal.armed { opacity: 0; transform: translateY(16px); }
  .reveal.armed.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }
}
.sk { background: linear-gradient(100deg, var(--paper-2) 30%, var(--paper-3) 50%, var(--paper-2) 70%);
  background-size: 200% 100%; animation: sk 1.3s infinite linear; border-radius: var(--r-lg); }
@keyframes sk { to { background-position: -200% 0; } }

/* ==========================================================================
   print
   ========================================================================== */
@media print {
  .nav, .foot, .chips, .hero__cta { display: none !important; }
  body { background: #fff; color: #000; } body::before { display: none; }
  .masonry { grid-template-columns: repeat(2,1fr); }
  .pin { box-shadow: none; border: 1px solid #ccc; }
}
