/* =====================================================================
   PepLoop — one shared CSS system
   Dark editorial canvas · frosted glass · serif display · mascot glows
   ===================================================================== */

/* ---- Tokens -------------------------------------------------------- */
:root {
  --bg:        #06070a;
  --bg-2:      #08090d;
  --surface:   #0c0e12;
  --text:      #f3f1ee;
  --text-soft: rgba(243, 241, 238, 0.72);
  --text-mute: rgba(243, 241, 238, 0.52);
  --text-faint:rgba(243, 241, 238, 0.36);
  --hair:      rgba(255, 255, 255, 0.07);
  --hair-2:    rgba(255, 255, 255, 0.12);

  /* glass */
  --glass-bg:  rgba(8, 9, 12, 0.65);
  --glass-bg-2:rgba(12, 14, 19, 0.55);
  --radius:    28px;
  --radius-sm: 18px;

  /* mascot accents + glows */
  --loop:  #3287ff;  --loop-glow:  #0050ff;
  --pep:   #ff5453;  --pep-glow:   #f50000;
  --nodi:  #61d46a;  --nodi-glow:  #00a50b;
  --shade: #74dac6;  --shade-glow: #00b39c;

  --maxw: 1120px;
  --pad:  clamp(1.25rem, 5vw, 2.5rem);

  /* fluid type */
  --fs-eyebrow: 0.7rem;
  --fs-body:    1.0625rem;
  --fs-lead:    clamp(1.125rem, 0.9rem + 1.1vw, 1.4rem);
  --fs-h3:      clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  --fs-h2:      clamp(2rem, 1.3rem + 2.8vw, 3.4rem);
  --fs-h1:      clamp(2.7rem, 1.4rem + 5.4vw, 5.4rem);
  --fs-display: clamp(3.4rem, 1.5rem + 8vw, 7rem);
}

/* ---- Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, picture { max-width: 100%; display: block; height: auto; }
a { color: inherit; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Neutral depth only — no color. Per the brief, the only color on the site comes
   from the mascot accent glows; the canvas itself stays near-black. A barely-there
   achromatic lift from the top keeps it from reading as a flat, dead fill. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(130% 90% at 50% -20%, rgba(255, 255, 255, 0.045), transparent 60%);
  pointer-events: none;
}
body::after { /* faint grain to kill banding on the dark gradients */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Typography ---------------------------------------------------- */
.serif { font-family: "Instrument Serif", Georgia, "Times New Roman", serif; font-weight: 400; }

h1, h2, h3 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; line-height: 1.02; letter-spacing: -0.01em; }

.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 500;
}

.lead { font-size: var(--fs-lead); color: var(--text-soft); line-height: 1.55; }

/* ---- Layout helpers ------------------------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: clamp(4.5rem, 11vh, 9rem); position: relative; }
.stack > * + * { margin-top: 1.1rem; }

/* skip link */
.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--text); color: var(--bg); padding: 0.6rem 1rem;
  border-radius: 0 0 12px 0; font-weight: 600; font-size: 0.9rem;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--loop); outline-offset: 3px; border-radius: 4px; }

/* ---- Glass --------------------------------------------------------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  backdrop-filter: blur(28px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 30px 80px -40px rgba(0,0,0,0.8);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(14, 16, 22, 0.92); }
}

/* ---- Mascot + glow stage ------------------------------------------ */
.stage { position: relative; display: grid; place-items: center; isolation: isolate; }
.stage .glow {
  position: absolute;
  z-index: -1;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.55;
  pointer-events: none;
}
.stage img { position: relative; filter: drop-shadow(0 26px 40px rgba(0,0,0,0.55)); }

.glow-loop  { background: radial-gradient(circle, var(--loop-glow)  0%, transparent 68%); }
.glow-pep   { background: radial-gradient(circle, var(--pep-glow)   0%, transparent 68%); }
.glow-nodi  { background: radial-gradient(circle, var(--nodi-glow)  0%, transparent 68%); }
.glow-shade { background: radial-gradient(circle, var(--shade-glow) 0%, transparent 68%); }

