/* ==========================================================================
   Mezzonome: "The Spread"
   The site is laid out like a magazine: every section is a two-page spread,
   and the gutter between the pages (the mezzo, the middle) runs the whole way
   down as one manzanita hairline. The name itself is split across it.

   Fonts: Ivy Presto Display + Neue Haas Grotesk come from the Adobe kit linked
   in each page. Cormorant Garamond + Inter Tight are self-hosted stand-ins.
   ========================================================================== */

@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300 600; font-display: swap; src: url("fonts/cormorant-garamond-roman.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 300 600; font-display: swap; src: url("fonts/cormorant-garamond-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("fonts/inter-tight.woff2") format("woff2"); }

/* Foothill granite, oak shadow, manzanita bark */
:root {
  --paper: #ECEDEA; --ink: #1B1E1C; --slate: #5F6561; --line: #C6C9C3; --accent: #6A2620;
  --deep: #1B1E1C; --on-deep: #E6E7E3; --on-deep-soft: #A9AEA9; --on-photo: #F2F2EE;

  --font-display: "ivypresto-display", "Cormorant Garamond", Georgia, serif;
  --font-text: "neue-haas-unica", "Inter Tight", "Helvetica Neue", Arial, sans-serif;

  --outer: clamp(1.25rem, 5vw, 6rem);     /* page margin at the outside edge */
  --inner: clamp(1.25rem, 2.6vw, 3.25rem); /* page margin at the gutter */
  --block: clamp(4rem, 9vw, 8.5rem);       /* page margin top and bottom */
  --hmax: 78svh;                           /* tallest a photograph may stand */
  --bar: 4.5rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #141715; --ink: #E4E5E1; --slate: #9DA39F; --line: #2D322F; --accent: #C98A80; --deep: #0E100F; }
}
:root[data-theme="dark"] { --paper: #141715; --ink: #E4E5E1; --slate: #9DA39F; --line: #2D322F; --accent: #C98A80; --deep: #0E100F; }
:root[data-theme="light"] { color-scheme: light; }
/* Inquire stays light in every theme, so the HoneyBook card sits on paper */
#inquire {
  --paper: #ECEDEA; --ink: #1B1E1C; --slate: #5F6561; --line: #C6C9C3; --accent: #6A2620; --deep: #1B1E1C;
  background: var(--paper); color: var(--ink); color-scheme: light;
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--bar); }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--font-text); font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem); line-height: 1.62;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
  counter-reset: folio;
}
img, picture { display: block; width: 100%; height: auto; }
a { color: inherit; }
ol, ul { list-style: none; }
p { text-wrap: pretty; }
h1, h2, h3 { font-weight: 300; text-wrap: balance; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--paper); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 99; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; }

.text-link { display: inline-block; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 0.2rem; font-size: 0.9375rem; transition: color 0.25s; }
.text-link:hover { color: var(--accent); }

/* ---- Masthead: navigation mirrored around the gutter ---------------------- */
.masthead {
  position: fixed; inset: 0 0 auto; z-index: 20; height: var(--bar);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-inline: var(--outer);
  background: var(--paper); color: var(--ink); box-shadow: 0 1px 0 var(--line);
  transition: background-color 0.35s, color 0.35s, box-shadow 0.35s;
}
.masthead ul { display: flex; align-items: center; gap: clamp(1.25rem, 2.4vw, 2.25rem); }
.masthead a { text-decoration: none; }
.masthead nav a { font-size: 0.9375rem; padding: 0.35rem 0; border-bottom: 1px solid transparent; transition: border-color 0.25s; }
.masthead nav a:hover { border-bottom-color: currentColor; }
.nav-right { justify-self: end; }
.masthead .inq { border: 1px solid currentColor; padding: 0.55rem 1.1rem; }
.masthead .inq:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mini-mark { display: grid; grid-template-columns: 1fr 1px 1fr; width: 13em; align-items: center; gap: 0.75em; font-family: var(--font-display); font-size: 1.0625rem; letter-spacing: 0.26em; text-transform: uppercase; transition: opacity 0.35s; }
.bar-mark { font-family: var(--font-display); font-size: 1.0625rem; letter-spacing: 0.26em; margin-right: -0.26em; text-transform: uppercase; transition: opacity 0.35s; }
.mini-mark i { display: block; width: 1px; height: 1.3em; background: var(--accent); }
.mini-mark span:first-child { justify-self: end; }
.mini-mark span:last-child { justify-self: start; margin-right: -0.26em; }
/* Over the hero (only with JS): light on the photograph, the small mark waits for the big one to pass */
.js .masthead[data-hero]:not(.solid) { background: transparent; box-shadow: none; color: var(--on-photo); }
.js .masthead[data-hero]:not(.solid) .inq:hover { background: var(--on-photo); color: #1B1E1C; border-color: var(--on-photo); }
.js .masthead[data-hero]:not(.solid) .bar-mark { opacity: 0; visibility: hidden; }
.menu { display: none; }

/* Five links on the left need room beside the centred mark; below this width they fold into Menu */
@media (max-width: 78rem) {
  .masthead { grid-template-columns: 1fr auto auto; }
  .nav-left { display: none; }
  .masthead .inq { padding: 0.45rem 0.9rem; }
  .menu { display: block; }
  .menu summary { list-style: none; cursor: pointer; font-size: 0.9375rem; padding: 0.6rem 0 0.6rem 1rem; position: relative; z-index: 2; }
  .menu summary::-webkit-details-marker { display: none; }
  .menu summary::after { content: "Menu"; }
  .menu[open] summary::after { content: "Close"; }
  .menu nav { position: fixed; inset: 0; z-index: 1; background: var(--paper); color: var(--ink); padding: calc(var(--bar) + 2.5rem) var(--outer) 2rem; overflow-y: auto; }
  .menu ul { flex-direction: column; align-items: flex-start; gap: 0.9rem; }
  .menu nav a { font-family: var(--font-display); font-size: 2.4rem; font-weight: 300; line-height: 1.2; }
  .masthead:has(.menu[open]), .js .masthead[data-hero]:has(.menu[open]) { color: var(--ink); background: var(--paper); }
  .masthead:has(.menu[open]) .bar-mark { position: relative; z-index: 2; opacity: 1; visibility: visible; }
}

/* ---- The spread ----------------------------------------------------------- */
.spread { position: relative; display: grid; grid-template-columns: 1fr 1fr; }
.spread::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; margin-left: -0.5px; background: var(--accent); opacity: 0.6; pointer-events: none; }

