/* ==========================================================================
   STUDIO GUALDE — Cocobolo Venao proposal site
   Landing page. Grayscale only; no color accents.
   ========================================================================== */

:root {
  /* Field grey sampled from the layout frame */
  --field: #111111;
  --ink: #111111;
  --paper: #ffffff;

  /* Type */
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Times New Roman", Times, Georgia, serif;
}

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

html, body { height: 100%; }

body {
  background: var(--field);
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}


/* Custom cursor — small white circle everywhere, never the text I-beam */
*, *::before, *::after,
input, label, p, h1 {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12'><circle cx='6' cy='6' r='5.5' fill='white'/></svg>") 6 6, auto !important;
}


/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  touch-action: manipulation;
}

.hero__frame {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Keep the bay anchored on the left as the viewport narrows */
  object-position: 48% 46%;
  filter: grayscale(100%);
  animation: hero-in 1.6s ease-out both;
}

@keyframes hero-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__image { animation: none; }
}

/* Access gate — centered line input with serif label below */
.access {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.access__field {
  pointer-events: auto;
  width: clamp(260px, 30vw, 440px);
}

.access__row { position: relative; }

.access__submit {
  display: none;
  position: absolute;
  right: 4px;
  bottom: 2px;
  width: 30px;
  height: 26px;
  background: transparent;
  border: none;
  padding: 0;
  align-items: center;
  justify-content: flex-end;
}
.access__submit::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--paper);
}

.access__input {
  display: block;
  width: 100%;
  padding-right: 34px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--paper);
  border-radius: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(10px, 0.85vw, 13px);
  letter-spacing: 0.12em;
  padding: 0 0 8px;
  outline: none;
  caret-color: var(--paper);
}

.access__input:focus-visible {
  border-bottom-width: 2px;
  padding-bottom: 7px;
}

.access__label {
  display: block;
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(12px, 1vw, 15px);
  color: var(--paper);
}

.access__error {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(10px, 0.85vw, 13px);
  color: var(--paper);
  opacity: 0.75;
}

/* Bold wordmark, bottom-left */
.hero__wordmark {
  position: absolute;
  bottom: clamp(32px, 6vh, 72px);
  left: clamp(28px, 4vw, 72px);
  font-weight: 700;
  font-size: clamp(19px, 2vw, 30px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--paper);
}

/* Serif caption, bottom-right */
.hero__caption {
  position: absolute;
  bottom: clamp(32px, 6vh, 72px);
  right: clamp(28px, 4vw, 72px);
  font-family: var(--serif);
  font-size: clamp(12px, 1.1vw, 16px);
  color: var(--paper);
}

/* --------------------------------------------------------------------------
   Mobile — stack the two lower texts so they never collide
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .hero__caption {
    right: auto;
    left: clamp(28px, 4vw, 72px);
    bottom: clamp(16px, 3vh, 36px);
  }
  .hero__wordmark {
    bottom: clamp(52px, 10vh, 110px);
  }
}

/* --------------------------------------------------------------------------
   Proposal page
   -------------------------------------------------------------------------- */

/* Masterplan base image: keep the plan centered */
.hero__image--plan {
  object-position: 40% 42%;
}

/* Area legend, right of the plan */
.legend {
  position: absolute;
  left: 73.8%;   /* fallback; js/legend-anchor.js repositions to track the image */
  top: 42%;
  list-style: none;
  font-family: var(--serif);
  font-size: clamp(11px, 0.95vw, 15px);
  line-height: 1.55;
  color: var(--paper);
}

/* Two-line, right-aligned caption variant */
.hero__caption--stacked {
  text-align: right;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .legend {
    left: auto;
    right: clamp(20px, 5vw, 48px);
    top: clamp(20px, 4vh, 48px);
  }
  .hero__caption--stacked {
    text-align: left;
  }
}

/* Area highlight overlays — registered to the plan image, faded on hover */
.hero__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 42%;
  opacity: 0;
  transition: opacity 0.07s ease-out;
  will-change: opacity;
  pointer-events: none;
}
.hero__overlay.is-active { opacity: 1; }
.hero__overlay.is-instant { transition: none; }