/* ---- Header / nav -------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--hair);
  background: rgba(6, 7, 10, 0.6);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 1px var(--hair); }
.brand .word { font-family: "Instrument Serif", Georgia, serif; font-size: 1.6rem; line-height: 1; letter-spacing: 0.01em; }
.tabs { display: flex; align-items: center; gap: clamp(0.4rem, 2vw, 1.6rem); list-style: none; padding: 0; }
.tabs a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--text-mute);
  padding: 0.4rem 0.2rem;
  position: relative;
  transition: color 0.18s ease;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); }
.tabs a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1.5px;
  background: linear-gradient(90deg, var(--loop), var(--shade));
}

/* ---- Buttons / badges ---------------------------------------------- */
.badge-soon {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--hair-2);
  background: rgba(255,255,255,0.03);
  font-size: 0.95rem; font-weight: 500; color: var(--text);
  cursor: default;
}
.badge-soon .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--loop); box-shadow: 0 0 12px var(--loop); }
.badge-soon .sub { color: var(--text-mute); font-size: 0.82rem; }

.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: "JetBrains Mono", monospace; font-size: 0.7rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-soft);
  border: 1px solid var(--hair); border-radius: 999px; padding: 0.35rem 0.75rem;
}
.pill .swatch { width: 9px; height: 9px; border-radius: 50%; }

/* =====================================================================
   HOME
   ===================================================================== */
.hero { padding-top: clamp(3rem, 7vh, 5.5rem); padding-bottom: clamp(3.5rem, 8vh, 6rem); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 { font-size: var(--fs-h1); margin-top: 1.4rem; }
.hero h1 .accent { font-style: italic; color: var(--loop); }
.hero .lead { margin-top: 1.4rem; max-width: 30ch; }
.hero .cta-row { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; }
.hero .disclaimer { margin-top: 1.4rem; font-size: 0.85rem; color: var(--text-mute); display: flex; align-items: center; gap: 0.55rem; }
.hero .disclaimer::before { content: ""; width: 16px; height: 1px; background: var(--text-faint); }
.hero-stage { min-height: 380px; }
.hero-stage .glow { width: 88%; opacity: 0.6; filter: blur(54px); }
.hero-stage img { max-width: min(420px, 100%); }

/* section heading block */
.head { max-width: 40ch; margin-bottom: clamp(2.5rem, 6vh, 4rem); }
.head h2 { font-size: var(--fs-h2); margin-top: 0.9rem; }
.head p { margin-top: 1rem; color: var(--text-soft); }

/* How it works — editorial numbered rows, not icon cards */
.steps { display: grid; gap: clamp(1rem, 2vw, 1.4rem); }
.step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  padding: clamp(1.5rem, 3vw, 2.4rem);
}
.step .num { font-family: "Instrument Serif", serif; font-size: clamp(2.6rem, 5vw, 4.2rem); line-height: 1; color: var(--text-faint); }
.step h3 { font-size: var(--fs-h3); }
.step p { margin-top: 0.5rem; color: var(--text-soft); max-width: 46ch; }
.step .figure { width: clamp(92px, 14vw, 132px); }
.step .figure .stage .glow { filter: blur(34px); opacity: 0.5; }
.step-tag { font-family: "JetBrains Mono", monospace; font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-mute); }

