/* Universal Constructor — company site
   Skyline collage: photo + pixel-dither city + binary-flow pyramid plate. */

:root {
  --bg: #0c0d12;
  --bg2: #14151c;
  --ink: #f3f2ec;
  --dim: #a8a9b4;
  --faint: #6b6d7a;
  --cobalt: #2540e6;
  --cobalt-soft: #8b97e8;
  --magenta: #e625a0;
  --magenta-soft: #f0a0d0;
  --chalk: #f7f7f4;
  --line: rgba(243, 242, 236, 0.12);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Serif", "Iowan Old Style", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* —— top bar —— */
.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 18px clamp(20px, 4vw, 40px);
  mix-blend-mode: difference;
}

.top nav {
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.top nav a {
  opacity: 0.75;
  transition: opacity 0.25s var(--ease);
}

.top nav a:hover {
  opacity: 1;
}

.cta-link {
  opacity: 1 !important;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* —— hero —— */
.hero {
  position: relative;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  padding: 0 clamp(20px, 5vw, 56px) clamp(40px, 8vh, 72px);
  isolation: isolate;
}

.skyline {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #0a0b10;
  /* nothing shows until the shaders are mounted — no raw-photo flash */
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}

.skyline.ready,
.skyline.fallback {
  opacity: 1;
}

.skyline.fallback .photo-base {
  opacity: 1;
  filter: none;
}

.photo-base {
  position: absolute;
  inset: 0;
  background: center / cover no-repeat url("assets/skyline.webp");
  /* keep a little of the real photo under the paper plate */
  opacity: 0.55;
  filter: saturate(0.85) contrast(1.05);
}

.shader-layer {
  position: absolute;
  inset: 0;
}

.shader-layer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.shader-layer.city {
  opacity: 0.85;
  filter: saturate(0.82) contrast(1.04);
}

/* animated dither current sweeping across the city */
.shader-layer.flow {
  mix-blend-mode: screen;
  opacity: 0.45;
}

/* Pyramid: liquid-metal plate clipped hard to the exact silhouette; the
   binary shader draws digits-only on top (it masks itself in GLSL). */
.shader-layer.pyramid.metal {
  -webkit-mask-image: url("assets/transamerica-mask.png?v=6");
  mask-image: url("assets/transamerica-mask.png?v=6");
  -webkit-mask-size: cover;
  mask-size: cover;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* the plate sits above every other layer on the page and scrolls WITH the
   scene (absolute, not fixed — the photo is anchored to the document too) */
#pyramid-stack {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}

#pyramid-stack.ready {
  opacity: 1;
}

.skyline-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(12, 13, 18, 0.35) 0%,
      transparent 28%,
      rgba(12, 13, 18, 0.55) 72%,
      rgba(12, 13, 18, 0.92) 100%
    ),
    linear-gradient(
      90deg,
      rgba(12, 13, 18, 0.45) 0%,
      transparent 35%,
      transparent 65%,
      rgba(12, 13, 18, 0.35) 100%
    );
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding-bottom: 8px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(22px, 3.2vw, 34px);
  letter-spacing: -0.01em;
  color: var(--chalk);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
  animation: rise 0.9s var(--ease) both;
}

.brand-lockup img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
}

.contact-line {
  font-size: clamp(16px, 1.8vw, 20px);
  color: color-mix(in srgb, var(--chalk) 85%, var(--dim));
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.35);
  animation: rise 0.95s var(--ease) 0.08s both;
}

.contact-line a {
  color: var(--magenta-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--magenta) 45%, transparent);
  transition:
    color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.contact-line a:hover {
  color: var(--chalk);
  border-color: var(--magenta);
}

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

@media (prefers-reduced-motion: reduce) {
  .brand-lockup,
  .contact-line {
    animation: none !important;
  }
}

@media (max-width: 640px) {
  .brand-lockup {
    font-size: 20px;
  }
  .brand-lockup img {
    width: 32px;
    height: 32px;
  }
}
