/* ==========================================================================
   Auto Dark Mode — website styles
   --------------------------------------------------------------------------
   Sections:
     1. Reset & base
     2. Theme tokens (light / dark / auto + accent variants)
     3. Layout helpers
     4. Header & theme switch
     5. Hero
     6. Intro
     7. Features
     8. Download
     9. Awards
    10. Footer
    11. Responsive
   ========================================================================== */

/* 1. Reset & base ---------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

/* Smooth cross-fade when the theme changes */
body,
body * { transition: background-color .3s ease, border-color .3s ease, color .2s ease, box-shadow .3s ease; }

/* 2. Theme tokens ---------------------------------------------------------- */
:root {
  --bg: #f3f3f1;
  --bg2: #eaeae7;
  --surface: #ffffff;
  --surface2: #fafafa;
  --text: #1a1a1a;
  --text-soft: #565656;
  --text-faint: #8c8c8c;
  --border: rgba(0, 0, 0, .09);
  --border-strong: rgba(0, 0, 0, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 14px 40px rgba(0, 0, 0, .08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .08);
  --header-bg: rgba(243, 243, 241, .82);
  --code-bg: #1c1c1c;
  --code-text: #ededed;
  --code-border: rgba(255, 255, 255, .10);

  /* accent (overridden by [data-accent]) */
  --accent: #f3a01c;
  --accent-hover: #e29110;
  --accent-text: #1b1b1b;
  --logo: var(--accent);

  /* brand palette — taken straight from the colored logo (amber sun + blue moon) */
  --brand-amber: #f3a01c;
  --brand-amber-bright: #ffc23d;
  --brand-orange: #ff8a3d;
  --brand-blue: #2f44c4;
  --brand-indigo: #25307e;
  --grad: linear-gradient(118deg, var(--brand-amber-bright), var(--brand-amber) 42%, var(--brand-blue));

  /* responsive sizing */
  --h1: clamp(2.4rem, 5.4vw, 4.4rem);
  --lead: clamp(1.06rem, 1.7vw, 1.32rem);
  --feat-cols: repeat(2, minmax(0, 1fr));
  --two-cols: 1.04fr 0.96fr;
  --dl-cols: repeat(2, minmax(0, 1fr));
  --nav-disp: flex;
  --pad: clamp(20px, 5vw, 56px);
}

/* Dark tokens shared by "auto + system is dark" and "forced dark" */
@media (prefers-color-scheme: dark) {
  html:not([data-mode="light"]) {
    --bg: #151515;
    --bg2: #1c1c1c;
    --surface: #212121;
    --surface2: #272727;
    --text: #f1f1f1;
    --text-soft: #b3b3b3;
    --text-faint: #7c7c7c;
    --border: rgba(255, 255, 255, .09);
    --border-strong: rgba(255, 255, 255, .18);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 48px rgba(0, 0, 0, .55);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
    --header-bg: rgba(21, 21, 21, .82);
    --code-bg: #000000;
    --code-text: #ededed;
    --code-border: rgba(255, 255, 255, .08);
  }
}

html[data-mode="dark"] {
  --bg: #151515;
  --bg2: #1c1c1c;
  --surface: #212121;
  --surface2: #272727;
  --text: #f1f1f1;
  --text-soft: #b3b3b3;
  --text-faint: #7c7c7c;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .18);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 48px rgba(0, 0, 0, .55);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --header-bg: rgba(21, 21, 21, .82);
  --code-bg: #000000;
  --code-text: #ededed;
  --code-border: rgba(255, 255, 255, .08);
}

/* Accent variants */
html[data-accent="amber"] { --accent: #f3a01c; --accent-hover: #e29110; --accent-text: #1b1b1b; }
html[data-accent="blue"]  { --accent: #2f6fed; --accent-hover: #2a63d6; --accent-text: #ffffff; }
html[data-accent="green"] { --accent: #15883e; --accent-hover: #127537; --accent-text: #ffffff; }

/* 3. Layout helpers -------------------------------------------------------- */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.section { padding: clamp(60px, 8vw, 108px) 0; }
.section--alt { background: var(--bg2); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .76rem;
  font-weight: 700;
  color: var(--accent);
}

.h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 14px 0 0;
}

/* Theme-aware screenshots */
.shot {
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.shot-dark { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-mode="light"]) .shot-light { display: none; }
  html:not([data-mode="light"]) .shot-dark { display: block; }
}
html[data-mode="dark"] .shot-light { display: none; }
html[data-mode="dark"] .shot-dark { display: block; }
html[data-mode="light"] .shot-light { display: block; }
html[data-mode="light"] .shot-dark { display: none; }

/* Buttons & links */
.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 650;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 9px;
  cursor: pointer;
}
.btn--primary {
  background: var(--accent);
  background-image: linear-gradient(135deg, var(--brand-amber-bright), var(--brand-amber) 48%, var(--brand-orange));
  color: var(--accent-text);
  border: 0;
  box-shadow: 0 8px 24px -8px rgba(243, 160, 28, .6), var(--shadow-sm);
}
.btn--primary:hover { filter: brightness(1.05); box-shadow: 0 10px 28px -8px rgba(243, 160, 28, .72), var(--shadow-sm); }
.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn--ghost:hover { background: var(--surface2); border-color: var(--border-strong); }
.btn--invert {
  background: var(--text);
  color: var(--bg);
  border: 0;
}
.btn--invert:hover { background: var(--text-soft); }

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.link:hover { text-decoration: underline; }

/* 4. Header & theme switch ------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 13px;
  padding-bottom: 13px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
}
.brand__mark {
  display: inline-block;
  width: 28px;
  height: 28px;
  flex: none;
  background: var(--logo);
  -webkit-mask: url("../assets/logo.svg") center / contain no-repeat;
  mask: url("../assets/logo.svg") center / contain no-repeat;
}
/* Full-color logo mark — overrides the monochrome mask above. */
.brand__mark--color {
  width: 30px;
  height: 30px;
  background: url("../assets/logo-color.png") center / contain no-repeat;
  -webkit-mask: none;
  mask: none;
}
.brand__name { font-weight: 650; font-size: 1.02rem; letter-spacing: -.01em; }

.header__right { display: flex; align-items: center; gap: 8px; }
.nav { display: var(--nav-disp); align-items: center; gap: 24px; margin-right: 14px; }
.nav a {
  text-decoration: none;
  color: var(--text-soft);
  font-size: .92rem;
  font-weight: 550;
}
.nav a:hover { color: var(--text); }

.switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 7px;
  cursor: pointer;
  line-height: 1;
}
.seg:hover { color: var(--text); }
html[data-mode="light"] .seg[data-seg="light"],
html[data-mode="dark"] .seg[data-seg="dark"],
html:not([data-mode="light"]):not([data-mode="dark"]) .seg[data-seg="auto"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* 5. Hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(56px, 9vw, 118px) 0 clamp(40px, 6vw, 76px);
}

