/* ============================================================
   Latent Space Consulting — bold black & white one-pager
   ============================================================ */

:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --grey: #6b6b6b;
  --line: rgba(10, 10, 10, 0.12);
  --line-inv: rgba(255, 255, 255, 0.18);
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --pad-x: clamp(24px, 6vw, 96px);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.locked { overflow: hidden; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

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

a { color: inherit; }

.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding: 6px 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.num {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--grey);
}

/* ============ LOADING SCREEN ============ */

#preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

/* Wrapper handles fade/scale; the logo itself handles the loading spin,
   so the two transforms don't conflict. */
#preloader .pl-logo-wrap {
  opacity: 0;
  transform: scale(0.85);
  animation: pl-in 1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}

#preloader .pl-logo {
  width: clamp(90px, 12vw, 140px);
  filter: invert(1);            /* black star -> white, transparency preserved */
  /* Two full turns; the ease-out tail decelerates the spin so the star
     settles upright (720deg = normal position) just as the title appears. */
  animation: pl-spin 2.05s cubic-bezier(0.6, 0.05, 0.25, 1) 0.25s forwards;
}

#preloader .pl-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(18px, 2.6vw, 28px);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0;
  transform: translateY(12px);
  animation: pl-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 2.3s forwards;
}

@keyframes pl-in {
  to { opacity: 1; transform: none; }
}

@keyframes pl-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(720deg); }
}

body.loaded #preloader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ============ NAV ============ */

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad-x);
  background: rgba(255, 255, 255, 0);
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease, padding 0.35s ease;
}

#nav.solid {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  padding-top: 12px;
  padding-bottom: 12px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.nav-brand img { width: 34px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  position: relative;
}

.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 1.5px;
  background: var(--black);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }

.nav-cta {
  padding: 10px 22px;
  background: var(--black);
  color: var(--white);
  border-radius: 999px;
  transition: opacity 0.25s ease;
}

.nav-cta:hover { opacity: 0.8; }

#nav-burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

#nav-burger span {
  width: 26px;
  height: 2px;
  background: var(--black);
}

/* ============ HERO ============ */

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  padding: 140px var(--pad-x) 80px;
}

.hero-copy,
.hero-art { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(44px, 6.5vw, 92px);
}

.hero-sub {
  margin-top: 28px;
  max-width: 520px;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--grey);
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 15px 32px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.03em;
  text-decoration: none;
  border-radius: 999px;
  border: 1.5px solid var(--black);
  transition: all 0.25s ease;
  cursor: pointer;
}

.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { background: var(--white); color: var(--black); }

.btn-ghost { background: transparent; color: var(--black); }
.btn-ghost:hover { background: var(--black); color: var(--white); }

.btn-light {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}
.btn-light:hover { background: transparent; color: var(--white); }

.hero-art img,
.hero-art .img-placeholder { aspect-ratio: 4 / 5; object-fit: cover; }

/* Animated latent-space constellation (injected by script.js as a
   full-hero background layer; the .hero-art img stays in the layout,
   hidden, both as the static fallback and to anchor the star's position) */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Feather the artwork into the page so there's no hard rectangular edge:
   two perpendicular gradients, intersected, fade all four sides */
.hero-art img {
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  mask-composite: intersect;
}

/* ============ APPROACH ============ */

.approach {
  padding: 120px var(--pad-x);
  border-top: 1px solid var(--line);
}

.approach-head { max-width: 820px; }

.approach-head h2 { font-size: clamp(32px, 4.2vw, 58px); }

.approach-head p {
  margin-top: 24px;
  font-size: 18px;
  color: var(--grey);
  max-width: 640px;
}

