
/* =========================
   Base site styles (keep)
   ========================= */
:root { color-scheme: dark; }
html, body { height: 100%; scroll-behavior: smooth; }

/* Green cosmic background */
body {
  margin: 0;
  color: #fff;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background-image:
    radial-gradient(circle at 20% 20%, rgba(34,73,100,0.5), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(7,21,32,0.5), transparent 70%),
    linear-gradient(135deg, #0f2532 0%, #071a27 100%);
  background-size: cover;
  background-attachment: fixed;
}

.glass { background: rgba(255,255,255,0.06); backdrop-filter: blur(10px); }
.ringed { box-shadow: 0 0 0 1px rgba(16,185,129,0.35), inset 0 0 0 1px rgba(255,255,255,0.05); }
section { scroll-margin-top: 96px; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(16,185,129,0.6), transparent); }

.starfield {
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.7) 0, transparent 60%),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.5) 0, transparent 60%);
  opacity: .10;
}

/* gentle float on hero icon */
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.float { animation: float 8s ease-in-out infinite; }

/* Portrait video frame 9:16 */
.portrait-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  border-radius: 2rem;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(16,185,129,0.35),
    0 10px 30px rgba(0,0,0,0.5),
    inset 0 0 30px rgba(16,185,129,0.08);
  background: #0b0616;
  backdrop-filter: blur(10px);
}
.portrait-frame.is-paused { cursor: pointer; }
#videoTap { background: transparent; }

.portrait-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 1rem;
}

@media (min-width: 768px) { .portrait-frame { max-width: 360px; } }
@media (max-width: 767px) { #mobileBar { cursor: pointer; } }

/* =========================
   Hero variables (add)
   ========================= */
:root{
  --hero-h: 100vh;
  --frame-size: min(60vmin, 640px);
  --window-size: calc(var(--frame-size) * 0.68);

  --brand: #e9e7ff;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --overlay-top: rgba(0,0,0,0.25);
  --overlay-bot: rgba(0,0,0,0.55);

  --btn-bg: #8b5cf6;
  --btn-bg-hover: #7c3aed;
  --btn-ghost: rgba(255,255,255,0.16);
  --btn-ghost-hover: rgba(255,255,255,0.26);

  --glow: rgba(139, 92, 246, 0.45);
}

*{ box-sizing: border-box; }

/* =========================
   HERO (exactly like yours)
   ========================= */
.hero{
  position: relative;
  height: var(--hero-h);
  overflow: clip;
  isolation: isolate;
}

/* Background */
.hero-bg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  z-index: 0;
}
.hero-overlay{
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--overlay-top), var(--overlay-bot));
  z-index: 0;
}

/* Particles */
.particles{
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 10% 20%, rgba(255,255,255,0.12), transparent 60%),
    radial-gradient(2px 2px at 80% 30%, rgba(255,255,255,0.08), transparent 60%),
    radial-gradient(1px 1px at 30% 70%, rgba(255,255,255,0.10), transparent 60%),
    radial-gradient(1px 1px at 60% 50%, rgba(255,255,255,0.06), transparent 60%);
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
  animation: twinkle 8s linear infinite;
}
@keyframes twinkle{
  0%,100%{ opacity: 0.6; }
  50%{ opacity: 0.9; }
}

/* PORTAL STACK */
.portal-wrap{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  transform: translateZ(0);
  will-change: transform;
}

/* Typewriter prompt - always centered above the portal window */
.portal-prompt {
  position: absolute;
  top: calc(50% - var(--frame-size) * 0.7); /* moved higher above portal */
  left: 50%;
  transform: translateX(-50%);
  max-width: min(86vw, 800px);
  padding: 8px 14px;
  text-align: center;
  font-size: clamp(14px, 2.2vw, 24px);
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #fff;
  background: linear-gradient(90deg, rgba(139,92,246,0.18), rgba(34,211,238,0.18));
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  backdrop-filter: blur(6px) saturate(120%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  min-height: 1.2em; /* keeps box height steady even if text is short */
}
@media (max-width: 768px) {
  .portal-prompt {
    font-size: 1rem;
    transform: translate(-50%, calc(-50% - (var(--window-size) / 2) - 8px));
  }
}
@media (min-width: 769px) {
  .portal-wrap {
    transform: translate3d(0, -10vh, 0); /* adjust -5vh up, try -3vh to -8vh */
  }
}
@media (max-width: 768px) {
  :root {
    --frame-size: min(100vmin, 380px); /* example smaller max for mobile */
    --window-size: calc(var(--frame-size) * 0.68);
  }
}


.portal-prompt.typing::after{
  content: "|";
  position: relative;
  bottom: 100px;
  animation: caretBlink 900ms steps(1, end) infinite;
}
@keyframes caretBlink{
  0%, 49%{ opacity: 1; }
  50%, 100%{ opacity: 0; }
}

/* Inner circular window that shows slideshow */
.portal-window{
  position: absolute;
  width: var(--window-size);
  height: var(--window-size);
  border-radius: 50%;
  overflow: hidden;
  clip-path: circle(50% at 50% 50%);
  filter: url(#rippleFilter);
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.6),
    0 0 80px rgba(139, 92, 246, 0.25);
  z-index: 1;
}

/* Rotating rune frame above the window */
.portal-frame{
  position: absolute;
  width: var(--frame-size);
  height: var(--frame-size);
  object-fit: contain;
  filter: drop-shadow(0 0 18px var(--glow));
  animation: spin-slow 36s linear infinite;
  z-index: 2;
}
@keyframes spin-slow{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}

/* Soft glow ring on top */
.portal-glow{
  position: absolute;
  width: calc(var(--window-size) * 1.16);
  height: calc(var(--window-size) * 1.16);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(139,92,246,0.18), transparent 70%);
  filter: blur(12px);
  pointer-events: none;
  z-index: 3;
}

