/* ============================================================
   TOWN SQUARE DISTRICT — Coming Soon
   ------------------------------------------------------------
   The scene is built on a fixed-aspect "plate" (2400 × 1400)
   that emulates `object-fit: cover`. Every layer — dark base,
   illumination zones, desktop typography — lives inside the
   plate in percentages / plate units, so the composition stays
   pixel-glued to the building at every viewport size.

   1 plate-px  =  max(100vw / 2400, 100lvh / 1400)
   ============================================================ */

/* ---------- brand tokens (TSD guidelines v1.1) ---------- */
:root {
  --tsd-black:     #000000;
  --tsd-grege:     #F4F0E8;
  --tsd-bronze:    #C9B08A;   /* rule + logo accent            */
  --tsd-warm-gray: #F9F7F3;
  --tsd-gold:      #D8B26E;   /* headline gold, off the comp   */
  --tsd-cream:     #EFE8D5;   /* paragraph parchment           */

  /* shared left edge of the message column (wordmark + comp align) */
  --col-left: clamp(28px, 7.5vw, 170px);

  --ink:      #FFFFFF;        /* title white — full strength        */
  --ink-soft: #F8FAFF;        /* subtitle white                     */
  /* soft ambient lift so light type never sinks into the photograph */
  --type-shadow: 0 1px 3px rgba(4, 8, 18, 0.45), 0 2px 22px rgba(4, 8, 18, 0.55);
  --bg:       #081020;        /* pre-paint backdrop, sky-adjacent   */

  /* one plate pixel, cover-fit (2400/24 = 100vw, 1400/14 = 100lvh) */
  --u: max(0.0416667vw, 0.0714286vh);
}
@supports (height: 1lvh) {
  :root { --u: max(0.0416667vw, 0.0714286lvh); }
}

