/* Ardverran House: page layout. Spec sections 4, 6, 7. */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--gorse);
  color: var(--ink);
  padding: 0.6rem 1rem;
  text-decoration: none;
}
.skip:focus { left: 12px; top: 12px; }

/* Nav: fixed, 64px, one line always */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-inline: 6vw;
  transition: background-color 0.3s var(--ease-surge);
}
nav::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 18, 23, 0.6), transparent);
  pointer-events: none;
  transition: opacity 0.3s var(--ease-surge);
}
nav.docked {
  background: var(--ink);
  border-bottom: 1px solid rgba(234, 241, 239, 0.14);
}
nav.docked::before { opacity: 0; }
nav > * { position: relative; }
nav .wordmark { margin-right: auto; }
nav a.navlink {
  color: var(--spindrift);
  text-decoration: none;
  font-variation-settings: 'wght' 480, 'wdth' 104;
}
nav a.navlink:hover {
  text-decoration: underline;
  text-decoration-color: var(--gorse);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
nav .btn-primary { padding: 0.55rem 1.1rem; }
@media (max-width: 720px) {
  nav a.navlink { display: none; }
  nav { gap: 1rem; }
  nav .wordmark { font-size: 0.78rem; letter-spacing: 0.14em; }
  nav .btn-primary { padding: 0.5rem 0.9rem; font-size: 0.95rem; }
}
.wordmark { white-space: nowrap; }

section { scroll-margin-top: 84px; }

/* The voyage: fixed canvas behind hero + crossing */
#sea, .sea-still {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100lvh;
  object-fit: cover;
  z-index: 0;
}
#sea { opacity: 0; transition: opacity 0.6s ease; }
#sea.live { opacity: 1; }

/* Hero */
.beat-hero {
  position: relative;
  height: 100lvh;
  z-index: 1;
}
.beat-hero .hero-scrim {
  position: absolute;
  inset: 0;
  right: auto;
  width: 100%;
  /* deep enough that spindrift passes AA over the bright gap light; edge-free by construction */
  background: linear-gradient(90deg, rgba(9, 18, 23, 0.9), rgba(9, 18, 23, 0.76) 52%, transparent 88%);
  pointer-events: none;
}
.beat-hero .hero-copy {
  position: absolute;
  top: 18vh;
  left: 6vw;
  max-width: 58rem;
}
.beat-hero h1 { max-width: 30ch; }
.beat-hero .sub {
  margin-top: 1.4rem;
  max-width: 44ch;
}
.beat-hero .btn-ghost { margin-top: 2rem; }

/* The crossing */
#crossing {
  position: relative;
  height: 255vh; /* trimmed from 300 on the second overlong flag; beats are fractions so the mapping scales */
  z-index: 1;
}
@media (max-width: 720px) {
  #crossing { height: 220vh; }
}
.crossing-stage {
  position: sticky;
  top: 0;
  height: 100lvh;
  overflow: clip;
}
.crossing-line {
  position: absolute;
  top: 26lvh;
  left: 6vw;
  max-width: 24ch;
  font-size: 1.6rem;
  line-height: 1.25;
  font-variation-settings: 'wght' 640, 'wdth' 116;
  color: var(--spindrift);
  opacity: 0;
}
/* the crossing carries the same left haar as the hero, so the copy lines pass AA */
.crossing-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  /* deepened one step (knob round 1): the living weather brightens the water
     behind the copy column beyond v1's worst case */
  background: linear-gradient(90deg, rgba(9, 18, 23, 0.92), rgba(9, 18, 23, 0.8) 38%, transparent 64%);
  pointer-events: none;
}
@media (max-width: 720px) {
  .crossing-line { max-width: 86vw; }
}
.shore-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  pointer-events: none;
}
.shore-layer svg { display: block; width: 100%; height: auto; }
/* the match-cut arrival: the crossing resolves INTO the landfall photograph */
.arrival {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 50%;
  opacity: 0;
  transform: scale(1.06);
  will-change: opacity, transform;
}
/* the bridge light: a 7px dot that hands over to the photo's own lit window
   (calibrated from the delivered A6 at 1280x900; desktop only) */
.crossing-stage { --winx: 60.8%; --winy: 27.2%; }
.window-light {
  position: absolute;
  left: var(--winx, 66%);
  top: var(--winy, 52%);
  width: 7px;
  height: 7px;
  background: radial-gradient(circle, #E8C24A 0%, rgba(232, 194, 74, 0) 70%);
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 720px) {
  .arrival { object-position: 60% 50%; }
  .window-light { display: none; }
}
.nogl-caption {
  position: absolute;
  bottom: 8lvh;
  left: 6vw;
}
.crossing-arrived { display: none; }

/* Reduced motion: no pin; the crossing rests as the arrived composition
   with all three lines visible, stacked (spec 5.9). */
@media (prefers-reduced-motion: reduce) {
  #crossing { height: auto; }
  .crossing-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.4rem;
    padding-left: 6vw;
  }
  .crossing-arrived {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
  }
  .crossing-line {
    position: static;
    opacity: 1;
    transform: none;
  }
  .shore-layer { transform: none; opacity: 1; }
}

