/* =========================================================================
   Kyndrawell landing — "Instrument for iron"
   Cinematic strength photography + a precise data-instrument UI.
   Type: Archivo Expanded (display) · Archivo (body) · IBM Plex Mono (technical)
   ========================================================================= */

:root {
  --base: #0a0a0b;
  --base-2: #0d0d10;
  --surface: #131318;
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.06);

  --fg: #f4f4f5;
  --muted: #9b9ba4;
  --faint: #6a6a73;

  --accent: #4ade80;
  --accent-press: #86efac;
  --accent-glow: rgba(74, 222, 128, 0.35);

  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;
  --sans: 'Archivo', system-ui, sans-serif;
  --display: 'Archivo Expanded', 'Archivo', system-ui, sans-serif;

  --pad: clamp(1.25rem, 5vw, 5rem);
  --maxw: 1280px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--base);
  color: var(--fg);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #04140a;
}

img,
video {
  display: block;
  max-width: 100%;
}

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

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    120% 90% at 50% 0%,
    transparent 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* ---- Header -------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1rem, 2.2vw, 1.6rem) var(--pad);
  mix-blend-mode: difference; /* stays legible over the hero video */
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  width: 1.85rem;
  height: 1.85rem;
  color: var(--accent);
  flex: none;
}

.brand-word {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--accent-glow);
  }
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
  padding-bottom: clamp(3rem, 8vh, 6rem);
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: #000 center / cover no-repeat;
  background-image: image-set(
    url('/assets/hero-poster.jpg') 1x
  );
  background-image: url('/assets/hero-poster.jpg');
}

.hero-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero-media video.is-playing {
  opacity: 1;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to top,
      rgba(10, 10, 11, 0.95) 0%,
      rgba(10, 10, 11, 0.45) 38%,
      rgba(10, 10, 11, 0.2) 65%,
      rgba(10, 10, 11, 0.55) 100%
    ),
    linear-gradient(to right, rgba(10, 10, 11, 0.6) 0%, transparent 60%);
}

.hero-inner {
  position: relative;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.4rem;
}

.eyebrow .tick {
  color: var(--faint);
}

.hero-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3.2rem, 13vw, 11rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: none;
  margin: 0;
}

.hero-title .dot,
.closing-title .dot {
  color: var(--accent);
}

/* line-by-line clip reveal */
.line {
  display: block;
  overflow: hidden;
}
.line > span {
  display: block;
  transform: translateY(110%);
  animation: lineUp 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-title .line:nth-child(1) > span {
  animation-delay: 0.15s;
}
.hero-title .line:nth-child(2) > span {
  animation-delay: 0.28s;
}
@keyframes lineUp {
  to {
    transform: translateY(0);
  }
}

.hero-sub {
  max-width: 46ch;
  margin: 1.8rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.32rem);
  line-height: 1.55;
}

.readout {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
  margin: 2.4rem 0 0;
  padding: 1.2rem 0 0;
  border-top: 1px solid var(--line);
}

.readout li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--mono);
}
.readout .k {
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: var(--faint);
}
.readout .v {
  font-size: 0.95rem;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.scroll-cue {
  position: absolute;
  right: var(--pad);
  bottom: clamp(2rem, 6vh, 4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute;
  top: -50%;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--accent);
  animation: scrollDrop 2s ease-in-out infinite;
}
@keyframes scrollDrop {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(300%);
  }
}

/* ---- Ticker -------------------------------------------------------------- */
.ticker {
  display: flex;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--base-2);
  padding: 0.9rem 0;
  white-space: nowrap;
  user-select: none;
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 1.4rem;
  padding-left: 1.4rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  animation: marquee 38s linear infinite;
}
.ticker-track .sep {
  color: var(--accent);
}
@keyframes marquee {
  to {
    transform: translateX(-100%);
  }
}

/* ---- Manifesto ----------------------------------------------------------- */
.manifesto {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(5rem, 14vh, 11rem) var(--pad);
}
.manifesto p {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 1rem + 3.4vw, 3.4rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  max-width: 22ch;
  margin: 0 auto;
  text-align: left;
}
.manifesto em {
  font-style: normal;
  color: var(--faint);
}

/* ---- Features ------------------------------------------------------------ */
.features {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(4rem, 10vh, 8rem);
  display: flex;
  flex-direction: column;
  gap: clamp(5rem, 12vh, 9rem);
}

.feature {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}
.feature--reverse .feature-media {
  order: 2;
}

.feature-media {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
}
.feature-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.feature:hover .feature-media img {
  transform: scale(1.04);
}
/* corner ticks */
.feature-media::before,
.feature-media::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 2;
  pointer-events: none;
}
.feature-media::before {
  top: 10px;
  left: 10px;
  border-top: 1.5px solid var(--accent);
  border-left: 1.5px solid var(--accent);
}
.feature-media::after {
  bottom: 10px;
  right: 10px;
  border-bottom: 1.5px solid var(--accent);
  border-right: 1.5px solid var(--accent);
}

.feature-index {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.feature-kicker {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}
.feature-copy h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.7rem, 1rem + 2.4vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.1rem;
}
.feature-body {
  color: var(--muted);
  margin: 0;
  max-width: 42ch;
  font-size: 1.05rem;
}

/* ---- Closing ------------------------------------------------------------- */
.closing {
  position: relative;
  text-align: center;
  padding: clamp(6rem, 18vh, 13rem) var(--pad);
  border-top: 1px solid var(--line);
  background:
    radial-gradient(70% 130% at 50% 120%, rgba(74, 222, 128, 0.12), transparent 70%),
    var(--base);
}
.closing-eyebrow {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.6rem;
}
.closing-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3rem, 14vw, 10rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin: 0;
}
.closing-domain {
  font-family: var(--mono);
  font-size: clamp(0.9rem, 0.8rem + 0.6vw, 1.2rem);
  letter-spacing: 0.2em;
  color: var(--accent);
  margin: 2.2rem 0 0;
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 2.4rem var(--pad);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.foot-brand .brand-mark {
  width: 1.3rem;
  height: 1.3rem;
  color: var(--accent);
}
.foot-note {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
}

/* ---- Reveal animations --------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.8s ease,
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.feature.reveal {
  transform: translateY(40px);
}

/* hero children reveal immediately (staggered) */
.hero .reveal {
  animation: heroReveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}
.hero .eyebrow {
  animation-delay: 0.05s;
}
.hero .hero-sub {
  animation-delay: 0.5s;
}
.hero .readout {
  animation-delay: 0.66s;
}
.hero .scroll-cue {
  animation-delay: 0.9s;
}
@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 820px) {
  .feature,
  .feature--reverse {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
  .feature--reverse .feature-media {
    order: 0;
  }
  .scroll-cue {
    display: none;
  }
  .hero {
    padding-bottom: 3rem;
  }
  .manifesto p,
  .feature-body {
    max-width: none;
  }
}

@media (max-width: 540px) {
  .status span:not(.status-dot) {
    display: none;
  }
  .readout {
    gap: 1rem 2rem;
  }
}

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .line > span {
    transform: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
