/* ============================================================
   Two Piggie's — prototype tokens & layout
   Signature: the page moves through the day. A single scroll-
   linked wash (--wash) warms from porcelain dawn to clear noon,
   then the golden teaser and dusk booking strip finish the arc.
   ============================================================ */

@font-face {
  font-family: 'TwoPiggiesScript';
  src: url('../fonts/milkymatcha.woff2') format('woff2');
  font-display: swap;
}

:root {
  /* palette — subject-derived, AA-checked */
  --dawn: #dfe8f2;        /* cool porcelain morning sky            */
  --noon: #fcfaf2;        /* clear bright midday                   */
  --dusk: #212a40;        /* deep blue after the sun is gone       */
  --ink: #1d2530;         /* blue-black text                       */
  --ink-soft: #55606e;    /* secondary text (AA on dawn & noon)    */
  --lake: #34655f;        /* deep lake teal — eyebrows, links      */
  --ember: #a85417;       /* sunset ember — CTAs (5.3:1 w/ white)  */
  --ember-deep: #8c4512;  /* hover                                 */
  --amber: #f2b366;       /* amber text on dusk (7.8:1)            */

  --wash: var(--dawn);    /* animated by js/day.js                 */

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Mulish', system-ui, sans-serif;
  --font-script: 'TwoPiggiesScript', cursive;

  --measure: 34em;
  --gutter: clamp(20px, 4vw, 48px);
  --section-pad: clamp(72px, 10vw, 128px);
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 17.5px;
  line-height: 1.68;
  color: var(--ink);
  background: var(--wash);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--lake); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--ember);
  outline-offset: 2px;
  border-radius: 4px;
}
/* ember fails 3:1 on the dark sections — amber passes (7.8:1) */
.book :focus-visible, .daybar :focus-visible, .footer :focus-visible {
  outline-color: var(--amber);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
}
.skip-link:focus-visible {
  left: 12px;
  top: 12px;
  background: #fff;
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lake);
}

/* ============ nav ============ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 28px);
  padding: 10px clamp(14px, 3vw, 28px);
  transition: background 300ms ease, box-shadow 300ms ease;
}
.nav--solid {
  background: color-mix(in srgb, var(--wash) 86%, white 14%);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.06);
}
.brand {
  font-family: var(--font-script);
  font-size: clamp(20px, 4.5vw, 27px);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  text-shadow: 0 1px 10px rgb(0 0 0 / 0.35);
  transition: color 300ms ease, text-shadow 300ms ease;
}
.brand img { width: 1.05em; height: 1.05em; }
.nav--solid .brand { color: var(--ink); text-shadow: none; }
.nav-links {
  display: flex;
  gap: clamp(12px, 1.8vw, 24px);
  margin-left: auto;
}
.nav-links a {
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.4);
  transition: color 300ms ease, text-shadow 300ms ease;
  display: inline-block;
  padding: 10px 4px; /* 44px effective touch target */
}
.nav-key {
  display: none;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.4);
  padding: 10px 6px;
  margin-left: auto;
  transition: color 300ms ease, text-shadow 300ms ease;
}
.nav--solid .nav-key { color: var(--ink); text-shadow: none; }
.nav--solid .nav-links a { color: var(--ink); text-shadow: none; }
.nav-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav .cta { margin-left: auto; }

/* the one CTA style, used everywhere */
.cta {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--ember);
  color: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease;
}
.cta:hover { background: var(--ember-deep); transform: translateY(-1px); }
.nav-links + .cta { margin-left: 0; }

