/* ==========================================================================
   Casa Quivira — owntulemar.com
   Direction B: Bone & Deep Teal
   Palette derived from the Duarte Dellarole photography:
     limestone #D5CDC8 · hardwood #7A522D (hue 28°) · styling teal #418496
   Accent is the wood's complement, deepened. Used on ~3% of surface.
   ========================================================================== */

/* --- self-hosted fonts (deterministic across environments) --------------- */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400; font-display: swap;
             src: url('/assets/fonts/cormorant-garamond-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: swap;
             src: url('/assets/fonts/inter-300.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
             src: url('/assets/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
             src: url('/assets/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
             src: url('/assets/fonts/inter-600.woff2') format('woff2'); }

:root {
  /* colour */
  --bg:        #F6F2EB;   /* warm bone — sits close to the limestone in-frame */
  --bg-alt:    #E9E3D8;
  --ink:       #1B1E1E;   /* warm near-black; pure black goes cold against wood */
  --body:      #48453F;
  --muted:     #877F72;
  --rule:      #D9D0C2;
  --accent:    #0E4A52;
  --accent-lt: #16646F;
  --on-accent: #F6F2EB;
  --chip:      #DDE6E5;

  /* type */
  --serif: 'Cormorant Garamond', 'Hoefler Text', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;

  /* rhythm */
  --gutter: clamp(20px, 4vw, 48px);
  --measure: 1180px;
  --sec: clamp(64px, 9vw, 116px);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); }
.sec  { padding-block: var(--sec); }
.sec--alt { background: var(--bg-alt); }

/* --- type ---------------------------------------------------------------- */
.eyebrow {
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(38px, 5.6vw, 74px); line-height: 1.02; }
h2 { font-size: clamp(28px, 3.6vw, 46px); line-height: 1.14; max-width: 20ch; }
h3 { font-size: clamp(20px, 2vw, 26px); line-height: 1.25; }
.lede { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.78; max-width: 62ch; }
.lede + .lede { margin-top: 1.1em; }
.kicker { font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 2.6vw, 32px); color: var(--ink);
          line-height: 1.25; margin-top: 1.2em; max-width: 24ch; }
.fine { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* --- skip link ----------------------------------------------------------- */
.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 12px; top: 12px; z-index: 999; background: var(--accent); color: var(--on-accent);
  padding: 10px 18px; border-radius: 3px;
}

/* --- hero ---------------------------------------------------------------- */
.hero { position: relative; min-height: 78svh; display: grid; background: var(--ink); }
.hero picture, .hero img { grid-area: 1/1; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; grid-area: 1/1;
  background: linear-gradient(180deg, rgba(10,8,6,.44) 0%, rgba(10,8,6,.04) 40%, rgba(10,8,6,.66) 100%);
}
.hero__txt { grid-area: 1/1; z-index: 2; align-self: end; padding-block: clamp(34px, 6vw, 62px); }
.hero__txt h1 { color: #fff; max-width: 15ch; margin-top: 18px;
                font-size: clamp(44px, 6vw, 82px); text-shadow: 0 2px 18px rgba(11,8,6,.28); }
.hero__txt .eyebrow { color: #FBF6EC; font-weight: 600; font-size: 13.5px; letter-spacing: .2em;
                      text-shadow: 0 1px 4px rgba(11,8,6,.6); }
.hero__sub { margin-top: 24px; color: #FBF6EC; max-width: 46ch; font-weight: 400;
             font-size: clamp(18px, 1.7vw, 22px); line-height: 1.55;
             text-shadow: 0 1px 5px rgba(11,8,6,.55); }

/* --- scarcity bar -------------------------------------------------------- */
.bar { background: var(--accent); color: var(--on-accent); }
.bar .wrap { padding-block: 22px; display: flex; gap: 14px 34px; flex-wrap: wrap; align-items: baseline; }
.bar__lead { font-family: var(--serif); font-weight: 400; font-size: clamp(19px, 2.2vw, 24px); }
.bar__detail { font-size: 13.5px; opacity: .84; }

/* --- stats --------------------------------------------------------------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--rule); border-block: 1px solid var(--rule); margin-top: 56px;
}
.stat { background: var(--bg); padding: 28px 24px; }
.sec--alt .stat { background: var(--bg-alt); }
.stat__n { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 40px); color: var(--ink);
           line-height: 1; font-variant-numeric: tabular-nums; }
.stat__l { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
           color: var(--muted); margin-top: 12px; font-weight: 500; }

/* --- gallery ------------------------------------------------------------- */
.group + .group { margin-top: clamp(48px, 6vw, 84px); }
.group__head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.group__head::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(6, 1fr); }
.shot { position: relative; margin: 0; overflow: hidden; background: var(--bg-alt); }
.shot button {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none;
  cursor: zoom-in; font: inherit; color: inherit;
}
.shot picture { display: block; width: 100%; height: 100%; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.shot:hover img { transform: scale(1.035); }
.shot button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }

/* span rules — first shot in a group leads */
.shot--lead { grid-column: span 4; aspect-ratio: 3/2; }
.shot--half { grid-column: span 2; aspect-ratio: 3/4; }
.shot--third{ grid-column: span 2; aspect-ratio: 3/2; }
.shot--wide { grid-column: span 3; aspect-ratio: 3/2; }

/* --- reveal -------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }

/* --- investment ---------------------------------------------------------- */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(36px, 6vw, 76px); align-items: start; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: 22px; }
.tbl th {
  text-align: left; font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; padding: 0 0 13px; border-bottom: 1px solid var(--rule);
}
.tbl td { padding: 15px 0; border-bottom: 1px solid var(--rule); font-size: 15.5px; }
.tbl th:last-child, .tbl td:last-child { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.is-peak td { color: var(--ink); font-weight: 500; }
.callout { border-left: 2px solid var(--accent); padding: 4px 0 4px 26px; }

.facts { display: grid; gap: 26px; margin-top: 34px; }
.fact h3 { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink);
           letter-spacing: .02em; text-transform: none; }
