/* The Days of You — the front door. The book's own palette and typefaces (tools/render_years.py:
   Parchment, Ink, Brick, Ochre, Navy, Moss; Fraunces for the titles, Inter for everything else). */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin-full-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin-full-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --parch: #F4EDDD;
  --ink: #221D18;
  --brick: #A8402F;
  --ochre: #D19C2F;
  --navy: #27385C;
  --moss: #55705B;
  --dim: #60584C;
  --faint: #8C8372;
  --rule: #C4BAA6;
  --night: #1A1E34;
  --parch-deep: #EADFC7;

  --bg: var(--parch);
  --fg: var(--ink);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --measure: 36rem;
  --gutter: 16px;
  --wide: 1160px;
}
@media (min-width: 720px) { :root { --gutter: 32px; } }
@media (min-width: 1100px) { :root { --gutter: 48px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 17px; line-height: 1.55;
  font-feature-settings: "ss01" 0, "cv11" 1;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 900; font-optical-sizing: auto;
  font-variation-settings: "SOFT" 0, "WONK" 0; letter-spacing: -0.005em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }

/* type scale */
.kicker { font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brick); margin: 0 0 0.9rem; }
.kicker-light { color: var(--ochre); }
.lede { font-size: 1.1rem; color: var(--dim); max-width: var(--measure); }
.standfirst { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; line-height: 1.45; max-width: var(--measure); font-optical-sizing: auto; }
.standfirst-2 { color: var(--dim); }
.standfirst-lead { font-weight: 600; margin-bottom: 0.6em; }
.small { font-size: 0.85rem; color: var(--dim); }

/* masthead */
.masthead { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.1rem var(--gutter); border-bottom: 1px solid var(--rule); }
.wordmark { font-family: var(--serif); font-weight: 900; font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.02em; text-decoration: none; }
.masthead-nav { display: flex; gap: 1.4rem; font-size: 0.9rem; font-weight: 500; }
.masthead-nav a { text-decoration: none; color: var(--dim); }
.masthead-nav a:hover { color: var(--ink); }
.masthead-nav .nav-order { color: var(--brick); font-weight: 600; }
@media (max-width: 560px) { .masthead-nav a:not(.nav-order) { display: none; } }

/* sections */
main > section { padding: clamp(3rem, 7vw, 6rem) var(--gutter); }
.section-head { max-width: var(--wide); margin: 0 auto 2.5rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.05; text-transform: uppercase; max-width: 22ch; margin-bottom: 1rem; }

/* hero */
.hero { display: grid; gap: 2rem; max-width: var(--wide); margin: 0 auto; align-items: center; padding-top: clamp(2rem, 5vw, 4rem) !important; }
.hero-cover { margin: 0; width: 100%; max-width: 420px; justify-self: center; }
.hero-cover img { box-shadow: 0 24px 60px -24px rgba(34, 29, 24, 0.45), 0 2px 6px rgba(34, 29, 24, 0.15); border-radius: 2px; transition: opacity 0.2s; }
.hero-cover.is-busy img { opacity: 0.7; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.6rem); line-height: 0.98; text-transform: uppercase; margin-bottom: 1.4rem; }
.particulars { color: var(--dim); max-width: var(--measure); }
.byline { margin-top: 1.4rem; font-size: 0.9rem; color: var(--dim); }
.byline em { font-style: italic; }
.particulars .price { font-family: var(--serif); font-weight: 900; color: var(--ink); font-size: 1.25em; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.6rem; }
@media (min-width: 820px) {
  .hero { grid-template-columns: 5fr 7fr; gap: clamp(2rem, 5vw, 5rem); }
  .hero-cover { justify-self: end; }
}
@media (max-width: 819px) { .hero { padding-left: var(--gutter); padding-right: var(--gutter); } }

