/* ==========================================================================
   HyperianLabs — design tokens
   ========================================================================== */

:root {
  --bg: #050505;
  --bg-raised: #0b0b0d;
  --bg-raised-2: #101013;
  --white: #f5f5f5;
  --silver: #c7c7c7;
  --grey: #777777;
  --blue: #4f6bff;
  --violet: #6757ff;
  --line: rgba(199, 199, 199, 0.16);
  --line-strong: rgba(199, 199, 199, 0.34);

  --gradient-energy: linear-gradient(120deg, var(--silver) 0%, var(--white) 32%, var(--blue) 66%, var(--violet) 100%);
  --gradient-energy-soft: linear-gradient(120deg, rgba(199, 199, 199, 0.9) 0%, rgba(245, 245, 245, 0.95) 32%, rgba(79, 107, 255, 0.95) 66%, rgba(103, 87, 255, 0.95) 100%);

  --font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1280px;
  --gutter: clamp(1.25rem, 5vw, 4rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.3s;
  --dur-med: 0.7s;
  --dur-slow: 1.1s;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

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

h1, h2, h3, p { margin: 0; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

@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;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Utility
   ========================================================================== */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--white);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 4px;
  z-index: 1000;
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: 1rem; }

.section-head {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}
.section-head > p {
  color: var(--grey);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  max-width: 42ch;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0.95rem 1.75rem;
  border-radius: 2px;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn--primary {
  background: var(--white);
  color: var(--bg);
  border: 1px solid var(--white);
}
.btn--primary:hover {
  box-shadow: 0 0 0 1px var(--blue), 0 8px 30px -8px rgba(79, 107, 255, 0.55);
  transform: translateY(-2px);
}
.btn--ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--blue);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px -10px rgba(103, 87, 255, 0.4);
}
.btn span { transition: transform var(--dur-fast) var(--ease); }
.btn:hover span { transform: translateX(3px); }

/* ==========================================================================
   Nav
   ========================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), backdrop-filter var(--dur-fast) var(--ease);
}
.nav.nav--scrolled {
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}

.nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 76px;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-right: auto;
}
.nav__mark {
  display: block;
  width: 22px;
  height: 28px;
}
.nav__mark img { width: 100%; height: 100%; object-fit: contain; }

.nav__word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--white);
}
.nav__word-accent { color: var(--blue); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}
.nav__links a {
  font-size: 0.9rem;
  color: var(--silver);
  position: relative;
  padding: 0.25rem 0;
  transition: color var(--dur-fast) var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 1px;
  background: var(--gradient-energy);
  transition: right var(--dur-fast) var(--ease);
}
.nav__links a:hover { color: var(--white); }
.nav__links a:hover::after { right: 0; }

.nav__cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  border: 1px solid var(--line-strong);
  padding: 0.55rem 1.1rem;
  border-radius: 2px;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.nav__cta:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
}
.nav__toggle span {
  width: 20px;
  height: 1.5px;
  background: var(--white);
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav__mobile {
  display: none;
  flex-direction: column;
  padding: 0.5rem var(--gutter) 1.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.8);
}
.nav__mobile a {
  padding: 0.85rem 0;
  font-size: 1rem;
  color: var(--silver);
  border-bottom: 1px solid var(--line);
}
.nav__mobile.is-open { display: flex; }

@media (max-width: 860px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem var(--gutter) 4rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 45% at 50% 30%, rgba(79, 107, 255, 0.08), transparent 70%),
    var(--bg);
}

.hero__mark {
  position: absolute;
  top: 50%;
  right: -8%;
  width: min(46vw, 640px);
  transform: translateY(-50%);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
  isolation: isolate;
}
@media (max-width: 860px) {
  .hero__mark { width: min(58vw, 340px); right: -14%; opacity: 0.28; }
}
@media (max-width: 700px) {
  .hero__mark { top: auto; bottom: -10%; right: -22%; transform: none; width: min(52vw, 260px); opacity: 0.22; }
}
.hero__mark-base { width: 100%; display: block; }
.hero__mark-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.9) 47%, rgba(79, 107, 255, 0.9) 53%, rgba(103, 87, 255, 0.9) 58%, transparent 72%);
  background-size: 320% 100%;
  -webkit-mask-image: url("/assets/logo-mark.png");
  mask-image: url("/assets/logo-mark.png");
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  opacity: 0.85;
  animation: sheen 9s ease-in-out infinite;
}
@keyframes sheen {
  0% { background-position: 110% 0; }
  50% { background-position: -10% 0; }
  100% { background-position: 110% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__mark-sheen { animation: none; background-position: 40% 0; }
}

.hero__content { position: relative; z-index: 1; max-width: 920px; }

.hero__headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 5.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 1.75rem;
}

.hero__sub {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--silver);
  margin-bottom: 3rem;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.hero__scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  z-index: 1;
  color: var(--grey);
  transition: color var(--dur-fast) var(--ease);
}
.hero__scroll-cue:hover,
.hero__scroll-cue:focus-visible { color: var(--silver); }
.hero__scroll-cue-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3em;
}
.hero__scroll-cue-line {
  display: block;
  width: 1px;
  height: 40px;
  background: var(--line-strong);
  overflow: hidden;
}
.hero__scroll-cue-line span {
  display: block;
  width: 100%;
  height: 40%;
  background: var(--gradient-energy);
  animation: cue 2.6s ease-in-out infinite;
}
@keyframes cue {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(250%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__scroll-cue-line span { animation: none; transform: translateY(60%); }
}

/* ==========================================================================
   Products
   ========================================================================== */

