:root {
  --green: #35c733;
  --green-deep: #2bb02a;
  --bg: #0a0c0d;
  --ink: #f4f6f4;
  --muted: #9aa0a2;
  --line: rgba(255, 255, 255, 0.14);
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* lens tints */
  --l1: 217, 138, 61;   /* amber   */
  --l2: 169, 146, 214;  /* lavender*/
  --l3: 184, 217, 74;   /* lime    */
  --l4: 214, 228, 236;  /* clear   */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.scene {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 42%, #12161a 0%, #0a0c0d 60%, #060708 100%);
}

/* ---- Lens light-shafts ---- */
.spectrum {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: min(640px, 68vw);
  z-index: 0;
  pointer-events: none;
}
.shaft {
  position: absolute;
  top: 0; bottom: 0;
  width: 25%;
  opacity: 0.55;
  transition: opacity .5s ease, filter .5s ease;
  mix-blend-mode: screen;
}
.shaft.s1 { left: 0;   background: radial-gradient(150% 46% at 50% 50%, rgba(var(--l1), 0.85), rgba(var(--l1), 0) 70%); }
.shaft.s2 { left: 25%; background: radial-gradient(150% 46% at 50% 50%, rgba(var(--l2), 0.85), rgba(var(--l2), 0) 70%); }
.shaft.s3 { left: 50%; background: radial-gradient(150% 46% at 50% 50%, rgba(var(--l3), 0.85), rgba(var(--l3), 0) 70%); }
.shaft.s4 { left: 75%; background: radial-gradient(150% 46% at 50% 50%, rgba(var(--l4), 0.7), rgba(var(--l4), 0) 70%); }
.spectrum.active .shaft { opacity: 0.18; }
.spectrum.active .shaft.on { opacity: 0.95; filter: saturate(1.2); }

.gridline {
  position: absolute;
  top: 12%; bottom: 12%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.16) 30%, rgba(255,255,255,0.16) 70%, transparent);
}

/* Film grain */
.grain {
  position: fixed;
  inset: -120px;
  z-index: 5;
  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");
  animation: grain 0.6s steps(2) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-40px, 24px); }
  100% { transform: translate(30px, -18px); }
}

/* ---- Stage ---- */
.stage {
  --stage: 1180px;
  position: relative;
  z-index: 1;
  max-width: 1180px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 22px clamp(22px, 5vw, 56px) 18px;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo { height: 34px; width: auto; display: block; }
.since {
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Hero ---- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(14px, 3vh, 34px) 0;
  perspective: 1200px;
}
.eyebrow {
  margin-bottom: 14px;
}
.eyebrow span {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green);
  padding: 7px 15px;
  border: 1px solid rgba(53, 199, 51, 0.4);
  border-radius: 100px;
  background: rgba(53, 199, 51, 0.06);
}
h1 {
  font-weight: 500;
  font-size: clamp(38px, 6.4vw, 78px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff, #c9cfcf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  margin-top: 14px;
  font-size: clamp(14px, 1.55vw, 17px);
  color: var(--muted);
  letter-spacing: 0.2px;
}

/* Glasses */
.glasses {
  position: relative;
  width: min(640px, 68vw);
  margin: clamp(6px, 1.8vh, 22px) auto clamp(6px, 1.2vh, 12px);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translate3d(var(--tx, 0), var(--ty, 0), 0);
  transition: transform .18s ease-out;
  transform-style: preserve-3d;
  will-change: transform;
}
.glasses img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 40px 60px rgba(0, 0, 0, 0.7));
}
/* Specular sheen, masked to the exact frame silhouette */
.sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,0.55) 50%, transparent 58%);
  background-size: 260% 100%;
  background-position: 130% 0;
  -webkit-mask: url(assets/images/glasses-hero.webp) center / contain no-repeat;
  mask: url(assets/images/glasses-hero.webp) center / contain no-repeat;
  mix-blend-mode: screen;
  opacity: 0;
}
.scene.ready .sheen { animation: sweep 8s ease-in-out 1.6s infinite; }
@keyframes sweep {
  0% { background-position: 130% 0; opacity: 0; }
  8% { opacity: .9; }
  26% { background-position: -30% 0; opacity: 0; }
  100% { background-position: -30% 0; opacity: 0; }
}

