/* ==========================================================================
   VpINTERIORS — coming soon
   Dark graphite ground, drifting colour mesh, kinetic type.
   TODO: brand — palette and type stacks live in :root, change them here only.
   ========================================================================== */

:root {
  /* Palette */
  --ground:      #0a0b0d;
  --bone:        #f2ece4;
  --bone-dim:    #a9a49c;
  --hairline:    rgba(242, 236, 228, 0.14);
  --accent:      #e8a06a;   /* copper — TODO: swap for the VpINTERIORS brand colour */
  --accent-2:    #6f93b5;   /* cool counter-light */
  --accent-3:    #7c5cc4;   /* violet, used faintly in the mesh */

  /* Type */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
           "Times New Roman", serif;
  --mono:  ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono",
           "Roboto Mono", Menlo, Consolas, monospace;

  /* Fluid scale. Display size is capped by viewport HEIGHT (svh) as well as
     width, so the page holds one screen instead of forcing a scroll. */
  --step-display: clamp(2.25rem, min(1.2rem + 4.6vw, 9.5svh), 5.25rem);
  --step-lede:    clamp(1rem, 0.95rem + 0.5vw, 1.25rem);
  --step-small:   clamp(0.6875rem, 0.66rem + 0.15vw, 0.78rem);

  /* Rhythm — bands shrink on short viewports. */
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --band:   clamp(1.25rem, min(4vw, 4.5svh), 3rem);
  --tracking-wide: 0.18em;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* --- Reset ---------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--ground);
  color: var(--bone);
  font-family: var(--serif);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms var(--ease);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: var(--gutter);
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--bone);
  color: var(--ground);
}

/* --- Backdrop -------------------------------------------------------------
   Decorative layers behind the content: blurred mesh blobs give the glow, the
   grid gives it structure, grain kills gradient banding, vignette calms the
   edges so type always sits on a quiet ground.
   -------------------------------------------------------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mesh {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  will-change: transform;
}

.mesh--a {
  width: 62vmax; height: 62vmax;
  top: -28vmax; left: -18vmax;
  background: radial-gradient(circle at 50% 50%, var(--accent), transparent 68%);
  animation: drift-a 26s var(--ease) infinite alternate;
}

.mesh--b {
  width: 55vmax; height: 55vmax;
  right: -22vmax; top: 8vmax;
  background: radial-gradient(circle at 50% 50%, var(--accent-2), transparent 70%);
  opacity: 0.38;
  animation: drift-b 32s var(--ease) infinite alternate;
}

.mesh--c {
  width: 48vmax; height: 48vmax;
  left: 24vmax; bottom: -30vmax;
  background: radial-gradient(circle at 50% 50%, var(--accent-3), transparent 72%);
  opacity: 0.3;
  animation: drift-c 38s var(--ease) infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(12vw, 8vh, 0) scale(1.18); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to   { transform: translate3d(-10vw, 12vh, 0) scale(0.92); }
}
@keyframes drift-c {
  from { transform: translate3d(0, 0, 0) scale(0.95); }
  to   { transform: translate3d(8vw, -10vh, 0) scale(1.15); }
}

/* Hairline grid, faded out toward the edges. */
.grid {
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(to right, rgba(242, 236, 228, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(242, 236, 228, 0.055) 1px, transparent 1px);
  background-size: clamp(48px, 7vw, 96px) clamp(48px, 7vw, 96px);
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 35%, transparent 100%);
  animation: grid-in 1.8s var(--ease) both 300ms;
}

@keyframes grid-in {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: none; }
}

/* Film grain — inline SVG turbulence, no network request. */
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Pointer-follow glow. JS sets --mx/--my; without JS it stays hidden. */
.cursor-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(
    28rem 28rem at var(--mx, 50%) var(--my, 40%),
    rgba(232, 160, 106, 0.16),
    transparent 70%
  );
  transition: opacity 600ms var(--ease);
}
.cursor-glow.is-live { opacity: 1; }

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 40%, rgba(10, 11, 13, 0.75) 100%),
    linear-gradient(to bottom, rgba(10, 11, 13, 0.4), transparent 30%, rgba(10, 11, 13, 0.6));
}

/* --- Layout shell --------------------------------------------------------- */

.frame {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--band);
  min-height: 100svh;
  max-width: 78rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block:
    calc(env(safe-area-inset-top, 0px) + var(--band))
    calc(env(safe-area-inset-bottom, 0px) + var(--band));
}

/* --- Header --------------------------------------------------------------- */

.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-bottom: var(--band);
  border-bottom: 1px solid var(--hairline);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: var(--step-small);
  letter-spacing: 0.22em;
}
.wordmark:hover { color: var(--accent); }

.wordmark-mark {
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
  animation: mark-spin 9s linear infinite;
}
@keyframes mark-spin {
  to { transform: rotate(405deg); }
}

.head-meta {
  font-family: var(--mono);
  font-size: var(--step-small);
  letter-spacing: 0.1em;
  color: var(--bone-dim);
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.75rem, min(2.5vw, 2.5svh), 1.75rem);
  padding-block: var(--band);
}

