/* ============================================================
   The Brown Print — the gate (index)
   Loaded after css/tokens.css. A fixed, single-screen entrance:
   one line about the studio, the way into the archive, and
   direct doors to the four services.
   ============================================================ */

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

html, body {
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--c-bg);
  font-family: var(--f-body);
  color: var(--c-text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--c-accent); color: var(--c-bg); }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }

/* ============================ BACKDROP ============================ */
.backdrop { position: fixed; inset: 0; overflow: hidden; }
.backdrop img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(.55) contrast(1.12) brightness(.72);
  transform: scale(1.06);
  animation: drift 28s var(--ease) infinite alternate;
}
@keyframes drift {
  from { transform: scale(1.06) translateX(-0.6%); }
  to   { transform: scale(1.10) translateX(0.6%); }
}
/* brand tint + light bleed (upper-right glow, red undertone) */
.backdrop::before {
  content: "";
  position: absolute; inset: 0; z-index: 2;
  background:
    radial-gradient(120% 90% at 82% 8%, rgba(218,31,31,.32), transparent 55%),
    radial-gradient(140% 120% at 50% 115%, rgba(10,9,8,.92), transparent 60%),
    linear-gradient(to bottom, rgba(10,9,8,.72) 0%, rgba(10,9,8,.4) 18%, rgba(10,9,8,.45) 78%, rgba(10,9,8,.8) 100%);
  pointer-events: none;
}
/* film grain */
.backdrop::after {
  content: "";
  position: absolute; inset: -50%; z-index: 3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: .12;
  animation: grain .9s steps(4) infinite;
  pointer-events: none;
}
@keyframes grain {
  0% { transform: translate(0,0); } 25% { transform: translate(-2%,3%); }
  50% { transform: translate(3%,-2%); } 75% { transform: translate(-3%,-3%); }
  100% { transform: translate(2%,2%); }
}

/* ============================ CHROME ============================ */
.chrome {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: max(var(--sp-5), env(safe-area-inset-top)) var(--page-margin) max(var(--sp-6), env(safe-area-inset-bottom));
  text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 2px 18px rgba(0,0,0,.65);
}

.topline {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
  opacity: 0; animation: rise 1.2s var(--ease) .6s forwards;
}
/* One lockup everywhere: symbol + Archivo Black wordmark. */
.tbrand { display: inline-flex; align-items: center; gap: var(--sp-3);
  font: 400 20px/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.tbrand img { width: 40px; height: 40px; filter: drop-shadow(0 2px 10px rgba(0,0,0,.5)); }
.est { font: 700 var(--fs-label)/1 var(--f-body); letter-spacing: var(--tr-nav); text-transform: uppercase; white-space: nowrap; }
.est .dot { color: var(--c-accent); }

/* ============================ CENTER ============================ */
.center { display: flex; flex-direction: column; align-items: center; gap: var(--sp-6); text-align: center; }

.statement {
  max-width: 22ch;
  font: 400 var(--fs-statement)/var(--lh-quote) var(--f-voice);
  letter-spacing: var(--tr-voice);
  text-wrap: balance;
  opacity: 0; animation: rise 1.4s var(--ease) .2s forwards;
}
.statement em { color: var(--c-accent); }

.enter {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 40px;
  font: 700 13px/1 var(--f-body); letter-spacing: var(--tr-label); text-transform: uppercase;
  color: var(--c-bg); background: var(--c-accent);
  border: 0; border-radius: var(--r-pill); cursor: pointer; text-shadow: none;
  transition: background-color var(--dur-ui) var(--ease), transform var(--dur-ui) var(--ease), box-shadow var(--dur-ui) var(--ease);
  opacity: 0; animation: rise 1.4s var(--ease) .4s forwards;
}
.enter:hover, .enter:focus-visible { background: var(--c-text); transform: scale(1.04); box-shadow: 0 0 60px rgba(246,243,237,.25); }
.enter:active { transform: scale(.98); }

/* Direct doors for visitors who arrive knowing what they want. */
.doors { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--sp-2);
  opacity: 0; animation: rise 1.4s var(--ease) .6s forwards; }
.doors a { padding: 14px var(--sp-2); font: 700 var(--fs-label)/1 var(--f-body); letter-spacing: var(--tr-label); text-transform: uppercase;
  transition: color var(--dur-fast) var(--ease); }
.doors a + a::before { content: "·"; margin-right: var(--sp-4); color: var(--c-muted); }
.doors a:hover { color: var(--c-accent); }

/* ============================ SOCIALS ============================ */
.socials { display: flex; gap: var(--sp-3); opacity: 0; animation: rise 1.4s var(--ease) .8s forwards; }
.socials a {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 1.5px solid var(--c-line-strong); border-radius: 50%;
  background: rgba(10,9,8,.35);
  transition: background-color var(--dur-ui) var(--ease), color var(--dur-ui) var(--ease), border-color var(--dur-ui) var(--ease);
}
.socials a:hover { background: var(--c-text); border-color: var(--c-text); color: var(--c-bg); }
.socials svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.socials svg.filled { fill: currentColor; stroke: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================ EXIT FADE ============================ */
.fade {
  position: fixed; inset: 0; z-index: 50;
  background: var(--c-bg);
  opacity: 0; pointer-events: none;
  transition: opacity .7s var(--ease);
}
body.leaving .fade { opacity: 1; pointer-events: auto; }
body.leaving .center { transition: transform .7s var(--ease), opacity .7s var(--ease); transform: scale(.96); opacity: 0; }

@media (max-width: 479px) {
  .tbrand { font-size: 15px; }
  .tbrand img { width: 32px; height: 32px; }
  .est { display: none; }
}
/* Short viewports (landscape phones): let the gate scroll instead of clipping. */
@media (max-height: 540px) {
  html, body { overflow: auto; }
  .chrome { position: absolute; min-height: 540px; }
}

@media (prefers-reduced-motion: reduce) {
  *, .backdrop img, .backdrop::after { animation: none !important; transition: none !important; }
  .topline, .statement, .enter, .doors, .socials { opacity: 1; }
}