/* Legend item bolds while its area is highlighted */
.legend [data-area] {
  transition: font-weight 0.05s linear;
}
.legend [data-area].is-active {
  font-weight: 700;
}

/* Vector linework layer — registered over the aerial */
.hero__linework {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 42%;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Area detail pages — geometry measured from the printed spread @1440x810:
   media 43.75% | text 699-1367px | col gap 23px | title/headings grey #999
   -------------------------------------------------------------------------- */

.detail-page { background: #ffffff; }

.detail {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 43.75% 56.25%;
  background: #ffffff;
}

.detail__media {
  position: relative;
  overflow: hidden;
  background: #111111;  /* dark ground while media loads; never visible once
                           the video paints (desktop video bleeds past edges) */
  min-height: 100svh;
}



.detail__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  background: #111111;  /* any loop-gap frame blends dark instead of flashing */
}

/* variant: footage framed near the top with a margin of water below */
.detail__video--top {
  object-position: center 22%;
}

.detail__wordmark {
  position: absolute;
  top: clamp(22px, 3.4vh, 32px);
  left: clamp(22px, 1.9vw, 36px);
  white-space: nowrap;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(19px, 2vw, 30px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #ffffff;
  text-decoration: none;
}

.detail__content {
  position: relative;
  /* top 7vh | right 5.1vw | bottom | left 4.8vw — measured */
  padding: clamp(42px, 7vh, 68px) clamp(40px, 5.1vw, 84px) clamp(48px, 8vh, 90px) clamp(38px, 4.8vw, 80px);
  color: #808080;
}

.detail__titlebar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: clamp(10px, 1.4vh, 16px) clamp(26px, 3vw, 48px);
  padding-bottom: clamp(14px, 2.4vh, 22px);
  border-bottom: 1px solid #b2b2b2;
  margin-bottom: clamp(14px, 2.2vh, 20px);
}

.detail__title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 24px;
  color: #808080;
  margin: 0;
}

.detail__tabs {
  display: flex;
  align-items: baseline;
  gap: clamp(16px, 1.8vw, 30px);
}