/* ============ hero ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
}
.hero-img, .hero-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgb(10 14 22 / 0.66) 0%,
    rgb(10 14 22 / 0.32) 38%,
    rgb(10 14 22 / 0.05) 62%,
    rgb(10 14 22 / 0.38) 100% /* scrim for the nav over pale sky */
  );
}
.hero h1 span { display: block; } /* one sentence per line, every width */
.hero-copy {
  padding: 0 var(--gutter) clamp(56px, 9vh, 96px);
  max-width: 1200px;
  margin-inline: auto;
  width: 100%;
  color: #fff;
}
.hero-copy .eyebrow, .teaser-copy .eyebrow {
  color: rgb(255 255 255 / 0.93);
  text-shadow: 0 1px 10px rgb(0 0 0 / 0.5);
}
.hero-copy .eyebrow { margin-bottom: 14px; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: clamp(42px, 6.4vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  max-width: 11em;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgb(0 0 0 / 0.35);
}
.hero-sub {
  margin-top: 18px;
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 600;
  max-width: var(--measure);
  text-shadow: 0 1px 12px rgb(0 0 0 / 0.5);
}
.hero-trust {
  margin-top: 10px;
  font-size: 14.5px;
  font-weight: 700;
  color: rgb(255 255 255 / 0.92);
  text-shadow: 0 1px 10px rgb(0 0 0 / 0.5);
}
.hero-actions {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-actions .cta { padding: 14px 28px; font-size: 16px; }
.link-ghost {
  color: rgb(255 255 255 / 0.85);
  font-size: 14.5px;
  font-weight: 600;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.5);
  display: inline-block;
  padding: 10px 2px;
  margin: -10px 0;
}
.link-ghost:hover { color: #fff; }

/* ============ at-a-glance ============ */
.glance {
  max-width: 1200px;
  margin-inline: auto;
  padding: clamp(40px, 6vw, 64px) var(--gutter);
  text-align: center;
}
.glance-lede {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 480;
  font-size: clamp(20px, 2.6vw, 26px);
  color: var(--ink);
}
.glance-facts {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  gap: clamp(20px, 4vw, 56px);
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}
.glance-facts li {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.glance-facts strong { color: var(--ink); font-weight: 800; }

/* ============ chapters ============ */
.chapter {
  max-width: 1200px;
  margin-inline: auto;
  padding: var(--section-pad) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.chapter--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.chapter--flip .chapter-media { order: 2; }

.chapter-media { display: grid; gap: 16px; min-width: 0; }
.chapter-media figure { margin: 0; }
.chapter-media img {
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 12px 28px -22px rgb(29 37 48 / 0.25);
  /* gentle unifying grade so phone snapshots sit in one palette */
  filter: saturate(0.94) sepia(0.04) contrast(0.99);
}
.media-main img { aspect-ratio: 4 / 3.4; object-fit: cover; }
.media-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.media-duo img { aspect-ratio: 1 / 0.86; object-fit: cover; }
.media-wide img { aspect-ratio: 2 / 1; object-fit: cover; }

.chapter-copy { min-width: 0; }
.chapter h2 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(38px, 4.6vw, 58px);
  line-height: 1.02;
  margin-top: 12px;
  letter-spacing: -0.01em;
}
.chapter-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 460;
  font-size: clamp(19px, 2.2vw, 24px);
  color: var(--ink-soft);
  margin-top: 8px;
}
.chapter-copy p:not(.chapter-sub) {
  margin-top: 20px;
  max-width: var(--measure);
  color: var(--ink);
}
.chapter blockquote {
  margin: 28px 0 0;
  padding-left: 18px;
  border-left: 3px solid var(--ember);
  max-width: var(--measure);
}
.chapter blockquote p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 470;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
}
.chapter cite {
  display: block;
  margin-top: 10px;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* ============ golden teaser ============ */
.teaser {
  position: relative;
  min-height: 88svh;
  display: flex;
  align-items: flex-end; /* copy sits lower-left on the dark water, off the sun */
  isolation: isolate;
  margin-top: clamp(24px, 4vw, 56px);
}
.teaser-img, .teaser-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.teaser::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--noon) 55%, transparent) 0%,
    transparent 26%,
    rgb(15 19 32 / 0.22) 58%,
    var(--dusk) 100% /* dissolves seamlessly into the book-direct strip */
  );
}
.teaser-copy {
  padding: 0 var(--gutter) clamp(56px, 9vh, 104px);
  max-width: 1200px;
  margin-inline: auto;
  width: 100%;
  color: #fff;
}
.teaser h2 span { display: block; } /* break at the sentence, never mid-phrase */
.teaser h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(32px, 4.4vw, 54px);
  line-height: 1.12;
  margin-top: 14px;
  max-width: 14em;
  text-shadow: 0 2px 28px rgb(0 0 0 / 0.45);
}
.teaser-sup {
  margin-top: 16px;
  font-size: clamp(15px, 1.8vw, 17.5px);
  font-weight: 600;
  max-width: var(--measure);
  color: rgb(255 255 255 / 0.94);
  text-shadow: 0 1px 12px rgb(0 0 0 / 0.5);
}
.teaser .link-ghost { display: inline-block; margin-top: 22px; }