.fact p { font-size: 15px; margin-top: 6px; }

.price { margin-top: 1.1em; font-family: var(--serif); font-weight: 400; color: var(--ink);
         font-size: clamp(30px, 3.4vw, 42px); line-height: 1; font-variant-numeric: tabular-nums;
         letter-spacing: -.01em; }
.price__label { display: block; margin-bottom: 10px; font-family: var(--sans); font-size: 10.5px;
                letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

.flag {
  display: inline-block; background: var(--chip); color: var(--accent);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 2px; font-weight: 600;
}

/* --- form ---------------------------------------------------------------- */
.form { display: grid; gap: 18px; max-width: 520px; margin-top: 30px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
               color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 2px; padding: 13px 14px;
}
.sec--alt .field input, .sec--alt .field select, .sec--alt .field textarea { background: var(--bg); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,74,82,.12);
}
.field--error input { border-color: #9B3B2F; }
.field__err { font-size: 12.5px; color: #9B3B2F; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-block; background: var(--accent); color: var(--on-accent);
  padding: 16px 38px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 500; border: 0; border-radius: 2px; cursor: pointer; text-decoration: none;
  transition: background .25s;
}
.btn:hover, .btn:focus-visible { background: var(--accent-lt); }
.btn[disabled] { opacity: .55; cursor: default; }
.form__ok { border-left: 2px solid var(--accent); padding-left: 22px; }

/* --- custom select (progressive enhancement) ----------------------------- */
/* No-JS baseline: strip the native chrome and draw our own chevron so the
   closed control is on-brand even before main.js upgrades it to a listbox. */
.field select[data-select] {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23877F72' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}
/* Native control is kept in the DOM for form submission, hidden once enhanced. */
.field select.select-native {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.select { position: relative; }
.select__btn {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 2px;
  padding: 13px 14px; width: 100%; cursor: pointer;
  display: flex; align-items: center; gap: 12px; text-align: left;
}
.select__btn::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-left: auto;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: translateY(-2px) rotate(45deg); transition: transform .2s ease;
}
.select.is-open .select__btn::after { transform: translateY(2px) rotate(225deg); }
.select__btn:focus-visible, .select.is-open .select__btn {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,74,82,.12);
}
.select__val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select__val--placeholder { color: var(--muted); }

.select__list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  margin: 0; padding: 5px; list-style: none;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 3px;
  box-shadow: 0 14px 40px rgba(27,30,30,.16); max-height: 300px; overflow-y: auto;
}
.select__list[hidden] { display: none; }
.select__opt {
  display: flex; align-items: center; gap: 10px; line-height: 1.3;
  padding: 11px 12px; border-radius: 2px; font-size: 16px; color: var(--ink); cursor: pointer;
}
.select__opt::before {
  content: ""; flex: none; width: 13px; height: 7px; margin-top: -3px;
  border-left: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg); opacity: 0; transition: opacity .12s ease;
}
.select__opt[aria-selected="true"] { color: var(--accent); font-weight: 500; }
.select__opt[aria-selected="true"]::before { opacity: 1; }
.select__opt.is-active { background: var(--chip); }

/* --- features / specification ------------------------------------------- */
.featgrid { display: grid; grid-template-columns: repeat(2, 1fr);
            gap: clamp(30px, 4vw, 56px) clamp(36px, 6vw, 88px); margin-top: 46px; }
.featgroup h3 { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--ink);
                letter-spacing: .04em; text-transform: uppercase;
                padding-bottom: 13px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; }
.featgroup ul { list-style: none; display: grid; gap: 10px; }
.featgroup li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.45; color: var(--body); }
.featgroup li::before { content: ""; position: absolute; left: 1px; top: .56em;
                        width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .55; }

/* --- lightbox ------------------------------------------------------------ */
dialog.lb {
  border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100dvh;
  background: #0F0D0B; color: #EFE9DF;
}
dialog.lb::backdrop { background: rgba(12,10,8,.94); }
.lb__fig { display: grid; place-items: center; width: 100%; height: 100%; }
.lb__fig img { max-width: 94vw; max-height: 84dvh; object-fit: contain; width: auto; height: auto; }
.lb__cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
           font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #B3A899; }
.lb__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.09); border: 0; color: #EFE9DF; cursor: pointer;
  width: 52px; height: 52px; border-radius: 50%; font-size: 21px; line-height: 1;
}
.lb__btn:hover { background: rgba(255,255,255,.18); }
.lb__prev { left: 16px; } .lb__next { right: 16px; }
.lb__close { top: 16px; right: 16px; transform: none; }

/* --- footer -------------------------------------------------------------- */
footer { border-top: 1px solid var(--rule); padding-block: 34px; }
footer .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
               font-size: 12px; color: var(--muted); }

/* --- responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .shot--lead, .shot--wide, .shot--third { grid-column: span 2; aspect-ratio: 3/2; }
  .shot--half { grid-column: span 1; aspect-ratio: 3/4; }
  .lb__btn { width: 44px; height: 44px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr; }
  .shot--half { grid-column: span 1; }
  .featgrid { grid-template-columns: 1fr; }
}

/* --- print --------------------------------------------------------------- */
@media print {
  .hero { min-height: 0; } .lb, .btn, .form { display: none; }
  body { background: #fff; font-size: 11pt; }
}