.products { padding: 8rem 0 9rem; }
.products .section-head { margin-bottom: 3.5rem; }

.product-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.product-card {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2.75rem;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: 0 24px 60px -24px rgba(79, 107, 255, 0.35);
}

.product-card__motif {
  position: absolute;
  top: -6%;
  right: -6%;
  width: 62%;
  max-width: 260px;
  opacity: 0.5;
  transition: transform var(--dur-slow) var(--ease), opacity var(--dur-slow) var(--ease);
}
.product-card:hover .product-card__motif {
  transform: translate(-6px, 6px) scale(1.03);
  opacity: 0.85;
}
.motif-stroke {
  stroke: var(--silver);
  stroke-width: 1.4;
  fill: none;
}
.motif-stroke--dim { stroke: var(--grey); opacity: 0.6; }
.motif-stroke--accent { stroke: var(--blue); }
.motif-path { stroke-linecap: round; }
.motif-dot { fill: var(--silver); stroke: none; }
.motif-dot.motif-stroke--accent { fill: var(--blue); stroke: none; }

.product-card__body { position: relative; z-index: 1; }
.product-card__eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--grey);
  margin-bottom: 0.85rem;
}
.product-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.85rem, 2.6vw, 2.5rem);
  letter-spacing: -0.01em;
  margin-bottom: 0.9rem;
}
.product-card__desc {
  color: var(--silver);
  font-size: 0.98rem;
  max-width: 34ch;
  margin-bottom: 1.75rem;
}
.product-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--white);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.2rem;
  transition: border-color var(--dur-fast) var(--ease);
}
.product-card__cta span { transition: transform var(--dur-fast) var(--ease); }
.product-card:hover .product-card__cta { border-color: var(--blue); }
.product-card:hover .product-card__cta span { transform: translateX(4px); }

@media (max-width: 760px) {
  .product-grid { grid-template-columns: 1fr; }
  .product-card { padding: 2rem; min-height: 280px; }
  .product-card__motif {
    width: 34%;
    max-width: 130px;
    top: -4%;
    right: -4%;
    opacity: 0.32;
  }
  .product-card:hover .product-card__motif,
  .product-card:active .product-card__motif {
    opacity: 0.55;
  }
}

/* ==========================================================================
   The Lab
   ========================================================================== */