/* Logo-colored aurora behind the hero. Blobs drift on their own; the whole
   field rotates with scroll (--hero-rot is set in main.js). A soft scrim keeps
   the headline readable on top of the color. */
.hero__aurora {
  position: absolute;
  inset: -28%;
  z-index: -2;
  pointer-events: none;
  filter: blur(62px) saturate(132%);
  transform: rotate(var(--hero-rot, 0deg)) scale(1.04);
  will-change: transform;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(62% 56% at 50% 44%, var(--bg) 8%, transparent 74%);
  opacity: .62;
}

.hero__blob {
  position: absolute;
  width: 48%;
  height: 48%;
  border-radius: 50%;
  opacity: .5;
  animation: blobDrift 18s ease-in-out infinite alternate;
}
.hero__blob--1 { top: -6%;  left: 4%;   background: radial-gradient(circle, var(--brand-amber-bright), transparent 68%); animation-duration: 19s; }
.hero__blob--2 { top: -10%; right: 2%;  background: radial-gradient(circle, var(--brand-orange), transparent 66%);       animation-duration: 23s; animation-delay: -4s; }
.hero__blob--3 { bottom: -12%; right: 6%; background: radial-gradient(circle, var(--brand-blue), transparent 66%);        animation-duration: 21s; animation-delay: -8s; }
.hero__blob--4 { bottom: -8%;  left: -2%; background: radial-gradient(circle, var(--brand-indigo), transparent 68%);      animation-duration: 25s; animation-delay: -2s; }
.hero__blob--5 { top: 24%; left: 30%; width: 42%; height: 42%; opacity: .42; background: radial-gradient(circle, var(--brand-amber), transparent 64%); animation-duration: 27s; animation-delay: -11s; }

@keyframes blobDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(6%, -5%) scale(1.12); }
  100% { transform: translate(-5%, 7%) scale(.95); }
}

.hero__inner { text-align: center; }
.hero__title {
  font-size: var(--h1);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.03em;
  max-width: 14ch;
  margin: 18px auto 0;
}
.hero__tagline {
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  font-weight: 550;
  color: var(--text);
  max-width: 30ch;
  margin: 20px auto 0;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.hero__lead {
  font-size: var(--lead);
  color: var(--text-soft);
  max-width: 58ch;
  margin: 18px auto 0;
  line-height: 1.6;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 34px;
}
.hero__media {
  max-width: 1000px;
  margin: clamp(44px, 6vw, 76px) auto 0;
}
.hero__note {
  text-align: center;
  color: var(--text-faint);
  font-size: .84rem;
  margin: 16px 0 0;
}

/* 6. Intro ----------------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: var(--two-cols);
  gap: clamp(34px, 5vw, 68px);
  align-items: center;
}
.intro__lead {
  font-size: 1.18rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  font-weight: 500;
}
.intro__p {
  font-size: 1.05rem;
  color: var(--text-soft);
  line-height: 1.7;
  margin: 20px 0 0;
}

/* 7. Features -------------------------------------------------------------- */
.features__grid {
  display: grid;
  grid-template-columns: var(--feat-cols);
  gap: 0 clamp(28px, 4vw, 56px);
  margin-top: 36px;
}
.feature {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 15px 0;
  border-top: 1px solid var(--border);
  font-size: 1.02rem;
  line-height: 1.5;
}
.features__grid .feature:last-child { border-bottom: 1px solid var(--border); }
.feature__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 8px;
  flex: none;
}
.footnote {
  font-size: .86rem;
  color: var(--text-faint);
  margin: 18px 0 0;
}