/* ---------- fonts ---------- */
@font-face {
  font-family: "Trajan Pro 3";
  src: url("assets/fonts/TrajanPro3-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;        /* never show a fallback face */
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/CormorantGaramond-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;         /* true italic file — no synthesis */
  font-display: block;
}
@font-face {
  font-family: "Gotham Book";
  src: url("assets/fonts/GothamBook.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Playfair Display";
  src: url("assets/fonts/PlayfairDisplay-Variable.woff2") format("woff2");
  font-weight: 400 900;        /* variable — real weights, no synthesis */
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/CormorantGaramond-Variable.woff2") format("woff2");
  font-weight: 300 700;        /* upright companion to the italic above */
  font-style: normal;
  font-display: block;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  /* stop iOS Safari inflating type when the device rotates to landscape */
  -webkit-text-size-adjust: 100%;
          text-size-adjust: 100%;
}
html, body {
  height: 100%;
  overflow: hidden;                 /* single-viewport experience */
  overscroll-behavior: none;        /* no rubber-band bounce on iOS / Chrome */
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: "Gotham Book", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  font-synthesis: none;             /* forbid faux bold / faux italic */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- scene & plate ---------- */
.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
}

.plate {
  position: absolute;
  left: 50%;
  top: 50%;
  /* cover-fit the 2400×1400 plate. width AND height are both stated (and are
     algebraically the same cover scale) so the plate never collapses on
     engines without `aspect-ratio` support — iOS Safari < 15, older Android. */
  width:  max(100vw, 171.4286vh);
  height: max(100vh, 58.3333vw);
  aspect-ratio: 2400 / 1400;        /* redundant belt-and-suspenders on modern UAs */
  transform: translate(-50%, -50%);
}
@supports (height: 1lvh) {
  .plate {
    width:  max(100vw, 171.4286lvh);
    height: max(100lvh, 58.3333vw);
  }
}

.base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transform: translateZ(0);   /* own compositor layer beneath the zones */
}

/* ---------- illumination zones (generated by script.js) ---------- */
.zones { position: absolute; inset: 0; }

.zone {
  position: absolute;
  background-image: var(--lit);
  background-repeat: no-repeat;
  opacity: 0;
  /* feathered edges — zones overlap the same pixels, so seams cannot show */
  -webkit-mask-image: radial-gradient(ellipse 68% 68% at 50% 50%, #000 52%, transparent 99%);
          mask-image: radial-gradient(ellipse 68% 68% at 50% 50%, #000 52%, transparent 99%);
}
.zone.lit { opacity: 1; }           /* the single pre-lit window */

/* full-frame unifier layer — unmasked, completes the finale exactly */
.zone.zone-full {
  -webkit-mask-image: none;
          mask-image: none;
}

/* ============================================================
   DESKTOP COMPOSITION  (approved comp: left editorial column)
   Eyebrow wordmark · dash · BEIRUT · caps lines · dash ·
   paragraph · dash — column seated on the dark side of the
   frame, clear of the tower so the light-up stays pristine.
   ============================================================ */
.comp {
  position: absolute;
  left: var(--col-left);
  top: 50%;                          /* centered on the image height */
  transform: translateY(-50%);
}

.title {
  font-family: "Playfair Display", Georgia, serif;
  text-transform: uppercase;
  color: var(--tsd-gold);
  text-shadow: var(--type-shadow);
}
.title-city {
  display: block;
  font-weight: 700;
  font-size: calc(var(--u) * 176);
  letter-spacing: 0.135em;           /* tracked out, per comp */
  line-height: 0.94;
}
.title-lines {
  display: block;
  font-weight: 600;
  font-size: calc(var(--u) * 66);
  letter-spacing: 0.045em;
  line-height: 1.16;
  margin-top: calc(var(--u) * 28);
}

.rule {
  width: calc(var(--u) * 48);
  height: max(calc(var(--u) * 2.5), 1.5px);
  margin-top: calc(var(--u) * 42);
  background: var(--tsd-gold);
  transform-origin: left center;
}

.subtitle {
  font-family: "Cormorant Garamond", "Cormorant", Georgia, serif;
  font-style: normal;
  font-weight: 500;
  font-size: calc(var(--u) * 29);
  letter-spacing: 0.01em;
  line-height: 1.42;
  margin-top: calc(var(--u) * 24);
  color: var(--tsd-cream);
  text-shadow: var(--type-shadow);
}
/* closing dash + status note — inside the subtitle, so they share its reveal */
.sub-dash {
  display: block;
  width: calc(var(--u) * 48);
  height: max(calc(var(--u) * 2.5), 1.5px);
  margin-top: calc(var(--u) * 28);
  background: var(--tsd-gold);
}
.sub-note {
  display: block;
  font-family: "Gotham Book", "Helvetica Neue", Arial, sans-serif;
  font-size: calc(var(--u) * 16.5);
  letter-spacing: 0.24em;
  line-height: 1;
  text-transform: uppercase;
  margin-top: calc(var(--u) * 26);
  color: rgba(244, 240, 232, 0.82);
  text-shadow: var(--type-shadow);
}

/* ---------- brand lockup, head of the column ---------- */
.brand {
  position: absolute;
  top: 8.2vh;
  left: var(--col-left);
}
.logo {
  display: block;
  width: clamp(210px, 18vw, 300px);          /* transparent lockup, no panel */
  height: auto;
}

/* ---------- contact block, bottom right ---------- */
.site-foot {
  position: absolute;
  right: clamp(22px, 3.2vw, 52px);
  bottom: calc(clamp(16px, 2.8vh, 30px) + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: flex-end;
}
.foot-line {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.9em;
  text-align: right;
  font-size: clamp(11px, 0.62vw + 6px, 13.5px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 240, 232, 0.96);          /* grege, near-full strength */
  /* tight contact shadow only — the bottom fade below does the lifting */
  text-shadow: 0 1px 3px rgba(4, 8, 18, 0.5);
}

/* bottom-anchored shading: strongest at the page edge, EASED to zero.
   The stop curve follows a smooth bell tail — constant-derivative
   two-stop gradients produce Mach bands (a visible "line" at each end);
   this profile has no perceivable start or end. */
.footfade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(140px, 24vh, 260px);
  pointer-events: none;
  background: linear-gradient(to top,
      rgba(4, 8, 18, 0.58)  0%,
      rgba(4, 8, 18, 0.54)  8%,
      rgba(4, 8, 18, 0.47) 17%,
      rgba(4, 8, 18, 0.38) 27%,
      rgba(4, 8, 18, 0.29) 38%,
      rgba(4, 8, 18, 0.20) 50%,
      rgba(4, 8, 18, 0.125) 62%,
      rgba(4, 8, 18, 0.065) 74%,
      rgba(4, 8, 18, 0.025) 85%,
      rgba(4, 8, 18, 0.006) 93%,
      rgba(4, 8, 18, 0)   100%);
}
/* left-anchored shading: seats the message column on the dark side of
   the frame, per the approved comp. Same Mach-band-free eased profile
   as the bottom fade; it reaches zero before the tower's left face,
   so the illumination sequence is never dimmed. Static by design. */
.sidefade {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(52vw, 900px);
  pointer-events: none;
  background: linear-gradient(to right,
      rgba(4, 8, 18, 0.50)  0%,
      rgba(4, 8, 18, 0.46) 12%,
      rgba(4, 8, 18, 0.39) 24%,
      rgba(4, 8, 18, 0.30) 37%,
      rgba(4, 8, 18, 0.21) 50%,
      rgba(4, 8, 18, 0.13) 63%,
      rgba(4, 8, 18, 0.065) 76%,
      rgba(4, 8, 18, 0.02) 88%,
      rgba(4, 8, 18, 0)   100%);
}

/* "Website by" credit — rides the contact block's reveal */
.credit {
  display: flex;
  align-items: center;
  gap: 0.75em;
  line-height: 1;                    /* text box hugs the caps → true centering */
  margin-top: 1.25em;                /* a clear step off the contact lines */
}
.credit-text {
  transform: translateY(3px);                /* optical seat against the wordmark */
}
.credit-logo {
  display: block;
  width: clamp(92px, 6.8vw, 118px);          /* nascode minimum ≈90px */
  height: auto;
}

.foot-line a {
  color: var(--tsd-grege);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 176, 138, 0.75);
  padding-bottom: 2px;
  transition: color 0.35s ease, border-color 0.35s ease;
}
.foot-line a:hover,
.foot-line a:focus-visible {
  color: var(--tsd-bronze);
  border-color: var(--tsd-bronze);
  outline: none;
}

/* ============================================================
   PRE-ANIMATION STATE — only when JS is available.
   script.js animates these to their final values; visitors
   without JS simply see the finished composition.
   ============================================================ */
html.js .reveal { opacity: 0; }
html.js .rule   { transform: scaleX(0); }

/* Reduced motion: present the finished scene with one gentle fade */
@media (prefers-reduced-motion: reduce) {
  html.js .reveal,
  html.js .zone { transition: opacity 0.9s ease; }
  html.js .rule { transition: opacity 0.9s ease, transform 0s; transform: none; }
  html.finale .reveal,
  html.finale .zone { opacity: 1; }
}

/* ============================================================
   COMPACT COMPOSITION — portrait & narrow screens (aspect ≤ 1.4)
   Intentional recomposition: the same left editorial column,
   scaled to the device; tower centered and uncropped; contact
   kept bottom-right over the roadway.
   ============================================================ */
@media (max-aspect-ratio: 7/5) {
  .plate { transform: translate(-48.3%, -50%); }  /* centre the tower */

  /* the column now sits over the frame, so the scrim falls
     diagonally from the top-left corner instead of the side */
  .sidefade {
    width: 100%;
    background: linear-gradient(157deg,
        rgba(4, 8, 18, 0.55)  0%,
        rgba(4, 8, 18, 0.51) 12%,
        rgba(4, 8, 18, 0.44) 24%,
        rgba(4, 8, 18, 0.35) 36%,
        rgba(4, 8, 18, 0.25) 48%,
        rgba(4, 8, 18, 0.16) 58%,
        rgba(4, 8, 18, 0.08) 66%,
        rgba(4, 8, 18, 0.03) 72%,
        rgba(4, 8, 18, 0)   78%);
  }

  .brand { top: max(26px, env(safe-area-inset-top, 0px) + 16px); left: 7vw; }
  .logo  { width: clamp(170px, 48vw, 230px); }

  .comp { left: 7vw; }               /* vertical centering from the base rule */
  .title-city  { font-size: clamp(39px, 12vw, 67px); }
  .title-lines { font-size: clamp(19px, 5.7vw, 29px);
                 margin-top: clamp(10px, 1.8vh, 18px); }
  .rule     { width: clamp(30px, 8vw, 44px);
              margin-top: clamp(16px, 2.8vh, 28px); }
  .subtitle { font-size: clamp(14px, 3.9vw, 18px);
              margin-top: clamp(10px, 1.8vh, 17px); }
  .sub-dash { width: clamp(30px, 8vw, 44px);
              margin-top: clamp(12px, 2.2vh, 22px); }
  .sub-note { font-size: clamp(10px, 2.9vw, 13px); letter-spacing: 0.22em;
              margin-top: clamp(11px, 2vh, 20px); }

  .site-foot { right: 6vw; }
  .foot-line { gap: 0.8em; }
}

/* Very wide + short screens: tighten the column so it clears the foot */
@media (min-aspect-ratio: 12/7) and (max-height: 560px) {
  .brand { top: 5.5vh; }
  .title-city { font-size: calc(var(--u) * 140); }
}