.lab { padding: 8rem 0 9rem; border-top: 1px solid var(--line); }
.lab__kicker {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--blue);
  margin-bottom: 1rem;
}
.lab__sub { margin-top: 1rem; max-width: 60ch !important; }

.pipeline {
  max-width: var(--container);
  margin: 5rem auto 0;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.pipeline::before {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 9px;
  height: 1px;
  background: var(--line);
}
.pipeline::after {
  content: "";
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 9px;
  height: 1px;
  background: var(--gradient-energy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.6s var(--ease);
}
.pipeline.is-visible::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  .pipeline::after { transform: scaleX(1); transition: none; }
}

.pipeline__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  position: relative;
  z-index: 1;
}
.pipeline__stage::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--silver);
}
.pipeline__index {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--grey);
}
.pipeline__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  letter-spacing: 0.02em;
}

@media (max-width: 760px) {
  .pipeline { flex-direction: column; align-items: flex-start; gap: 2.5rem; }
  .pipeline::before, .pipeline::after { left: 9px; right: auto; top: 0; bottom: 0; width: 1px; height: calc(100% - 2rem); }
  .pipeline::after { transform: scaleY(0); transform-origin: top; }
  .pipeline.is-visible::after { transform: scaleY(1); }
  .pipeline__stage { flex-direction: row; align-items: center; }
}

/* ==========================================================================
   What We Build
   ========================================================================== */

.build { padding: 8rem 0 9rem; border-top: 1px solid var(--line); }
.build .section-head { margin-bottom: 3rem; }

.build-list {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.build-list__item {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 7vw, 4.5rem);
  letter-spacing: -0.02em;
  padding: 0.55em 0;
  border-top: 1px solid var(--line);
  color: var(--grey);
  cursor: default;
  transform: translateX(0);
  transition: color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.build-list__item:last-child { border-bottom: 1px solid var(--line); }
.build-list__item:hover {
  color: var(--white);
  transform: translateX(0.35em);
  background: linear-gradient(90deg, rgba(79, 107, 255, 0.06), transparent 40%);
}

/* ==========================================================================
   Closing CTA
   ========================================================================== */

.closing {
  position: relative;
  padding: 10rem var(--gutter) 9rem;
  text-align: center;
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.closing__mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(45vw, 460px);
  transform: translate(-50%, -50%);
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
  isolation: isolate;
}
.closing__eyebrow {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  color: var(--grey);
  margin-bottom: 1.5rem;
}
.closing h2 {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5.5vw, 4.25rem);
  letter-spacing: -0.02em;
  max-width: 800px;
  margin: 0 auto 1.5rem;
}
.closing__sub {
  position: relative;
  z-index: 1;
  color: var(--silver);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  max-width: 46ch;
  margin: 0 auto 2.75rem;
}
.closing .btn { position: relative; z-index: 1; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 5rem var(--gutter) 2.5rem;
}
.site-footer__top {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3.5rem;
}
.site-footer__brand p {
  color: var(--grey);
  font-size: 0.9rem;
  margin-top: 0.85rem;
}
.site-footer__col h3 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--grey);
  margin-bottom: 1.1rem;
}
.site-footer__col {
  display: flex;
  flex-direction: column;
}
.site-footer__col a {
  color: var(--silver);
  font-size: 0.9rem;
  padding: 0.45rem 0;
  transition: color var(--dur-fast) var(--ease);
}
.site-footer__col a:hover { color: var(--white); }

.site-footer__bottom {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  color: var(--grey);
  font-size: 0.82rem;
}

@media (max-width: 700px) {
  .site-footer__top { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 700px) {
  .hero { min-height: 0; padding: 7rem var(--gutter) 4rem; }
  .hero__scroll-cue { position: static; transform: none; margin: 4rem auto 0; }
  .products, .lab, .build { padding: 5.5rem 0 6rem; }
  .closing { padding: 6.5rem var(--gutter) 6rem; }
}
