/* Highland Real Estate Partners — styles
   Part 1 is the foundation from the /built-landingpage skill: reset, accessibility and the
   motion rules (trimmed to what this page uses). Part 2 is this site's look, built from the
   Figma design HRE001 Holding Page V1: tokens, type, the three screens and the menu.
   One file on purpose: one render-blocking request. */

/* ═════════════════════════ 1. FOUNDATION ═════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
img, svg, picture { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
h1, h2, p, figure, ul, address { margin: 0; }
body.is-locked { overflow: hidden; }

/* ── accessibility ── */
.vh {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--focus, #000); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }

@keyframes rise-in { from { opacity: 0; transform: translate3d(0, 18px, 0); } }
@keyframes fade-in { from { opacity: 0; } }

/* ── reduced motion: everything still, nothing waiting ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

@media print {
  .dot, .menu, .show__toggle { display: none !important; }
  .view { display: block !important; min-height: 0 !important; height: auto !important; break-after: page; }
  .show { position: relative !important; inset: auto !important; height: 60vh; }
}

/* ═════════════════════════ 2. THIS SITE ═════════════════════════
   Figma frames are 1920 × 1080. Every distance below is the Figma pixel value times --k
   (the logo's width over its 536 px design width), so the screens keep their proportions
   from a laptop to a 4K monitor; gutter, text and controls have their own floors for phones. */

@font-face {
  font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("../fonts/cormorant-garamond-300.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/inter-700.woff2") format("woff2");
}

:root {
  --blue: #879ed1;          /* the full stop, tagline, rules and menu (Figma "Ellipse 1") */
  --ink: #000;              /* copy and menu words */
  --paper: #fff;
  --focus: #000;
  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --logo-w: clamp(176px, 27.92vw, 960px);      /* 536 at 1920 */
  --k: calc(var(--logo-w) / 536);               /* one Figma pixel */
  --g: clamp(16px, 2.604vw, 90px);              /* 50 at 1920: margins */
  --dot: clamp(24px, 1.72vw, 60px);             /* 33 at 1920 */
  --text: clamp(16px, 1.146vw, 40px);           /* 22 at 1920 (Inter) */
  --menu-text: clamp(58px, 5.73vw, 200px);      /* 110 at 1920 (Cormorant Garamond Light) */
  --rule: max(1px, .104vw);                     /* 2 at 1920 */
  --band-top: calc(var(--g) + var(--k) * 109);  /* home photos start on the logo's baseline */

  --ease: cubic-bezier(.22, .61, .36, 1);       /* ease-out, as the Figma prototype */
  --swap: .3s;                                  /* screen and menu slides (Figma: 300 ms) */
  --fade: .6s;                                  /* crossfade between home photos */
}
/* portrait phones and tablets: a larger lockup, so "Real Estate Partners" stays legible */
@media (orientation: portrait) { :root { --logo-w: clamp(200px, 40vw, 600px); } }

body { background: var(--paper); color: var(--ink); font: 400 var(--text) / 1.24 var(--sans); }

/* ── screens ──
   Without JavaScript the three screens simply stack and scroll. main.js adds .js to <html>
   and shows one screen at a time; the home screen fills the first view either way, so
   nothing jumps while the script loads. */
.view { position: relative; display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; background: var(--paper); }
.js .view:not(.is-on) { display: none; }
.js .view.is-entering { z-index: 60; animation: view-in var(--swap-now, var(--swap)) var(--ease) both; }
.js .view.is-leaving { display: flex; position: fixed; inset: 0 0 auto; z-index: 1; }
@keyframes view-in { from { transform: translate3d(0, -100%, 0); } }   /* Figma: slide in from top */

/* ── logo + menu dot ── */
.bar {
  position: relative; z-index: 3; display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--g); padding: var(--g) var(--g) 0;
}
.logo { display: block; flex: none; width: var(--logo-w); }
.logo a, a.logo { display: block; text-decoration: none; }
.logo img { width: 100%; height: auto; }
.dot {
  position: relative; display: none; flex: none; width: var(--dot); height: var(--dot);
  border-radius: 50%; background: var(--blue);
  transition: transform .45s var(--ease), background-color .3s var(--ease);
}
.js .dot { display: block; }
.dot::before { content: ""; position: absolute; inset: -11px; border-radius: 50%; }   /* 44 px target */
@media (hover: hover) { .dot:hover { transform: scale(1.18); } }
.dot--close { background: var(--paper); }

