/* ============================================================================
   MatterScope — site styles
   Aesthetic: deep-space scientific instrument. Near-black voids, restrained
   glow, colour used to encode meaning. Type: Instrument Serif (display),
   Instrument Sans (body), IBM Plex Mono (readouts / scientific labels).
   ========================================================================== */

:root {
  --bg:            #05060B;
  --bg-2:          #090B14;
  --surface:       #0E1120;
  --surface-2:     #161B30;
  --hairline:      rgba(255, 255, 255, 0.08);
  --hairline-2:    rgba(255, 255, 255, 0.14);

  --text:          #F3F5FB;
  --text-2:        #A7ADC4;
  --text-3:        #6B7192;

  --accent:        #5EC8FF;  /* interactive blue */
  --green:         #54E0A8;  /* molecules */
  --violet:        #7C6BFF;  /* quantum / electrons */
  --amber:         #FFB454;  /* protons / warmth */
  --rose:          #FF7A6B;

  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Atmospheric background: layered nebula glows + fine grain overlay. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(60rem 60rem at 12% -8%, rgba(94, 200, 255, 0.12), transparent 60%),
    radial-gradient(55rem 55rem at 92% 4%, rgba(124, 107, 255, 0.13), transparent 60%),
    radial-gradient(70rem 50rem at 50% 120%, rgba(84, 224, 168, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 40%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.035;
  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.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------- typography */
.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-ligatures: none;
}
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}
h1, h2, h3 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; line-height: 1.04; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 5vw, 3.25rem); }
h3 { font-size: 1.5rem; }
p { color: var(--text-2); }

/* -------------------------------------------------------------------- layout */
.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
section { padding: clamp(2.25rem, 4.5vw, 4rem) 0; position: relative; }
.center { text-align: center; }

/* ----------------------------------------------------------------------- nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  background: rgba(5, 6, 11, 0.72);
  border-bottom: 1px solid var(--hairline);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: "Instrument Serif", serif; font-size: 1.35rem; letter-spacing: -0.01em; }
.brand .mark { width: 26px; height: 26px; }
/* A slightly larger mark in the header for presence. */
.nav .brand { font-size: 1.5rem; }
.nav .brand .mark { width: 36px; height: 36px; }
.nav__links { display: flex; align-items: center; gap: 1.8rem; }
.nav__links a { color: var(--text-2); font-size: 0.92rem; transition: color 0.2s; }
.nav__links a:hover { color: var(--text); }
.nav__links .pill { color: var(--bg); }

@media (max-width: 720px) {
  .nav__links a:not(.pill) { display: none; }
}

/* --------------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.9rem;
  padding: 0.6rem 1.15rem; border-radius: 999px;
  background: linear-gradient(100deg, var(--accent), var(--green));
  color: var(--bg);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  box-shadow: 0 6px 24px rgba(94, 200, 255, 0.22);
}
.pill:hover { transform: translateY(-2px); box-shadow: 0 10px 34px rgba(94, 200, 255, 0.34); }
.pill--ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--hairline-2); box-shadow: none;
}
.pill--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* -------------------------------------------------------------------- hero */
.hero { padding-top: clamp(3rem, 7vw, 6rem); overflow: visible; }
.hero__grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(3rem, 8.5vw, 6rem);
  margin: 1.1rem 0 1.3rem;
}
.hero h1 .glow { color: var(--accent); font-style: italic; }
.hero__lede { font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 34ch; color: var(--text-2); }
.hero__cta { display: flex; gap: 0.85rem; margin-top: 2rem; flex-wrap: wrap; }
.chips { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 2.2rem; }
.chip {
  font-family: "IBM Plex Mono", monospace; font-size: 0.72rem; letter-spacing: 0.04em;
  color: var(--text-3);
  padding: 0.4rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.02);
}
.chip b { color: var(--text-2); font-weight: 500; }

/* -------------------------------------------------------- evolving hero atom */
.hero__atom {
  position: relative; width: min(100%, 540px); margin-inline: auto;
  display: grid; place-items: center;
}
.hero__atom-glow {
  position: absolute; inset: 14%; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle, rgba(94, 200, 255, 0.18), transparent 64%);
  filter: blur(10px); pointer-events: none;
}
#heroAtom {
  position: relative; z-index: 1;
  width: 100%; aspect-ratio: 1; display: block;
}
.hero__atom-label {
  position: relative; z-index: 1;
  margin-top: -0.5rem; text-align: center;
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-3);
}
.hero__atom-label span { color: var(--text-2); }

