/* Art Calendar 2027 — one typeface (TeX Gyre Pagella, the calendar's Palatino), one type scale,
   paper background with one cream band and one night band. See WEBSITE_BRIEF.md → Round 3. */

@font-face { font-family: "Pagella Web"; src: url(assets/fonts/pagella-regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Pagella Web"; src: url(assets/fonts/pagella-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Pagella Web"; src: url(assets/fonts/pagella-bold.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* colour */
  --paper: #FAF7F2;     /* page background */
  --cream: #FCF0E0;     /* calendar cream — one band only */
  --ink: #1A1816;
  --muted: #6B625A;
  --line: #E7DFD4;
  --night: #2A2230;     /* deep aubergine from January's coat */
  --on-night: #F4EDE4;
  --on-night-muted: #C2B6AA;
  --red: #ED3F31;       /* buttons, focus rings */
  --red-dark: #C92F23;
  --card: #FFFFFF;
  --shadow: 4px 6px 14px rgba(122, 92, 62, .26);

  /* type: one family, fixed scale (desktop → mobile via clamp) */
  --serif: "Pagella Web", "Noto Serif", Georgia, serif;
  --fs-display: clamp(40px, 5.6vw, 64px);
  --fs-h2: clamp(30px, 3.6vw, 40px);
  --fs-quote: clamp(22px, 2.6vw, 28px);
  --fs-body-l: clamp(18px, 1.5vw, 19px);
  --fs-body: 17px;
  --fs-small: 14px;
  --fs-label: 12px;

  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--fs-body)/1.6 var(--serif);
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
h1, h2, h3 { font-weight: 400; margin: 0 0 .35em; }
h1 { font-size: var(--fs-display); line-height: 1.05; }
h2 { font-size: var(--fs-h2); line-height: 1.15; text-align: center; }
h1, h2 { text-wrap: balance; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* The one spaced-caps style */
.label, .eyebrow {
  font-size: var(--fs-label); line-height: 1.4; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 14px;
}

/* Dev-only banner (shown by app.js on localhost or ?preview) */
.mock-banner { background: #FFF1BF; color: #6B5300; text-align: center; font-size: var(--fs-small); padding: 4px 16px; }

/* Logo: the handwritten signature, recoloured via currentColor */
.logo {
  display: block; aspect-ratio: 772.8 / 189; width: 150px; background: currentColor;
  -webkit-mask: url(assets/logo.svg) center / contain no-repeat;
          mask: url(assets/logo.svg) center / contain no-repeat;
}

/* Header */
.topbar {
  max-width: var(--max); margin: 0 auto; padding: 18px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
}
.brand { color: var(--ink); }
.topbar nav { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--ink); text-decoration: underline; }

main > section { max-width: var(--max); margin: 0 auto; padding: 64px 16px; }

/* Full-bleed colour bands without extra wrappers */
.band-cream, .band-night { box-shadow: 0 0 0 100vmax var(--band); clip-path: inset(0 -100vmax); background: var(--band); }
.band-cream { --band: var(--cream); }
.band-night { --band: var(--night); color: var(--on-night); }

/* ---------- Intro curtain (signature writes itself, then lifts) ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--paper);
  animation: lift .9s cubic-bezier(.7, 0, .2, 1) 4.1s forwards; cursor: pointer;
}
.intro-sig { width: min(62vw, 520px); }
.intro-sig object { width: 100%; aspect-ratio: 772.8 / 189; display: block; pointer-events: none; }
.intro-tag {
  margin: 14px 0 0; text-align: center; font-size: var(--fs-label);
  letter-spacing: .42em; text-transform: uppercase; opacity: 0; animation: fadeUp .8s ease 3.1s forwards;
}
.intro-tag::before {
  content: ''; display: block; width: 60%; height: 1px; margin: 0 auto 12px; background: currentColor; opacity: .6;
  transform: scaleX(0); animation: rule .7s ease 2.9s forwards;
}
.intro.skip { animation: lift .6s cubic-bezier(.7, 0, .2, 1) forwards; }
.intro.gone, .no-intro .intro { display: none; }
@keyframes lift { to { transform: translateY(-100%); visibility: hidden; } }
@keyframes rule { to { transform: scaleX(1); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
main > .hero {
  max-width: none; padding: 0; position: relative; overflow: hidden;
  min-height: min(88vh, 780px); display: grid; place-items: center;
}
.hero-media, .hero picture { position: absolute; inset: 0; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: scale(1.04) translate(-1.5%, 1%); } to { transform: scale(1.12) translate(1.5%, -1.5%); } }
.hero-panel {
  position: relative; margin: 48px 16px; padding: 36px 48px 38px; max-width: 560px; text-align: center;
  background: rgba(250, 247, 242, .92); box-shadow: 6px 10px 28px rgba(60, 40, 20, .25);
}
.hero-panel > * { opacity: 0; animation: fadeUp .9s ease forwards; }
.hero-panel > :nth-child(1) { animation-delay: var(--t1, 4.6s); }
.hero-panel > :nth-child(2) { animation-delay: var(--t2, 4.8s); }
.hero-panel > :nth-child(3) { animation-delay: var(--t3, 5.1s); }
.hero-panel > :nth-child(4) { animation-delay: var(--t4, 5.8s); }
.no-intro .hero-panel { --t1: .1s; --t2: .3s; --t3: .6s; --t4: 1.2s; }
.hero-panel .eyebrow { color: var(--ink); }
.theme { font-size: var(--fs-quote); font-style: italic; line-height: 1.45; margin: 0 0 26px; }
.theme .w { display: inline-block; opacity: 0; animation: word .5s ease forwards; }
@keyframes word { from { opacity: 0; filter: blur(4px); transform: translateY(4px); } to { opacity: 1; filter: none; transform: none; } }

/* ---------- Scroll motion (only when JS is on, so content is visible without it) ---------- */
.js [data-fade] { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s ease; }
.js [data-fade].in { opacity: 1; transform: none; }
.reveal { margin: 0; font-size: var(--fs-quote); font-style: italic; line-height: 1.45; }
.reveal cite { display: block; margin-top: 14px; font-size: var(--fs-small); font-style: normal; color: var(--muted); }
.js .reveal .w { opacity: .08; transition: opacity .5s ease; }
.js .reveal.in .w { opacity: 1; }

/* ---------- Product intro ---------- */
.intro-product { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: center; }
.intro-copy h2 { text-align: left; }
.price { font-size: 32px; font-weight: 700; line-height: 1.2; margin: 0 0 14px; font-variant-numeric: lining-nums tabular-nums; }
.price small { font-size: var(--fs-small); font-weight: 400; color: var(--muted); margin-left: 6px; }
.facts { list-style: none; padding: 0; margin: 0 0 28px; font-size: var(--fs-body-l); }
.facts li { padding: 8px 0 8px 22px; position: relative; border-bottom: 1px solid var(--line); }
.facts li::before { content: ''; position: absolute; left: 2px; top: 20px; width: 6px; height: 6px; background: var(--ink); border-radius: 50%; }
.stock { font-size: var(--fs-small); color: var(--muted); margin: 14px 0 0; }

/* ---------- Artwork tiles: every image opens the same viewer ---------- */
.art {
  display: block; width: 100%; border: 0; padding: 0; background: var(--card); cursor: zoom-in;
  overflow: hidden; box-shadow: var(--shadow); transition: transform .3s ease, box-shadow .3s ease;
}
.art img { width: 100%; display: block; }
.art:hover { transform: translateY(-4px); box-shadow: 6px 12px 24px rgba(122, 92, 62, .32); }
.art--cover { max-width: 440px; justify-self: center; }
.art--detail img { transform-origin: var(--fo, 50% 50%); }
.js .art--detail img { transform: scale(1.18); transition: transform 2.6s cubic-bezier(.2, .6, .2, 1) .1s; }
.js .art--detail.in img { transform: none; }
.band-night .art { box-shadow: 0 14px 34px rgba(0, 0, 0, .38); }

/* ---------- Feature rows: one landscape detail + its words ---------- */
.feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: center; }
.feature--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.feature-copy--note { text-align: center; }

/* Sanchari's own words: set straight on the page, between old-book flourishes */
.words { margin: 14px 0 0; text-align: center; font-size: var(--fs-body-l); line-height: 1.7; }
.words p { margin: 18px auto; max-width: 34em; }
.words::before, .words::after {
  content: ''; display: block; width: 180px; max-width: 70%; aspect-ratio: 240 / 24; margin: 0 auto;
  background: var(--muted); opacity: .75;
  -webkit-mask: url(assets/flourish.svg) center / contain no-repeat;
          mask: url(assets/flourish.svg) center / contain no-repeat;
}
.words::after { transform: scaleY(-1); }

/* ---------- Inside ---------- */
.section-lede { color: var(--muted); text-align: center; font-size: var(--fs-body-l); margin: 0 0 36px; }
.gallery-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.gallery-row .art img { aspect-ratio: 3 / 4; object-fit: cover; }

/* ---------- Night band: October + what's still to come ---------- */
.band-night .reveal cite, .band-night .eyebrow { color: var(--on-night-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; border: 0; border-radius: 2px; padding: 13px 30px;
  font-size: var(--fs-body); letter-spacing: .02em; line-height: 1.4;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-block { display: block; width: 100%; }

/* ---------- Flip video ---------- */
.flip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.flip figure { margin: 0; }
.flip-video video { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; box-shadow: var(--shadow); background: var(--card); }
.flip-copy h2 { text-align: left; }
.flip-copy p { margin: 0 0 16px; font-size: var(--fs-body-l); }
.flip-copy .btn { margin-top: 8px; }

/* ---------- Artist ---------- */
.artist-art { width: 100%; box-shadow: var(--shadow); margin-bottom: 48px; }
.artist-copy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.years { list-style: none; padding: 0; margin: 0 0 28px; font-variant-numeric: lining-nums tabular-nums; }
.years li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.years span { color: var(--muted); display: inline-block; width: 3.6em; }

/* ---------- Signature sign-off ---------- */
.sig-slot { width: 180px; aspect-ratio: 772.8 / 189; margin: 0 auto; }
.sig-slot object { width: 100%; height: 100%; display: block; pointer-events: none; }
.sig-slot .logo { width: 100%; }
.signoff { text-align: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.signoff p { margin: 0 0 4px; color: var(--muted); }

/* ---------- Order ---------- */
main > .order { max-width: 720px; }
.card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 28px; }
.qty-row { display: flex; align-items: center; gap: 12px 16px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.qty-row > label, .total { white-space: nowrap; }
.stepper { display: flex; border: 1px solid var(--line); background: #fff; }
.stepper button { width: 40px; border: 0; background: none; cursor: pointer; }
.stepper input { width: 46px; border: 0; padding: 8px 0; text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { appearance: none; }
.total { margin: 0 0 0 auto; }
.total strong { font-size: var(--fs-body-l); font-weight: 700; margin-left: 6px; font-variant-numeric: lining-nums tabular-nums; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.grid label, .pay-steps label { display: flex; flex-direction: column; gap: 4px; }
.grid > * { min-width: 0; }
.grid input, .grid textarea { width: 100%; }
.span-2 { grid-column: span 2; }
.opt { color: var(--muted); font-size: var(--fs-small); }
.note-toggle summary { cursor: pointer; color: var(--muted); list-style: none; }
.note-toggle summary::-webkit-details-marker { display: none; }
.note-toggle summary::before { content: '+ '; color: var(--ink); }
.note-toggle[open] summary::before { content: '− '; }
.note-toggle textarea { width: 100%; margin-top: 8px; }
input, textarea { background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px; min-width: 0; }
input:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: -1px; }
.form-error { color: var(--red-dark); min-height: 1.2em; margin: 10px 0 0; }

.agree { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; cursor: pointer; }
.agree input { width: 18px; height: 18px; margin: 4px 0 0; padding: 0; accent-color: var(--ink); flex: none; }
.pay-hint { text-align: center; }
.done-title { font-size: var(--fs-h2); line-height: 1.15; margin: 0 0 12px; }
.done p { margin: 0 0 12px; }
.sold-out { text-align: center; }
.sold-out p { margin: 0 0 8px; }
.hint { color: var(--muted); margin: 8px 0 0; font-size: var(--fs-small); }
.mobile-only { display: none; margin-bottom: 14px; }
#pay-btn:disabled { opacity: .7; cursor: progress; }

/* ---------- FAQ ---------- */
main > .faq { max-width: 720px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary {
  cursor: pointer; list-style: none; position: relative; padding-right: 32px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {   /* thin + that turns into − when open */
  content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: var(--fs-body-l); line-height: 1; font-weight: 400; color: var(--ink);
  transition: transform .15s ease, opacity .15s ease;
}
.faq details[open] summary::after { content: '−'; transform: translateY(-50%) rotate(180deg); }
.faq p { margin: 8px 0 0; color: var(--muted); }

/* ---------- Footer (night) ---------- */
.footer { text-align: center; padding: 48px 16px 56px; background: var(--night); color: var(--on-night); font-size: var(--fs-small); }
.footer p { margin: 4px 0; }
.sig-slot--footer { width: 180px; margin: 0 auto 14px; }   /* fixed + centred, so it doesn't drift while writing */
.credits { color: var(--on-night-muted); }
.footer-links { margin: 6px 0; color: var(--on-night-muted); }

/* ---------- Policy pages ---------- */
.doc { max-width: 720px; margin: 0 auto; padding: 40px 16px 72px; }
.doc h1 { font-size: var(--fs-h2); line-height: 1.15; margin-bottom: 6px; }
.doc > .hint { margin: 0 0 32px; }
.doc h2 {
  font-size: var(--fs-label); line-height: 1.4; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); text-align: left; margin: 32px 0 8px;
}
.doc p, .doc li { font-size: var(--fs-body-l); }
.doc p { margin: 0 0 14px; }
.doc .plain { list-style: none; padding: 0; margin: 0 0 14px; }
.doc .plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* ---------- Viewer ---------- */
.viewer { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; }
.viewer::backdrop { background: rgba(26, 20, 16, .88); }
.viewer figure { margin: 0; }
.viewer img { max-height: 86vh; width: auto; margin: 0 auto; }
.viewer figcaption { color: var(--on-night); text-align: center; font-size: var(--fs-small); margin-top: 10px; }
.v-close, .v-nav {
  position: fixed; z-index: 1; border: 0; background: rgba(255, 255, 255, .18); color: #fff;
  width: 48px; height: 48px; border-radius: 50%; font-size: 28px; line-height: 1; cursor: pointer;
}
.v-close { top: 16px; right: 16px; }
.v-nav { top: 50%; transform: translateY(-50%); }
.v-prev { left: 16px; }
.v-next { right: 16px; }

@media (max-width: 820px) {
  .intro-product, .feature, .feature--flip, .flip, .artist-copy { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .art--cover { max-width: 360px; }
  .flip-copy h2 { text-align: center; }
  .intro-copy, .intro-copy h2 { text-align: left; }
  .feature--flip .feature-copy { order: 2; }
  /* phones/tablets: September across the top, April + July side by side */
  .gallery-row { grid-template-columns: 1fr 1fr; gap: 16px; }
  .gallery-row .art--detail { grid-column: 1 / -1; order: -1; }
  .gallery-row .art--detail img { aspect-ratio: 4 / 3; object-position: 50% 15%; }
  .mobile-only { display: block; }
}
@media (max-width: 700px) {
  main > .hero { min-height: min(88svh, 720px); }
  .hero-panel {
    margin: 24px 20px; padding: 26px 22px 28px; background: rgba(250, 247, 242, .84);
    -webkit-backdrop-filter: blur(6px) saturate(1.1); backdrop-filter: blur(6px) saturate(1.1);
  }
  .theme { margin-bottom: 18px; }
  main > section { padding-top: 48px; padding-bottom: 48px; }
}
@media (max-width: 600px) {
  /* phones: one ~56 px row — signature left, a single Order link right */
  .topbar { flex-wrap: nowrap; justify-content: space-between; padding: 10px 16px; min-height: 56px; }
  .topbar .logo { width: 120px; }
  .nav-extra { display: none; }
}
@media (max-width: 520px) {
  .card { padding: 18px 16px; }
  .grid { gap: 12px 10px; margin-bottom: 18px; }
  .grid input, .grid textarea { padding: 9px 10px; }
  .qty-row { gap: 10px; }
  .stepper button { width: 34px; }
  .stepper input { width: 38px; }
  .total strong { margin-left: 4px; }
  .v-nav { top: auto; bottom: 16px; transform: none; }
}

/* Reduced motion: no curtain, no drift, everything shown at once */
@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
  .hero-bg { animation: none; transform: scale(1.04); }
  .hero-panel > *, .theme .w { opacity: 1; animation: none; }
  .js [data-fade] { opacity: 1; transform: none; transition: none; }
  .js .reveal .w { opacity: 1; transition: none; }
  .js .art--detail img { transform: none; transition: none; }
  .art { transition: none; }
}
