/* Layout: one screen. Photographs sit whole on a slate-felt ground, framed by a thin top bar
   (wordmark, Inquire) and bottom bar (discipline, controls). Inquire raises a cream-stone
   sheet over everything. Palette drawn from Brian's materials board; type from his card.
   Single deliberate look (no light/dark switch): the photos always sit on slate. */
:root {
  --slate: #3e4144;      /* page ground: the charcoal felt board */
  --stone: #eee8d9;      /* cream stone: text on slate, the inquiry sheet */
  --bronze: #a3987f;     /* champagne bronze: secondary text, hairlines on slate */
  --oak: #84603e;        /* weathered oak: the one accent */
  --iron: #2b2724;       /* dark bronze grid: text on stone */
  --rule-light: #cfc6b2; /* hairlines on stone */
  --error: #9b3f2c;

  --font-mark: "Syncopate", "Sackers Gothic Std", "Copperplate", "Helvetica Neue", sans-serif;
  --font-text: "Cormorant Garamond", "EB Garamond", Garamond, "Times New Roman", serif;

  --gutter: clamp(16px, 3.2vw, 44px);
  --bar: clamp(64px, 9vh, 88px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--slate);
  color: var(--stone);
  font-family: var(--font-text);
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.5;
  display: grid;
  grid-template-rows: var(--bar) minmax(0, 1fr) var(--bar);
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}
body.sheet-open { overflow: hidden; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--stone); outline-offset: 4px; }

/* ---------- bars ---------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: var(--gutter);
  padding-block: 0;
  min-width: 0;
}
.bar.top { padding-top: env(safe-area-inset-top, 0px); }
.bar.bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }

.wordmark {
  margin: 0;
  font-family: var(--font-mark);
  font-weight: 400;
  font-size: clamp(0.95rem, 1.5vw, 1.25rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.wordmark.small { font-size: 0.8rem; }

.inquire-btn {
  font-family: var(--font-mark);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  border: 1px solid var(--bronze);
  padding: 12px 18px 12px 21px; /* extra left balances the trailing letter-spacing */
  transition: background-color 0.25s ease, color 0.25s ease;
}
.inquire-btn:hover { background: var(--stone); color: var(--iron); border-color: var(--stone); }

.discipline {
  margin: 0;
  font-style: italic;
  font-weight: 400;
  color: var(--bronze);
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  min-width: 0;
}

/* ---------- gallery ---------- */
.gallery { min-height: 0; padding-inline: var(--gutter); }
.stage {
  position: relative;
  height: 100%;
  overflow: hidden; /* photos float on the slate ground itself, no box behind them */
}
.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.slide.is-active { opacity: 1; }
.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; /* the whole photograph, never cropped */
}
.stage-empty {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  color: var(--bronze);
  font-style: italic;
  text-align: center;
  padding: 24px;
}
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } }

.gallery-controls { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.nav-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  color: var(--stone);
  cursor: pointer;
  opacity: 0.8;
}
.nav-btn:hover { opacity: 1; }
.nav-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn .i-play { display: none; }
.nav-btn[aria-pressed="true"] .i-play { display: block; }
.nav-btn[aria-pressed="true"] .i-pause { display: none; }
/* Read aloud by screen readers ("Photo 3 of 14"), never shown. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- inquiry sheet ---------- */
.sheet {
  /* <dialog> opened with showModal(): sits above everything, traps focus, Esc closes. */
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--stone);
  color: var(--iron);
  overflow-y: auto;
  overscroll-behavior: contain;
  color-scheme: light;
}
.sheet[open] { animation: sheet-up 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sheet::backdrop { background: rgba(30, 31, 33, 0.6); }
@keyframes sheet-up { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }

.sheet-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--bar);
  padding-inline: var(--gutter);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: 0;
  background: var(--stone);
}
.close-btn {
  font-family: var(--font-mark);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--iron);
  background: none;
  border: 1px solid var(--iron);
  padding: 12px 18px 12px 21px;
  cursor: pointer;
}
.close-btn:hover { background: var(--iron); color: var(--stone); }
.sheet :focus-visible { outline-color: var(--iron); }

.sheet-body {
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-top: clamp(24px, 6vh, 72px);
  padding-bottom: calc(clamp(40px, 8vh, 96px) + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(28px, 5vw, 72px);
}
.sheet-intro h2, .sent h2 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.005em;
}
.sheet-intro p, .sent p { margin: 0.8em 0 0; font-style: italic; font-weight: 400; color: #5d554b; max-width: 30ch; }

.inquiry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 32px;
  margin: 0;
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; padding: 0; border: 0; }
.wide { grid-column: 1 / -1; }
.field label, .field legend { font-weight: 600; font-size: 1.0625rem; padding: 0; }
.optional { font-weight: 400; font-style: italic; color: #6f665a; }
.inquiry input[type="text"],
.inquiry input[type="email"],
.inquiry input[type="tel"],
.inquiry textarea {
  width: 100%;
  font: inherit;
  font-size: 1.1875rem;
  color: var(--iron);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-light);
  border-radius: 0;
  padding: 6px 0;
}
.inquiry textarea { resize: vertical; min-height: 7em; border: 1px solid var(--rule-light); padding: 10px 12px; }
.inquiry input:focus-visible, .inquiry textarea:focus-visible { outline: none; border-color: var(--oak); box-shadow: 0 1px 0 0 var(--oak); }
.inquiry textarea:focus-visible { box-shadow: 0 0 0 1px var(--oak); }
.inquiry ::placeholder { color: #8c8274; font-style: italic; }
.inquiry [aria-invalid="true"] { border-color: var(--error); }

.location legend { margin-bottom: 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--rule-light);
  font-size: 1.0625rem;
}
.choice input:checked + span { background: var(--oak); border-color: var(--oak); color: var(--stone); }
.choice input:focus-visible + span { outline: 1px solid var(--iron); outline-offset: 3px; }
.location.is-invalid .choice span { border-color: var(--error); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* The security check stays invisible unless Cloudflare needs the visitor to click it. */
.verify:has(#turnstile:empty) { display: none; }

.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; }
.send {
  font-family: var(--font-mark);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
  background: var(--iron);
  border: 1px solid var(--iron);
  padding: 15px 24px 15px 27px;
  cursor: pointer;
}
.send:hover { background: var(--oak); border-color: var(--oak); }
.send:disabled { opacity: 0.6; cursor: progress; }
.status { margin: 0; font-style: italic; color: #5d554b; min-width: 0; }
.status.is-error { color: var(--error); font-style: normal; }

/* After sending: one quiet, centred message; Close (top right) is the only control. */
.sheet.is-sent .sheet-intro { display: none; }
.sheet.is-sent .sheet-body { grid-template-columns: minmax(0, 1fr); min-height: calc(100% - var(--bar)); align-content: center; }
.sent { grid-column: 1 / -1; text-align: center; padding-bottom: var(--bar); }
.sent p { margin-inline: auto; }
.sent h2:focus { outline: none; }

/* ---------- narrow screens ---------- */
@media (max-width: 760px) {
  .sheet-body { grid-template-columns: minmax(0, 1fr); }
  .inquiry { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  body { grid-template-rows: var(--bar) minmax(0, 1fr) auto; }
  .bar.bottom { flex-direction: column-reverse; align-items: center; gap: 2px; padding-block: 6px 14px; }
  .bar.bottom { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .discipline { font-size: 0.95rem; text-align: center; }
  .wordmark { font-size: 0.85rem; letter-spacing: 0.12em; }
  .inquire-btn { padding: 10px 13px 10px 16px; font-size: 0.66rem; }
}