/* 8. Download -------------------------------------------------------------- */
.dl-grid {
  display: grid;
  grid-template-columns: var(--dl-cols);
  gap: 18px;
  margin-top: 36px;
}
.dl-grid + .dl-grid { margin-top: 18px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  min-width: 0;
}
.card__title { font-weight: 650; font-size: 1.12rem; }
.card__text {
  color: var(--text-soft);
  font-size: .95rem;
  margin: 8px 0 20px;
  line-height: 1.55;
}
.card__text--tight { margin: 8px 0 14px; font-size: .92rem; }

.cmd-stack { display: flex; flex-direction: column; gap: 9px; }
.cmd {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 9px;
  padding: 10px 10px 10px 14px;
}
.cmd code {
  font-family: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
  color: var(--code-text);
  font-size: .9rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}
.cmd__copy {
  flex: none;
  border: 1px solid var(--code-border);
  background: transparent;
  color: var(--code-text);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
.cmd__copy:hover { background: rgba(255, 255, 255, .12); }

.install { margin-top: 30px; max-width: 760px; }
.install p { color: var(--text-soft); font-size: .98rem; line-height: 1.65; margin: 0; }
.install p + p { margin-top: 14px; }
.install code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .9em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

/* 9. Awards ---------------------------------------------------------------- */
.award__title {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 14px 0 0;
  max-width: 16ch;
}
.award__text {
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 18px 0 24px;
  max-width: 48ch;
}
.award__img { width: 100%; max-width: 420px; height: auto; border-radius: 16px; box-shadow: var(--shadow); }

/* 10. Footer --------------------------------------------------------------- */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: clamp(48px, 6vw, 76px) 0 40px;
}
.footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
}
.footer__brand { max-width: 34ch; }
.footer__brand p { color: var(--text-soft); font-size: .92rem; line-height: 1.6; margin: 14px 0 0; }
.footer__cols { display: flex; gap: clamp(36px, 6vw, 72px); flex-wrap: wrap; }
.footer__col { display: flex; flex-direction: column; gap: 11px; }
.footer__head {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-faint);
  font-weight: 700;
}
.footer__col a { color: var(--text-soft); text-decoration: none; font-size: .93rem; }
.footer__col a:hover { color: var(--text); }
.footer__bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: .9rem;
}

/* 11. Carousel ------------------------------------------------------------- */
/* Full-bleed gallery wrapper — spans nearly the full viewport width */
.gallery__bleed {
  width: 100%;
  box-sizing: border-box;
  padding-inline: clamp(16px, 3vw, 44px);
}
.gallery__panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: clamp(18px, 2.5vw, 28px);
  padding: clamp(22px, 3.5vw, 48px);
  box-shadow: var(--shadow);
}
.carousel { position: relative; margin-top: 0; --vp-pad: clamp(8px, 1.6vw, 22px); }
.carousel__viewport {
  position: relative;
  width: 100%;
  height: clamp(420px, 50vw, 780px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.carousel__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--vp-pad, clamp(14px, 3vw, 40px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}
.carousel__slide.is-active { opacity: 1; pointer-events: auto; }
.carousel__slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.carousel__cap {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  background: rgba(18, 18, 18, .72);
  color: #fff;
  font-size: .82rem;
  font-weight: 550;
  padding: 6px 14px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  white-space: nowrap;
}
.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel__arrow:hover { background: var(--surface2); }
.carousel__arrow svg { width: 20px; height: 20px; }
.carousel__arrow--prev { left: 14px; }
.carousel__arrow--next { right: 14px; }
.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
}
.carousel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
  transition: background-color .25s ease, width .25s ease;
}
.carousel__dot:hover { background: var(--text-faint); }
.carousel__dot.is-active { background: var(--grad); width: 26px; }

/* Gallery header */
.gallery__head { margin-bottom: clamp(20px, 3vw, 32px); }

/* 12. Responsive ----------------------------------------------------------- */
@media (max-width: 820px) {
  :root {
    --feat-cols: 1fr;
    --two-cols: 1fr;
    --dl-cols: 1fr;
    --nav-disp: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body, body * { transition: none; }
  .hero__blob { animation: none; }
  .hero__aurora { transform: none; }
}
