/* =========================================================
   ARKON GROUP — Division Portal
   Cinematic / dark · brand blue #005587
   Static, no build. Matches the Arkon Technology design system.
   ========================================================= */

:root {
  --base: #060a12;
  --surface: #0b1320;
  --ink: #eaf1fb;
  --muted: #93a4bd;
  --faint: #5a6b84;
  --line: #1b2940;
  --brand: #005587;
  --brand-bright: #38a7dd;
  --accent: #7ab8db;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);

  --pad: clamp(1.4rem, 3.2vw, 3rem);
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden; /* desktop: single-screen portal */
}

::selection {
  background: color-mix(in oklab, var(--brand-bright) 45%, transparent);
  color: #fff;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: -6px;
  border-radius: 4px;
}

/* ---- Film grain overlay ---- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.045;
  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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Masthead ---- */
.masthead {
  position: fixed;
  top: clamp(1.25rem, 3vh, 2.25rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
  pointer-events: none;
  animation: drop-in 0.9s var(--ease) both;
}

.wordmark {
  height: clamp(22px, 2.6vh, 30px);
  width: auto;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.6));
}

.kicker {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Stage / panels ---- */
.stage {
  display: flex;
  height: 100dvh;
  width: 100%;
}

.panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  isolation: isolate;
  transition: flex-grow 0.65s var(--ease);
  animation: panel-in 0.9s var(--ease) both;
}
.panel--construction {
  --tint: #e6a64e;
  --glow: 230, 166, 78;
  animation-delay: 0.13s;
}
.panel--technology {
  --tint: #46b4e6;
  --glow: 56, 167, 221;
  animation-delay: 0.21s;
}
.panel--lighting {
  --tint: #c08cf4;
  --glow: 176, 124, 240;
  animation-delay: 0.05s;
}
.panel + .panel {
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

/* Background: brand-dark gradient + division glow + texture (fallback layer) */
.panel__bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  transform: scale(1.01);
  filter: brightness(0.5) saturate(0.82);
  transition:
    transform 1.1s var(--ease),
    filter 0.65s var(--ease);
  background:
    radial-gradient(
      125% 85% at 50% 122%,
      rgba(var(--glow), 0.32),
      transparent 62%
    ),
    linear-gradient(180deg, var(--surface) 0%, var(--base) 78%);
}
.panel__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  transition: opacity 0.65s var(--ease);
}
.panel--construction .panel__bg::before {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0 43px,
      rgba(255, 255, 255, 0.045) 43px 44px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 43px,
      rgba(255, 255, 255, 0.045) 43px 44px
    );
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 70%);
  mask-image: linear-gradient(180deg, transparent, #000 70%);
}
.panel--technology .panel__bg::before {
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.07) 1px,
    transparent 1.6px
  );
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 70%);
  mask-image: linear-gradient(180deg, transparent, #000 70%);
}
.panel--lighting .panel__bg::before {
  background-image: repeating-conic-gradient(
    from 202deg at 50% 116%,
    rgba(255, 255, 255, 0.06) 0deg 1.5deg,
    transparent 1.5deg 11deg
  );
}

/* Background video — drop files into assets/ (gradient is the fallback).
   Landscape 16:9 footage + object-fit cover: the clip fills the panel HEIGHT,
   so expanding a panel just reveals more WIDTH — no zoom, no crop change,
   no fill layer needed. Hover only brightens (never scales). */
.panel__video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: transparent;
  /* The poster attribute is the placeholder until a frame loads, so imagery
     shows even when autoplay is deferred / data-saver is on / the connection
     is slow. The video paints over the poster once it plays. */
  filter: brightness(0.52) saturate(0.95);
  transition: filter 0.65s var(--ease);
}
.panel--lighting .panel__video {
  object-position: 62% center; /* bias the resting crop toward the lit tower */
}
.panel:hover .panel__video,
.panel:focus-visible .panel__video {
  filter: brightness(0.8) saturate(1.05);
}

/* Shade for text legibility */
.panel__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(6, 10, 18, 0.34) 0%,
    rgba(6, 10, 18, 0.58) 48%,
    rgba(6, 10, 18, 0.95) 100%
  );
}