/* --------------------------------------------------------------- phone frame */
.phone {
  position: relative; width: 260px; border-radius: 40px; padding: 10px;
  background: linear-gradient(160deg, #23283b, #0c0e18);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.06);
}
.phone::before { /* notch */
  content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 22px; background: #05060B; border-radius: 14px; z-index: 3;
}
.phone img { border-radius: 30px; }
.phones { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; }
.phones .phone:nth-child(odd)  { transform: rotate(-3deg); }
.phones .phone:nth-child(even) { transform: rotate(3deg); }
.phones .phone { transition: transform 0.4s var(--ease); }
.phones .phone:hover { transform: rotate(0) translateY(-8px); }

/* --------------------------------------------------------- screenshot gallery */
.gallery-wrap { position: relative; margin-top: 2.5rem; }
.gallery {
  --shot-h: 400px; /* shared tile height so phone + iPad match in depth */
  display: flex; align-items: center; gap: 24px; overflow-x: auto;
  padding: 40px max(20px, calc((100% - var(--maxw)) / 2));
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery-item {
  flex: 0 0 auto;
  transition: transform 0.4s var(--ease);
  will-change: transform;
}
/* Slight alternating tilt; straighten, lift and grow on hover. */
.gallery-item:nth-child(odd)  { transform: rotate(-2.5deg); }
.gallery-item:nth-child(even) { transform: rotate(2.5deg); }
.gallery-item:hover {
  transform: rotate(0deg) translateY(-14px) scale(1.045);
  z-index: 3; position: relative;
}

/* portrait phone frame — sized by height so it matches the iPad tile depth */
.pf {
  position: relative; border-radius: 34px; padding: 8px;
  background: linear-gradient(160deg, #23283b, #0c0e18);
  box-shadow: 0 26px 70px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.06);
}
.pf::before {
  content: ""; position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
  width: 70px; height: 18px; background: #05060B; border-radius: 12px; z-index: 2;
}
.pf img { display: block; height: var(--shot-h); width: auto; border-radius: 27px; }

/* landscape frame */
.lf {
  width: 620px; max-width: 80vw; border-radius: 22px; padding: 8px;
  background: linear-gradient(160deg, #23283b, #0c0e18);
  box-shadow: 0 26px 70px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.06);
}
.lf img { display: block; width: 100%; border-radius: 15px; }

/* iPad portrait frame — softer bezel, no notch; also sized by height */
.if {
  position: relative; border-radius: 26px; padding: 12px;
  background: linear-gradient(160deg, #23283b, #0c0e18);
  box-shadow: 0 26px 70px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.06);
}
.if img { display: block; height: var(--shot-h); width: auto; border-radius: 14px; }

/* device toggle */
.gallery-toggle {
  display: inline-flex; gap: 4px; margin: 1.6rem auto 0; padding: 4px;
  border-radius: 999px; background: rgba(14,17,32,0.7);
  border: 1px solid var(--hairline-2); position: relative; left: 50%;
  transform: translateX(-50%);
}
.gallery-toggle button {
  appearance: none; border: 0; cursor: pointer;
  padding: 0.5rem 1.3rem; border-radius: 999px;
  font: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--text-3); background: transparent;
  transition: color 0.2s, background 0.2s;
}
.gallery-toggle button.is-active { color: var(--bg); background: var(--accent); }
.gallery-toggle button:not(.is-active):hover { color: var(--text); }

.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 52px; height: 52px; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center;
  background: rgba(14,17,32,0.82); backdrop-filter: blur(8px);
  border: 1px solid var(--hairline-2); color: var(--text);
  transition: background 0.2s, color 0.2s, transform 0.1s;
}
.gallery-arrow:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.gallery-arrow:active { transform: translateY(-50%) scale(0.92); }
.gallery-arrow svg { width: 22px; height: 22px; }
.gallery-arrow.prev { left: clamp(8px, 2.5vw, 28px); }
.gallery-arrow.next { right: clamp(8px, 2.5vw, 28px); }
.gallery-hint { text-align: center; margin-top: 0.4rem; font-size: 0.85rem; color: var(--text-3); }

@media (hover: none), (max-width: 900px) {
  .gallery-arrow { display: none; }
  .gallery { --shot-h: 340px; }
  .lf { width: 82vw; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-item,
  .gallery-item:nth-child(odd),
  .gallery-item:nth-child(even) { transform: none; }
  .gallery-item:hover { transform: translateY(-8px); }
}

/* ------------------------------------------------------------------ descent */
.descent { display: grid; gap: 0; max-width: 900px; margin-inline: auto; }
.level {
  display: grid; grid-template-columns: 160px 1fr; gap: 2rem; align-items: start;
  padding: 1.7rem 0; border-top: 1px solid var(--hairline); position: relative;
}
.level h3 { font-size: 1.7rem; }
.level p { font-size: 1.02rem; }
.level:first-child { border-top: none; }
.level__tag {
  font-family: "IBM Plex Mono", monospace; font-size: 0.8rem; letter-spacing: 0.06em;
  color: var(--dot); text-align: right; padding-top: 0.2rem;
  display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem;
}
.level__tag::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 12px var(--dot); }
.level h3 { margin-bottom: 0.2rem; }
.level p { font-size: 0.96rem; }