/* buttons */
.button { display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  padding: 0.85rem 1.4rem; border-radius: 3px; border: 1.5px solid transparent; text-decoration: none; cursor: pointer; line-height: 1.2; transition: background 0.15s, color 0.15s; }
.button-primary { background: var(--brick); color: var(--parch); border-color: var(--brick); }
.button-primary:hover { background: #8f3627; }
.button-quiet { background: transparent; color: var(--ink); border-color: var(--ink); }
.button-quiet:hover { background: var(--ink); color: var(--parch); }
.button-ochre { background: var(--ochre); color: var(--ink); border-color: var(--ochre); }
.button-ochre:hover { background: #e0ab3a; }
.button-large { font-size: 1.05rem; padding: 1rem 1.8rem; }
.button[disabled] { opacity: 0.55; cursor: progress; }

/* the preview: the night ground of the opening spread */
.preview { background: var(--ink); color: var(--parch); }
.preview-inner { max-width: var(--wide); margin: 0 auto; display: grid; gap: 2rem; }
.preview-lead h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1.05; text-transform: uppercase; color: var(--parch); max-width: 24ch; margin-bottom: 1rem; }
.preview .lede { color: #CFC6B2; }
.preview-form { display: grid; gap: 1.25rem; align-content: start; }
.preview-result { margin: 0; }
.preview-frame { background: var(--night); border: 1px solid rgba(244, 237, 221, 0.12); box-shadow: 0 30px 70px -30px rgba(0,0,0,0.8); aspect-ratio: 1284 / 864; position: relative; }
.preview-frame img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.25s; }
.preview-frame.is-busy img { opacity: 0.35; }
.preview-frame.is-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%;
  border: 3px solid rgba(244,237,221,0.25); border-top-color: var(--ochre); animation: turn 0.9s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.preview-result figcaption { font-size: 0.9rem; color: #CFC6B2; margin-top: 0.9rem; max-width: 60ch; }
@media (min-width: 900px) {
  .preview-inner { grid-template-columns: minmax(280px, 360px) 1fr; grid-template-areas: "lead result" "form result"; gap: 2rem clamp(2rem, 4vw, 4rem); }
  .preview-lead { grid-area: lead; }
  .preview-form { grid-area: form; }
  .preview-result { grid-area: result; align-self: center; }
}

/* forms */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend, .field > label, .field-place > label { display: block; font-weight: 600; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.5rem; padding: 0; }
.date-parts { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 0.6rem; max-width: 22rem; }
.date-parts label span { display: block; font-size: 0.75rem; color: var(--faint); margin-bottom: 0.25rem; }
input[type="text"], input:not([type]) {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 0.7rem 0.8rem; border-radius: 3px;
  background: var(--parch); color: var(--ink); border: 1.5px solid var(--rule); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { border-color: var(--ochre); box-shadow: 0 0 0 3px rgba(209, 156, 47, 0.3); }
.preview input[type="text"], .preview input:not([type]) { background: #2E2823; color: var(--parch); border-color: #4A423A; }
.preview input::placeholder { color: #776D60; }
.preview legend, .preview .field-place > label, .preview .field > label { color: var(--parch); }
.preview .date-parts label span { color: #A89E8C; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--rule); border-radius: 3px; overflow: hidden; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: block; padding: 0.6rem 1rem; font-size: 0.95rem; font-weight: 500; cursor: pointer; color: var(--dim); border-right: 1.5px solid var(--rule); }
.segmented label:last-child span { border-right: 0; }
.segmented input:checked + span { background: var(--ink); color: var(--parch); }
.segmented input:focus-visible + span { outline: 2px solid var(--ochre); outline-offset: -2px; }
.preview .segmented { border-color: #4A423A; }
.preview .segmented span { color: #CFC6B2; border-color: #4A423A; }
.preview .segmented input:checked + span { background: var(--ochre); color: var(--ink); }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 0.3rem 0; list-style: none;
  background: var(--parch); color: var(--ink); border: 1.5px solid var(--rule); border-radius: 3px; box-shadow: 0 14px 30px -12px rgba(34,29,24,0.4); max-height: 16rem; overflow: auto; }
.combo-list li { padding: 0.5rem 0.8rem; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; font-size: 0.98rem; }
.combo-list li small { color: var(--faint); font-size: 0.8rem; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--parch-deep); }
.field-help { font-size: 0.85rem; color: var(--dim); margin: 0.5rem 0 0; max-width: 40rem; }
.preview .field-help { color: #A89E8C; }
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--faint); }
.form-message { min-height: 1.4em; font-size: 0.95rem; margin: 0; }
.form-message.is-error { color: var(--brick); }
.preview .form-message.is-error { color: #E8A090; }
.form-message.is-note { color: var(--moss); }
.preview .form-message.is-note { color: #CFC6B2; }

/* inside: the gallery */
.gallery { max-width: var(--wide); margin: 0 auto; display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); }
.gallery-item { margin: 0; display: grid; gap: 1rem; align-items: end; }
.gallery-item img { box-shadow: 0 20px 50px -24px rgba(34, 29, 24, 0.5), 0 1px 3px rgba(34,29,24,0.12); }
.gallery-item figcaption { font-size: 0.95rem; color: var(--dim); max-width: 34rem; }
.gallery-item figcaption strong { display: block; font-family: var(--serif); font-weight: 900; font-size: 1.15rem; color: var(--ink); text-transform: uppercase; letter-spacing: 0; margin-bottom: 0.3rem; }
@media (min-width: 820px) {
  .gallery-item { grid-template-columns: 8fr 4fr; gap: 2rem; }
  .gallery-item:nth-child(even) { grid-template-columns: 4fr 8fr; }
  .gallery-item:nth-child(even) img { order: 2; }
  .gallery-item:nth-child(even) figcaption { text-align: right; justify-self: end; }
}
.contents { max-width: var(--wide); margin: clamp(3rem, 6vw, 5rem) auto 0; border-top: 1px solid var(--rule); padding-top: 2rem; }
.chapter-list { margin: 0; padding: 0; list-style: none; columns: 1; column-gap: 2.5rem; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.6; text-transform: uppercase; letter-spacing: 0.01em; font-optical-sizing: auto; }
.chapter-list li { break-inside: avoid; padding: 0.15rem 0; border-bottom: 1px dotted var(--rule); counter-increment: chapter; }
.chapter-list li::before { content: counter(chapter, decimal-leading-zero) "  "; font-family: var(--sans); font-weight: 500; font-size: 0.75rem; color: var(--ochre); letter-spacing: 0.1em; }
@media (min-width: 640px) { .chapter-list { columns: 2; } }
@media (min-width: 1000px) { .chapter-list { columns: 3; } }

/* the book: the particulars */
.book { background: var(--parch-deep); }
.facts { max-width: var(--wide); margin: 0 auto; display: grid; gap: 1.6rem 3rem; }
.facts > div { border-top: 1px solid var(--rule); padding-top: 1rem; }
.facts dt { font-weight: 600; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brick); margin-bottom: 0.4rem; }
.facts dd { margin: 0; color: var(--ink); }
.facts dd [data-price] { font-family: var(--serif); font-weight: 900; font-size: 1.6rem; }
@media (min-width: 720px) { .facts { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .facts { grid-template-columns: 1fr 1fr 1fr; } }

/* order */
.order-form, .moment { margin-left: max(0px, calc((100% - var(--wide)) / 2)); margin-right: auto; }
.order-form { max-width: 44rem; display: grid; gap: 1.6rem; }
.order-summary { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); padding: 1rem 0; margin-top: 0.5rem; }
.order-summary p { margin: 0; }
.order-title .kicker { display: block; margin-bottom: 0.2rem; }
#order-summary-title { display: block; font-family: var(--serif); font-weight: 900; font-size: 1.5rem; text-transform: uppercase; line-height: 1.1; }
.order-summary-line { display: block; font-size: 0.9rem; color: var(--dim); margin-top: 0.3rem; }
.order-price [data-price] { font-family: var(--serif); font-weight: 900; font-size: 2.2rem; line-height: 1; }
.order-price-note { display: block; font-size: 0.8rem; color: var(--dim); text-align: right; }
.field-submit .field-help { margin-top: 0.7rem; }

/* footer */
.colophon { border-top: 1px solid var(--rule); padding: 2.5rem var(--gutter) 3rem; font-size: 0.95rem; color: var(--dim); }
.colophon p { max-width: var(--wide); margin: 0 auto 0.4rem; }
.colophon strong { color: var(--ink); }

/* the thank-you page */
.thanks { max-width: var(--measure); margin: 0 auto; padding: clamp(3rem, 8vw, 7rem) var(--gutter); }
.thanks h1 { font-size: clamp(2rem, 5vw, 3.6rem); text-transform: uppercase; line-height: 1; margin-bottom: 1.4rem; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .preview-frame.is-busy::after { animation: none; } }

/* the live chapters: a figure is dimmed while its page is being drawn */
.gallery-item.is-live img { transition: opacity 0.25s; }
.gallery-item.is-busy img { opacity: 0.45; }
.gallery-item.is-live figcaption[data-for]::after { content: "Drawn for " attr(data-for) "."; display: block; margin-top: 0.4rem; font-size: 0.8rem; color: var(--ochre); }

/* the two spoken lines, set like the hero's first sentence (the bold serif), each aligned with what
   sits above it: the heartbeat with the Inside heading, the giver's moment with the order form */
.heartbeat, .moment { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; line-height: 1.45; color: var(--ink); font-optical-sizing: auto; text-wrap: pretty; }
.heartbeat { max-width: var(--wide); margin: 0 auto 2.5rem; }
.heartbeat > span.measure, .moment > span.measure { display: block; max-width: 40rem; }
.heartbeat strong { font-weight: 900; color: var(--brick); white-space: nowrap; }
.moment { max-width: 44rem; margin-bottom: 1.6rem; }
/* the dedication */
textarea { width: 100%; font: inherit; font-size: 1.05rem; line-height: 1.45; padding: 0.7rem 0.8rem; border-radius: 3px; background: var(--parch); color: var(--ink); border: 1.5px solid var(--rule); outline: none; resize: vertical; min-height: 5.5rem; }
textarea:focus { border-color: var(--ochre); box-shadow: 0 0 0 3px rgba(209, 156, 47, 0.3); }
.field-words .field-help em { font-family: var(--serif); font-style: italic; }
/* what people say */
.voices { background: var(--parch); }
.voices-grid { max-width: var(--wide); margin: 0 auto; display: grid; gap: 2rem; }
.voices blockquote { margin: 0; border-top: 1px solid var(--rule); padding-top: 1rem; font-family: var(--serif); font-size: 1.15rem; line-height: 1.45; font-optical-sizing: auto; }
.voices cite { display: block; margin-top: 0.6rem; font-family: var(--sans); font-style: normal; font-size: 0.85rem; color: var(--dim); }
@media (min-width: 820px) { .voices-grid { grid-template-columns: 1fr 1fr 1fr; } }

/* the privacy notice and the terms */
.legal { max-width: 40rem; margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) 3rem; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); text-transform: uppercase; line-height: 1.05; margin-bottom: 1.2rem; }
.legal h2 { font-size: 1.2rem; text-transform: uppercase; margin: 2rem 0 0.5rem; }
.legal ul { padding-left: 1.2rem; } .legal li { margin-bottom: 0.5rem; }
.colophon a { color: var(--dim); }