.page {
  position: relative; z-index: 1; min-width: 0; counter-increment: folio;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1.5rem;
  padding: var(--block) var(--inner) var(--block) var(--outer);
}
.page + .page { padding: var(--block) var(--outer) var(--block) var(--inner); }
.page.top { justify-content: flex-start; }
.page.bottom { justify-content: flex-end; }
.page.gutter:first-child { align-items: flex-end; text-align: right; }
.page.center { align-items: center; }

/* Folios: page numbers and running feet, as in print. Bleed pages carry none. */
.page::after { position: absolute; bottom: clamp(1.25rem, 2.4vw, 2rem); font-size: 0.8125rem; color: var(--slate); font-variant-numeric: oldstyle-nums; }
.page:first-child::after { content: counter(folio) "\2003Mezzonome"; left: var(--outer); }
.page:last-child::after { content: var(--section, "") "\2003" counter(folio); right: var(--outer); }
.page.bleed::after, .no-folio .page::after { content: none; }

/* Photographs set on the page. --r is width / height. */
.plate { width: min(100%, calc(var(--hmax) * var(--r)), var(--wmax, 100%)); text-align: left; }
.plate.small { --hmax: 58svh; }
.zoom { all: unset; display: block; width: 100%; cursor: zoom-in; }
.zoom:focus-visible { outline: 1px solid var(--accent); outline-offset: 5px; }
.zoom img { transition: opacity 0.35s; }
.zoom:hover img { opacity: 0.92; }
figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 0.75rem; }
figcaption span { font-family: var(--font-display); font-style: italic; font-size: 1.125rem; line-height: 1.3; }
figcaption em { font-style: normal; font-size: 0.8125rem; color: var(--slate); white-space: nowrap; }

/* A photograph that runs off the page to the edge and into the gutter */
.page.bleed { padding: 0; }
.page.bleed::before { content: ""; display: block; padding-top: calc(100% / var(--r)); }
.page.bleed .zoom, .page.bleed picture { position: absolute; inset: 0; }
.page.bleed img { height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }

/* One photograph across both pages */
.centerfold { position: relative; z-index: 1; }
.centerfold img { aspect-ratio: var(--r); max-height: 100svh; object-fit: cover; }

/* ---- Type ---------------------------------------------------------------- */
.title { font-family: var(--font-display); font-weight: 300; font-size: clamp(3.25rem, 7.4vw, 8rem); line-height: 0.95; letter-spacing: -0.015em; }
.deck { max-width: 30rem; color: var(--slate); }
.lede { font-family: var(--font-display); font-weight: 300; font-size: clamp(1.5rem, 2.4vw, 2.15rem); line-height: 1.3; max-width: 24ch; }
.small { font-size: 0.875rem; color: var(--slate); }
.prose { max-width: 32rem; }
.prose p + p { margin-top: 1em; }
.prose .muted { color: var(--slate); }

