/* ============ Creato Homes — base, intro, landing ============ */
:root {
  --bg-light: #F2F0EF;
  --bg-dark: #333333;
  --ink: #121212;
  --paper: #FAFAFA;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --win-radius: 22px;
  --ease-win: cubic-bezier(0.32, 0.72, 0, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: #000;
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: var(--font); cursor: pointer; }

img { display: block; }

/* ---------- video background ---------- */
#video-bg { position: fixed; inset: 0; z-index: 0; background: #000; }

.bg-clip {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.bg-clip.on { opacity: 1; }

#vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 30%),
    linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 25%);
  pointer-events: none;
}

/* ---------- intro ---------- */
#intro {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: clamp(36px, 6vh, 64px);
  text-align: center;
  padding: 24px;
  /* soft dark scrim so the white text + signatures stay legible over any clip */
  background: radial-gradient(ellipse 95% 72% at 50% 50%, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.34) 52%, rgba(0,0,0,0) 82%);
  transition: opacity 1.2s ease;
}
#intro.fade { opacity: 0; pointer-events: none; }

.intro-text {
  color: var(--paper);
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: 0.02em;
  max-width: min(1080px, 92vw);   /* keeps it a centred block, two lines on desktop */
  margin: 0 auto;
  text-align: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.4s ease, transform 1.4s ease;
  text-shadow: 0 2px 24px rgba(0,0,0,0.45);
}
.intro-text br { display: none; }              /* let it wrap naturally on small screens */
@media (min-width: 761px) { .intro-text br { display: inline; } }
#intro.show-text .intro-text { opacity: 1; transform: translateY(0); }

.intro-sigs {
  display: flex;
  gap: clamp(28px, 7vw, 96px);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* real signature artwork (white, transparent) — revealed left→right as if written */
.sig {
  display: block;
  width: auto;
  height: clamp(72px, 9vw, 132px);   /* both signatures share one height → same scale */
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)) drop-shadow(0 3px 18px rgba(0, 0, 0, 0.55));
  /* hidden: clipped away from the right edge */
  clip-path: inset(-8% 100% -8% -2%);
  opacity: 0;
  will-change: clip-path;
}
.sig-adam  { transform: rotate(-3deg); }
.sig-mitch { transform: rotate(-1deg); height: clamp(65px, 8.1vw, 119px); }  /* 10% smaller than Adam */
.sig.draw {
  opacity: 1;
  /* revealed: clip pulled back to the right edge → the stroke "draws" across */
  clip-path: inset(-8% -2% -8% -2%);
  transition: clip-path 1.8s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.15s ease;
}

/* ---------- brand ---------- */
#brand {
  position: fixed;
  top: clamp(16px, 3vh, 30px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
body.landing #brand { opacity: 1; }
/* hide the centred logo while a window is open (it overlaps content, esp. full-screen on mobile) */
body.window-open #brand { opacity: 0; }
#brand img { height: clamp(25px, 4vh, 37.5px); width: auto; }

/* ---------- landing link blocks ---------- */
#landing-links {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
  transition: opacity 0.9s ease, transform 0.9s ease;
}
body.landing #landing-links {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
body.landing.window-open #landing-links {
  opacity: 0;
  transform: translateY(24px);
  pointer-events: none;
}

.land-link {
  flex: 1;
  appearance: none;
  border: none;
  background: rgba(18, 18, 18, 0.22);
  color: var(--paper);
  font-size: clamp(15px, 1.6vw, 22px);
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: clamp(22px, 4vh, 38px) 12px;
  border-top: 1px solid rgba(250,250,250,0.25);
  transition: background 0.35s ease, backdrop-filter 0.35s ease;
}
.land-link + .land-link { border-left: 1px solid rgba(250,250,250,0.25); }
.land-link:hover, .land-link:focus-visible {
  background: rgba(250, 250, 250, 0.16);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  outline: none;
}

/* ---------- shared window shell ---------- */
.window {
  position: fixed;
  top: 50%; left: 50%;
  width: min(85vw, calc(100vw - 32px));
  height: min(85vh, calc(100vh - 110px));
  z-index: 25;
  border-radius: var(--win-radius);
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
  visibility: hidden;
  transition: transform 0.85s var(--ease-win), visibility 0s linear 0.85s;
}
.window.open {
  visibility: visible;
  transition: transform 0.85s var(--ease-win);
}

/* slide directions */
.win-us       { transform: translate(calc(-50% - 120vw), -50%); }
.win-projects { transform: translate(calc(-50% + 120vw), -50%); }
.win-talk     { transform: translate(-50%, calc(-50% + 120vh)); }
.window.open  { transform: translate(-50%, -50%); }

.back-btn {
  position: absolute;
  top: 18px; left: 20px;
  z-index: 10;
  appearance: none;
  border: 1.5px solid var(--ink);
  background: var(--bg-light);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 7px 18px;
  border-radius: 999px;
  transition: background 0.25s ease, color 0.25s ease;
}
.back-btn:hover { background: var(--ink); color: var(--paper); }
.back-btn.light { border-color: #000000; background: #2b2b2b; color: #000000; }
.back-btn.light:hover { background: #000000; color: var(--paper); }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .window {
    width: 100vw;
    height: 100dvh;
    top: 0; left: 0;
    border-radius: 0;
  }
  .win-us       { transform: translate(-120vw, 0); }
  .win-projects { transform: translate(120vw, 0); }
  .win-talk     { transform: translate(0, 120vh); }
  .window.open  { transform: translate(0, 0); }

  #landing-links { flex-direction: column; }
  .land-link + .land-link { border-left: none; }
  .land-link { padding: 18px 12px; }

  /* signatures: smaller so Adam + Mitch both fit on one row (Mitch was wrapping off-screen) */
  .intro-sigs { gap: 18px; flex-wrap: nowrap; }
  .sig { height: clamp(40px, 12vw, 54px); }
  .sig-mitch { height: clamp(36px, 10.8vw, 49px); }   /* ~10% smaller than Adam */
}

@media (prefers-reduced-motion: reduce) {
  .bg-clip, .window, .intro-text, .sig { transition: none !important; }
}