.detail__tab {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 17px;
  color: #bdbdbd;
}
.detail__tab:hover { color: #808080; }
.detail__tab.is-active { color: #808080; }

.detail__phase { display: none; }
.detail__phase.is-active { display: block; }

.detail__section { margin-bottom: clamp(18px, 3.1vh, 28px); }
.detail__section:last-child { margin-bottom: 0; }

.detail__section h2 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 17px;
  color: #808080;
  margin-bottom: clamp(12px, 2.3vh, 20px);
}

.detail__body {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  text-align: justify;
  hyphens: auto;
  color: #808080;
}

.detail__body strong { color: #808080; }

.detail__body p { margin-bottom: 1em; }
.detail__body p:last-child { margin-bottom: 0; }

.detail__body ul {
  margin: 0 0 1em 1em;
  padding: 0;
}
.detail__body li { margin-bottom: 0.25em; }

.detail__schedule { break-inside: avoid; }

/* Fee tables — Site Plan reference type, aligned amounts */
.fee-block {
  break-inside: avoid;
  margin-bottom: 1.4em;
}
.fee-block:last-child { margin-bottom: 0; }

.fee-row {
  display: grid;
  grid-template-columns: 1fr 6em 8em;
  column-gap: 12px;
  align-items: baseline;
  margin-bottom: 0.35em;
  text-align: left;
  hyphens: none;
}

/* construction-cost rows carry a name + calculation pair */
.fee-row--calc {
  grid-template-columns: max-content 1fr 6em 8em;
}

/* per-model rows: self-sizing middle for amounts with multipliers */
.fee-row--calc2 {
  grid-template-columns: 1fr max-content 8em;
}
.fee-mid { text-align: center; }
.fee-amt { text-align: right; }

.fee-row--total { margin-top: 0.9em; }

.fee-note { margin-top: 1.2em; }

/* Service phase blocks — tabular document layout */
.svc-block {
  break-inside: avoid;
  margin-bottom: 1.1em;
}
.svc-block:last-child { margin-bottom: 0; }

.detail__body .svc-head {
  font-family: var(--sans);
  font-weight: 700;
  margin-bottom: 0;
}

.svc-row {
  display: grid;
  grid-template-columns: 1fr 38%;
  column-gap: 18px;
  text-align: left;
  hyphens: none;
}

.svc-del { margin-top: 0.8em; }

.svc-drow {
  display: grid;
  grid-template-columns: 7.5em 1fr 38%;
  column-gap: 18px;
  font-style: italic;
  text-align: left;
  hyphens: none;
}
.svc-dlabel { font-style: italic; }

.svc-note {
  font-style: italic;
  text-align: right;
}
.svc-note .ns { display: none; }

/* No orphaned words: multi-line cells balance their line breaks,
   prose avoids single-word last lines where the browser supports it */
.svc-row > span,
.svc-drow > span,
.fee-row > span {
  text-wrap: pretty;
}
.detail__body p { text-wrap: pretty; }

/* Mobile: condensed table — deliverable label stacks above its items,
   qualifiers share one aligned column and shrink rather than wrap */
@media (max-width: 900px) {
  /* the note always sits beside the text, right-justified at its natural
     width; the LEFT text yields and wraps instead — fuller first line,
     never a lone word on the second */
  .svc-row,
  .svc-drow {
    display: grid;
    /* the note takes its natural width up to a cap; beyond it, it wraps —
       long qualifiers can never force the page wider than the screen */
    grid-template-columns: 1fr fit-content(58%);
    column-gap: 14px;
    align-items: baseline;
  }
  .svc-note {
    text-align: right;
  }
  .svc-note .nl { display: none; }
  .svc-note .ns { display: inline; }
  .svc-dlabel {
    grid-column: 1 / -1;
    margin-bottom: 0.2em;
  }

  /* fees: each group is one shared grid, so its = signs and its
     percentages align on a single vertical rail set by the group's
     furthest-right instance; amounts hold the page edge */
  .fee-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content max-content;
    column-gap: 12px;
    row-gap: 0.4em;
  }
  .fee-block > p,
  .fee-block .svc-head,
  .fee-block .fee-note {
    grid-column: 1 / -1;
  }
  .fee-row,
  .fee-row--calc {
    display: contents;
  }
  .fee-row > span:first-child { grid-column: 1; }
  .fee-row--calc .fee-name { grid-column: 1 / -1; }
  .fee-row--calc .fee-calc { grid-column: 1; }
  .fee-mid {
    grid-column: 2;
    text-align: center;
  }
  .fee-amt {
    grid-column: 3;
    text-align: right;
  }
  /* rows without a = or % (totals, phase 5) span across the rail so
     their long labels never push it right or squeeze the amounts */
  .fee-row--wide > span:first-child { grid-column: 1 / 3; }
  .fee-row--wide .fee-mid { display: none; }
  .svc-dlabel {
    grid-column: 1 / -1;
    margin-bottom: 0.2em;
  }

  /* fees: each group is one shared grid, so its = signs and its
     percentages align on a single vertical rail set by the group's
     furthest-right instance; amounts hold the page edge */
  .fee-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content max-content;
    column-gap: 12px;
    row-gap: 0.4em;
  }
  .fee-block > p,
  .fee-block .svc-head,
  .fee-block .fee-note {
    grid-column: 1 / -1;
  }
  .fee-row,
  .fee-row--calc {
    display: contents;
  }
  .fee-row > span:first-child { grid-column: 1; }
  .fee-row--calc .fee-name { grid-column: 1 / -1; }
  .fee-row--calc .fee-calc { grid-column: 1; }
  .fee-mid {
    grid-column: 2;
    text-align: center;
  }
  .fee-amt {
    grid-column: 3;
    text-align: right;
  }
  /* rows without a = or % (totals, phase 5) span across the rail so
     their long labels never push it right or squeeze the amounts */
  .fee-row--wide > span:first-child { grid-column: 1 / 3; }
  .fee-row--wide .fee-mid { display: none; }
  .svc-dlabel:empty { display: none; }
}

