/* =========================================================
   TLEOTH — The Legendary Estates of the Hamptons
   Sizes are authored on a 1440px canvas and scale with --s.
   ========================================================= */
:root {
  --s: calc(100vw / 1440);
  --paper: #f1efe9;
  --paper-2: #e7e3da;
  --ink: #161412;
  --ink-2: #2b2723;
  --muted: #8b857c;
  --rule: rgba(22, 20, 18, .18);
  --ease: cubic-bezier(.43, .195, .02, 1);
  --serif: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --m: calc(20 * var(--s));
}
@media (max-width: 767px) {
  :root { --s: calc(100vw / 640); --m: 16px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-weight: 400;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.is-loading { overflow: hidden; height: 100vh; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ol, ul { list-style: none; margin: 0; padding: 0; }
h1, h2, p { margin: 0; font-weight: 400; }

/* ---------- Shared type ---------- */
.small, .hd, .hero__foot, .hero__hint, .legend__meta, .trad__labels, .card__row,
.label, .btn, .ft__row, .estates__head > span {
  font-size: max(11px, calc(13 * var(--s)));
  letter-spacing: 0; text-transform: uppercase; line-height: 1.02;
}
.big {
  font-size: calc(140 * var(--s)); line-height: .9; letter-spacing: -.02em;
  text-transform: uppercase; font-weight: 400; white-space: nowrap;
}
.mid {
  font-size: calc(54 * var(--s)); line-height: .98; letter-spacing: -.01em;
  text-transform: uppercase; font-weight: 400;
}
@media (max-width: 767px) {
  .big { font-size: calc(110 * var(--s)); }
  .mid { font-size: 30px; }
}

/* Line masks (built by main.js) */
.ln { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.ln > span { display: inline-block; transform: translateY(110%); transition: transform 1.4s var(--ease); }
.is-in .ln > span { transform: none; }
.ch { display: inline-block; transform: translateY(105%); transition: transform 1.3s var(--ease); }
.is-in .ch { transform: none; }

.btn {
  display: inline-block; margin-top: calc(34 * var(--s));
  padding: 1.1em 2.2em; border: 1px solid currentColor;
  position: relative; overflow: hidden; isolation: isolate;
  transition: color .6s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--ink); transform: translateY(101%); transition: transform .6s var(--ease);
}
.btn:hover { color: var(--paper); }
.btn:hover::before { transform: none; }
.btn--light::before { background: var(--paper); }
.btn--light:hover { color: var(--ink); }

/* =========================================================
   LOADER
   ========================================================= */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--ink); color: var(--paper);
  --hole: 0px;
}
.loader.is-opening {
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent var(--hole), #000 calc(var(--hole) + 1px));
          mask-image: radial-gradient(circle at 50% 50%, transparent var(--hole), #000 calc(var(--hole) + 1px));
}
.loader__name, .loader__pct {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: max(11px, calc(12 * var(--s))); letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
  animation: fadeUp 1.2s var(--ease) .2s both;
}
.loader__name { left: var(--m); }
.loader__pct { right: var(--m); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(40%); } }
.loader__mark {
  position: absolute; left: 50%; top: 50%;
  width: max(64px, calc(88 * var(--s))); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  animation: sq .9s var(--ease) both;
}
.loader__mark svg { width: 100%; height: 100%; display: block; }
@keyframes sq { from { transform: translate(-50%, -50%) scale(0); } }
.loader__arch, .loader__base { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 1.6s var(--ease) .4s forwards; }
.loader__base { animation-delay: .25s; }
.loader__key { opacity: 0; animation: keyIn .8s var(--ease) 1.4s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes keyIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* =========================================================
   HEADER
   ========================================================= */
.hd {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: calc(150 * var(--s)); padding: calc(14 * var(--s)) var(--m) 0;
  color: var(--paper); pointer-events: none;
  transition: color .9s var(--ease), opacity .6s var(--ease), visibility 0s;
}
.hd[data-theme="light"] { color: var(--ink); }
.hd.is-hidden { opacity: 0; visibility: hidden; transition: opacity .6s var(--ease), visibility 0s .6s; }
.hd a { pointer-events: auto; transition: opacity .4s var(--ease); }
.hd a:hover { opacity: .5; }
.hd > * { opacity: 0; transform: translateY(-10px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
body.is-ready .hd > * { opacity: 1; transform: none; }
body.is-ready .hd > *:nth-child(2) { transition-delay: .08s; }
body.is-ready .hd > *:nth-child(3) { transition-delay: .16s; }
body.is-ready .hd > *:nth-child(4) { transition-delay: .24s; }
body.is-ready .hd > *:nth-child(5) { transition-delay: .32s; }

.hd__logo { position: absolute; left: var(--m); top: calc(12 * var(--s)); display: flex; align-items: center; gap: .7em; }
.hd__logo svg { width: max(13px, calc(14 * var(--s))); height: auto; }
.hd__index { position: absolute; left: calc(210 * var(--s)); top: calc(14 * var(--s)); }
body.is-ready .hd.is-scrolled .hd__index { opacity: 0; transform: translateY(-10px); transition-delay: 0s; }
body.is-ready .hd.is-scrolled .hd__index a { pointer-events: none; }
.hd__index ol { display: grid; gap: calc(22 * var(--s)); }
.hd__index ol > li { display: grid; grid-template-columns: calc(38 * var(--s)) auto; }
.hd__index .n { opacity: 1; }
.hd__index ul { grid-column: 2; padding: .2em 0 0 1.9em; display: grid; gap: 0; }
.hd__index ul a { opacity: 1; }
.hd__index ul a:hover { opacity: 1; }
.hd__title {
  position: absolute; left: 50%; top: calc(8 * var(--s)); transform: translateX(-50%);
  font-size: calc(56 * var(--s)); text-transform: uppercase; letter-spacing: -.01em;
  white-space: nowrap; line-height: 1; overflow: hidden; height: 1.05em;
}
body.is-ready .hd__title { transform: translateX(-50%); }
.hd__title > span { display: block; transition: transform .7s var(--ease); }
.hd__right { position: absolute; right: calc(180 * var(--s)); top: calc(14 * var(--s)); display: flex; gap: 1.4em; }
.hd__cta { position: absolute; right: var(--m); top: calc(14 * var(--s)); }
@media (max-width: 767px) {
  .hd__index, .hd__right { display: none; }
  .hd__title { display: none; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero { position: relative; height: 100vh; min-height: 520px; overflow: hidden; background: #05070d; color: var(--paper); }
.hero__stage { position: absolute; inset: 0; will-change: transform; }
.hero__fallback, .hero__gl { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__gl { opacity: 0; transition: opacity 1s; cursor: crosshair; }
.hero__gl.is-ready { opacity: 1; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,.35), transparent 22%, transparent 70%, rgba(0,0,0,.45));
}
.hero__hint {
  position: absolute; left: 50%; bottom: calc(70 * var(--s)); transform: translateX(-50%);
  z-index: 2; opacity: .85; white-space: nowrap; transition: opacity 1s var(--ease);
}
.hero__hint.is-gone { opacity: 0; }
.hero__foot {
  position: absolute; left: var(--m); right: var(--m); bottom: calc(18 * var(--s)); z-index: 2;
  display: flex; justify-content: space-between;
}

/* =========================================================
   LEGEND — sticky stack
   ========================================================= */
.legend { position: relative; height: 420vh; background: var(--paper); }
.legend__sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.legend__word {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: .25em; font-size: calc(140 * var(--s)); line-height: .9; text-transform: uppercase;
  letter-spacing: -.02em; white-space: nowrap; font-weight: 400; pointer-events: none;
}
.legend__word .w { display: inline-block; will-change: transform; }
.legend__stack {
  position: absolute; left: 50%; top: 50%;
  width: calc(520 * var(--s)); aspect-ratio: 16 / 10;
  transform: translate(-50%, -50%); z-index: 2;
}
.legend__stack img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  clip-path: inset(100% 0 0 0); will-change: clip-path, transform;
}
.legend__meta { position: absolute; z-index: 3; }
.legend__meta--tl { left: var(--m); top: 50%; transform: translateY(calc(-50% - 170 * var(--s))); }
.legend__meta--tr { right: var(--m); top: 50%; transform: translateY(calc(-50% - 170 * var(--s))); text-align: right; }
.legend__meta--bl { left: var(--m); top: 50%; transform: translateY(calc(-50% + 170 * var(--s))); }
.legend__meta--br { right: var(--m); top: 50%; transform: translateY(calc(-50% + 170 * var(--s))); font-variant-numeric: tabular-nums; }
@media (max-width: 767px) {
  .legend__stack { width: 78vw; }
  .legend__word { font-size: 64px; flex-direction: column; gap: 0; }
}

/* =========================================================
   STATEMENT
   ========================================================= */
.statement { padding: calc(160 * var(--s)) var(--m) calc(220 * var(--s)); text-align: center; background: var(--paper); }
.statement__txt { font-size: calc(46 * var(--s)); line-height: 1.02; text-transform: uppercase; letter-spacing: -.005em; }
@media (max-width: 767px) { .statement__txt { font-size: 26px; } }

/* =========================================================
   TRADITIONS — line drawings
   ========================================================= */
.trad { position: relative; background: var(--paper); padding-bottom: calc(180 * var(--s)); }
.trad__sticky { position: sticky; top: 0; height: 100vh; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.trad__pin { height: 300vh; }
.trad__labels { display: flex; gap: calc(60 * var(--s)); padding: 0 var(--m); align-self: center; }
.trad__labels--r { justify-content: flex-end; }
.trad__lab, .trad__num { white-space: nowrap; }
.trad__lab { color: var(--muted); transition: color .6s var(--ease); }
.trad__lab.is-on, .trad__num { color: var(--ink); }
.trad__svg { width: calc(560 * var(--s)); height: auto; color: var(--ink-2); overflow: visible; }
.trad__svg .draw { opacity: 0; transition: opacity .6s var(--ease); }
.trad__svg .draw.is-on { opacity: 1; }
.trad__svg path { vector-effect: non-scaling-stroke; }
.trad .big { text-align: center; margin-top: calc(-40 * var(--s)); position: relative; }
.trad__note { text-align: center; margin-top: calc(50 * var(--s)); font-size: calc(26 * var(--s)); line-height: 1.15; text-transform: uppercase; color: var(--ink-2); }
@media (max-width: 767px) {
  .trad__sticky { grid-template-columns: 1fr; grid-template-rows: auto auto auto; align-content: center; gap: 20px; }
  .trad__labels, .trad__labels--r { justify-content: center; gap: 14px; flex-wrap: wrap; }
  .trad__num { display: none; }
  .trad__svg { width: 90vw; justify-self: center; }
  .trad__note { font-size: 17px; }
}

/* =========================================================
   ESTATES
   ========================================================= */
.estates { background: var(--ink); color: var(--paper); padding: calc(120 * var(--s)) var(--m) calc(140 * var(--s)); position: relative; }
.estates__head { display: flex; justify-content: space-between; align-items: flex-end; }
.estates__head > span { padding-bottom: .9em; }
.estates__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(80 * var(--s)) calc(10 * var(--s)); margin-top: calc(120 * var(--s)); }
.card { display: block; opacity: 0; transform: translateY(60px); transition: opacity 1.4s var(--ease), transform 1.4s var(--ease); }
.card.is-in { opacity: 1; transform: none; }
.card:nth-child(3n+2) { margin-top: calc(90 * var(--s)); transition-delay: .1s; }
.card:nth-child(3n) { margin-top: calc(180 * var(--s)); transition-delay: .2s; }
.card__img { aspect-ratio: 4 / 5; overflow: hidden; background: #222; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: transform 1.6s var(--ease), filter 1.2s var(--ease); filter: grayscale(.25); }
.card:hover .card__img img { transform: scale(1.03); filter: none; }
.card__row { display: grid; grid-template-columns: 1fr 2fr 1fr; margin-top: 1em; }
.card__row span:last-child { text-align: right; opacity: .55; }
@media (max-width: 767px) {
  .estates__grid { grid-template-columns: 1fr; }
  .card:nth-child(n) { margin-top: 0; }
  .estates__head { flex-wrap: wrap; }
  .estates__head .big { font-size: 56px; order: -1; width: 100%; margin-bottom: 14px; }
}

/* =========================================================
   BOOK
   ========================================================= */
.book { background: var(--paper-2); padding: calc(160 * var(--s)) var(--m); overflow: hidden; }
.book__wrap { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: calc(80 * var(--s)); }
.book__obj {
  position: relative; justify-self: center;
  width: calc(400 * var(--s)); aspect-ratio: 3 / 4;
  transform-style: preserve-3d; transform: perspective(1600px) rotateY(-28deg) rotateX(4deg);
  will-change: transform;
}
.book__cover {
  position: absolute; inset: 0; background: var(--ink); color: var(--paper); overflow: hidden;
  box-shadow: 30px 40px 80px rgba(0,0,0,.28); backface-visibility: hidden;
}
.book__cover img { position: absolute; left: 10%; right: 10%; top: 26%; width: 80%; height: 40%; object-fit: cover; }
.book__type {
  position: absolute; inset: 7% 10% auto; display: grid; gap: .1em; text-align: center;
  font-size: calc(22 * var(--s)); text-transform: uppercase; line-height: 1.05;
}
.book__type em { font-style: italic; text-transform: none; font-size: .8em; margin-top: .4em; opacity: .7; }
.book__cover::after {
  content: "TLEOTH"; position: absolute; left: 0; right: 0; bottom: 6%; text-align: center;
  font-size: calc(14 * var(--s)); letter-spacing: .4em;
}
.book__spine {
  position: absolute; top: 0; bottom: 0; left: 0; width: calc(44 * var(--s));
  background: #0d0c0b; color: var(--paper);
  transform-origin: left center; transform: rotateY(-90deg);
  writing-mode: vertical-rl; display: grid; place-items: center;
  font-size: calc(11 * var(--s)); letter-spacing: .3em; text-transform: uppercase;
}
.book__txt p { max-width: 30em; margin-top: calc(28 * var(--s)); font-size: calc(20 * var(--s)); line-height: 1.35; color: var(--ink-2); }
.label { display: block; margin-bottom: calc(26 * var(--s)); opacity: .7; }
@media (max-width: 767px) {
  .book__wrap { grid-template-columns: 1fr; }
  .book__obj { width: 62vw; }
  .book__txt p { font-size: 17px; }
}

/* =========================================================
   ENQUIRE + FOOTER
   ========================================================= */
.enquire { background: var(--ink); color: var(--paper); text-align: center; padding: calc(200 * var(--s)) var(--m) calc(160 * var(--s)); }
.enquire p { max-width: 32em; margin: calc(28 * var(--s)) auto 0; font-size: calc(20 * var(--s)); line-height: 1.35; opacity: .75; }
@media (max-width: 767px) { .enquire p { font-size: 17px; } }

.ft { background: var(--ink); color: var(--paper); padding: 0 var(--m) calc(10 * var(--s)); overflow: hidden; }
.ft__row { display: flex; justify-content: space-between; gap: 1em; padding: calc(16 * var(--s)) 0; border-top: 1px solid rgba(241,239,233,.18); flex-wrap: wrap; }
.ft__word {
  font-size: calc(352 * var(--s)); line-height: .78; letter-spacing: -.03em;
  display: flex; justify-content: space-between; margin-top: calc(30 * var(--s));
}
.ft__word > span { display: inline-block; transform: translateY(100%); will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .ln > span, .ch, .card { transform: none !important; opacity: 1 !important; transition: none !important; }
}

/* =========================================================
   HEADER + HERO — positions and sizes matched to the
   ottoobjects.com layout (1440 grid)
   ========================================================= */
.hd { height: calc(140 * var(--s)); padding: 0; font-size: max(10px, calc(12 * var(--s))); letter-spacing: 0; line-height: .98; }
.hd a, .hd span, .hd li { text-transform: uppercase; white-space: nowrap; }
.hd__logo { left: calc(20 * var(--s)); top: calc(11 * var(--s)); display: block; }
.hd__logo svg { width: calc(12 * var(--s)); height: calc(12 * var(--s)); min-width: 10px; min-height: 10px; display: block; }
.hd__logo span { position: absolute; left: calc(20 * var(--s)); top: calc(2 * var(--s)); }
.hd__index { left: 0; top: 0; }
.hd__index ol { display: block; }
.hd__index ol > li { position: absolute; top: calc(13 * var(--s)); left: 0; display: block; }
.hd__index ol > li:nth-child(2) { top: calc(60 * var(--s)); }
.hd__index ol > li:nth-child(3) { top: calc(107 * var(--s)); }
.hd__index .n { position: absolute; left: calc(210 * var(--s)); top: 0; opacity: 1; }
.hd__index ol > li > a { position: absolute; left: calc(232 * var(--s)); top: 0; }
.hd__index ul { position: absolute; left: calc(248 * var(--s)); top: calc(9 * var(--s)); padding: 0; display: block; }
.hd__index ul li { display: block; line-height: 1; }
.hd__index ul a { opacity: 1; }
.hd__title { top: calc(9 * var(--s)); font-size: calc(50 * var(--s)); letter-spacing: -.01em; line-height: .98; height: 1.04em; }
.hd__right { left: calc(1010 * var(--s)); right: auto; top: calc(13 * var(--s)); gap: calc(12 * var(--s)); }
.hd__cta { right: calc(20 * var(--s)); top: calc(13 * var(--s)); }
/* the hero carries only the picture, like the reference */
.hero__foot, .hero__hint { display: none; }
.hero::after { background: none; }
@media (max-width: 767px) {
  .hd { font-size: 11px; }
  .hd__logo { left: 16px; top: 14px; }
  .hd__logo span { left: 20px; top: 1px; }
  .hd__cta { right: 16px; top: 16px; }
}

/* Header measurements taken from the reference page source (1440 grid) */
.hd__logo { left: calc(20 * var(--s)); top: calc(15 * var(--s)); }
.hd__logo svg { width: calc(18 * var(--s)); height: calc(18 * var(--s)); }
.hd__logo span { left: calc(24 * var(--s)); top: calc(3 * var(--s)); }
.hd__index ol > li { top: calc(18 * var(--s)); }
.hd__index ol > li:nth-child(2) { top: calc(85 * var(--s)); }
.hd__index ol > li:nth-child(3) { top: calc(152 * var(--s)); }
.hd__index ul { top: calc(13 * var(--s)); }
.hd__index ul li { line-height: 1.12; }
.hd__title { top: calc(12 * var(--s)); }
.hd__right { left: 0; right: auto; top: calc(18 * var(--s)); display: block; }
.hd__right a { position: absolute; left: calc(1082 * var(--s)); top: 0; }
.hd__right a + a { left: calc(1135 * var(--s)); }
.hd__cta { right: calc(20 * var(--s)); top: calc(18 * var(--s)); }
.hd { height: calc(200 * var(--s)); }
.hero__stage { left: -2.085vw; right: -2.085vw; }

/* ---------- Phones ---------- */
@media (max-width: 767px) {
  .hd { height: 56px; }
  .hd__logo { top: 16px; }
  .hd__logo svg { width: 16px; height: 16px; }
  .hd__logo span { left: 22px; top: 3px; }
  .hd__cta { top: 18px; }
  .statement { padding: 110px 16px 140px; }
  .statement__txt { font-size: 18px; line-height: 1.12; }
  .legend__meta { font-size: 10px; }
  .legend__meta--tl, .legend__meta--tr { transform: translateY(calc(-50% - 31vw)); }
  .legend__meta--bl, .legend__meta--br { transform: translateY(calc(-50% + 31vw)); }
  .trad .big { font-size: 40px; margin-top: 0; }
  .estates { padding: 80px 16px 90px; }
  .estates__grid { margin-top: 50px; gap: 46px; }
  .card__row { grid-template-columns: auto 1fr auto; gap: 12px; }
  .book { padding: 80px 16px; }
  .book__wrap { gap: 60px; }
  .enquire { padding: 110px 16px 100px; }
  .enquire .mid { font-size: 24px; }
  .ft__row { flex-direction: column; gap: 6px; padding: 14px 0; }
  .ft__word { font-size: calc((100vw - 32px) / 4.1); margin-top: 24px; }
}

/* The hero message: shown again, centred low on the picture */
.hero__hint { display: block; bottom: calc(40 * var(--s)); padding: .7em 1.2em; color: #fff;
  background: rgba(20, 18, 16, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .45s var(--ease); pointer-events: none; z-index: 3; }
@media (max-width: 767px) { .hero__hint { bottom: 28px; font-size: 11px; } }

/* Title: "The Legendary Estates / of the Hamptons" on two centred lines */
.hd__title { white-space: pre-line; text-align: center; height: 2.08em; line-height: .98; }
.hd__title > span { white-space: pre-line; }

/* Phones: the picture is for playing - swiping it restores the house instead of scrolling.
   It stops short of full height so the next section shows and the page can be scrolled from there.
   svh keeps it steady while Safari's address bar slides in and out. */
@media (max-width: 767px) {
  .hero { height: 84vh; height: 84svh; min-height: 0; }
  .hero__gl { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
  .hero__hint { bottom: 22px; white-space: nowrap; }
}
@media (pointer: coarse) { .hero { -webkit-touch-callout: none; } }

/* =========================================================
   THE HOUSE — 3D model
   ========================================================= */
.house3d { background: var(--paper); padding: calc(140 * var(--s)) var(--m) calc(150 * var(--s)); }
.house3d__head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.house3d__head .label { margin-bottom: calc(18 * var(--s)); }
.house3d__frame {
  position: relative; margin-top: calc(70 * var(--s));
  aspect-ratio: 16 / 8.2; background: #ebe7df; overflow: hidden; border: 1px solid var(--rule);
  opacity: .0; transform: translateY(40px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
}
.house3d__frame.is-ready { opacity: 1; transform: none; }
.house3d__frame canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }
.house3d__frame canvas:active { cursor: grabbing; }
.house3d__wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted);
  font-size: max(11px, calc(12 * var(--s))); text-transform: uppercase; }
.house3d__frame.is-ready .house3d__wait { display: none; }
.house3d.is-failed .house3d__frame { opacity: 1; transform: none; }
.house3d.is-failed .house3d__wait::after { content: " — 3D view unavailable on this device"; }
.house3d__bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: calc(18 * var(--s));
  font-size: max(11px, calc(12 * var(--s))); text-transform: uppercase; }
.house3d__hint { opacity: .6; }
.house3d__modes { display: flex; gap: 8px; }
.house3d__modes button { font: inherit; text-transform: uppercase; color: var(--ink); background: transparent;
  border: 1px solid var(--rule); padding: .7em 1.1em; cursor: pointer; transition: background .4s var(--ease), color .4s var(--ease); }
.house3d__modes button:hover { border-color: var(--ink); }
.house3d__modes button.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (max-width: 767px) {
  .house3d { padding: 80px 16px 90px; }
  .house3d .big { font-size: 44px; }
  .house3d__frame { margin-top: 34px; aspect-ratio: 4 / 5; }
  .house3d__bar { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .house3d__modes { justify-content: center; }
  .house3d__modes button { flex: 1; padding: .9em .4em; }
}

/* Touch screens (iPad, iPhone): the picture fills the screen exactly and stays still */
@media (pointer: coarse) {
  .hero__stage { left: 0; right: 0; transform: none !important; }
}
@media (pointer: coarse) and (min-width: 768px) {
  .hero { height: 100vh; height: 100svh; }
}

/* Safety net: the restored house sits behind the animation, so no gap can ever show black */
.hero { background: #05070d url("img/house-new.jpg?v=1") 50% 70% / cover no-repeat; }
.hero__gl { left: 0; top: 0; right: auto; bottom: auto; }

/* =========================================================
   Phones: full-screen first picture, and the desktop header
   (logo, centred two-line title, index menu, links) scaled down
   ========================================================= */
@media (max-width: 767px) {
  .hero { height: 100vh; height: 100svh; }
  /* up-and-down swipes scroll the page; sideways swipes paint the water */
  .hero__gl { touch-action: pan-y; }

  .hd { height: auto; font-size: 10.5px; }
  .hd__logo { left: 16px; top: 16px; }
  .hd__cta { right: 16px; top: 18px; }

  .hd__title {
    display: block; left: 50%; top: 46px; transform: translateX(-50%);
    font-size: 25px; line-height: 1; height: auto; white-space: pre-line; text-align: center;
  }
  body.is-ready .hd__title { transform: translateX(-50%); }

  .hd__index { display: block; left: 0; top: 0; }
  .hd__index ol > li { top: 118px; }
  .hd__index ol > li:nth-child(2) { top: 168px; }
  .hd__index ol > li:nth-child(3) { top: 232px; }
  .hd__index .n { left: 16px; }
  .hd__index ol > li > a { left: 36px; }
  .hd__index ul { left: 48px; top: 13px; }
  .hd__index ul li { line-height: 1.2; }

  .hd__right { display: block; left: auto; right: 0; top: 118px; }
  .hd__right a { left: auto; right: 16px; }
  .hd__right a + a { left: auto; right: 16px; top: 16px; }
}
@media (max-width: 767px) {
  /* keep the title to its two lines, as on desktop */
  .hd__title, .hd__title > span { white-space: pre; width: max-content; max-width: calc(100vw - 32px); }
}
@media (max-width: 380px) { .hd__title { font-size: 22px; } }

/* Phones: fill the whole screen even when Safari hides its toolbars (lvh = largest viewport),
   and keep the message above Safari's bottom bar when it is showing */
@media (max-width: 767px) {
  .hero { height: 100vh; height: 100lvh; }
  .hero__hint { bottom: 22px; bottom: calc(100lvh - 100svh + 22px); }
}

/* iPad: the picture is for drawing - one finger paints instead of scrolling (two fingers scroll, see main.js) */
@media (pointer: coarse) and (min-width: 768px) {
  .hero__gl { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
}

/* The hero button: "Click to turn back time" / "Click to restore it" - works on every device */
.hero__hint {
  display: block; pointer-events: auto; cursor: pointer; z-index: 5;
  font: inherit; font-size: max(11px, calc(12 * var(--s))); letter-spacing: 0; text-transform: uppercase;
  color: #fff; background: rgba(20, 18, 16, .38); border: 1px solid rgba(255, 255, 255, .55);
  padding: .9em 1.5em; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .45s var(--ease), background .3s var(--ease), color .3s var(--ease);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.hero__hint:hover, .hero__hint:focus-visible { background: #fff; color: #161412; outline: none; }
.hero__hint:active { transform: translateX(-50%) scale(.97); }
@media (max-width: 767px) { .hero__hint { font-size: 12px; padding: 1em 1.6em; } }

/* Scroll-down button: phones and iPad only (one finger draws on the picture there) */
.hero__down { display: none; }
@media (pointer: coarse) {
  .hero__down {
    display: block; position: absolute; z-index: 5; left: 16px; bottom: calc(40 * var(--s));
    font: inherit; font-size: 12px; text-transform: uppercase; letter-spacing: 0;
    color: #fff; background: rgba(20, 18, 16, .38); border: 1px solid rgba(255, 255, 255, .55);
    padding: 1em 1.4em; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  }
  .hero__down:active { background: #fff; color: #161412; }
}
@media (pointer: coarse) and (max-width: 767px) {
  /* side by side on phones: scroll on the left, turn back time on the right */
  .hero__down { bottom: 22px; bottom: calc(100lvh - 100svh + 22px); }
  .hero__hint { left: auto; right: 16px; transform: none; }
  .hero__hint:active { transform: scale(.97); }
}

/* iPhone/iPad: the picture runs up under the status bar (viewport-fit=cover), so the sky reaches the top edge.
   The header moves down by the safe area so the logo, title and menu clear the clock and notch. */
.hd { top: env(safe-area-inset-top, 0px); }
@media (max-width: 767px) {
  .hero__hint, .hero__down { margin-bottom: env(safe-area-inset-bottom, 0px); }
}

/* iOS 26 Safari tints the status-bar strip with the page background (theme-color is ignored there) */
html.at-top, html.at-top body { background-color: #2a66a7; }
@media (max-width: 767px) { html.at-top, html.at-top body { background-color: #3e70ad; } }

/* Phones: the top of the photo melts into the status-bar colour, so the sky looks continuous behind the clock */
@media (max-width: 767px) {
  .hero::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 90px; z-index: 1; pointer-events: none;
    background: linear-gradient(#3e70ad 0%, rgba(62, 112, 173, .55) 35%, rgba(62, 112, 173, 0) 100%);
  }
  html.is-old .hero::before { background: linear-gradient(#5d82b6 0%, rgba(93, 130, 182, .55) 35%, rgba(93, 130, 182, 0) 100%); }
  html.at-top.is-old, html.at-top.is-old body { background-color: #5d82b6; }
}

/* =========================================================
   TIME MACHINE — a thin line with a glowing sphere (after Osmos's time control)
   ========================================================= */
.hero__hint[hidden] { display: none !important; }
.tm {
  position: absolute; left: 50%; bottom: calc(44 * var(--s)); transform: translateX(-50%); z-index: 5;
  color: #fff; text-align: center; -webkit-user-select: none; user-select: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}
.tm__name { display: block; margin-bottom: 14px; font-size: max(10px, calc(11 * var(--s))); letter-spacing: .28em; text-transform: uppercase; opacity: .9; }
.tm__row { display: flex; align-items: center; gap: 18px; font-size: max(11px, calc(12 * var(--s))); text-transform: uppercase; }
.tm__end { opacity: .85; min-width: 3em; }
.tm__row .tm__end:first-child { text-align: right; }
.tm__row .tm__end:last-child { text-align: left; }
.tm__track { position: relative; width: calc(380 * var(--s)); min-width: 220px; height: 34px; cursor: pointer; touch-action: none; outline: none; -webkit-tap-highlight-color: transparent; }
.tm__line, .tm__fill { position: absolute; left: 0; top: 50%; height: 1px; margin-top: -.5px; }
.tm__line { right: 0; background: rgba(255, 255, 255, .5); box-shadow: 0 0 6px rgba(0, 0, 0, .35); }
.tm__fill { width: 0; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .7); }
.tm__knob {
  position: absolute; top: 50%; left: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #ffffff 0%, #eef4fb 38%, #aac3e0 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .7), 0 0 14px 4px rgba(255, 255, 255, .45), 0 0 36px 10px rgba(150, 195, 255, .28);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  animation: tm-breathe 3.2s ease-in-out infinite;
}
@keyframes tm-breathe { 50% { box-shadow: 0 0 0 1px rgba(255,255,255,.8), 0 0 18px 6px rgba(255,255,255,.55), 0 0 44px 14px rgba(150,195,255,.34); } }
.tm.is-drag .tm__knob, .tm__track:hover .tm__knob, .tm__track:focus-visible .tm__knob { transform: scale(1.25); }
@media (max-width: 767px) {
  .tm { bottom: 80px; bottom: calc(100lvh - 100svh + 80px); width: calc(100vw - 32px); }
  .tm__row { gap: 12px; justify-content: center; }
  .tm__track { width: 58vw; min-width: 0; height: 40px; }
  .tm__knob { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
}

/* Time Machine sphere: a living Osmos-like mote drawn on a canvas */
.tm__knob {
  width: 26px; height: 26px; margin: -13px 0 0 -13px;
  background: none; box-shadow: none; animation: none;
}
.tm__mote { position: absolute; left: 50%; top: 50%; width: 190%; height: 190%; transform: translate(-50%, -50%); pointer-events: none; }
.tm__fill { background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .85); }
@media (max-width: 767px) {
  .tm__knob { width: 32px; height: 32px; margin: -16px 0 0 -16px; }
}

/* Time Machine sphere grows to double size when touched, dragged or hovered, with a soft springy pop */
.tm__knob { transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); will-change: transform; }
.tm.is-drag .tm__knob, .tm__track:focus-visible .tm__knob { transform: scale(2); }
.tm__track:hover .tm__knob { transform: none; }
@media (hover: hover) { .tm__track:hover .tm__knob, .tm.is-drag .tm__knob { transform: scale(2); } }

/* Time Machine: a small mote marks the "under construction" stop, a third of the way along */
.tm__stop {
  position: absolute; left: 33.333%; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fff 0 14%, rgba(255,255,255,.35) 22%, rgba(70,82,100,.55) 48%, rgba(170,182,198,.6) 78%, #fff 92%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.75), 0 0 8px 2px rgba(255,255,255,.55), 0 0 18px 5px rgba(255,255,255,.22);
  animation: tm-stop 2.6s ease-in-out infinite; pointer-events: none;
}
@keyframes tm-stop { 50% { transform: scale(1.18); box-shadow: 0 0 0 1px rgba(255,255,255,.9), 0 0 11px 3px rgba(255,255,255,.7), 0 0 24px 7px rgba(255,255,255,.3); } }
@media (max-width: 767px) { .tm__stop { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; } }

/* Time Machine markers are living motes too: fiery at the construction stop, black at the "then" end */
.tm__stop, .tm__then {
  position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: none; box-shadow: none; animation: none; pointer-events: none;
}
.tm__stop { left: 33.333%; }
.tm__then { left: 100%; }
@media (max-width: 767px) { .tm__stop, .tm__then { width: 18px; height: 18px; margin: -9px 0 0 -9px; } }

/* the "then" mote is the largest marker */
.tm__then { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
@media (max-width: 767px) { .tm__then { width: 24px; height: 24px; margin: -12px 0 0 -12px; } }

/* The TLEOTH mark: the U (arch) with the black mote living inside it - in the loader and the header */
.loader__mark .logo-mote, .hd__mark .logo-mote {
  position: absolute; left: 50%; top: 61%; width: 25%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none;
}
.loader__mark .logo-mote { animation: logoMote 1s var(--ease) 1.1s both; }
@keyframes logoMote { from { opacity: 0; transform: translate(-50%, -50%) scale(0); } }
.hd__mark { position: relative; display: block; line-height: 0; }
.hd__mark .tm__mote { overflow: visible; }

/* Loader: only the black sphere, turning in the middle of the dark screen */
.loader__mark { animation: none; }
.loader__mark .logo-mote { top: 50%; width: 70%; animation: logoMote 1s var(--ease) .2s both; }

/* Header logo: only the black sphere (the U square stays invisible to keep the size and the link area) */
.hd__mark svg { visibility: hidden; }
.hd__mark .logo-mote { top: 50%; width: 120%; }

/* Loading screen: a Time Machine line; the black sphere travels along it as the site loads, the percentage below */
.loader__mark.loader__tm {
  width: calc(380 * var(--s)); min-width: 220px; height: 34px; aspect-ratio: auto;
  animation: tmIn 1s var(--ease) .1s both;
}
@keyframes tmIn { from { opacity: 0; transform: translate(-50%, -50%) scaleX(.2); } }
.loader__tm .tm__line { background: rgba(241, 239, 233, .35); box-shadow: none; }
.loader__tm .tm__fill { background: #f1efe9; box-shadow: 0 0 8px rgba(255, 255, 255, .5); }
.loader__knob { position: absolute; top: 50%; left: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; }
.loader__pct { left: 50%; right: auto; top: calc(50% + 34px); transform: translateX(-50%); }
@media (max-width: 767px) {
  .loader__mark.loader__tm { width: 62vw; }
  .loader__knob { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
}

/* Loading line: shorter, a white sphere waits at the end, white percentage */
.loader__mark.loader__tm { width: calc(220 * var(--s)); min-width: 150px; }
.loader__end { position: absolute; top: 50%; left: 100%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; }
.loader__pct, .loader__pct span { color: #fff; }
@media (max-width: 767px) {
  .loader__mark.loader__tm { width: 42vw; }
  .loader__end { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
}
/* Header logo: the black sphere, bigger; the name beside it in white */
.hd__logo, .hd__logo span { color: #fff; }
.hd__logo .hd__mark svg { width: calc(30 * var(--s)); height: calc(30 * var(--s)); min-width: 24px; min-height: 24px; }
.hd__logo span { left: calc(max(24px, calc(30 * var(--s))) + 14px); top: calc(max(24px, calc(30 * var(--s))) / 2 - .62em); }
@media (max-width: 767px) {
  .hd__logo .hd__mark svg { width: 28px; height: 28px; }
  .hd__logo span { left: 36px; top: 8px; }
}

/* Header: no sphere logo, just the name */
.hd__logo span { position: static; left: auto; top: auto; display: block; }
@media (max-width: 767px) { .hd__logo span { position: static; } }

/* Loading screen: the name TLEOTH large above the loading line, the percentage below */
.loader__name {
  left: 50%; right: auto; top: auto; bottom: calc(50% + 34px);
  transform: translateX(-50%); white-space: nowrap;
  font-family: var(--serif); font-size: clamp(44px, 8vw, 128px); line-height: 1; letter-spacing: .08em;
  color: #f1efe9; animation: loaderIn 1.2s var(--ease) .1s both;
}
.loader__pct { animation: loaderIn 1.2s var(--ease) .3s both; }
@keyframes loaderIn { from { opacity: 0; transform: translate(-50%, 30%); } }
@media (max-width: 767px) { .loader__name { font-size: 15vw; bottom: calc(50% + 28px); } }

/* Timelines (the Time Machine and the loading line) are set in Helvetica */
.tm, .tm__name, .tm__end, .loader__pct, .loader__pct span {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 400;
}

/* Time Machine runs from Then (left) to Now (right): the black "then" sphere sits at the start, the stop two thirds along */
.tm__stop { left: 66.667%; }
.tm__then { left: 0; }

/* "Time Portal Open" - the caption of the water effect; it fades in while the water opens onto the old house */
.portal {
  position: absolute; left: 50%; bottom: calc(44 * var(--s) + 92px); z-index: 5; margin: 0;
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none; white-space: nowrap;
  display: flex; align-items: center; gap: .8em;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: max(10px, calc(11 * var(--s)));
  letter-spacing: .32em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.portal i { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px rgba(255, 255, 255, .8); animation: portalPulse 1.6s ease-in-out infinite; }
@keyframes portalPulse { 50% { opacity: .35; transform: scale(.7); } }
.portal.is-open { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 767px) { .portal { bottom: calc(100lvh - 100svh + 168px); } }

/* E.01: the front of 710 North Beverly Drive as a looping film, styled like the photo cards */
.card__img video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: transform 1.6s var(--ease), filter 1.2s var(--ease); filter: grayscale(.25); }
.card:hover .card__img video { transform: scale(1.03); filter: none; }

/* "Time Portal Open" follows the opening: small, thin, black letters just under it */
.portal {
  left: 0; top: 0; bottom: auto; transform: translate(-50%, 6px);
  font-size: 9px; font-weight: 300; letter-spacing: .3em; color: #111;
  text-shadow: 0 0 6px rgba(255, 255, 255, .75), 0 0 2px rgba(255, 255, 255, .6);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.portal i { width: 4px; height: 4px; background: #111; box-shadow: 0 0 5px 1px rgba(255, 255, 255, .7); }
.portal.is-open { transform: translate(-50%, 0); }
@media (max-width: 767px) { .portal { bottom: auto; font-size: 8px; } }

/* the "Time Machine" title at half its earlier size, on desktop (phones keep the earlier size) */
@media (min-width: 768px) { .tm__name { font-size: max(5px, calc(5.5 * var(--s))); margin-bottom: 8px; } }

/* once settled above the Time Machine, "Time Portal Open" stays put */
.portal.is-docked { transition: opacity .9s var(--ease); }

/* "Time Portal Open": white and easier to read */
.portal { color: #fff; font-weight: 400; font-size: 10px; text-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 0 10px rgba(0, 0, 0, .45); }
.portal i { background: #fff; box-shadow: 0 0 6px 1px rgba(255, 255, 255, .8); }
@media (max-width: 767px) { .portal { font-size: 9px; } }
