/* The Long Way Roast · concept site by Planet Presence */

/* ---------- Fonts (self-hosted, SIL Open Font Licence; see CREDITS.md) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---------- Palette ---------- */
:root {
  --ink: #2A1C13;
  --cherry: #B3261E;
  --cream: #F6EBD9;
  --brass: #B8892B;
  --butter: #F3D77A;
  --powder: #B8D4EC;
  --cobalt: #2E4A9E;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --strip-h: 30px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--butter); }
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 0.5rem;
}

/* ---------- Concept strip ---------- */
.concept-strip {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  min-height: var(--strip-h);
  display: flex; align-items: center; justify-content: center;
  padding: 6px 16px;
  background: rgba(42, 28, 19, 0.82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(184, 137, 43, 0.35);
  font-family: var(--font-mono);
  font-size: 11px; line-height: 1.35; letter-spacing: 0.02em;
  text-align: center;
  color: rgba(246, 235, 217, 0.88);
}
.concept-strip__short { display: none; }
@media (max-width: 760px) {
  .concept-strip__long { display: none; }
  .concept-strip__short { display: inline; }
}

/* =====================================================================
   SCENE 1 · THE DOOR
   ===================================================================== */
.door {
  position: relative;
  height: 400vh;               /* 1 screen of stage + 3 screens of scroll */
  height: 400svh;
}
.door__stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  perspective: 1500px;
  perspective-origin: 50% 50%;
  background: var(--ink);
  isolation: isolate;
  --p: 0;                       /* scroll progress, set by JS */
  --seam: 50%;                  /* seam between the doors, set by JS in px */
}

/* Room behind the doors */
.door__room {
  position: absolute; inset: 0;
  transform-origin: 56% 46%;    /* walk towards the counter and grinder */
  will-change: transform;
}
.door__counter { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.door__dim {
  position: absolute; inset: 0;
  background: #120b07;
  opacity: 0.6;
  pointer-events: none;
}
/* Warm tint over the room: turns the cold blue photo amber as the light comes up */
.door__warm {
  position: absolute; inset: 0;
  background: #E8913F;
  mix-blend-mode: soft-light;
  opacity: 0;
  pointer-events: none;
}
/* Warm light rising from below (a light pool, not on the logo) */
.door__light {
  position: absolute; inset: -10% -10% -10% -10%;
  background:
    radial-gradient(70% 60% at 50% 100%, rgba(242, 150, 60, 0.7), rgba(242, 150, 60, 0) 70%),
    radial-gradient(28% 30% at 64% 14%, rgba(255, 196, 120, 0.45), rgba(255, 196, 120, 0) 70%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}
.door__air {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* The two doors */
.door__leaf {
  position: absolute; inset: 0;
  will-change: transform;
  /* no backface-visibility: hidden here, it made the doors vanish in Edge/Chrome */
}
/* The photo is placed by JS (--door-x/y/w/h): it always covers the whole screen */
.door__leaf img {
  position: absolute;
  left: var(--door-x, 0px); top: var(--door-y, 0px);
  width: var(--door-w, 100%); height: var(--door-h, 100%);
  max-width: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.door__leaf img.is-loaded { opacity: 1; }

/* Each half reaches 1px past the seam, so they overlap by 2px and no hairline shows */
.door__leaf--left  { clip-path: inset(0 calc(100% - var(--seam) - 1px) 0 0); transform-origin: 0 50%; }
.door__leaf--right { clip-path: inset(0 0 0 calc(var(--seam) - 1px));        transform-origin: 100% 50%; }
.door__shade {
  position: absolute; inset: 0;
  background: #0d0805;
  opacity: 0;
}

/* Darkens the middle so the logo and line read well */
.door__vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 55% at 50% 52%, rgba(20, 12, 7, 0.72), rgba(20, 12, 7, 0) 75%);
  opacity: 0;
  pointer-events: none;
}

.door__title {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(14px, 2.4vh, 26px);
  padding: calc(var(--strip-h) + 16px) 16px 16px;
  text-align: center;
  pointer-events: none;
}
.door__logo { margin: 0; display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2vh, 20px); opacity: 0; }
.door__mark { width: clamp(72px, 9vw, 120px); height: auto; }
.door__wordmark { width: clamp(260px, 42vw, 560px); height: auto; }
.door__line {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 380;
  font-size: clamp(1.15rem, 2.1vw, 1.6rem);
  color: var(--cream);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
  opacity: 0;
}

/* JS places the pill just above the doorstep */
.door__hint {
  position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  transition: opacity 0.2s linear;
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(42, 28, 19, 0.7);
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cream);
  white-space: nowrap;
  pointer-events: none;
}
.door__hint-arrow { display: inline-block; animation: hint-bob 1.8s ease-in-out infinite; }
@keyframes hint-bob { 50% { transform: translateY(3px); } }

/* Until the script takes over: keep the room hidden (dark brown shows) and the pill out of sight */
.js .door__room, .js .door__dim { visibility: hidden; }
.js .door__hint:not(.is-placed) { visibility: hidden; }

/* Phone: shorter scroll, simpler motion (handled in JS too) */
@media (max-width: 700px) {
  .door { height: 320vh; height: 320svh; }
  .door__stage { perspective: none; }
  .door__room { transform-origin: 55% 55%; }
  .door__counter { object-position: 56% 50%; }
}

/* Reduced motion: no pinning, no sliding. Show the room with the logo, fully readable. */
@media (prefers-reduced-motion: reduce) {
  .door { height: auto; }
  .door__stage { position: relative; }
  .js .door__room, .js .door__dim { visibility: visible; }
  .door__leaf, .door__air, .door__hint { display: none; }
  .door__dim { opacity: 0.35; }
  .door__light { opacity: 0.7; }
  .door__warm { opacity: 0.6; }
  .door__vignette, .door__logo, .door__line { opacity: 1; }
  .door__hint-arrow { animation: none; }
}

/* ---------- Temporary block after scene 1 ---------- */
.coming-next {
  min-height: 60vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 16px;
  text-align: center;
  border-top: 1px solid rgba(184, 137, 43, 0.25);
}
.coming-next__title { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2.4rem); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 48px 16px 64px;
  max-width: 760px; margin: 0 auto;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(246, 235, 217, 0.8);
  border-top: 1px solid rgba(184, 137, 43, 0.25);
}
.site-footer p { margin: 0 0 12px; }
.site-footer__tag { font-family: var(--font-display); font-size: 1.6rem; color: var(--cream); }
.site-footer a { display: inline-block; padding: 12px 4px; min-height: 44px; }
.site-footer__concept, .site-footer__ai { font-family: var(--font-mono); font-size: 0.75rem; }
.site-footer__credits { margin-top: 16px; font-size: 0.8rem; text-align: left; }
.site-footer__credits summary {
  cursor: pointer; padding: 12px 0; min-height: 44px;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brass); text-align: center;
}
.site-footer__credits a { display: inline; padding: 0; min-height: 0; }