/* Content */
.panel__content {
  position: absolute;
  inset: 0;
  display: block;
  padding: var(--pad);
}
.panel__index {
  position: absolute;
  top: var(--pad);
  left: var(--pad);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--tint);
  opacity: 0.85;
}
.panel__body {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: var(--pad);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.panel__kicker {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tint);
}
.panel__bar {
  display: block;
  width: 38px;
  height: 3px;
  margin: 0.85rem 0;
  border-radius: 2px;
  background: var(--tint);
  box-shadow: 0 0 18px rgba(var(--glow), 0.7);
  transition: width 0.6s var(--ease);
}
.panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.3vw, 2.9rem);
  line-height: 1.12;
  text-wrap: balance;
  letter-spacing: -0.015em;
  color: #fff;
}
.panel__tagline {
  margin-top: 0.85rem;
  min-height: 3em; /* reserve ~2 lines so all titles align across panels */
  max-width: 34ch;
  font-size: clamp(0.88rem, 1vw, 1rem);
  line-height: 1.5;
  color: var(--muted);
}
.panel__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.panel__arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.4s var(--ease);
}
.panel__domain {
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--faint);
}

/* Bloom on hover/focus: reveal kicker/bar/tagline/cta */
.panel__kicker,
.panel__bar,
.panel__tagline,
.panel__cta {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease),
    width 0.6s var(--ease);
}
.panel__bar {
  transform: translateY(16px) scaleX(0.4);
  transform-origin: left;
}
.panel:hover .panel__kicker,
.panel:focus-visible .panel__kicker,
.panel:hover .panel__tagline,
.panel:focus-visible .panel__tagline,
.panel:hover .panel__cta,
.panel:focus-visible .panel__cta,
.panel:hover .panel__bar,
.panel:focus-visible .panel__bar {
  opacity: 1;
  transform: translateY(0);
}
.panel:hover .panel__bar,
.panel:focus-visible .panel__bar {
  transform: translateY(0) scaleX(1);
}
.panel:hover .panel__bg,
.panel:focus-visible .panel__bg {
  transform: scale(1.07);
  filter: brightness(0.88) saturate(1.06);
}
.panel:hover .panel__bg::before,
.panel:focus-visible .panel__bg::before {
  opacity: 0.95;
}
.panel:hover .panel__arrow,
.panel:focus-visible .panel__arrow {
  transform: translateX(4px);
}

/* Desktop expand-on-hover */
@media (hover: hover) and (min-width: 861px) {
  .stage:hover .panel {
    flex-grow: 0.72;
  }
  .stage .panel:hover,
  .stage .panel:focus-visible {
    flex-grow: 2.3;
  }
}

/* On large screens, surface the title at rest too */
@media (min-width: 861px) {
  .panel__title {
    transition: transform 0.5s var(--ease);
  }
}

/* ---- Footer ---- */
.footer {
  position: fixed;
  bottom: clamp(0.85rem, 2.2vh, 1.6rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  animation: drop-in 0.9s 0.3s var(--ease) both;
}
.footer__mail {
  color: var(--muted);
  text-decoration: none;
  pointer-events: auto;
  transition: color 0.3s var(--ease);
}
.footer__mail:hover {
  color: var(--accent);
}

/* =========================================================
   Mobile / tablet — stack the panels vertically
   ========================================================= */
@media (max-width: 860px) {
  body {
    overflow-y: auto;
  }
  .stage {
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
    padding: calc(clamp(1.25rem, 3vh, 2.25rem) + 64px) 0 0;
  }
  /* Footer flows after the panels instead of floating over the last one */
  .footer {
    position: static;
    transform: none;
    justify-content: center;
    padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    background: var(--base);
  }
  .panel {
    flex: 1 1 auto;
    min-height: 33vh;
  }
  .panel + .panel {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  /* Always show content on touch — no hover to rely on */
  .panel__bg {
    filter: brightness(0.7) saturate(0.95);
  }
  .panel__video {
    filter: brightness(0.72) saturate(1);
  }
  .panel__kicker,
  .panel__bar,
  .panel__tagline,
  .panel__cta {
    opacity: 1;
    transform: none;
  }
  .panel__bar {
    transform: scaleX(1);
  }
}

/* ---- Keyframes ---- */
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes drop-in {
  from {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .panel__video {
    display: none; /* fall back to the static gradient — no motion */
  }
  .panel__kicker,
  .panel__bar,
  .panel__tagline,
  .panel__cta {
    opacity: 1;
    transform: none;
  }
}