/* ---- Hero: one photograph, the name across its foot ---------------------- */
.hero { position: relative; height: 100svh; min-height: 34rem; max-height: 68rem; display: flex; align-items: flex-end; overflow: hidden; background: #2A2E2B; color: var(--on-photo); }
.hero picture, .hero img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero img { object-fit: cover; object-position: 38% 55%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / 0.32) 0%, rgb(0 0 0 / 0) 24%, rgb(0 0 0 / 0.06) 44%, rgb(0 0 0 / 0.5) 70%, rgb(0 0 0 / 0.62) 100%); }
.hero-inner { position: relative; z-index: 1; width: 100%; padding: 0 var(--outer) clamp(1.25rem, 3.5vw, 2.75rem); }
.hero-sub { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-bottom: clamp(0.75rem, 1.8vw, 1.5rem); text-shadow: 0 1px 14px rgb(0 0 0 / 0.35); }
.hero-sub .line { font-family: var(--font-display); font-style: italic; font-weight: 300; font-size: clamp(1.35rem, 2.2vw, 1.9rem); line-height: 1.25; max-width: 22ch; }
.hero-sub .where { font-size: 0.9375rem; max-width: 30ch; text-align: right; }
.hero-sub .where a { display: inline-block; margin-top: 0.75rem; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 0.15rem; }
.wordmark { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.75rem, 12.4vw, 13rem); line-height: 0.8; white-space: nowrap; }
.wordmark .wm { display: inline-block; text-transform: uppercase; letter-spacing: 0.07em; margin-right: -0.07em; }
@media (prefers-reduced-motion: no-preference) {
  .wordmark { animation: rise 1.6s cubic-bezier(0.2, 0.7, 0.1, 1) both 0.15s; }
  .hero-sub { animation: fade 1.2s ease both 0.9s; }
  @keyframes rise { from { opacity: 0; transform: translateY(12%); } to { opacity: 1; transform: none; } }
  @keyframes fade { from { opacity: 0; } }
}
@media (max-width: 40rem) {
  .hero-sub { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .hero-sub .where { text-align: left; }
}

/* ---- The name: the middle line comes down into it ------------------------- */
.mezzo-line { display: block; width: 1px; height: 4rem; background: var(--accent); opacity: 0.6; margin-inline: auto; }
.name { position: relative; z-index: 1; text-align: center; padding: clamp(5rem, 11vw, 10rem) var(--outer); }
.name .mezzo-line { margin-bottom: 2.5rem; }
.name .word { font-family: var(--font-display); font-style: italic; font-weight: 300; font-size: clamp(4rem, 11vw, 9rem); line-height: 0.9; letter-spacing: -0.02em; }
.name .def { font-size: 0.9375rem; color: var(--slate); margin: 1.5rem 0 2.25rem; }
.name .body { font-family: var(--font-display); font-weight: 300; font-size: clamp(1.55rem, 2.6vw, 2.2rem); line-height: 1.35; max-width: 28ch; margin-inline: auto; }
.name .say { font-size: 0.875rem; color: var(--slate); margin-top: 2.25rem; }

/* ---- A client's words, held in the middle --------------------------------- */
.interlude { position: relative; z-index: 1; text-align: center; padding-inline: var(--outer); }
.interlude::before, .interlude::after { content: ""; display: block; width: 1px; height: clamp(4.5rem, 11vw, 9rem); margin-inline: auto; background: var(--accent); opacity: 0.6; }
.interlude blockquote { font-family: var(--font-display); font-style: italic; font-weight: 300; font-size: clamp(2.2rem, 4.6vw, 4.4rem); line-height: 1.12; letter-spacing: -0.01em; max-width: 20ch; margin: clamp(2rem, 4vw, 3.25rem) auto 0; text-wrap: balance; }
.interlude figcaption { display: block; margin: 1.75rem 0 clamp(2rem, 4vw, 3.25rem); font-size: 0.875rem; color: var(--slate); }

/* ---- A photograph set alone on the gutter -------------------------------- */
.solo { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; padding-inline: var(--outer); }
.solo::before, .solo::after { content: ""; display: block; width: 1px; height: clamp(4rem, 9vw, 7.5rem); background: var(--accent); opacity: 0.6; }
.solo .plate { margin-block: clamp(1.5rem, 3vw, 2.5rem); }

/* Two photographs on one page, one above the other */
.page.stack { justify-content: space-between; gap: clamp(2.5rem, 5vw, 4rem); }

/* A quiet onward link at the end of a section */
.more { text-align: center; padding: 0 var(--outer) clamp(4rem, 8vw, 7rem); }

/* Pages without a cover start below the masthead */
main.sub { padding-top: var(--bar); }

/* ---- Editorial: the dark pages -------------------------------------------- */
.dark { background: var(--deep); color: var(--on-deep); }
.dark .spread::before { background: var(--on-deep-soft); opacity: 0.35; }
.dark .page::after, .dark .deck, .dark figcaption em, .dark .muted { color: var(--on-deep-soft); }
.dark .zoom:focus-visible { outline-color: var(--on-deep); }

/* ---- The commission ------------------------------------------------------- */
.commission { position: relative; z-index: 1; padding: var(--block) var(--outer); }
.c-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.25rem; max-width: 40rem; margin: 0 auto clamp(3rem, 6vw, 5rem); }
.c-head .lede { margin-inline: auto; }
.c-head .prose { margin-inline: auto; }
.steps { max-width: 72rem; margin-inline: auto; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 5rem 4fr 6fr; gap: var(--gutter, 2rem); padding-block: clamp(1.4rem, 3vw, 2.1rem); border-bottom: 1px solid var(--line); align-items: baseline; }
.steps .n { font-family: var(--font-display); font-style: italic; font-size: 1.5rem; color: var(--accent); }
.steps h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.45rem, 2.1vw, 1.9rem); line-height: 1.2; }
.steps p { color: var(--slate); max-width: 34rem; }
.commission .prices { display: grid; gap: 0.35rem; justify-items: center; text-align: center; margin-top: clamp(2.5rem, 5vw, 4rem); }
.price { font-family: var(--font-display); font-weight: 300; font-size: clamp(1.4rem, 2.2vw, 1.9rem); line-height: 1.35; }
.commission .more { padding: 0; margin-top: 2rem; }
@media (max-width: 56rem) { .steps li { grid-template-columns: 2.5rem 1fr; gap: 0.3rem 1rem; } .steps li p { grid-column: 2; } }