/* Meet the mascots — alternating composed rows */
.mascot-row {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-block: clamp(2rem, 5vh, 3.5rem);
}
.mascot-row + .mascot-row { border-top: 1px solid var(--hair); }
.mascot-row:nth-child(even) .m-art { order: 2; }
.mascot-row .m-art { min-height: 300px; }
.mascot-row .m-art img { max-width: min(300px, 90%); }
.mascot-name { font-size: clamp(2rem, 4vw, 3rem); }
.mascot-role { color: var(--text-soft); margin-top: 0.8rem; max-width: 42ch; }
.mascot-meta { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* Trust / safety */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; }
.trust .cell { padding: clamp(1.6rem, 3vw, 2.4rem); background: var(--glass-bg-2); }
.trust .cell h3 { font-size: 1.4rem; }
.trust .cell p { margin-top: 0.6rem; color: var(--text-soft); font-size: 0.98rem; }
.trust .cell .k { font-family: "JetBrains Mono", monospace; font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-mute); display: block; margin-bottom: 0.9rem; }

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer { border-top: 1px solid var(--hair); padding-block: clamp(3rem, 6vh, 4.5rem); margin-top: clamp(2rem, 6vh, 4rem); }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem 2rem; align-items: flex-start; }
.foot-brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.foot-brand img { width: 28px; height: 28px; border-radius: 7px; }
.foot-brand .word { font-family: "Instrument Serif", serif; font-size: 1.4rem; }
.foot-tag { color: var(--text-mute); font-size: 0.9rem; margin-top: 0.7rem; max-width: 34ch; }
.foot-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.foot-links a { color: var(--text-soft); text-decoration: none; font-size: 0.92rem; }
.foot-links a:hover { color: var(--text); }
.foot-legal { width: 100%; border-top: 1px solid var(--hair); margin-top: 1.5rem; padding-top: 1.5rem; color: var(--text-mute); font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

/* =====================================================================
   DOCUMENT PAGES (privacy / terms / support)
   ===================================================================== */
.doc { padding-top: clamp(3rem, 6vh, 5rem); }
.doc-head { max-width: 52ch; margin-bottom: clamp(2.2rem, 5vh, 3.2rem); }
.doc-head h1 { font-size: clamp(2.6rem, 1.6rem + 4vw, 4.2rem); margin-top: 1rem; }
.doc-head .meta { margin-top: 1rem; color: var(--text-mute); font-size: 0.92rem; }
.doc-body { padding: clamp(1.8rem, 4vw, 3.4rem); }
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.1rem; }
.prose .intro { font-size: var(--fs-lead); color: var(--text-soft); line-height: 1.55; }
.prose h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--hair);
}
.prose h2:first-of-type { border-top: 0; padding-top: 0; }
.prose h3 { font-size: 1.2rem; margin-top: 1.8rem; font-family: "Inter", sans-serif; font-weight: 600; letter-spacing: 0; }
.prose p, .prose li { color: var(--text-soft); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-top: 0.55rem; }
.prose li::marker { color: var(--text-faint); }
.prose a { color: var(--loop); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(50,135,255,0.45); }
.prose a:hover { text-decoration-color: var(--loop); }
.prose .contact-block { margin-top: 1.2rem; line-height: 1.8; }
.prose .closing { margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px solid var(--hair); color: var(--text-mute); font-size: 0.9rem; }

/* FAQ (support) */
.faq { list-style: none; padding: 0; }
.faq > li { padding-block: 1.5rem; border-top: 1px solid var(--hair); }
.faq > li:first-child { border-top: 0; }
.faq .q { font-family: "Instrument Serif", serif; font-size: 1.5rem; color: var(--text); }
.faq .a { margin-top: 0.6rem; color: var(--text-soft); }
.support-contact { padding: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 2rem; }
.support-contact .eyebrow { margin-bottom: 0.7rem; }
.support-contact a { color: var(--loop); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(50,135,255,0.45); }
.support-contact a:hover { text-decoration-color: var(--loop); }

/* =====================================================================
   MOTION (opt-in, reduced-motion safe)
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .float { animation: float 7s ease-in-out infinite; }
  .float-2 { animation: float 8.5s ease-in-out infinite; }
  @keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
  .stage .glow { animation: breathe 9s ease-in-out infinite; }
  @keyframes breathe { 0%,100% { opacity: 0.45; } 50% { opacity: 0.62; } }
  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .js .reveal.in { opacity: 1; transform: none; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stage { order: -1; min-height: 300px; }
  .hero-stage img { max-width: min(320px, 78%); }
  .mascot-row { grid-template-columns: 1fr; gap: 1.5rem; }
  .mascot-row:nth-child(even) .m-art { order: 0; }
  .mascot-row .m-art { min-height: auto; }
  .trust { grid-template-columns: 1fr; }
  .step { grid-template-columns: auto 1fr; }
  .step .figure { display: none; }
}
@media (max-width: 560px) {
  .brand .word { font-size: 1.4rem; }
  .tabs { gap: 0.85rem; }
  .tabs a { font-size: 0.85rem; }
  .step { grid-template-columns: 1fr; gap: 0.5rem; }
  .step .num { font-size: 2.4rem; }
}
