/* ==========================================================================
   Swift · Build Your Way — Stylesheet
   ========================================================================== */

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

:root {
  --bg: #05070a;
  --bg-soft: #0b0f16;
  --fg: #ffffff;
  --fg-muted: rgba(255, 255, 255, 0.55);
  --fg-dim: rgba(255, 255, 255, 0.75);
  --accent: #e08a80;
  --accent-2: #c0504a;
  --pill-bg: rgba(255, 255, 255, 0.12);
  --pill-border: rgba(255, 255, 255, 0.15);
  --radius-pill: 999px;
  --header-pad-x: 4rem;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
}

/* Very subtle, always-on wash so no section of the page ever reads as
   flat, dead black — sits behind every other background layer. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 15% 10%, rgba(224, 110, 100, 0.05), transparent 70%),
    radial-gradient(60rem 40rem at 85% 90%, rgba(179, 58, 58, 0.05), transparent 70%);
}

a {
  color: inherit;
}

/* -------------------------------------------------------------------- */
/* Ambient background (CSS-generated — no external assets required)     */
/* -------------------------------------------------------------------- */

.bg-stack {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 300vh;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

.bg-layer {
  position: absolute;
  inset: 0;
  will-change: opacity, transform;
  transform-origin: center top;
}

/* Fine blueprint-style drafting grid, faded out toward the edges so it
   reads as texture rather than a hard pattern. */
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 10%, black 35%, transparent 85%);
  mask-image: radial-gradient(ellipse 75% 55% at 50% 10%, black 35%, transparent 85%);
}

/* Layer 1 — cool "build" state: blue/violet aurora blobs drifting behind
   the grid, echoing the accent palette instead of a photo. */
.bg-layer-1 {
  opacity: 1;
  background:
    radial-gradient(38rem 26rem at 18% 8%, rgba(224, 110, 100, 0.28), transparent 60%),
    radial-gradient(34rem 24rem at 82% 2%, rgba(179, 58, 58, 0.24), transparent 60%),
    radial-gradient(46rem 30rem at 50% 32%, rgba(224, 110, 100, 0.10), transparent 70%);
  filter: blur(4px);
}

/* Layer 2 — brighter "ship it" state: the same family of glows, pushed
   warmer and more saturated so the crossfade still reads as motion. */
.bg-layer-2 {
  opacity: 0;
  background:
    radial-gradient(40rem 28rem at 26% 4%, rgba(179, 58, 58, 0.34), transparent 62%),
    radial-gradient(36rem 26rem at 76% 10%, rgba(224, 110, 100, 0.30), transparent 62%),
    radial-gradient(50rem 32rem at 50% 30%, rgba(179, 58, 58, 0.14), transparent 72%);
  filter: blur(4px);
}

/* Static variant of the same design used on standalone pages (e.g. 404)
   that don't run the scroll crossfade. */
.bg-image {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg);
}

.bg-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(38rem 26rem at 18% 8%, rgba(224, 110, 100, 0.24), transparent 60%),
    radial-gradient(34rem 24rem at 82% 6%, rgba(179, 58, 58, 0.22), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: auto, auto, 72px 72px, 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 10%, black 35%, transparent 85%);
  mask-image: radial-gradient(ellipse 75% 55% at 50% 10%, black 35%, transparent 85%);
  filter: blur(4px);
}

/* Mirrors the top ambient background at the bottom of the page (footer /
   socials area), so the glow doesn't fade out to flat black for good. */
.bg-bottom {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 130vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.bg-bottom::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(38rem 26rem at 18% 100%, rgba(224, 110, 100, 0.26), transparent 60%),
    radial-gradient(34rem 24rem at 82% 100%, rgba(179, 58, 58, 0.24), transparent 60%),
    radial-gradient(46rem 30rem at 50% 74%, rgba(224, 110, 100, 0.12), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: auto, auto, auto, 72px 72px, 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 92%, black 35%, transparent 85%);
  mask-image: radial-gradient(ellipse 75% 60% at 50% 92%, black 35%, transparent 85%);
  filter: blur(4px);
}

/* Fades the top edge of this layer back into solid black so it blends
   seamlessly with whatever content sits above it (e.g. the Documentation
   section's fade-to-black). */
.bg-bottom::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, transparent 42%);
  pointer-events: none;
}

.bg-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 7, 10, 0.35) 0%, rgba(5, 7, 10, 0.15) 22%, rgba(5, 7, 10, 0.3) 65%, rgba(5, 7, 10, 0.55) 90%, var(--bg) 100%);
  pointer-events: none;
}