/* ---- Inquire -------------------------------------------------------------- */
.hb-form { width: 100%; max-width: 40rem; min-height: 32rem; }
.hb-form.hb-failed { min-height: 0; }
.hb-fallback, .hb-form noscript p { font-family: var(--font-display); font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.45; max-width: 30ch; }
.hb-fallback a, .hb-form noscript a { text-decoration: underline; text-underline-offset: 0.2em; }

/* ---- Colophon ------------------------------------------------------------- */
.colophon { position: relative; text-align: center; padding: 0 var(--outer) clamp(2.5rem, 5vw, 4rem); font-size: 0.875rem; color: var(--slate); }
.colophon::before { content: ""; display: block; width: 1px; height: clamp(4.5rem, 10vw, 8rem); margin: 0 auto clamp(2rem, 4vw, 3rem); background: var(--accent); opacity: 0.6; }
.colophon .mini-mark { margin-inline: auto; color: var(--ink); font-size: 1.25rem; text-decoration: none; margin-bottom: 1.5rem; }
.colophon p { max-width: 40ch; margin-inline: auto; }
.colophon p + p { margin-top: 0.6rem; }
.colophon a:hover { color: var(--accent); }

/* ---- Photo viewer --------------------------------------------------------- */
dialog.lb { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #0E100F; color: #E6E7E3; }
dialog.lb::backdrop { background: #0E100F; }
.lb-inner { height: 100%; display: grid; grid-template-rows: auto 1fr auto; gap: 1rem; padding: calc(1rem + env(safe-area-inset-top, 0px)) var(--outer) calc(1rem + env(safe-area-inset-bottom, 0px)); }
.lb-bar, .lb-nav { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.lb-cap { font-family: var(--font-display); font-style: italic; font-size: 1.125rem; }
.lb-stage { position: relative; min-height: 0; }
.lb-stage picture { position: absolute; inset: 0; width: 100%; height: 100%; }
.lb-stage img { width: 100%; height: 100%; object-fit: contain; }
.lb-nav { font-size: 0.8125rem; color: #9DA39F; }
.lb button { font: inherit; font-size: 0.875rem; color: #E6E7E3; background: none; border: 0; padding: 0.75rem 0; cursor: pointer; }

/* ---- One page at a time on phones and small tablets ----------------------- */
@media (max-width: 48rem) {
  .spread { grid-template-columns: 1fr; padding-block: 1.5rem; }
  .spread::before { content: none; }
  .page, .page + .page { padding: 1.25rem var(--outer); }
  .page.text { padding-block: 2.5rem; }
  .page.gutter:first-child { align-items: flex-start; text-align: left; }
  .page:first-child::after, .page:last-child::after { content: none; }
  .plate { align-self: center; --hmax: 82svh; }
  .page.bleed { margin-inline: 0; }
  .spread:has(.bleed) { padding-block: 0; }
  .spread:has(.bleed) .page:not(.bleed) { padding-block: 2.5rem; }

}

/* ---- Motion & print ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print { .masthead, .hb-form, dialog { display: none !important; } }