.status {
  display: inline-flex;
  align-items: center;
  align-self: start;
  gap: 0.6rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(20, 22, 26, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: var(--step-small);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--bone-dim);
}

.status-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(232, 160, 106, 0.55); }
  70%  { box-shadow: 0 0 0 0.6rem rgba(232, 160, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 160, 106, 0); }
}

.display {
  max-width: 16ch;
  font-size: var(--step-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

/* Each line clips its words, so they rise into view from behind a mask. */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em; /* room for descenders inside the clip */
}

.word {
  display: inline-block;
  background: linear-gradient(100deg, var(--bone) 30%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.display em {
  font-style: italic;
  background: linear-gradient(100deg, var(--bone-dim) 10%, var(--accent) 95%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Without background-clip: text the gradient fill would paint over the glyphs
   and the headline would read as blank. Fall back to flat bone. */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .word,
  .display em {
    background: none;
    color: var(--bone);
  }
  .display em { color: var(--bone-dim); }
}

.lede {
  max-width: 48ch;
  font-size: var(--step-lede);
  line-height: 1.6;
  color: var(--bone-dim);
  text-wrap: pretty;
}

/* Hairline that draws itself in from the left. */
.rule {
  height: 1px;
  background: linear-gradient(to right, var(--hairline), transparent);
  transform-origin: left;
}

/* --- Marquee -------------------------------------------------------------- */

.marquee {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 34s linear infinite;
}
.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track { animation-play-state: paused; }

@keyframes marquee {
  to { transform: translateX(-50%); }
}

.services {
  display: flex;
  flex-shrink: 0;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-right: clamp(1.5rem, 4vw, 3rem);
  font-family: var(--mono);
  font-size: var(--step-small);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-dim);
  white-space: nowrap;
}
.services li::before {
  content: "\25C6";
  margin-right: 0.7rem;
  color: var(--accent);
  font-size: 0.7em;
  vertical-align: 0.15em;
}

/* --- Footer --------------------------------------------------------------- */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem clamp(1.5rem, 4vw, 3rem);
  padding-top: var(--band);
  border-top: 1px solid var(--hairline);
  font-size: var(--step-lede);
}

.foot-label,
.social,
.copyright {
  font-family: var(--mono);
  font-size: var(--step-small);
  letter-spacing: 0.12em;
}

.foot-label {
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  color: var(--bone-dim);
}

.contact p:last-child { line-height: 1.7; }
.contact a { border-bottom: 1px solid var(--hairline); }
.contact a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  text-transform: uppercase;
}

/* Underline that wipes in from the left on hover. */
.social a {
  position: relative;
  padding-bottom: 0.25rem;
}
.social a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 320ms var(--ease);
}
.social a:hover { color: var(--accent); }
.social a:hover::after,
.social a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.copyright { color: var(--bone-dim); }

/* --- Entrance -------------------------------------------------------------
   One timeline, driven by --i on each element. CSS animations, not a JS class
   flip: requestAnimationFrame never fires in a background tab, which would
   leave the page blank until it got focus. With no JS at all the .js hook is
   absent, nothing animates, and everything simply shows — the right fallback.
   -------------------------------------------------------------------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(1.1em); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(0.75rem); }
  to   { opacity: 1; transform: none; }
}
@keyframes draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.js .word { animation: rise 900ms var(--ease) both calc(var(--i, 0) * 110ms + 150ms); }

.js .status,
.js .lede,
.js .marquee,
.js .site-foot { animation: fade-up 800ms var(--ease) both calc(var(--i, 0) * 110ms + 150ms); }

.js .rule { animation: draw 900ms var(--ease) both calc(var(--i, 0) * 110ms + 150ms); }

.js .site-head { animation: fade-up 800ms var(--ease) both 100ms; }

/* --- Reduced motion -------------------------------------------------------
   Everything ambient stops; entrances collapse to nothing.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .mesh,
  .status-dot,
  .wordmark-mark,
  .marquee-track,
  .grid { animation: none !important; }

  .cursor-glow { display: none; }

  .js .word,
  .js .status,
  .js .lede,
  .js .marquee,
  .js .rule,
  .js .site-head,
  .js .site-foot {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  * { transition-duration: 0.01ms !important; }
}

/* --- Short viewports ------------------------------------------------------
   Laptop-class windows (1440x900 included) and landscape phones: trim the
   display type and the bands so the page still reads as one full-screen
   poster instead of scrolling.
   -------------------------------------------------------------------------- */

@media (max-height: 960px) {
  :root {
    --step-display: clamp(2rem, min(1.1rem + 4.2vw, 8svh), 4.5rem);
    --band: clamp(1rem, 3svh, 1.75rem);
  }

  .lede {
    max-width: 62ch;
    font-size: 1rem;
    line-height: 1.55;
  }
}

/* --- Print ---------------------------------------------------------------- */

@media print {
  body { background: #fff; color: #000; }
  .backdrop, .skip-link { display: none; }
  .word, .display em {
    background: none;
    color: #000;
    -webkit-text-fill-color: #000;
  }
}