/* SLIDES */
.slides, .slide{
  width: 100%;
  height: 100%;
}
.slides{
  position: relative;
}
.slide{
  position: absolute;
  inset: 0;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 900ms ease, transform 800ms ease;
  will-change: opacity, transform;
}
.slide.is-active{
  opacity: 1;
  transform: scale(1);
}
.slide.is-leaving{
  opacity: 0;
  transform: scale(1.06);
}

/* CONTENT */
.hero-content{
  position: absolute;
  left: 50%;
  bottom: 6vh;
  transform: translateX(-50%);
  text-align: center;
  z-index: 4;
  max-width: min(92vw, 960px);
  padding: 0 16px;
}
.brand{
  margin: 0 0 8px 0;
  font-weight: 800;
  font-size: clamp(28px, 5vw, 60px);
  letter-spacing: 0.5px;
  color: var(--brand);
  text-shadow: 0 2px 18px rgba(0,0,0,0.5);
}
.tagline{
  margin: 0 0 18px 0;
  font-size: clamp(14px, 2.4vw, 22px);
  opacity: 0.92;
}
.cta-row{
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn{
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 160ms ease;
  will-change: transform;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: linear-gradient(135deg, var(--btn-bg), var(--accent-2));
  color: #0b0b12;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.35);
}
.btn-primary:hover{
  background: linear-gradient(135deg, var(--btn-bg-hover), var(--accent-2));
}
.btn-ghost{
  background: var(--btn-ghost);
  color: #ffffff;
  backdrop-filter: blur(6px);
}
.btn-ghost:hover{ background: var(--btn-ghost-hover); }

/* Below hero sections */
.how-it-works, .get-started{
  padding: 88px 20px;
  max-width: 960px;
  margin: 0 auto;
}
.how-it-works h2, .get-started h2{
  margin: 0 0 12px 0;
  font-size: clamp(22px, 3.2vw, 34px);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .portal-frame{ animation: none; }
  .slide, .slide.is-active, .slide.is-leaving{ transition: none; }
  .particles{ animation: none; }
}
/* Tighten space under the fixed nav on small screens */
@media (max-width: 768px) {
  main#top { padding-top: 1.25rem !important; } /* was 7rem via pt-28 */
}

/* Nudge the whole portal stack up a bit on mobile */
@media (max-width: 768px) {
  .portal-wrap { transform: translate3d(0, -4vh, 0); } /* tweak -3vh..-6vh */
}

/* Keep the prompt correctly above the portal on mobile after the nudge */
@media (max-width: 768px) {
  .portal-prompt { top: calc(50% - var(--frame-size) * 0.62); }
}

/* iOS safe area support */
@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 768px) {
    main#top { padding-top: calc(env(safe-area-inset-top) + 3.75rem) !important; }
  }
}
/* Mobile spacing fix above the portal */
@media (max-width: 768px) {
  /* Reduce space under the fixed nav */
  main#top { padding-top: 0.5rem !important; }

  /* Pull the whole portal stack higher */
  .portal-wrap { transform: translate3d(0, -7vh, 0); } /* try -10vh to -14vh */

  /* Keep the prompt aligned above the circle after the nudge */
  .portal-prompt { top: calc(50% - var(--frame-size) * 0.76); }

  /* Slightly tighten hero content at the bottom too */
  .hero-content { bottom: 4vh; }
}
  .portal-prompt { top: calc(50% - var(--frame-size) * 0.40); }
  
/* Desktop: bring the prompt closer to the portal */
@media (min-width: 769px) {
  .portal-prompt { top: calc(50% - var(--frame-size) * 0.65); } /* try 0.76–0.82 */
}
  
@media (max-width: 767px) {
  #mobileBar { cursor: pointer; }
}

.menu-icon {
  display: block;
  width: 28px;
  height: 28px;
  /* If your PNG is dark and you need it light, uncomment the next line */
  /* filter: invert(1) brightness(1.1); */
}
/* Ensure the dropdown sits above the overlay */
#mobileMenu {
  position: relative;
  z-index: 60; /* higher than overlay */
}
.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center; /* Always center the image */
  display: block;
}
/* Mobile adjustment */
@media (max-width: 767px) {
  .hero-bg {
    object-position: center 10%; /* Move the focal point up */
  }
}
.button-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px; /* horizontal padding for pill shape */
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  font-weight: 600;
  border-radius: 999px;
  background: #1e1e1e;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.3s ease;
}

.button.primary {
  background: linear-gradient(135deg, #3a7bd5, #00d2ff);
}

.button:hover {
  transform: translateY(-2px);
}