/* ============ book direct ============ */
.book {
  background: var(--dusk);
  color: #fff;
  padding: var(--section-pad) var(--gutter);
}
.book-inner { max-width: 720px; margin-inline: auto; text-align: center; }
.book .eyebrow { color: var(--amber); }
.book h2 {
  font-family: var(--font-display);
  font-weight: 540;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.06;
  margin-top: 12px;
  text-wrap: balance;
}
.book-body {
  margin: 20px auto 0;
  max-width: var(--measure);
  color: rgb(255 255 255 / 0.88);
}
.book-terms {
  margin: 14px auto 0;
  max-width: var(--measure);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--amber);
}
.book-actions {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}
.book-actions .cta { padding: 14px 28px; font-size: 16px; }
.book-alt {
  color: var(--amber);
  font-size: 14.5px;
  font-weight: 600;
  display: inline-block;
  padding: 10px 2px;
  margin: -10px 0;
}
.book blockquote { margin: 40px 0 0; }
.book blockquote p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 460;
  font-size: 20px;
  line-height: 1.5;
  color: rgb(255 255 255 / 0.92);
}
.book cite {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--amber);
}
.book-contact {
  margin-top: 34px;
  font-size: 14.5px;
  color: rgb(255 255 255 / 0.72);
}
.book-contact a {
  color: var(--amber);
  display: inline-block;
  padding: 10px 6px;
  margin: -10px 0;
}

/* ============ footer ============ */
.footer {
  background: color-mix(in srgb, var(--dusk) 88%, black 12%);
  color: rgb(255 255 255 / 0.65);
  text-align: center;
  padding: 34px var(--gutter) 110px; /* clearance for the day bar */
  font-size: 13.5px;
}
.footer .brand { color: #fff; font-size: 24px; text-shadow: none; }
.footer p { margin-top: 10px; }

/* ============ sticky day bar ============ */
.daybar {
  position: fixed;
  z-index: 60;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px 10px 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--dusk) 92%, black 8%);
  color: #fff;
  box-shadow: 0 18px 40px -12px rgb(10 14 22 / 0.5);
  transform: translateY(calc(100% + 24px));
  visibility: hidden; /* keep the hidden bar out of tab order & the a11y tree */
  transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s linear 380ms;
}
.daybar.show {
  transform: translateY(0);
  visibility: visible;
  transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s;
}
.daybar-sunset { font-size: 14px; font-weight: 600; color: var(--amber); }
.daybar .cta {
  padding: 9px 18px;
  font-size: 14.5px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
@media (min-width: 720px) {
  .daybar { left: auto; right: 24px; bottom: 24px; width: auto; }
}

/* ============ reveals & motion ============ */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 700ms ease, transform 700ms ease;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .daybar { transition: none; }
  .cta:hover { transform: none; }
}

/* ============ mobile ============ */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-key { display: inline-block; } /* keep Availability reachable on mobile */
  .nav .cta { margin-left: 0; }
}
@media (max-width: 880px) {
  .chapter, .chapter--flip { grid-template-columns: minmax(0, 1fr); }
  .chapter--flip .chapter-media { order: 0; }
  .chapter { gap: 28px; }
}
@media (max-width: 480px) {
  body { font-size: 16.5px; }
  .hero-actions .cta { width: 100%; text-align: center; }
  .media-duo { gap: 12px; }
  /* Availability duplicates Book direct's #book target — phone keeps the CTA + pill */
  .nav-key { display: none; }
  .nav .cta { margin-left: auto; }
}