.approach-grid {
  margin-top: 72px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.approach-item {
  background: var(--white);
  padding: 40px 32px;
}

.approach-item h3 {
  font-size: 26px;
  margin: 14px 0 12px;
}

.approach-item p { color: var(--grey); font-size: 15px; }

/* ============ PRODUCT (black) ============ */

.product {
  background: var(--black);
  color: var(--white);
  padding: 120px var(--pad-x);
}

.product .kicker { border-color: var(--line-inv); }

.product-head h2 {
  font-size: clamp(56px, 8vw, 110px);
  display: flex;
  align-items: center;
  gap: 0.25em;
}

.inline-star {
  width: 0.78em;
  filter: invert(1);
}

.product-tag {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.product-lede {
  margin-top: 22px;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 18px;
}

.product-body {
  margin-top: 72px;
}

/* The demo video is the focal point: large and centered */
.product-demo {
  max-width: 1100px;
  margin: 0 auto;
}

.product-caps {
  list-style: none;
  margin-top: 72px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
}

.product-caps li {
  padding-top: 28px;
  border-top: 1px solid var(--line-inv);
}

.product-caps h3 { font-size: 22px; margin-bottom: 10px; }

.product-caps p { color: rgba(255, 255, 255, 0.65); font-size: 15px; }

.product-demo video,
.product-demo .video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 1px solid var(--line-inv);
  background: #161616;
}

.demo-caption {
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 32px;
}

.video-placeholder .ph-play {
  width: 64px;
  height: 64px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.7);
}

.video-placeholder p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  max-width: 420px;
}

/* ============ SERVICES ============ */

.services {
  padding: 120px var(--pad-x);
}

.services-head { margin-bottom: 80px; }

.services-head h2 { font-size: clamp(32px, 4.2vw, 58px); }

.service {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 5vw, 90px);
  align-items: center;
  padding: 64px 0;
  border-top: 1px solid var(--line);
}

.service-flip .service-art { order: 2; }

.service-art img,
.service-art .img-placeholder { aspect-ratio: 4 / 3; object-fit: cover; }

.service-copy h3 {
  font-size: clamp(26px, 3vw, 40px);
  margin: 14px 0 20px;
}

.service-copy p {
  color: var(--grey);
  font-size: 16px;
  max-width: 520px;
}

.service-copy p + p { margin-top: 16px; }

/* ============ CONTACT (black) ============ */

.contact {
  background: var(--black);
  color: var(--white);
  padding: 120px var(--pad-x);
}

.contact-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.contact-star {
  width: 56px;
  margin: 0 auto 28px;
  filter: invert(1);
}

.contact h2 { font-size: clamp(32px, 4.2vw, 56px); }

.contact-inner > p {
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 17px;
}

#contact-form {
  margin-top: 44px;
  display: grid;
  gap: 14px;
  text-align: left;
}

#contact-form input,
#contact-form textarea {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: 1px solid var(--line-inv);
  border-radius: 10px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  resize: vertical;
  transition: border-color 0.25s ease;
}

#contact-form input::placeholder,
#contact-form textarea::placeholder { color: rgba(255, 255, 255, 0.4); }

#contact-form input:focus,
#contact-form textarea:focus {
  outline: none;
  border-color: var(--white);
}

#contact-form .btn { justify-self: start; margin-top: 8px; }

.contact-alt {
  margin-top: 32px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.contact-alt a { color: var(--white); }

/* ============ FOOTER ============ */

footer {
  padding: 56px var(--pad-x);
  border-top: 1px solid var(--line);
  text-align: center;
}

.foot-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}

.foot-brand img { width: 28px; }

footer > p {
  margin-top: 14px;
  font-size: 14px;
  color: var(--grey);
}

.foot-fine { font-size: 12px !important; margin-top: 24px !important; }

/* ============ IMAGE PLACEHOLDERS ============ */

.img-placeholder {
  width: 100%;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 14px, rgba(10, 10, 10, 0.025) 14px, rgba(10, 10, 10, 0.025) 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 32px;
}

.img-placeholder .ph-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}

.img-placeholder p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--grey);
  max-width: 420px;
}

/* ============ SCROLL REVEAL ============ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.in { opacity: 1; transform: none; }

/* ============ RESPONSIVE ============ */

@media (max-width: 900px) {
  .hero,
  .product-caps,
  .service { grid-template-columns: 1fr; }

  .hero { padding-top: 120px; min-height: auto; }

  .service-flip .service-art { order: 0; }

  .approach-grid { grid-template-columns: 1fr; }

  .nav-links {
    position: fixed;
    inset: 0;
    background: var(--white);
    flex-direction: column;
    justify-content: center;
    gap: 32px;
    font-size: 20px;
    display: none;
  }

  .nav-links.open { display: flex; }

  #nav-burger { display: flex; z-index: 110; }
}