/* Main sections scroll over the fixed sea */
main section {
  position: relative;
  background: var(--ink);
  z-index: 2;
  padding-block: clamp(96px, 14vh, 160px);
}
main { position: relative; z-index: 2; }
.gut { padding-inline: 6vw; }

.greybox {
  background: var(--ink-lift);
  width: 100%;
}

.photo {
  width: 100%;
  height: auto;
  object-fit: cover;
  background: var(--ink-lift);
}

/* #house: asymmetric split, image right 58%, text left 36% */
#house .split {
  display: grid;
  grid-template-columns: 36% 58%;
  justify-content: space-between;
  align-items: center;
}
#house .split .prose p { margin-top: 1.2rem; }
@media (max-width: 768px) {
  #house .split { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* #rooms: editorial grid */
#rooms .intro { margin-top: 1rem; }
#rooms .room-grid {
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem 5vw;
}
#rooms .room-wide {
  grid-column: 2 / 3;
}
#rooms .room-note {
  align-self: end;
  max-width: 34ch;
  padding-bottom: 3.2rem;
}
#rooms .room .card-title { margin-top: 1.1rem; }
#rooms .room p { margin-top: 0.6rem; }
@media (max-width: 768px) {
  #rooms .room-grid { grid-template-columns: 1fr; }
  #rooms .room-wide { grid-column: auto; }
}

/* #table: full bleed still, prose beneath */
#table .bleed { margin-inline: -6vw; }
#table h2 { margin-top: 3rem; }
#table p { margin-top: 1.2rem; max-width: 56ch; }

/* #island: triptych */
#island .intro { margin-top: 1rem; }
#island .trio {
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3vw;
}
#island .trio figcaption {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  letter-spacing: 0.11em;
}
@media (max-width: 768px) {
  #island .trio { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* #weather: pure type */
#weather .statement {
  margin-top: 2rem;
  font-size: 1.35rem;
  line-height: 1.6;
  max-width: 46ch;
}

/* #plan: the map, the facts */
#plan .map {
  margin-top: 3rem;
  max-width: 56rem;
}
#plan .map svg { display: block; width: 100%; height: auto; }
#plan .map path,
#plan .map rect {
  stroke: rgba(234, 241, 239, 0.75);
  stroke-width: 1.5;
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}
#plan .map .house-mark { fill: var(--gorse); stroke: none; }
#plan .map text {
  fill: var(--fog);
  font-size: 13px;
  letter-spacing: 0.13em;
  font-variation-settings: 'wght' 560, 'wdth' 110;
}
/* draw-on-scroll rest states (crossing.js scrubs them; reduced motion and
   the reduce fold rest fully drawn below) */
#plan .map .coast { stroke-dasharray: 1; stroke-dashoffset: 1; }
#plan .map .marks { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  #plan .map .coast, #plan .map .route-reveal { stroke-dashoffset: 0 !important; }
  #plan .map .marks { opacity: 1 !important; }
}
#plan .facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem 5vw;
  margin-top: 3.5rem;
}
#plan .fact-num {
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 1;
  font-variation-settings: 'wght' 780, 'wdth' 125;
  color: var(--spindrift);
}
#plan .fact dd {
  color: var(--fog);
  max-width: 24ch;
  margin-top: 0.4rem;
}
@media (max-width: 720px) {
  #plan .facts { grid-template-columns: 1fr; }
}

/* #stay: close */
#stay { padding-top: 0; }
/* the close-still is positioned, so the veil needs to paint above it */
#stay .veil { z-index: 1; }
#stay .close-still {
  position: relative;
  height: 44vh;
  overflow: clip;
}
#stay .close-still img,
#stay .close-still .greybox { width: 100%; height: 100%; object-fit: cover; }
#stay .close-still::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 26, 32, 0.2), var(--ink));
}
#stay h2 { margin-top: 4rem; }
#stay .ask { margin-top: 1.2rem; }
#stay .btn-primary { margin-top: 2rem; }
#stay .concept-note { margin-top: 1.4rem; }

footer {
  margin-top: clamp(96px, 14vh, 160px);
  padding-bottom: 4rem;
  display: grid;
  gap: 1.2rem;
}

/* Phone recomposition (R5): copy-fitted scrim bands that clear the lower
   half, so the signature sea shows on first paint. Last in the file so it
   wins the cascade. */
@media (max-width: 720px) {
  .beat-hero .hero-scrim {
    background: linear-gradient(180deg, rgba(9, 18, 23, 0.5) 0%, rgba(9, 18, 23, 0.82) 22%, rgba(9, 18, 23, 0.82) 56%, rgba(9, 18, 23, 0.12) 76%, transparent 90%);
  }
  .crossing-stage::before {
    background: linear-gradient(180deg, rgba(9, 18, 23, 0.5) 0%, rgba(9, 18, 23, 0.82) 18%, rgba(9, 18, 23, 0.82) 46%, rgba(9, 18, 23, 0.1) 68%, transparent 85%);
  }
  .beat-hero .hero-copy { top: 14vh; }
  nav .wordmark { letter-spacing: 0.08em; font-size: 0.72rem; }
  nav .btn-primary { padding: 0.45rem 0.8rem; }
}

/* Footer concept line, now a quiet link to its case study. */
.concept-link { color: inherit; text-decoration: none; }
.concept-link:hover { text-decoration: underline; }
