/* Balcony8 — under construction (static)
   Built from Figma "B8BB Landing Page": desktop frame 1728×1117, mobile frame 390×844.
   Desktop measurements use --u (1 design px at 1728 wide); mobile uses real px from the 390 frame. */

/* Brand fonts */
@font-face {
  font-family: "Hot Mess";
  src: url("/fonts/HotMess-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Eleven Eleven";
  src: url("/fonts/ElevenEleven-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ink: #000;
  --paper: #e9e7e3;
  --font-display: "Hot Mess", "Brush Script MT", cursive;
  --font-body: "Eleven Eleven", "Helvetica Neue", Arial, sans-serif;
  --u: calc(100vw / 1728);
  --mid: 45%; /* vertical centre of the headline / seal / contact row (desktop) */
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a { color: inherit; text-decoration: none; }
a:hover,
a:focus-visible { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

p { margin: 0; }

/* ---------- Page ---------- */
.page {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
}

/* Background: the wide emboss shot (3852×2491) — the seal fills 32.2% of its height, centred at 49%.
   The image is sized from the viewport HEIGHT so the seal sits at ~55% of screen height on any
   desktop shape; it only scales by width on screens wider than ~2.6:1 so the paper still covers. */
.bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.bg img {
  position: absolute;
  left: 50%;
  top: var(--mid);
  display: block;
  height: max(170.8%, calc(100vw / 1.5464)); /* 55% / 32.2% seal share */
  width: auto;
  max-width: none;
  transform: translate(-50%, -49%);
}

.seal-slot { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

/* ---------- Desktop (default) ---------- */
.headline {
  position: absolute;
  left: calc(39 * var(--u));
  top: var(--mid);
  width: calc(498 * var(--u));
  margin: 0;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: calc(110 * var(--u));
  line-height: calc(90 / 110);
  text-transform: uppercase;
  text-align: center;
}
.headline .w { display: block; }
.headline .l { display: inline-block; }

.contact {
  position: absolute;
  right: calc(90 * var(--u));
  top: var(--mid);
  width: calc(412 * var(--u));
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-style: normal;
  font-size: max(15px, calc(24 * var(--u)));
  line-height: 1.75; /* 42px at 24px */
  text-transform: uppercase;
  text-align: center;
}

.footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(47.49 * var(--u));
  height: max(28px, calc(46.51 * var(--u)));
}
.wordmark {
  display: block;
  overflow: visible;
  position: absolute;
  left: 50%;
  bottom: 0;
  width: max(165px, calc(270.15 * var(--u)));
  height: auto;
  transform: translateX(-50%);
}
.locations,
.copyright {
  position: absolute;
  top: 50%;
  font-size: max(11px, calc(12 * var(--u)));
  line-height: 1.2;
  white-space: nowrap;
}
/* Icons + locations form one group, centred 296 from the left edge: the mirror of the
   copyright line (centred 296 from the right), so the footer balances under the
   headline and contact columns. */
.loc-row {
  position: absolute;
  top: 50%;
  left: calc(296 * var(--u));
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: max(14px, calc(22 * var(--u)));
}
.loc-row .locations { position: static; transform: none; }
.social {
  display: flex;
  align-items: center;
  gap: max(10px, calc(12 * var(--u)));
}
.social a {
  position: relative;
  display: block;
  width: max(16px, calc(19 * var(--u)));
  height: max(16px, calc(19 * var(--u)));
  color: var(--ink);
  transition: transform .4s cubic-bezier(.16, 1, .3, 1), opacity .3s;
}
.social svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.social .dot { fill: currentColor; stroke: none; }
/* Hover: a solid "inked" version of the icon sweeps in through a feathered mask */
.social .ink {
  position: absolute;
  inset: 0;
  -webkit-mask: linear-gradient(90deg, #000 40%, transparent 60%) 100% 0 / 260% 100% no-repeat;
          mask: linear-gradient(90deg, #000 40%, transparent 60%) 100% 0 / 260% 100% no-repeat;
  transition: -webkit-mask-position .55s cubic-bezier(.22, 1, .36, 1), mask-position .55s cubic-bezier(.22, 1, .36, 1);
}
.social .ink .solid { fill: currentColor; stroke: none; }
.social .ink .knock { stroke: var(--paper); stroke-width: 1.7; fill: none; }
.social .ink .knock-dot { fill: var(--paper); stroke: none; }
.social a:hover,
.social a:focus-visible { transform: translateY(-2px); }
.social a:hover .ink,
.social a:focus-visible .ink { -webkit-mask-position: 0 0; mask-position: 0 0; }
.social a:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; border-radius: 4px; }
.copyright {
  right: calc(296 * var(--u));
  transform: translate(50%, -50%);
}

/* ---------- Phones & portrait tablets: stacked layout ----------
   The page is exactly the visible screen (svh = height with Safari's toolbars showing, vh fallback).
   Headline + contact sit at the top, footer at the bottom, and the seal only gets the space left
   between them (.seal-slot, a size container) so it can never run into the text on short screens. */
@media (max-width: 767px), (max-aspect-ratio: 3/4) and (max-width: 1100px) {
  html,
  body { background: #dcd8d2; }

  .page {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    height: 100svh;
    min-height: 500px;
    padding:
      calc(env(safe-area-inset-top, 0px) + clamp(24px, 6.5svh, 72px))
      max(16px, env(safe-area-inset-right, 0px))
      calc(env(safe-area-inset-bottom, 0px) + clamp(18px, 4.5svh, 52px))
      max(16px, env(safe-area-inset-left, 0px));
    /* seal-free strip of the same paper, so the page is always covered */
    background: #dcd8d2 url("/assets/paper.jpg") center / cover no-repeat;
  }

  .headline,
  .contact,
  .footer,
  .wordmark,
  .loc-row,
  .locations,
  .copyright {
    position: static;
    transform: none;
  }

  .headline {
    flex: none;
    width: auto;
    font-size: min(96px, 17vw, 8.2svh);
    line-height: .883;
  }

  .contact {
    flex: none;
    width: auto;
    margin-top: clamp(12px, 2.6svh, 28px);
    font-size: clamp(13px, 3.6vw, 18px);
    line-height: 1.6;
    letter-spacing: 1px;
  }

  .seal-slot {
    position: relative;
    inset: auto;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    margin-block: clamp(6px, 1.6svh, 20px);
    container-type: size;
    z-index: -1;
  }
  /* zero-size anchor at the slot centre; the photo is drawn around it and may spill past the slot */
  .bg {
    inset: auto;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
  }
  /* light photo: seal = 32.2% of image height / 24.9% of its height in width → fit 86% of slot height, 80% of width */
  .bg img {
    left: 0;
    top: 0;
    height: min(calc(100cqh * .86 / .322), calc(100cqw * .80 / .249));
    width: auto;
    transform: translate(-50%, -49%);
    -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
            mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  }

  .footer {
    flex: none;
    left: auto;
    right: auto;
    bottom: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .wordmark { width: clamp(160px, 56vw, 240px); }
  .locations,
  .copyright {
    opacity: 0.6;
    line-height: 1;
  }
  .loc-row {
    margin-top: clamp(8px, 1.4svh, 14px);
    gap: 12px;
    opacity: 0.6;
  }
  .loc-row .locations { opacity: 1; }
  .social { gap: 10px; }
  .social a { width: 15px; height: 15px; }
  .locations { font-size: 11px; }
  .copyright { font-size: 9px; margin-top: clamp(10px, 1.8svh, 16px); }
}

/* ---------- Contact micro-interaction (C2) ---------- */
.contact .cl { position: relative; display: inline-block; text-decoration: none; }
/* Underline paints in with the same feathered edge as the headline reveal */
.contact .cl::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .22em;
  height: 1px;
  background: linear-gradient(90deg, currentColor 40%, transparent 60%) 100% 0 / 260% 100% no-repeat;
  transition: background-position .6s cubic-bezier(.22, 1, .36, 1);
}
.contact .cl:hover,
.contact .cl:focus-visible { text-decoration: none; }
.contact .cl:hover::after,
.contact .cl:focus-visible::after { background-position: 0 0; }
.contact .tip {
  position: absolute;
  left: 50%; bottom: 100%;
  transform: translate(-50%, 6px);
  padding: 4px 10px 3px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .12em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s cubic-bezier(.16, 1, .3, 1);
}
@media (hover: hover) and (pointer: fine) {
  .contact .cl:hover .tip,
  .contact .cl.copied .tip { opacity: 1; transform: translate(-50%, -2px); }
  /* email pill sits below its line so it never covers the phone number */
  .contact .cl-mail .tip { bottom: auto; top: 100%; transform: translate(-50%, -6px); }
  .contact .cl-mail:hover .tip { transform: translate(-50%, 2px); }
}
@media not ((hover: hover) and (pointer: fine)) {
  .contact .tip { display: none; }
}

/* ---------- Intro sequence ----------
   html.anim  = armed before first paint (motion allowed): elements wait in their start state.
   html.play  = set by main.js once fonts + background are ready: the timeline runs.
   Without JS or with reduced motion, neither class is set and the page simply shows its final state. */

/* B2 — emboss press-in */
@keyframes b8-press {
  0%   { transform: scale(1.07); filter: contrast(.7) brightness(1.07) blur(4px); }
  60%  { filter: contrast(1.04) brightness(1) blur(0); }
  100% { transform: none; filter: none; }
}
.anim .bg { transform: scale(1.07); filter: contrast(.7) brightness(1.07) blur(4px); }
.play .bg { animation: b8-press 1.3s cubic-bezier(.16, 1, .3, 1) both; }

/* A2 — letter-by-letter ink flick with a feathered (gradient-masked) leading edge.
   Each letter's box is padded out so the soft mask and blur never show a hard rectangle. */
.headline .l {
  padding: .18em .22em;
  margin: -.18em -.22em;
}
@keyframes b8-letter {
  0%   { -webkit-mask-position: 100% 0; mask-position: 100% 0; opacity: 0; filter: blur(6px); transform: translate(-.04em, .05em) skewX(-10deg); }
  25%  { opacity: 1; }
  100% { -webkit-mask-position: 0 0; mask-position: 0 0; opacity: 1; filter: blur(0); transform: none; }
}
.anim .headline .l {
  -webkit-mask-image: linear-gradient(90deg, #000 38%, transparent 62%);
          mask-image: linear-gradient(90deg, #000 38%, transparent 62%);
  -webkit-mask-size: 260% 100%;
          mask-size: 260% 100%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
          mask-position: 100% 0;
  opacity: 0;
}
.play .headline .l {
  animation: b8-letter .6s cubic-bezier(.22, 1, .36, 1) calc(.35s + var(--i) * .045s) both;
}

/* Contact + footer copy fade up */
/* "from"-only keyframes: each element animates to its own resting opacity (mobile footer rests at .6) */
@keyframes b8-fade { from { opacity: 0; translate: 0 12px; } }
.anim:not(.play) .contact .cl,
.anim:not(.play) .footer .fade { opacity: 0; }
.play .contact .cl { animation: b8-fade 1s cubic-bezier(.16, 1, .3, 1) calc(.35s + var(--i) * .1s) both; /* starts with the headline */ }
.play .footer .loc-row { animation: b8-fade .7s cubic-bezier(.16, 1, .3, 1) 1.35s both; }
.play .footer .copyright { animation: b8-fade .7s cubic-bezier(.16, 1, .3, 1) 1.42s both; }

/* D2 — wordmark letters drop in, then the underline signs it */
.wordmark .g,
.wordmark .u { transform-box: fill-box; }
.wordmark .u { transform-origin: left center; }
@keyframes b8-drop { from { opacity: 0; transform: translateY(-45%); } to { opacity: 1; transform: none; } }
@keyframes b8-underline { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.anim .wordmark .g { opacity: 0; }
.anim .wordmark .u { transform: scaleX(0); }
.play .wordmark .g { animation: b8-drop .55s cubic-bezier(.16, 1, .3, 1) calc(1.4s + var(--i) * .05s) both; }
.play .wordmark .u { animation: b8-underline .55s cubic-bezier(.16, 1, .3, 1) 1.85s both; }

/* ---------- Hover moments (desktop, after the intro has finished) ---------- */
/* Headline: a letter re-inks as the cursor passes over it */
@keyframes b8-reink {
  0%   { -webkit-mask-position: 100% 0; mask-position: 100% 0; filter: blur(3px); transform: translate(-.03em, .03em) skewX(-8deg); }
  100% { -webkit-mask-position: 0 0; mask-position: 0 0; filter: blur(0); transform: none; }
}
.headline .l.reink {
  -webkit-mask: linear-gradient(90deg, #000 38%, transparent 62%) 0 0 / 260% 100% no-repeat;
          mask: linear-gradient(90deg, #000 38%, transparent 62%) 0 0 / 260% 100% no-repeat;
  animation: b8-reink .55s cubic-bezier(.22, 1, .36, 1) both;
}
/* Wordmark: letters ripple and the underline re-signs */
@keyframes b8-wave { 0%, 100% { transform: none; } 40% { transform: translateY(-16%); } }
.wordmark.wave .g { animation: b8-wave .6s cubic-bezier(.33, 1, .68, 1) calc(var(--i) * .04s) both; }
.wordmark.wave .u { animation: b8-underline .55s cubic-bezier(.16, 1, .3, 1) .25s both; }

@media (prefers-reduced-motion: reduce) {
  .headline .l.reink, .wordmark.wave .g, .wordmark.wave .u { animation: none !important; }
  .bg, .headline .l, .contact .cl, .footer .fade, .wordmark .g, .wordmark .u {
    animation: none !important; opacity: 1 !important; filter: none !important; transform: none !important;
    -webkit-mask-image: none !important; mask-image: none !important;
  }
}

/* ---------- Dark mode (follows the visitor's system setting) ----------
   Chrome-seal artwork on a near-black gradient. The photo is a smooth vertical gradient
   (#1e1e1e → #111), so the page paints the same gradient and the photo's edges are feathered
   into it: the seal stays at the light-mode size (~55% of screen height) on any screen shape. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3f1ed;
    --paper: #151515;
  }
  html,
  body { background: #151515; }
  .page { background: linear-gradient(180deg, #1e1e1e 0%, #191919 50%, #111 100%); }

  /* seal fills 61.1% of the photo's height, centred at 49.35% */
  .bg img {
    top: var(--mid);
    width: auto;
    height: 90%;
    transform: translate(-50%, -49.35%);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent),
                        linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
    -webkit-mask-composite: source-in;
            mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent),
                        linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
            mask-composite: intersect;
  }

  /* wordmark is inline SVG with black fills: reverse it */
  .wordmark path { fill: var(--ink); }
}
@media (prefers-color-scheme: dark) and (max-width: 767px), (prefers-color-scheme: dark) and (max-aspect-ratio: 3/4) and (max-width: 1100px) {
  html,
  body { background: #151515; }
  .page { background: linear-gradient(180deg, #1e1e1e 0%, #191919 50%, #111 100%); }
  /* chrome photo: seal = 61.1% of image height, 48.35% of its height in width */
  .bg img {
    top: 0;
    height: min(calc(100cqh * .86 / .611), calc(100cqw * .80 / .4835));
    transform: translate(-50%, -49.35%);
  }
}
