/* House: Ullastre. A full-bleed masthead that is the light study, a rail that stays with you, a story in panels,
   and a plan that is the contents. */

/* ---------- the masthead: the photograph is the hour ---------- */
.masthead { --n: clamp(4.5rem, 11vw, 12rem); height: calc(100svh - 2 * var(--gutter)); min-height: 600px; max-height: 1100px; background: #b9bbc0; isolation: isolate; }
.masthead__bg { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.masthead__bg img { object-position: 54% 62%; }
.masthead__scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(12, 14, 17, 0.26) 0%, rgba(12, 14, 17, 0) 24%, rgba(12, 14, 17, 0) 50%, rgba(12, 14, 17, 0.55) 100%); }
.masthead__name {
  position: absolute; z-index: 4; left: clamp(20px, 3.4vw, 52px); bottom: clamp(18px, 4.4vh, 46px); margin: 0;
  font-size: var(--n); font-weight: 600; letter-spacing: -0.055em; line-height: 0.8; color: #ffffff;
  text-shadow: 0 20px 46px rgba(16, 18, 22, 0.4);
}
.masthead__chips { position: absolute; z-index: 5; left: clamp(20px, 3.4vw, 52px); bottom: calc(clamp(18px, 4.4vh, 46px) + var(--n) * 0.82 + 18px); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.masthead__chips .tag { position: static; height: 34px; padding: 0 14px; }
.masthead .hero__chip, .hero__chip { display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px; border-radius: 999px; color: #1c1d20; text-decoration: none; font-family: var(--mono); font-size: 0.65625rem; letter-spacing: 0.12em; text-transform: uppercase; }
.masthead .hero__chip b { font-weight: 700; }
.masthead .hero__chip b + span::before { content: ""; display: inline-block; width: 4px; height: 4px; margin-right: 10px; border-radius: 50%; background: currentColor; opacity: 0.45; vertical-align: middle; }
.masthead__col { position: absolute; z-index: 5; right: clamp(16px, 3.2vw, 46px); bottom: clamp(24px, 5vh, 52px); width: min(440px, 36vw); padding: clamp(24px, 2.2vw, 34px); border-radius: 22px; }
.masthead__col .kicker { color: rgba(255, 255, 255, 0.86); margin-bottom: 12px; }
.masthead__line { font-family: var(--serif); font-size: clamp(1.6rem, 1rem + 1.1vw, 2.25rem); line-height: 1.08; color: #ffffff; }
.masthead__line em { font-style: italic; }
.masthead__study { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.16); display: grid; gap: 6px; }
.masthead__study .readout { font-size: 0.65625rem; }
.masthead .seasons { display: flex; width: 100%; }
.masthead .seasons button { flex: 1; min-height: 30px; padding: 0 6px; font-size: 0.625rem; }
html.js[data-motion="on"] .masthead__bg { animation: house-open 1.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
html.js[data-motion="on"] .masthead__name { animation: house-rise 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both; }
html.js[data-motion="on"] .masthead__col, html.js[data-motion="on"] .masthead__chips { animation: house-up 1s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both; }
@keyframes house-open { from { clip-path: inset(8% 8% 8% 8% round 30px); transform: scale(1.12); } to { clip-path: inset(0 0 0 0 round 0); transform: none; } }
@keyframes house-rise { from { transform: translateY(50%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes house-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- the layout under it: story left, the rail held in view ---------- */
.house__layout { display: grid; grid-template-columns: minmax(0, 7.3fr) minmax(0, 4.7fr); column-gap: var(--gutter); align-items: start; max-width: var(--container); margin: 0 auto; }
.house__story { grid-column: 1; grid-row: 1; min-width: 0; }
.house__rail {
  grid-column: 2; grid-row: 1; margin: 0; position: sticky; top: var(--gutter); display: grid; gap: clamp(12px, 1.4svh, 18px); align-content: start;
  padding: clamp(70px, 6vw, 80px) clamp(22px, 2.2vw, 34px) clamp(22px, 2.2vw, 30px); min-width: 0;
}

/* ---------- rail ---------- */
.rail__title { display: grid; gap: 8px; }
.rail__name { font-size: clamp(2.2rem, 1rem + 2.4vw, 3.4rem); font-weight: 600; letter-spacing: -0.045em; line-height: 0.9; }
.rail__line { max-width: 34ch; font-size: clamp(1.125rem, 0.95rem + 0.35vw, 1.3125rem); line-height: 1.2; text-wrap: pretty; }
.numerals { display: flex; flex-wrap: wrap; gap: 8px 36px; }
.numerals > div { display: grid; gap: 4px; align-content: start; }
.numerals dt { font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.numerals dd { font-size: clamp(1.6rem, 1.1rem + 0.9vw, 2.3rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.numerals--big { padding-block: 14px; border-block: 1px solid var(--line); justify-content: space-between; flex-wrap: nowrap; gap: 12px; }
.numerals--big dd { font-size: clamp(1.6rem, 1rem + 1.1vw, 2.4rem); }
.numerals__price dd { padding-top: 4px; }
.numerals__face { display: none !important; }

.rail__where { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: center; }
.compass-card { display: flex; align-items: center; gap: 14px; }
.compass { width: 84px; height: 84px; flex: none; overflow: visible; }
.compass__ring { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.compass__ticks { stroke: var(--muted); stroke-width: 1; }
.compass__n { font-family: var(--mono); font-size: 9px; font-weight: 700; fill: var(--ink-2); }
.compass__face { fill: var(--ink); }
.compass__line { stroke: var(--ink); stroke-width: 1.4; }
.compass__orbit circle { fill: var(--lime); stroke: var(--ink); stroke-width: 1.4; }
.compass__orbit { transition: opacity 250ms; }
.compass__orbit.is-down { opacity: 0; }
.compass-card__text { display: grid; gap: 2px; font-size: 0.8125rem; color: var(--muted); line-height: 1.35; }
.compass-card__text b { font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.locator { max-width: 200px; justify-self: end; width: 100%; }
.locator .island__bin { stroke-width: 2.8; }
.locator .island__bin--lit { stroke-width: 6; }
.locator .island__orbit-line { stroke-dasharray: 3 8; }
.locator__dot { fill: var(--lime); stroke: var(--ink); stroke-width: 4; }
.locator__ring { fill: none; stroke: var(--ink); stroke-width: 2; }

.study { display: grid; gap: 8px; padding: 18px 18px 16px; border-radius: var(--r-card); background: var(--dark-2); --surface: var(--dark-2); }
html[data-theme="night"] .study { background: #0f1012; }
.study .label { color: rgba(255, 255, 255, 0.66); }
.study__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.study__bar .readout { font-size: 0.625rem; }
.study__bar .seasons button { padding: 0 9px; min-height: 28px; font-size: 0.59375rem; }
.rail__hours { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.72); padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.rail__hours b { color: #ffffff; font-weight: 600; }
.rail__hours em { font-style: normal; text-decoration: underline dotted; text-underline-offset: 0.2em; }
.rail__cta { display: grid; gap: 8px; }
.rail__cta .button { width: 100%; justify-content: space-between; min-height: 52px; }
.rail__fine { font-size: 0.75rem; color: var(--muted); }
.house-bar, .plan-sheet { display: none; }

/* ---------- story ---------- */
.gallery { display: grid; gap: clamp(36px, 4vw, 64px); padding: clamp(28px, 3vw, 44px); margin-bottom: var(--gutter); }
.chapter { display: grid; gap: 20px; scroll-margin-top: 30px; }
.chapter__figure { display: grid; gap: 10px; }
.chapter .print { aspect-ratio: 3 / 2; }
.chapter__text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--gap); row-gap: 12px; align-items: start; padding-inline: 4px; }
.chapter__text > .kicker { grid-column: 1 / -1; }
.chapter__text h2 { grid-column: 1; }
.chapter__text p:not(.kicker) { grid-column: 2; color: var(--muted); max-width: 40ch; }
.chapter__text .numerals { grid-column: 2; padding-top: 14px; border-top: 1px solid var(--line); }
.chapter__figure.is-pulse .print { outline: 3px solid var(--lime-deep); outline-offset: 4px; }

.plan, .minutes { margin-bottom: var(--gutter); }
.plan__head { display: grid; gap: 14px; margin-bottom: 30px; max-width: 60ch; }
.plan__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); column-gap: clamp(20px, 2.6vw, 40px); align-items: start; }
.plan__figure { display: grid; gap: 10px; }
.planmap { width: 100%; height: auto; border-radius: var(--r-card); background: var(--panel-soft); }
.plan__ground { fill: var(--panel-soft); }
.plan__room { fill: var(--paper-shade); transition: fill 400ms var(--ease); cursor: default; }
.plan__room--yard { fill: var(--panel); }
.plan__room.is-lit { fill: var(--lime-wash); }
.plan__room.is-hot { fill: var(--stone); }
.planmap a { cursor: pointer; }
.planmap a:focus-visible { outline: none; }
.planmap a:focus-visible .plan__room { stroke: var(--ink); stroke-width: 0.25; }
.plan__yard-wall { fill: none; stroke: var(--ink); stroke-width: 0.26; stroke-linecap: round; }
.plan__stones { stroke: var(--muted); stroke-width: 0.1; fill: none; }
.plan__wedges polygon { fill: var(--lime-deep); opacity: 0.75; }
.plan__walls { fill: none; stroke: var(--ink); stroke-width: 0.34; stroke-linejoin: miter; }
.plan__gap { fill: var(--panel-soft); }
.plan__sash { stroke: var(--ink); stroke-width: 0.09; fill: none; }
.plan__shutter { stroke: var(--ink-2); stroke-width: 0.22; fill: none; stroke-linecap: round; }
.plan__no circle { fill: var(--panel); stroke: var(--ink); stroke-width: 0.1; }
.plan__no text { font-family: var(--mono); font-size: 0.8px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.plan__no { pointer-events: none; }
.plan__olive-ring { fill: none; stroke: var(--muted); stroke-width: 0.14; }
.plan__olive-crown { fill: var(--lime-deep); opacity: 0.5; }
.plan__olive-trunk { fill: var(--ink); }
.plan__north path { fill: none; stroke: var(--ink); stroke-width: 0.12; }
.plan__north text { font-family: var(--mono); font-size: 0.8px; font-weight: 700; fill: var(--ink-2); text-anchor: middle; }
.plan__caption { color: var(--muted); }

.rooms { display: grid; border-top: 1px solid var(--line); }
.room { border-bottom: 1px solid var(--line); }
.room__row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 14px; gap: 10px; align-items: center; min-height: 44px; padding: 6px 4px; border-radius: 10px; text-decoration: none; transition: background-color 250ms, padding 300ms var(--ease); }
a.room__row:hover, .room.is-hot .room__row { padding-left: 10px; background: var(--panel-soft); }
.room__n { font-family: var(--mono); font-size: 0.6875rem; color: var(--muted); }
.room__name { font-size: 1.0625rem; }
.room__area { font-family: var(--mono); font-size: 0.6875rem; color: var(--muted); }
.room__sun { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--muted); transition: background-color 300ms, box-shadow 300ms; }
.room.is-lit .room__sun { background: var(--lime); box-shadow: inset 0 0 0 1.5px var(--ink); }
.rooms__total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 4px; font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.rooms__total b { font-family: var(--sans); font-size: 1.75rem; letter-spacing: -0.03em; text-transform: none; color: var(--ink); font-weight: 500; }

.minutes__head { display: grid; gap: 12px; margin-bottom: 26px; max-width: 30ch; }
.minutes__body { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); column-gap: clamp(20px, 2.6vw, 40px); align-items: center; }
.places { display: grid; border-top: 1px solid var(--line); }
.places button { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name min" "note min"; column-gap: 16px; align-items: center; width: 100%; padding: 14px 6px; text-align: left; border-bottom: 1px solid var(--line); border-radius: 12px; transition: padding 300ms var(--ease), background-color 250ms; }
.places button .serif-line { grid-area: name; font-size: 1.375rem; }
.places__note { grid-area: note; font-size: 0.8125rem; color: var(--muted); }
.places__min { grid-area: min; display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--panel-soft); box-shadow: inset 0 0 0 1px var(--line); font-family: var(--mono); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; transition: background-color 250ms, color 250ms; }
.places button:hover, .places button.is-on { padding-left: 12px; background: var(--panel-soft); }
.places button.is-on .places__min, .places button:hover .places__min { background: var(--lime); color: var(--lime-ink); box-shadow: none; }
.minutes__map { padding: 0; }
.route { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 4 9; opacity: 0; transition: opacity 400ms var(--ease); }
.route.is-on { opacity: 1; animation: draw 700ms var(--ease); }
@keyframes draw { from { stroke-dashoffset: 600; } to { stroke-dashoffset: 0; } }
.route__end { fill: var(--lime); stroke: var(--ink); stroke-width: 3; opacity: 0; transition: opacity 400ms; }
.route__end.is-on { opacity: 1; }
.fine { margin-top: 18px; font-size: 0.8125rem; color: var(--muted); max-width: 70ch; }
.fine a { text-underline-offset: 0.15em; }
.house__end { display: grid; gap: 22px; margin-bottom: var(--gutter); }
.house__end-links { display: flex; flex-wrap: wrap; gap: 12px; }
.house__end .link-arrow { min-height: 46px; padding: 0 20px; border-radius: 999px; background: #ffffff; color: #141517; }
.house__end .link-arrow:last-child { background: var(--lime); color: var(--lime-ink); }

@media (min-width: 821px) and (max-height: 860px) {
  .rail__where .locator { display: none; }
  .rail__where { grid-template-columns: 1fr; }
  .rail__line { display: none; }
}
@media (min-width: 821px) and (max-height: 760px) {
  .rail__where { display: none; }
  .numerals--big { padding-block: 10px; }
}

/* ====================================================== phone ====================================================== */
@media (max-width: 820px) {
  body.page-house { --bar-h: calc(70px + var(--safe-b)); }
  .masthead { --n: clamp(4rem, 21vw, 6rem); height: calc(100svh - var(--strip-h) - 2 * var(--gutter) - var(--dock-h, 112px) - var(--bar-h) + 10px); min-height: 520px; max-height: none; }
  .masthead .guides, .masthead__study { display: none; }
  .masthead__bg img { object-position: 52% 55%; }
  .masthead__name { left: 18px; bottom: auto; top: 118px; }
  .masthead__chips { left: 16px; right: 16px; bottom: auto; top: 66px; flex-wrap: nowrap; }
  .masthead__chips .tag, .masthead .hero__chip { height: 30px; padding: 0 11px; font-size: 0.5625rem; }
  .masthead .hero__chip span { display: none; }
  .masthead__col { left: 10px; right: 10px; bottom: 10px; width: auto; padding: 18px 20px 20px; border-radius: 18px; }
  .masthead__line { font-size: clamp(1.5rem, 6.6vw, 1.85rem); }

  .house__layout { display: block; }
  .house__rail { position: static; padding: 22px var(--pad); margin-bottom: var(--gutter); gap: 18px; }
  .rail__title, .rail__cta, .study__bar, .study__arc, .rail__study .label { display: none; }
  .rail__study { padding: 14px 16px; }
  .rail__hours { border-top: 0; padding-top: 0; }
  .rail__where { grid-template-columns: minmax(0, 1fr) 118px; }
  .rail__where .locator { max-width: 118px; }
  .compass { width: 72px; height: 72px; }
  .rail__numerals { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; border-bottom: 0; }
  .rail__numerals > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .rail__numerals > div:nth-child(odd) { padding-right: 14px; border-right: 1px solid var(--line); }
  .rail__numerals > div:nth-child(even) { padding-left: 16px; }
  .numerals__face { display: grid !important; }
  .rail__numerals dd { font-size: 2rem; }

  .gallery { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 16px; margin-bottom: 0; border-radius: var(--r-panel) var(--r-panel) 0 0; scroll-padding-inline: 16px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .gallery::-webkit-scrollbar { display: none; }
  .chapter { flex: 0 0 min(84vw, 360px); scroll-snap-align: start; align-content: start; }
  .chapter .print { aspect-ratio: 4 / 5; }
  .chapter .print img { object-position: 54% 50%; }
  .chapter__text { grid-template-columns: 1fr; padding-inline: 2px; }
  .chapter__text h2, .chapter__text p:not(.kicker), .chapter__text .numerals { grid-column: 1; }
  .chapter__text p:not(.kicker) { max-width: none; }
  .gallery__count { display: none !important; }
  .gallery ~ .deck__controls { margin: 0 auto var(--gutter); padding: 0 16px 18px; background: var(--panel); border-radius: 0 0 var(--r-panel) var(--r-panel); }
  .gallery__count--old { margin: 0 auto var(--gutter); max-width: var(--container); padding: 0 16px 16px; background: var(--panel); border-radius: 0 0 var(--r-panel) var(--r-panel); font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.14em; color: var(--muted); }
  .plan__body { grid-template-columns: 1fr; row-gap: 18px; }
  .plan__open { width: 100%; margin-top: 14px; }
  .minutes__body { grid-template-columns: 1fr; row-gap: 24px; }
  .minutes__map { order: -1; max-width: 360px; }
  .places button .serif-line { font-size: 1.2rem; }

  .house-bar {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); z-index: 86; align-items: center; justify-content: space-between; gap: 16px;
    height: 60px; padding: 0 8px 0 18px; border-radius: 20px; background: var(--lime); color: var(--lime-ink);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
  }
  .house-bar__price { display: grid; line-height: 1.15; }
  .house-bar__price .label { color: #3d4c12; font-size: 0.5625rem; }
  .house-bar__price b { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; }
  .house-bar .button { background: #141517; color: #ffffff; min-height: 44px; padding: 0 18px; }
  .page-house .ribbon-dock { bottom: var(--bar-h); }

  .plan-sheet {
    position: fixed; inset: calc(var(--strip-h) + 64px) 10px calc(var(--dock-h, 112px) + var(--bar-h)) 10px; z-index: 84; background: var(--panel);
    border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
  }
  .plan-sheet[hidden] { display: none; }
  .plan-sheet__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--line); }
  .plan-sheet__view { position: relative; flex: 1; overflow: hidden; touch-action: none; background: var(--panel-soft); }
  .plan-sheet__layer { position: absolute; left: 0; top: 0; width: 100%; transform-origin: 0 0; will-change: transform; }
  .plan-sheet__layer .plan__figure { gap: 0; }
  .plan-sheet__layer .plan__caption { display: none; }
  .plan-sheet__layer .planmap { border-radius: 0; }
  .plan-sheet .filters__close { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong); }
  .page-house .site-footer { padding-bottom: calc(var(--dock-h, 112px) + var(--bar-h) + 24px); }
}
/* the chips sit over the crosshairs: solid, so no guide line or mark shows through their words */
.masthead__chips .glass { background: #ffffff; }
html[data-theme="night"] .masthead__chips .glass { background: rgba(30, 32, 36, 0.96); }