/* Extra glow specifically behind the Documentation section, since it sits
   right at the end of the crossfade stack where the scrim would otherwise
   have already faded almost to solid black. */
.bg-layer-doc {
  position: absolute;
  inset: 0;
  opacity: 1;
  background:
    radial-gradient(34rem 24rem at 22% 88%, rgba(179, 58, 58, 0.22), transparent 62%),
    radial-gradient(30rem 22rem at 78% 92%, rgba(224, 110, 100, 0.2), transparent 62%);
  filter: blur(4px);
}

/* Extra fade layer right after Infos, guaranteeing a clean, smooth
   transition into solid black before the following sections. */
.fade-to-black {
  position: relative;
  z-index: 1;
  height: 25vh;
  margin-top: -25vh;
  background: linear-gradient(to bottom, transparent, var(--bg) 90%);
  pointer-events: none;
}

/* -------------------------------------------------------------------- */
/* Header                                                                */
/* -------------------------------------------------------------------- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.6rem var(--header-pad-x);
  background: transparent;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

.logo-icon {
  width: 30px;
  height: auto;
  object-fit: contain;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--fg-dim);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0);
  border: 1px solid transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition),
    backdrop-filter var(--transition),
    transform var(--transition);
}

.nav a:hover,
.nav a:focus-visible,
.nav a.active {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.signin {
  text-decoration: none;
  color: var(--fg-dim);
  font-size: 0.95rem;
  font-weight: 500;
}

.signin:hover {
  color: var(--fg);
}

.btn-getstarted {
  background: var(--fg);
  color: #111;
  border: none;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-getstarted:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.hero {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding: 8rem var(--header-pad-x) 2rem;
}

.hero h1 {
  font-size: 4.5rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.hero h1 span {
  display: block;
}

.hero h1 .muted {
  color: var(--fg-muted);
}

.hero h1 .bright {
  color: var(--fg);
}

.hero p.subtitle {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--fg-dim);
  max-width: 620px;
  margin: 1.4rem 0 2rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.btn-primary {
  background: var(--fg);
  color: #111;
  border: none;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--pill-bg);
  color: var(--fg);
  border: 1px solid var(--pill-border);
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.fine-print {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* -------------------------------------------------------------------- */
/* Sections                                                              */
/* -------------------------------------------------------------------- */

.section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 3rem 2rem;
  text-align: center;
}

.section h2 {
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.section p {
  font-size: 1.05rem;
  color: var(--fg-muted);
  max-width: 600px;
}

/* -------------------------------------------------------------------- */
/* Infos section                                                        */
/* -------------------------------------------------------------------- */

.section-info h2 {
  font-size: 3.4rem;
}

.section-info .info-since {
  margin-top: 2.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg-dim);
  line-height: 1.6;
}

.section-info .info-since span {
  display: block;
  font-weight: 400;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

.stats {
  display: flex;
  gap: 3.5rem;
  margin-top: 2.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, var(--fg) 0%, var(--fg-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

@media (max-width: 700px) {
  .section-info h2 {
    font-size: 2.4rem;
  }

  .stats {
    gap: 2rem;
  }

  .stat-value {
    font-size: 1.7rem;
  }
}

/* -------------------------------------------------------------------- */
/* FAQ section                                                          */
/* -------------------------------------------------------------------- */

.accent {
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-faq {
  align-items: center;
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.section-faq h2 {
  font-size: 3rem;
  margin-bottom: 2.5rem;
}

.faq-list {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.faq-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color var(--transition), background var(--transition);
}

.faq-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg);
  text-align: left;
  padding: 1.3rem 1.6rem;
  font-family: inherit;
}

.faq-index {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  min-width: 1.6rem;
}

.faq-question-text {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
}

.faq-toggle {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--fg-dim);
  transition: transform var(--transition), background var(--transition);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding var(--transition);
}

.faq-answer p {
  padding: 0 1.6rem 1.4rem 3.4rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: none;
  text-align: left;
}

.faq-item.open .faq-toggle {
  transform: rotate(45deg);
  background: rgba(255, 255, 255, 0.1);
}

.faq-item.open {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.16);
}

@media (max-width: 700px) {
  .section-faq h2 {
    font-size: 2.2rem;
  }

  .faq-question {
    padding: 1.1rem 1.2rem;
  }

  .faq-answer p {
    padding: 0 1.2rem 1.2rem 2.9rem;
  }
}

/* -------------------------------------------------------------------- */
/* Socials section                                                      */
/* -------------------------------------------------------------------- */

.section-socials h2 {
  font-size: 3rem;
  margin-bottom: 0.6rem;
}

.socials-list {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 2.2rem;
}

.social-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.1rem 1.4rem;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.social-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.social-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
}