/* Return to Site Plan links */
.detail__return {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #808080;
  text-decoration: none;
}
.detail__return:hover { color: #666666; }
.detail__return--top { margin-bottom: 20px; }

/* Terms and Conditions expander */
.detail__terms {
  margin-top: clamp(28px, 5vh, 48px);
  text-align: center;
}
.detail__terms-toggle {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  color: #bdbdbd;
}
.detail__terms-toggle:hover,
.detail__terms-toggle.is-open {
  color: #808080;
}
.detail__terms-body {
  margin-top: clamp(16px, 3vh, 28px);
  text-align: left;
}
/* uniform rhythm: exactly one gap between the end of any text and the
   next title, regardless of what precedes it */
.detail__terms-body h2 { margin-top: 0; margin-bottom: 0; }
.detail__terms-body .svc-block,
.detail__terms-body .fee-block { margin-bottom: 1.6em; }
.detail__terms-body .svc-block > p:last-child { margin-bottom: 0; }
.detail__terms-body .svc-block:last-child { margin-bottom: 0; }
/* every title inside the terms carries the section-title size */
.detail__terms-body .svc-head { font-size: 17px; }

/* header with a trailing note: title left, note right at body-note size */
.svc-head--row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.svc-head--row .svc-note,
.detail__terms-body .svc-head--row .svc-note {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
}

/* Dark cursor over the light content column so it stays visible */
.detail__content, .detail__content * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12'><circle cx='6' cy='6' r='5.5' fill='%23808080'/></svg>") 6 6, auto !important;
}

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; overflow-x: clip; }
  .detail__media { min-height: 56svh; }
  .detail__wordmark {
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }
  .detail__title { font-size: 24px; }
  .detail__section h2 { font-size: 17px; }
  /* tabs: stacked one under the other beneath the title */
  .detail__tabs {
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .detail__tab { font-size: 15px; text-align: left; }
  .detail__body { font-size: 15px; }
}

/* --------------------------------------------------------------------------
   Mobile hero pages (landing + site plan)
   -------------------------------------------------------------------------- */
@media (max-width: 700px) {
  /* wordmark centered at the top, out of the plan's way */
  .hero__wordmark {
    top: clamp(18px, 3vh, 28px);
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  /* landing caption centered at the bottom */
  .hero__caption {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    text-align: center;
    width: max-content;
    max-width: 92vw;
    bottom: clamp(18px, 3.5vh, 34px);
  }

  /* site plan caption stays bottom-left */
  .hero__caption--stacked {
    left: clamp(16px, 5vw, 32px);
    transform: none;
    text-align: left;
  }

  /* legend just below the diagonal boundary road, nudged toward center */
  .legend {
    left: auto !important;
    top: 66svh !important;
    bottom: auto;
    right: clamp(44px, 14vw, 96px);
    text-align: left;
    font-size: 14px;
    line-height: 1.55;
  }

  /* larger subtitle on mobile */
  .hero__caption {
    font-size: 14px;
  }

  /* mobile plan framing: tall mobile assets fill the full screen height */
  .hero__image--plan,
  .hero__linework,
  .hero__overlay {
    object-position: 50% 50%;
  }

  /* 16px stops iOS from zooming into the field on focus */
  .access__input { font-size: 16px; }
  .access__label { font-size: 14px; }

  /* enter arrow is a mobile affordance only */
  .access__submit { display: flex; }
}

/* Desktop: the PAGE does not scroll — only the text column does, inside its
   own scroll container. Elastic overscroll (macOS rubber-banding) is thereby
   confined to the text pane; the video panel has no scroll context to move in.
   The video also bleeds past the viewport edges as a belt-and-braces measure. */
@media (min-width: 901px) {
  html, body.detail-page {
    height: 100%;
    overflow: hidden;
  }
  .detail {
    display: block;
    height: 100vh;
  }
  .detail__media {
    position: fixed;
    top: 0;
    left: 0;
    width: 43.75%;
    height: 100vh;
    min-height: 0;
  }
  .detail__content {
    position: fixed;
    top: 0;
    right: 0;
    width: 56.25%;
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* legacy Edge */
  }
  .detail__content::-webkit-scrollbar {
    display: none;                  /* Safari + Chrome */
  }
  .detail__video {
    top: -2vh;
    height: calc(100% + 4vh);
  }
}
