/* ============================================================
   Lattice Labs — landing
   Single viewport, no scroll. Dark, premium, purple.
   ============================================================ */

:root {
  --bg:        #09060f;
  --bg-2:      #0d0819;
  --ink:       #f4f1fb;
  --ink-soft:  #b6acce;
  --ink-dim:   #7d7295;
  --violet:    #9b57ff;
  --violet-hi: #b98bff;
  --violet-lo: #6d28d9;
  --line:      rgba(155, 87, 255, 0.16);

  --edge: clamp(20px, 4.4vw, 56px);
  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "Helvetica Neue", Inter, system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

body {
  position: relative;
  background:
    radial-gradient(120% 80% at 50% 42%, #17102b 0%, var(--bg-2) 42%, var(--bg) 100%);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

/* --- Background layers ------------------------------------- */

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  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='140' height='140'%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");
}

/* Subtle vignette to seat content */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(130% 100% at 50% 50%, transparent 55%, rgba(3, 1, 8, 0.55) 100%);
}

/* --- Frame ------------------------------------------------- */

.frame {
  position: relative;
  z-index: 2;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 3.4vh, 34px) var(--edge);
}

/* --- Identity (top-left) ----------------------------------- */

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(12px, 1.05vw, 13.5px);
  letter-spacing: 0.02em;
}

.identity__mark {
  width: clamp(22px, 2vw, 26px);
  height: auto;
  filter: drop-shadow(0 2px 10px rgba(155, 87, 255, 0.45));
}

.identity__name {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.identity__sep {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.identity__tag {
  color: var(--ink-dim);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0.06em;
}

/* --- Hero -------------------------------------------------- */

.hero {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(12px, 2.2vh, 22px);
}

.mark {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(96px, 15vh, 156px);
  height: clamp(96px, 15vh, 156px);
}

.mark__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 34px rgba(123, 58, 217, 0.55));
  animation: floaty 7s ease-in-out infinite;
}

.mark__halo {
  position: absolute;
  inset: -42%;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155, 87, 255, 0.42) 0%, rgba(109, 40, 217, 0.14) 40%, transparent 68%);
  filter: blur(6px);
  animation: pulse 6s ease-in-out infinite;
}

.wordmark {
  display: flex;
  gap: 0.34em;
  font-size: clamp(2.6rem, 8.4vw, 5.6rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.94;
}

.wordmark__word { color: var(--ink); }

.wordmark__word--grad {
  background: linear-gradient(135deg, var(--violet-hi) 0%, var(--violet) 45%, var(--violet-lo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.thesis {
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 1.65vw, 1.2rem);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.5;
}

/* --- Products ---------------------------------------------- */

.products {
  margin-top: clamp(6px, 1.6vh, 16px);
  width: min(340px, 78vw);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vh, 8px);
}

.product {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(9px, 1.5vh, 13px) 14px;
  border-radius: 13px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.product:hover {
  background: rgba(155, 87, 255, 0.06);
  border-color: var(--line);
  transform: translateY(-1px);
}

.product__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--violet);
  box-shadow: 0 0 10px rgba(155, 87, 255, 0.7);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.product:hover .product__dot {
  transform: scale(1.35);
  box-shadow: 0 0 16px rgba(185, 139, 255, 0.95);
}

.product__label {
  font-size: clamp(1rem, 2vw, 1.12rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.product__soon {
  flex: none;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 0.15em 0.5em;
  border: 1px solid var(--line);
  border-radius: 999px;
  opacity: 0.7;
}

.product__line {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
  transform: scaleX(0.35);
  transform-origin: left;
  opacity: 0.6;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.product:hover .product__line {
  transform: scaleX(1);
  opacity: 1;
}

.product__arrow {
  flex: none;
  font-size: 0.95rem;
  color: var(--ink-dim);
  transform: translate(-4px, 2px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease, color 0.35s ease;
}

.product:hover .product__arrow {
  transform: translate(0, 0);
  opacity: 1;
  color: var(--violet-hi);
}

.product:focus-visible {
  outline: none;
  border-color: rgba(155, 87, 255, 0.5);
  background: rgba(155, 87, 255, 0.08);
}

/* --- Footer ------------------------------------------------ */

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: clamp(11px, 1vw, 12.5px);
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}

.footer a {
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover { color: var(--ink-soft); }

.footer__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line);
}

.footer__copy { color: var(--ink-dim); }

/* --- Entrance motion --------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}

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

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.08); }
}

/* --- Reduced motion ---------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .mark__img, .mark__halo { animation: none; }
  * { transition-duration: 0.001ms !important; }
}

/* --- Landscape / short screens ----------------------------- */

@media (max-height: 560px) {
  .hero { gap: clamp(6px, 1.4vh, 12px); }
  .mark { width: clamp(72px, 13vh, 108px); height: clamp(72px, 13vh, 108px); }
  .thesis { display: none; }
  .products { margin-top: 4px; }
}

/* --- Small phones ------------------------------------------ */

@media (max-width: 380px) {
  .identity__tag, .identity__sep { display: none; }
}