/* ── home: the photo band ── */
.view--home { height: 100vh; height: 100svh; min-height: 400px; }
.show { position: absolute; inset: var(--band-top) 0 0; overflow: hidden; background: #d4d4d4; }
.slide { position: absolute; inset: 0; display: none; }
.slide.is-on, .slide.is-was, .slide.is-next { display: block; }
.slide.is-next { opacity: 0; }
.slide.is-on { z-index: 2; }
.slide.is-was { z-index: 1; }
.slide.is-in { animation: fade-in var(--fade) ease-out both; }
.slide picture { width: 100%; height: 100%; overflow: hidden; }
.slide img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
/* framing from the Figma crops (landscape); portrait screens use the 3:5 crops, centred */
.slide--s2 { --pos: 50% 96%; }
.slide--s4 { --pos: 50% 100%; }
@media (orientation: portrait) { .slide--s2, .slide--s4 { --pos: 50% 50%; } }
/* frame 3: three photos side by side, stacked as rows on portrait screens */
.slide--tri.is-on, .slide--tri.is-was, .slide--tri.is-next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (orientation: portrait) {
  .slide--tri.is-on, .slide--tri.is-was, .slide--tri.is-next { grid-template-columns: 1fr; grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .tri__a { --pos: 50% 48%; }
  .tri__b { --pos: 50% 30%; }
  .tri__c { --pos: 50% 15%; }
}
@media (prefers-reduced-motion: no-preference) {
  /* each photo settles while it is on screen: transform only, so slide 1 still counts as the LCP */
  .slide.is-on img { animation: settle 5.5s var(--ease) both; }
}
@keyframes settle { from { transform: scale(1.045); } }

/* pause / play: the only control the design didn't draw (WCAG 2.2.2, moving content) */
.show__toggle {
  position: absolute; right: var(--g); bottom: var(--g); z-index: 4; display: none; place-items: center;
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .86);
  opacity: .8; transition: opacity .3s var(--ease), transform .45s var(--ease);
}
.show__toggle::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; }   /* 44 px target */
.js .show__toggle { display: grid; }
.show__toggle::before {   /* pause: two bars */
  content: ""; width: 10px; height: 12px;
  background: linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 7px, var(--ink) 7px 10px);
}
.show__toggle[aria-pressed="true"]::before {   /* play: a triangle */
  width: 11px; margin-left: 3px; background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%);
}
@media (hover: hover) { .show__toggle:hover { opacity: 1; transform: scale(1.08); } }
.show__toggle:focus-visible { opacity: 1; }

/* ── info + address ── */
.rule {
  flex: none; height: var(--rule); margin: calc(var(--k) * 56) var(--g) 0; padding: 0;
  border: 0; background: var(--blue); transform-origin: 0 50%;
}
.page { flex: none; padding: max(18px, calc(var(--k) * 47)) var(--g) 0; }
.cols { display: grid; grid-template-columns: 51.21% 39.89%; column-gap: 3.3%; }   /* 932 / 726 / 60 of 1820 */
.addr { font-style: normal; }
.addr strong { font-weight: 700; }
.addr a {
  text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: max(1px, .08em);
  text-underline-offset: .2em; transition: text-decoration-color .3s var(--ease);
}
@media (hover: hover) { .addr a:hover { text-decoration-color: var(--ink); } }
.band {
  position: relative; flex: 1 0 auto; min-height: clamp(220px, 36vh, 900px);
  margin-top: max(32px, calc(var(--k) * 100)); overflow: hidden; background: #d4d4d4;
}
#address .band { margin-top: max(32px, calc(var(--k) * 73)); }   /* Figma: photo starts higher on Address */
.band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
@media (max-width: 47.99em) {
  .cols { grid-template-columns: 1fr; row-gap: 1em; }
}
/* entrance: the rule draws itself, then the copy settles (once per visit to the screen) */
@media (prefers-reduced-motion: no-preference) {
  .js .view--page.is-fresh .rule { animation: draw .9s var(--ease) both; }
  .js .view--page.is-fresh .page > :not(.vh) { animation: rise-in .8s var(--ease) .2s both; }
}
@keyframes draw { from { transform: scaleX(0); } }

/* ── menu: blue sheet, slides up from the bottom (Figma "Menu") ── */
.menu {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; overflow-y: auto;
  background: var(--blue); visibility: hidden; transform: translate3d(0, 100%, 0);
  transition: transform var(--swap) var(--ease), visibility 0s var(--swap);
}
.menu.is-open { visibility: visible; transform: none; transition: transform var(--swap) var(--ease), visibility 0s; }
.menu.is-instant { transition: none; }
.menu .rule { background: var(--paper); }
.menu__nav { margin-top: auto; padding: calc(var(--g) * 2) var(--g) max(10px, calc(var(--k) * 19)); text-align: right; }
.menu__nav ul { list-style: none; margin: 0; padding: 0; }
.menu__nav li + li { margin-top: .1em; }
.menu__nav a {
  display: inline-block; font: 300 var(--menu-text) / 1.21 var(--serif); letter-spacing: 0;
  color: var(--ink); text-decoration: none;
}
.menu__nav .p { display: inline-block; color: var(--paper); transform-origin: 30% 80%; transition: transform .45s var(--ease); }
@media (hover: hover) { .menu__nav a:hover .p { transform: scale(1.7); } }
.menu__nav a:focus-visible .p { transform: scale(1.7); }
@media (prefers-reduced-motion: no-preference) {
  .menu.is-open .menu__nav li { animation: rise-in .6s var(--ease) both; animation-delay: .14s; }
  .menu.is-open .menu__nav li + li { animation-delay: .23s; }
}