/* -------------------------------------------------------------- feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  border: 1px solid var(--hairline);
  border-radius: 20px; padding: 1.6rem;
  transition: border-color 0.3s, transform 0.3s var(--ease), background 0.3s;
}
.card:hover { border-color: var(--hairline-2); transform: translateY(-4px); }
.card__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  margin-bottom: 1.1rem; font-size: 1.3rem;
  background: rgba(94,200,255,0.1); border: 1px solid rgba(94,200,255,0.2);
}
.card h3 { font-size: 1.35rem; margin-bottom: 0.35rem; }
.card p { font-size: 0.92rem; }

/* -------------------------------------------------------------- privacy band */
.band {
  border: 1px solid var(--hairline); border-radius: 28px;
  background:
    radial-gradient(40rem 20rem at 100% 0%, rgba(84,224,168,0.1), transparent 60%),
    linear-gradient(180deg, var(--surface), rgba(14,17,32,0.4));
  padding: clamp(2.2rem, 5vw, 3.6rem);
  display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center;
}
.band__stats { display: flex; gap: 2.4rem; flex-wrap: wrap; }
.band__stat .n { font-family: "Instrument Serif", serif; font-size: 2.6rem; color: var(--green); line-height: 1; }
.band__stat .l { font-family: "IBM Plex Mono", monospace; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }

/* ---------------------------------------------------------------- section head */
.shead { max-width: 46ch; margin-bottom: 1.75rem; }
.shead.center { margin-inline: auto; }
.shead p { margin-top: 0.9rem; font-size: 1.05rem; }

/* --------------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--hairline); padding: 3.5rem 0 4rem; }
.footer__grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer__links { display: flex; gap: 2rem; flex-wrap: wrap; }
.footer__links a { color: var(--text-2); font-size: 0.92rem; transition: color 0.2s; }
.footer__links a:hover { color: var(--accent); }
.footer small { color: var(--text-3); font-family: "IBM Plex Mono", monospace; font-size: 0.72rem; letter-spacing: 0.03em; }

/* ============================================================ legal / prose */
.doc { padding-top: 3.5rem; }
.doc__head { border-bottom: 1px solid var(--hairline); padding-bottom: 2rem; margin-bottom: 2.5rem; }
.doc__head h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); margin-bottom: 0.6rem; }
.prose { max-width: 68ch; }
.prose h2 { font-size: 1.7rem; margin: 2.4rem 0 0.8rem; }
.prose h3 { font-size: 1.2rem; font-family: "Instrument Sans", sans-serif; font-weight: 600; margin: 1.6rem 0 0.5rem; color: var(--text); }
.prose p, .prose li { color: var(--text-2); margin-bottom: 0.85rem; }
.prose ul { padding-left: 1.2rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--text); }
.callout {
  border: 1px solid rgba(84,224,168,0.25); background: rgba(84,224,168,0.06);
  border-radius: 16px; padding: 1.2rem 1.4rem; margin: 1.5rem 0; color: var(--text);
}

/* -------------------------------------------------------------------- form */
.cform { display: grid; gap: 1rem; max-width: 34rem; margin-top: 1.5rem; }
.cform__hp { display: none; }
.cform label {
  display: grid; gap: 0.4rem;
  font-size: 0.8rem; letter-spacing: 0.02em; color: var(--text-2);
  font-family: "IBM Plex Mono", monospace;
}
.cform input, .cform textarea {
  font-family: "Instrument Sans", sans-serif; font-size: 1rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--hairline-2); border-radius: 12px;
  padding: 0.8rem 0.9rem; width: 100%; resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cform input::placeholder, .cform textarea::placeholder { color: var(--text-3); }
.cform input:focus, .cform textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94, 200, 255, 0.16);
}
.cform button { justify-self: start; border: none; cursor: pointer; margin-top: 0.4rem; }

/* -------------------------------------------------------------- reveal anim */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  /* Atom sits below the hero copy on narrow screens (DOM order). */
  .hero__visual { order: 2; }
  .features { grid-template-columns: 1fr 1fr; }
  .band { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .level { grid-template-columns: 84px 1fr; gap: 1rem; }
  .level__tag { font-size: 0.7rem; }
}
