:root {
  --linen: #cdbea3;
  --linen-light: #ddd0b8;
  --linen-dark: #8f7c62;
  --thread: #14100c;
  --thread-soft: #3a2f22;
  --offwhite: #f3ede0;

  --font-display: "Poppins", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-utility: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--linen);
  color: var(--thread);
  font-family: var(--font-utility);
  overflow: hidden;
}

a { color: inherit; }

/* ---------- stage & video ---------- */

.stage {
  position: relative;
  width: 100vw;
  height: 100dvh;
  background: var(--linen);
  overflow: hidden;
}

.reel-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.reel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.03) contrast(1.02);
}

/* Genuinely phone/tablet-sized, narrower-than-16:9 viewports load the
   dedicated 9:16 clip (see index.html source[media]) instead of cover-
   cropping the 16:9 one, so the wordmark is never cut off. Gated on both
   aspect ratio AND max-width so a wide-but-short desktop window never
   gets treated like a phone. */
@media (max-aspect-ratio: 16/9) and (max-width: 1024px) {
  .thread-egg {
    display: none;
  }
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0) 26%),
    linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0) 26%);
}

/* ---------- film grain ---------- */

.grain {
  position: fixed;
  inset: -10%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 1.1s steps(4) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 1%); }
  50%  { transform: translate(1%, -2%); }
  75%  { transform: translate(-1%, -1%); }
  100% { transform: translate(0, 0); }
}

/* ---------- top / bottom bars ---------- */

.bar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: clamp(18px, 3vw, 36px) clamp(20px, 4vw, 48px);
}

.bar--top {
  top: 0;
  justify-content: space-between;
  padding-top: calc(clamp(18px, 3vw, 36px) + env(safe-area-inset-top));
  padding-left: calc(clamp(20px, 4vw, 48px) + env(safe-area-inset-left));
  padding-right: calc(clamp(20px, 4vw, 48px) + env(safe-area-inset-right));
}

.bar--bottom {
  bottom: 0;
  justify-content: space-between;
  padding-bottom: calc(clamp(18px, 3vw, 36px) + env(safe-area-inset-bottom));
  padding-left: calc(clamp(20px, 4vw, 48px) + env(safe-area-inset-left));
  padding-right: calc(clamp(20px, 4vw, 48px) + env(safe-area-inset-right));
}

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(13px, 1.5vw, 17px);
  letter-spacing: 0.02em;
  color: var(--offwhite);
}

.tag {
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: clamp(10px, 1.1vw, 12px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--offwhite);
  opacity: 0.9;
}

.socials {
  display: flex;
  gap: 16px;
}

.socials a {
  color: var(--offwhite);
  opacity: 0.85;
  display: flex;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.socials a:hover,
.socials a:focus-visible {
  opacity: 1;
  transform: translateY(-2px);
}

.socials a:focus-visible {
  outline: 1px solid var(--offwhite);
  outline-offset: 4px;
}

/* ---------- thread easter egg (covers the corner watermark) ---------- */

.thread-egg {
  appearance: none;
  background: none;
  border: none;
  padding: 10px;
  margin-top: -10px;
  margin-left: -10px;
  margin-right: calc(3.5vw - 10px);
  margin-bottom: 13vh;
  display: flex;
  cursor: pointer;
  color: var(--offwhite);
}

.thread-egg svg {
  width: 40px;
  height: 40px;
  overflow: visible;
}

.thread-egg .thread-anchor {
  fill: var(--offwhite);
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

.thread-egg .thread-path {
  fill: none;
  stroke: var(--offwhite);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.45, 0, 0.2, 1);
}

.thread-egg:hover .thread-path,
.thread-egg:focus-visible .thread-path,
.thread-egg.is-active .thread-path {
  stroke-dashoffset: 0;
}

.thread-egg:hover .thread-anchor,
.thread-egg:focus-visible .thread-anchor,
.thread-egg.is-active .thread-anchor {
  opacity: 0.9;
}

.thread-egg:focus-visible {
  outline: 1px solid var(--offwhite);
  outline-offset: 6px;
}

/* ---------- curtain (linen-to-reel crossfade) ---------- */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--linen);
  transition: opacity 0.7s ease;
}

.curtain.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .curtain { transition: opacity 0.3s ease; }
  .reel { transition: none; }
  .thread-egg .thread-path { transition: none; }
}

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  .tag { font-size: 9px; letter-spacing: 0.1em; }
  .thread-egg svg { width: 32px; height: 32px; }
}