.social-icon svg {
  width: 20px;
  height: 20px;
}

.social-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.social-name {
  font-size: 1rem;
  font-weight: 600;
}

.social-handle {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.social-arrow {
  margin-left: auto;
  color: var(--fg-muted);
  font-size: 1.1rem;
  transition: transform var(--transition);
}

.social-card:hover .social-arrow {
  transform: translateX(3px);
  color: var(--fg);
}

@media (max-width: 700px) {
  .section-socials h2 {
    font-size: 2.2rem;
  }
}

/* -------------------------------------------------------------------- */
/* Portal reveal — clean iris-wipe transition                           */
/* Used on Documentation (from Infos) and Socials (from Documentation). */
/* --p (0 → 1) is written by main.js as each section crosses into view. */
/* -------------------------------------------------------------------- */

.portal-reveal {
  --p: 1;
  position: relative;
  clip-path: circle(calc(14% + var(--p) * 90%) at 50% 42%);
  transform: scale(calc(0.97 + var(--p) * 0.03));
  transition: clip-path 0.08s linear, transform 0.08s linear;
  will-change: clip-path, transform;
}

/* Thin glowing rim that traces the wipe edge — crisp instead of blurry,
   fades out once the section is fully open. */
.portal-glow {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
}

.portal-glow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc((14% + var(--p) * 90%) * 14.2px);
  height: calc((14% + var(--p) * 90%) * 14.2px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(224, 110, 100, calc((1 - var(--p)) * 0.6)),
    0 0 60px 8px rgba(224, 110, 100, calc((1 - var(--p)) * 0.35));
  opacity: calc(1 - var(--p));
}

@media (prefers-reduced-motion: reduce) {
  .portal-reveal {
    clip-path: none !important;
    transform: none !important;
  }

  .portal-glow {
    display: none;
  }
}

/* -------------------------------------------------------------------- */
/* Documentation section                                                */
/* -------------------------------------------------------------------- */

.section-doc h2 {
  font-size: 3rem;
  margin-bottom: 0.8rem;
}

.section-doc p {
  margin-bottom: 2.2rem;
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #5865f2;
  color: #ffffff;
  border: none;
  padding: 0.9rem 1.8rem;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}

.btn-discord:hover {
  background: #4a55d6;
  transform: translateY(-1px);
}

.btn-discord i {
  width: 20px;
  height: 20px;
}

/* -------------------------------------------------------------------- */
/* Lucide icon sizing                                                   */
/* -------------------------------------------------------------------- */

.social-icon i {
  width: 20px;
  height: 20px;
}

.social-arrow i {
  width: 18px;
  height: 18px;
  display: block;
}

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

.footer {
  position: relative;
  z-index: 1;
  padding: 2.5rem 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* -------------------------------------------------------------------- */
/* Responsive                                                            */
/* -------------------------------------------------------------------- */

@media (max-width: 700px) {
  :root {
    --header-pad-x: 1.5rem;
  }

  .nav {
    display: none;
  }

  .hero {
    padding: 7rem 1.5rem 2rem;
  }

  .hero h1 {
    font-size: 2.6rem;
  }

  .hero p.subtitle {
    font-size: 1rem;
  }

  .section h2 {
    font-size: 2.2rem;
  }
}

/* -------------------------------------------------------------------- */
/* Accessibility                                                        */
/* -------------------------------------------------------------------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

/* -------------------------------------------------------------------- */
/* Click bird — a tiny bird flies in from a random screen corner to      */
/* wherever the user clicks.                                             */
/* -------------------------------------------------------------------- */

.click-bird {
  position: fixed;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  will-change: transform, opacity;
}

.click-bird svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.click-bird .wing {
  transform-box: fill-box;
  transform-origin: 100% 50%;
  animation: bird-flap 0.11s ease-in-out infinite alternate;
}

.click-bird .wing-right {
  transform-origin: 0% 50%;
}

@keyframes bird-flap {
  from {
    transform: scaleY(1);
  }
  to {
    transform: scaleY(0.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .click-bird {
    display: none;
  }
}