/* Labels aligned to the 4 lens segments */
.labels {
  width: min(640px, 68vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.lbl {
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(10px, 1.15vw, 13px);
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 4px;
  transition: color .3s ease, transform .3s ease;
}
.lbl:hover, .lbl.on { color: var(--ink); transform: translateY(-2px); }

/* ---- CTA ---- */
.cta { text-align: center; padding: clamp(8px, 2vh, 22px) 0 4px; }
.signup {
  display: inline-flex;
  gap: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 100px;
  backdrop-filter: blur(8px);
  transition: border-color .2s, box-shadow .2s;
}
.signup:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(53, 199, 51, 0.14); }
.signup input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  padding: 11px 8px 11px 20px;
  width: min(300px, 52vw);
}
.signup input::placeholder { color: #7f8688; }
.signup button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  color: #072b06;
  background: var(--green);
  padding: 0 24px;
  border-radius: 100px;
  transition: background .18s, transform .1s;
}
.signup button:hover { background: var(--green-deep); }
.signup button:active { transform: translateY(1px); }
.signup button:disabled { opacity: .6; cursor: default; }
.microcopy {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.microcopy.error { color: #ff8a7a; }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: var(--muted);
}
.footer a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--green); padding-bottom: 1px; }
.footer a:hover { color: var(--green); }

/* ---- Success overlay ---- */
.success {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(4, 6, 5, 0.72);
  backdrop-filter: blur(8px);
}
.success.show { display: grid; animation: fade .28s ease; }
@keyframes fade { from{opacity:0} to{opacity:1} }
.success-card {
  width: min(430px, 100%);
  text-align: center;
  background: #101314;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 40px 34px 30px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  animation: pop .34s cubic-bezier(.2,.9,.3,1.25);
}
@keyframes pop { from{transform:scale(.94);opacity:0} to{transform:scale(1);opacity:1} }
.check {
  width: 54px; height: 54px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #072b06;
  box-shadow: 0 8px 26px rgba(53, 199, 51, 0.45);
}
.success-card h2 { font-weight: 500; font-size: 27px; letter-spacing: -0.02em; text-transform: uppercase; }
.success-card p { color: var(--muted); margin-top: 10px; font-size: 14.5px; }
.code {
  font-weight: 600;
  font-size: 28px;
  letter-spacing: 5px;
  color: var(--ink);
  background: rgba(53, 199, 51, 0.08);
  border: 1px dashed var(--green);
  border-radius: 11px;
  padding: 15px;
  margin: 18px 0 13px;
}
.copy-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: inherit;
  font-weight: 500;
  font-size: 14.5px;
  padding: 13px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.copy-btn:hover { border-color: var(--green); background: rgba(53,199,51,0.06); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }
.shop-btn {
  display: block;
  margin-top: 11px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  color: #072b06;
  background: var(--green);
  padding: 14px;
  border-radius: 10px;
  transition: background .2s;
}
.shop-btn:hover { background: var(--green-deep); }
.fineprint { font-size: 12px !important; margin-top: 16px !important; }

/* ---- Intro reveal on load ---- */
.topbar, .eyebrow, h1, .lede, .cta, .lbl { opacity: 0; }
.scene:not(.ready) .glasses img { opacity: 0; }
.scene:not(.ready) .shaft { opacity: 0; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(var(--rise, 18px)); }
  to   { opacity: 1; transform: none; }
}
@keyframes glassIn {
  from { opacity: 0; transform: translateY(44px) scale(0.955); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
.scene.ready .topbar { animation: riseIn .7s cubic-bezier(.2,.7,.2,1) .05s both; }
.scene.ready .eyebrow { animation: riseIn .8s cubic-bezier(.2,.7,.2,1) .5s both; }
.scene.ready h1 { --rise: 28px; animation: riseIn .9s cubic-bezier(.2,.7,.2,1) .62s both; }
.scene.ready .lede { animation: riseIn .8s cubic-bezier(.2,.7,.2,1) .8s both; }
.scene.ready .glasses img { animation: glassIn 1.1s cubic-bezier(.2,.7,.2,1) .2s both; }
.scene.ready .lbl { animation: riseIn .7s cubic-bezier(.2,.7,.2,1) both; }
.scene.ready .lbl:nth-child(1) { animation-delay: 1s; }
.scene.ready .lbl:nth-child(2) { animation-delay: 1.08s; }
.scene.ready .lbl:nth-child(3) { animation-delay: 1.16s; }
.scene.ready .lbl:nth-child(4) { animation-delay: 1.24s; }
.scene.ready .cta { animation: riseIn .8s cubic-bezier(.2,.7,.2,1) 1.2s both; }

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .since { display: none; }
  .labels .lbl { letter-spacing: 0.5px; }
  .signup { flex-direction: column; border-radius: 20px; width: min(360px, 88vw); }
  .signup input { width: 100%; padding: 13px 16px; text-align: center; }
  .signup button { padding: 13px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .glasses, .shaft, .lbl { transition: none; }
  .topbar, .eyebrow, h1, .lede, .cta, .lbl,
  .scene .glasses img { opacity: 1 !important; animation: none !important; transform: none !important; filter: none !important; }
  .scene .shaft { opacity: 0.5 !important; }
  .grain, .sheen { display: none; }
}
