/* ============================================================
   NeoChat Desktop (NEO) — Modern Landing Page Styles
   ============================================================ */

:root {
  --accent-rgb: 255, 176, 0;
  --accent2-rgb: 255, 201, 51;
  --bg-rgb: 11, 7, 0;
  --bg2-rgb: 17, 11, 0;
  --fg-rgb: 255, 255, 255;
  --on-accent: #0b0700;
  --font-head: 'VT323', 'IBM Plex Mono', monospace;
  --font-body: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  /* Colors */
  --bg: #0b0700;
  --bg-2: #110b00;
  --surface: rgba(var(--accent-rgb), 0.04);
  --surface-2: rgba(var(--accent-rgb), 0.07);
  --border: rgba(var(--accent-rgb), 0.22);
  --border-light: rgba(var(--accent-rgb), 0.45);

  --text: #ffd27a;
  --text-2: rgba(255, 190, 70, 0.75);
  --text-3: rgba(255, 190, 70, 0.58);

  /* NEO Brand Electric Blue & Cyan */
  --brand: #ffb000;
  --brand-2: #ffc933;
  --brand-glow: rgba(var(--accent-rgb), 0.25);
  --accent: #ffc933;
  --accent-glow: rgba(var(--accent2-rgb), 0.25);
  --accent-2: var(--brand);

  --blue: var(--brand);
  --green: var(--brand);
  --purple: var(--brand);
  --orange: var(--brand);
  --pink: var(--brand);
  --cyan: var(--brand);
  --indigo: var(--brand);
  --teal: var(--brand);

  /* Radius */
  --r-sm: 2px;
  --r-md: 3px;
  --r-lg: 4px;
  --r-xl: 6px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.65);
  --shadow-glow: rgba(var(--fg-rgb),.08) 0 0 16px, rgba(var(--fg-rgb),.04) 0 0 32px;

  --maxw: 1200px;
  --nav-h: 72px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.nav,
main,
.footer {
  position: relative;
  z-index: 1;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
/* Safety net: a screenshot must never be stretched. Where a box is forced to a
   fixed size, letterbox the image instead of deforming it. */
.hero__screenshot img,
.feature-showcase__img img,
.gallery-item img,
.lightbox__img { object-fit: contain; }
code, pre { font-family: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; }
html[data-head='retro'] h1, html[data-head='retro'] h2 { font-weight: 400; letter-spacing: 0.01em; text-transform: uppercase; line-height: 1.05; }
html[data-head='retro'] h1 { font-size: clamp(2.8rem, 8vw, 5rem); }
html[data-head='retro'] h3 { font-weight: 400; font-size: 1.5rem; letter-spacing: 0.02em; }
::selection { background: var(--brand); color: var(--on-accent); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px; left: 16px;
  background: var(--brand);
  color: var(--on-accent);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  z-index: 999;
  font-weight: 700;
  font-size: 0.9rem;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ===== Layout Containers ===== */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 24px);
}
.container--narrow { max-width: 860px; }

.legal-page {
  min-height: 100vh;
  padding: 56px 0 80px;
  background:
    radial-gradient(circle at 15% 0%, rgba(var(--accent-rgb), 0.18), transparent 34%),
    var(--bg);
}
.legal-page__back {
  display: inline-block;
  margin-bottom: 48px;
  color: var(--accent);
  font-weight: 700;
}
.legal-page h1 {
  margin-top: 18px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.1;
}
.legal-page__updated {
  margin-top: 12px;
  color: var(--text-3);
}
.legal-page__section {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.legal-page__section h2 {
  margin-bottom: 12px;
  font-size: 1.35rem;
}
.legal-page__section p + p { margin-top: 14px; }
.legal-page__section p { color: var(--text-2); }
.legal-page__section a { color: var(--accent); text-decoration: underline; }

.contact-section { background: var(--bg-2); }
.contact-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  gap: 64px;
  align-items: start;
}
.contact-copy__note {
  margin-top: 22px;
  color: var(--text-3);
  font-size: 0.92rem;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 700;
}
.contact-form input:not([type="hidden"]),
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  font-size: 0.94rem;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.contact-form__submit { align-self: flex-start; }
.contact-form__honey {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.contact-success__back { display: inline-flex; margin-top: 28px; }

/* ===== Background Decor ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(var(--fg-rgb), 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--fg-rgb), 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  z-index: -2;
  pointer-events: none;
}

.bg-aurora {
  position: fixed;
  inset: -18vh -12vw;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.94;
  filter: saturate(135%);
  transform: translateZ(0);
  --mouse-x: 50%;
  --mouse-y: 35%;
}
.bg-aurora::before {
  content: '';
  position: absolute;
  inset: 7% 10% 12% 18%;
  background-image:
    radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(255, 190, 70, 0.3), transparent 22%),
    radial-gradient(circle, rgba(255, 190, 70, 0.72) 1px, transparent 1.7px);
  background-size: 12px 12px;
  background-position: 0 0;
  opacity: 0.42;
  mask-image: radial-gradient(ellipse 55% 52% at 56% 48%, #000 0%, rgba(0, 0, 0, 0.86) 34%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 55% 52% at 56% 48%, #000 0%, rgba(0, 0, 0, 0.86) 34%, transparent 76%);
  animation: particle-field-drift 24s ease-in-out infinite alternate;
}
.bg-aurora::after {
  content: '';
  position: absolute;
  width: 76vw;
  height: 140vh;
  top: -44vh;
  left: 28vw;
  background:
    radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(var(--accent2-rgb), 0.22), transparent 20%),
    linear-gradient(108deg, transparent 31%, rgba(255, 210, 120, 0.13) 45%, rgba(var(--accent-rgb), 0.1) 52%, transparent 67%);
  opacity: 0.8;
  filter: blur(28px);
  transform: rotate(-12deg);
  animation: light-beam-drift 28s ease-in-out infinite alternate;
}
.bg-aurora__ribbon {
  position: absolute;
  width: 78vw;
  height: 34vh;
  border: 2px solid transparent;
  border-radius: 48% 52% 44% 56%;
  transform-origin: center;
  will-change: transform;
  mix-blend-mode: screen;
  filter: blur(12px);
  --pointer-x: 0px;
  --pointer-y: 0px;
}
.bg-aurora__ribbon::after {
  content: '';
  position: absolute;
  inset: 9% 4%;
  border: inherit;
  border-radius: inherit;
  opacity: 0.55;
}
.bg-aurora__ribbon--blue {
  top: 4vh;
  left: -12vw;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.28), transparent 68%);
  border-color: rgba(var(--accent-rgb), 0.42);
  box-shadow: 0 0 34px rgba(var(--accent-rgb), 0.22), inset 0 0 34px rgba(var(--accent-rgb), 0.12);
  animation: aurora-drift-blue 20s ease-in-out infinite alternate;
}
.bg-aurora__ribbon--cyan {
  top: 22vh;
  right: -16vw;
  width: 70vw;
  background: radial-gradient(ellipse, rgba(var(--accent2-rgb), 0.22), transparent 68%);
  border-color: rgba(var(--accent2-rgb), 0.34);
  box-shadow: 0 0 38px rgba(var(--accent2-rgb), 0.18), inset 0 0 30px rgba(var(--accent2-rgb), 0.1);
  animation: aurora-drift-cyan 26s ease-in-out infinite alternate;
}
.bg-aurora__ribbon--violet {
  top: 52vh;
  left: 14vw;
  width: 62vw;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.18), transparent 68%);
  opacity: 0.7;
  border-color: rgba(var(--accent-rgb), 0.26);
  box-shadow: 0 0 42px rgba(var(--accent-rgb), 0.14), inset 0 0 32px rgba(var(--accent-rgb), 0.08);
  animation: aurora-drift-violet 30s ease-in-out infinite alternate;
}
@keyframes aurora-drift-blue {
  from { transform: translate3d(calc(-4vw + var(--pointer-x)), calc(-2vh + var(--pointer-y)), 0) rotate(-8deg) scale(1); }
  to { transform: translate3d(calc(12vw + var(--pointer-x)), calc(12vh + var(--pointer-y)), 0) rotate(5deg) scale(1.16); }
}
@keyframes aurora-drift-cyan {
  from { transform: translate3d(calc(8vw + var(--pointer-x)), calc(4vh + var(--pointer-y)), 0) rotate(12deg) scale(1.08); }
  to { transform: translate3d(calc(-14vw + var(--pointer-x)), calc(-10vh + var(--pointer-y)), 0) rotate(-7deg) scale(0.94); }
}
@keyframes aurora-drift-violet {
  from { transform: translate3d(calc(-8vw + var(--pointer-x)), calc(5vh + var(--pointer-y)), 0) rotate(-12deg) scale(0.96); }
  to { transform: translate3d(calc(10vw + var(--pointer-x)), calc(-8vh + var(--pointer-y)), 0) rotate(9deg) scale(1.1); }
}
@keyframes particle-field-drift {
  from { transform: translate3d(-2vw, 1vh, 0) scale(1); background-position: 0 0; }
  to { transform: translate3d(3vw, -2vh, 0) scale(1.08); background-position: 22px -16px; }
}
@keyframes light-beam-drift {
  from { transform: translate3d(-6vw, 0, 0) rotate(-12deg); opacity: 0.45; }
  to { transform: translate3d(12vw, 3vh, 0) rotate(-7deg); opacity: 0.9; }
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  will-change: filter;
}
@media (prefers-reduced-motion: reduce) {
  .bg-glow { filter: blur(60px); opacity: 0.15 !important; }
  .bg-aurora::before,
  .bg-aurora::after,
  .bg-aurora__ribbon { animation: none !important; }
  .reveal { transition: none !important; }
}
.bg-glow--1 {
  width: 650px; height: 650px;
  background: radial-gradient(circle, var(--brand) 0%, transparent 70%);
  top: -240px; left: -150px;
  opacity: 0.45;
}
.bg-glow--2 {
  width: 550px; height: 550px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: 150px; right: -180px;
  opacity: 0.3;
}
.bg-glow--3 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, #ffb000 0%, transparent 70%);
  bottom: 5%; left: 30%;
  opacity: 0.2;
}

/* Trim the costliest decorative layers on phones: the particle field repaints
   via background-position every frame (not GPU-composited), and heavy blur
   filters over a full-viewport element are slow on mid/low-end mobile GPUs. */
@media (max-width: 768px) {
  .bg-aurora::before { display: none; }
  .bg-aurora::after { filter: blur(16px); }
  .bg-aurora__ribbon { filter: blur(8px); }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  line-height: 1;
}
.btn .icon { width: 18px; height: 18px; flex-shrink: 0; }
.btn--sm { padding: 9px 18px; font-size: 0.86rem; border-radius: 2px; }
.btn--lg { padding: 15px 32px; font-size: 1.05rem; border-radius: 2px; }
.btn--block { width: 100%; }

.btn--primary {
  background: #ffb000;
  color: var(--on-accent);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.45);
}
.btn--primary:hover {
  background: #ffc933;
}

.btn--ghost {
  background: rgba(var(--fg-rgb), 0.06);
  border-color: rgba(var(--fg-rgb), 0.15);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.btn--ghost:hover {
  background: rgba(var(--fg-rgb), 0.09);
  border-color: var(--border-light);
  transform: translateY(-2px);
}

/* ===== Badges & Pills ===== */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(var(--accent2-rgb), 0.08);
  border: 1px solid rgba(var(--accent2-rgb), 0.25);
  margin-bottom: 20px;
}
.badge--pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-2);
  background: rgba(var(--fg-rgb), 0.04);
  border: 1px solid var(--border);
}
.pulse-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}

.gradient-text {
  background: linear-gradient(135deg, #ffd27a 30%, #ffb000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Navbar ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(var(--bg-rgb), 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: var(--border);
}
.nav__inner {
  height: 100%;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  white-space: nowrap;
}
.nav__logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.3);
}
.nav__brand-text strong {
  color: var(--accent);
  font-weight: 800;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 1;
  min-width: 0;
}
.nav__links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav__links a:hover { color: var(--text); }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav__github {
  padding: 9px;
}
.nav__github .icon {
  width: 18px;
  height: 18px;
}
.lang-toggle {
  min-width: 44px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.nav__mobile-cta {
  margin-top: 4px;
  justify-content: center;
}
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
}
.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}
.nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

body.no-scroll { overflow: hidden; }
.nav__mobile {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: absolute;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  box-shadow: var(--shadow-lg);
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, padding 0.35s ease, visibility 0.35s;
}
.nav__mobile.open {
  max-height: min(480px, calc(100vh - var(--nav-h)));
  opacity: 1;
  visibility: visible;
  padding: 20px 24px 28px;
}
@media (prefers-reduced-motion: reduce) {
  .nav__mobile { transition: none; }
}
.nav__mobile a {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 500;
}

/* ===== Hero Section ===== */
.hero {
  padding: calc(var(--nav-h) + clamp(28px, 6vw, 60px)) 0 clamp(48px, 9vw, 80px);
  position: relative;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
  mix-blend-mode: screen;
}
@media (prefers-reduced-motion: reduce) {
  .hero-canvas { display: none; }
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 50px;
  align-items: center;
}
.hero__title {
  font-size: clamp(2.3rem, 4.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
}
.hero__subtitle {
  font-size: 1.12rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 580px;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}
.hero__platforms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 0.88rem;
  color: var(--text-3);
}
.platform-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}
.platform-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(var(--fg-rgb), 0.04);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-2);
}
.platform-tag.active-os {
  border-color: var(--brand);
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--text);
}

.hero__visual { position: relative; }

/* Floating Badges on Hero */
.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(var(--bg2-rgb), 0.88);
  border: 1px solid var(--border-light);
  padding: 12px 18px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
  z-index: 2;
  font-size: 0.85rem;
}
.float-card strong { display: block; color: var(--text); font-size: 0.88rem; }
.float-card small { color: var(--text-3); }
.float-card__icon { font-size: 1.4rem; }

.float-card--1 {
  top: -24px;
  right: -24px;
}
.float-card--2 {
  bottom: 30px;
  left: -32px;
}
.float-card--3 {
  bottom: -22px;
  right: 20px;
}

/* ===== Trust Section ===== */
.trust {
  padding: clamp(28px, 5vw, 40px) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(var(--bg2-rgb), 0.6);
}
.trust__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.trust__label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.trust__logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.trust__pill {
  background: rgba(var(--fg-rgb), 0.03);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-2);
}

/* ===== Section Shared ===== */
.section {
  padding: clamp(56px, 9vw, 100px) 0;
  position: relative;
}
.section--alt {
  background: var(--bg-2);
}
.section__head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto clamp(36px, 6vw, 60px);
}
.section__title {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.2;
}
.section__subtitle {
  font-size: 1.05rem;
  color: var(--text-2);
  line-height: 1.6;
}
.section__head--gallery { margin-top: 64px; }
.faq__list { margin: 10px 0 10px 20px; }

/* ===== Interactive Mode Showcase ===== */
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto 36px;
}
.mode-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s;
  color: var(--text-2);
}
.mode-tab__icon { font-size: 1.6rem; }
.mode-tab strong { display: block; font-size: 1rem; color: var(--text); }
.mode-tab small { font-size: 0.8rem; color: var(--text-3); }

.mode-tab.active {
  background: var(--surface-2);
  border-color: var(--brand);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.25);
  color: var(--text);
}
.mode-tab.active strong { color: var(--accent); }

.mode-panel {
  display: none;
}
.mode-panel.active {
  display: block;
}
.mode-panel[hidden] { display: none; }

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 40px);
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(24px, 5vw, 40px);
}
.mode-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--green);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  margin-bottom: 16px;
}
.mode-tag--power {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  border-color: rgba(var(--accent2-rgb), 0.3);
}

.mode-desc h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.mode-desc p {
  color: var(--text-2);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text);
}
.check-list svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.preview-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
}
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.preview-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
}
.status-indicator {
  font-size: 0.75rem;
  color: var(--green);
}
.status-indicator--power { color: var(--accent); }

.preview-chat-simple .bubble {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.preview-chat-simple .bubble.user {
  background: rgba(var(--accent-rgb), 0.15);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
}
.preview-chat-simple .bubble.ai {
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.preview-power-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.param-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--text-2);
}
.param-row code {
  font-size: 0.78rem;
  color: var(--accent);
  background: rgba(var(--accent2-rgb), 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}
.slider-mock {
  width: 120px;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.slider-mock span {
  display: block;
  height: 100%;
  background: var(--brand);
}
.badge-mini {
  font-size: 0.74rem;
  background: rgba(var(--fg-rgb), 0.06);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text);
}
.badge-mini--green {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--green);
}

/* ===== Features Grid ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(22px, 5vw, 32px) clamp(20px, 5vw, 28px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}
.feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.feature-card__icon svg { width: 24px; height: 24px; }
.feature-card__icon--blue { background: rgba(var(--accent-rgb), 0.15); color: #ffb000; }
.feature-card__icon--green { background: rgba(var(--accent-rgb), 0.15); color: #ffb000; }
.feature-card__icon--purple { background: rgba(var(--accent-rgb), 0.15); color: #ffb000; }
.feature-card__icon--orange { background: rgba(var(--accent-rgb), 0.15); color: #ffb000; }
.feature-card__icon--pink { background: rgba(var(--accent-rgb), 0.15); color: #ffb000; }
.feature-card__icon--cyan { background: rgba(var(--accent-rgb), 0.15); color: #06b6d4; }
.feature-card__icon--indigo { background: rgba(var(--accent-rgb), 0.15); color: #ffb000; }
.feature-card__icon--teal { background: rgba(var(--accent-rgb), 0.15); color: #ffb000; }

.feature-card h3 {
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.feature-card p {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.6;
}


/* ===== Tokens ===== */
.tokens__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.tokens__stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  text-align: center;
}
.tokens__stat strong {
  display: block;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tokens__stat span { font-size: 0.9rem; color: var(--text-2); }
.tokens__layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
  align-items: start;
}
.tokens__list { display: grid; gap: 16px; }
.tokens__shot { position: sticky; top: calc(var(--nav-h) + 24px); }
.tokens__caption {
  margin-top: 14px;
  text-align: center;
  color: var(--text-2);
  font-size: 0.95rem;
}
@media (max-width: 900px) {
  .tokens__layout { grid-template-columns: 1fr; }
  .tokens__shot { position: static; }
}
@media (max-width: 600px) {
  .tokens__stats { grid-template-columns: 1fr; }
}

/* ===== Comparison Table ===== */
.compare-table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}
.compare-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.compare-table th,
.compare-table td {
  padding: 14px 18px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.compare-table thead th {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-2);
}
.compare-table tbody th {
  text-align: left;
  font-weight: 500;
  color: var(--text);
  white-space: normal;
}
.compare-table thead th:first-child {
  text-align: left;
}
.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: none;
}
.compare-table__highlight {
  background: rgba(var(--accent-rgb), 0.08);
  border-left: 1px solid rgba(var(--accent2-rgb), 0.25);
  border-right: 1px solid rgba(var(--accent2-rgb), 0.25);
  color: var(--accent);
}
.compare-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.compare-icon--yes { color: var(--green); }
.compare-icon--no { color: var(--text-3); opacity: 0.5; }
.compare-footnote {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-3);
}
.compare-disclaimer {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-3);
}
.compare-disclaimer a { color: var(--accent); text-decoration: underline; }

/* ===== Download (single CTA) ===== */
.download-simple {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.download-simple__note {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--text-2);
}
.download-simple__platforms {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
  text-align: left;
}
.download-simple__platforms li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px 18px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.download-simple__platforms li.is-recommended {
  border-color: var(--accent);
  background: var(--surface-2);
  transform: translateY(-3px);
}
.download-simple__platforms svg {
  color: var(--accent);
  margin-bottom: 10px;
}
.download-simple__platforms strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}
.download-simple__platforms small {
  color: var(--text-3);
  font-size: 0.82rem;
  line-height: 1.5;
  display: block;
}
.download-simple__platforms a {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}
.download-simple__platforms a:hover { text-decoration: underline; }
@media (max-width: 700px) {
  .download-simple__platforms { grid-template-columns: 1fr; }
}

/* ===== FAQ Accordion ===== */
.faq {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq__item[open] {
  border-color: var(--border-light);
}
.faq__item summary {
  padding: 20px 24px;
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.2s;
}
.faq__item[open] summary::after {
  content: '−';
}
.faq__content {
  padding: 0 24px 22px;
  color: var(--text-2);
  font-size: 0.94rem;
  line-height: 1.65;
}
.faq__content a { color: var(--accent); text-decoration: underline; }
.faq__content code {
  color: var(--accent);
  background: rgba(var(--accent2-rgb), 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ===== CTA Final ===== */
.cta-final {
  padding: clamp(56px, 8vw, 80px) 0 clamp(72px, 10vw, 100px);
}
.cta-final__box {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15) 0%, rgba(var(--accent2-rgb), 0.08) 100%), var(--surface);
  border: 1px solid rgba(var(--accent2-rgb), 0.3);
  border-radius: var(--r-xl);
  padding: clamp(40px, 8vw, 70px) clamp(24px, 6vw, 40px);
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(var(--accent-rgb), 0.2);
}
.cta-final__icon {
  margin: 0 auto 20px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.4);
}
.cta-final__box h2 {
  font-size: clamp(2rem, 3.5vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.cta-final__box p {
  font-size: 1.1rem;
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto 32px;
}
.cta-final__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: clamp(48px, 8vw, 80px) 0 40px;
}
.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 2fr;
  gap: clamp(32px, 6vw, 60px);
  margin-bottom: clamp(36px, 6vw, 60px);
}
.footer__brand {
  display: flex;
  gap: 16px;
}
.footer__logo {
  border-radius: 8px;
  flex-shrink: 0;
}
.footer__brand strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.footer__brand p {
  font-size: 0.88rem;
  color: var(--text-3);
  max-width: 320px;
}
.footer__links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.footer__col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 18px;
}
.footer__col a {
  display: block;
  font-size: 0.88rem;
  color: var(--text-3);
  margin-bottom: 10px;
  transition: color 0.2s;
}
.footer__col a:hover { color: var(--accent); }

.footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: 30px;
}
.footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-3);
}
.footer__bottom a { color: var(--text-2); }
.footer__bottom a:hover { color: var(--text); }

/* ===== Reveal Animation on Scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive Breakpoints ===== */
@media (max-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 60px;
    text-align: center;
  }
  .hero__subtitle { margin: 0 auto 36px; }
  .hero__cta { justify-content: center; }
  .hero__platforms { justify-content: center; }
  .float-card--2 { left: 10px; }
  .mode-grid { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 1220px) {
  .nav__links, .nav__actions .btn { display: none; }
  .nav__toggle { display: flex; }
}

@media (max-width: 768px) {
  .mode-tabs { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .footer__links { grid-template-columns: 1fr 1fr; }
  .footer__bottom-inner { flex-direction: column; gap: 12px; text-align: center; }

  /* Floating hero badges reflow into a clean stacked list instead of
     overlapping the screenshot on narrow viewports. */
  .hero__visual {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .float-card {
    position: static;
    width: 100%;
    backdrop-filter: none;
    box-shadow: none;
  }
}

@media (max-width: 480px) {
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { width: 100%; }
  .cta-final__actions { flex-direction: column; align-items: stretch; }
  .cta-final__actions .btn { width: 100%; }
  .download-simple__btn { width: 100%; }
  .footer__links { grid-template-columns: 1fr; gap: 28px; }
  .nav__brand-text { font-size: 1rem; }
}

/* ============================================================
   Screenshot Showcase — Gallery & Lightbox
   ============================================================ */

/* --- Screenshot Gallery Section --- */
.showcase { padding: clamp(48px, 8vw, 80px) 0; }
.showcase .section__head { text-align: center; margin-bottom: 48px; }

/* Horizontal scrolling gallery strip */
.gallery-strip {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 16px 0 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.gallery-strip::-webkit-scrollbar { height: 6px; }
.gallery-strip::-webkit-scrollbar-track { background: transparent; }
.gallery-strip::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

.gallery-item {
  flex: 0 0 auto;
  scroll-snap-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
}
.gallery-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 30px var(--brand-glow);
  border-color: var(--brand);
}
.gallery-item {
  width: 340px;
}
/* contain (never cover): screenshots are letterboxed, never cropped or stretched */
.gallery-item img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: contain;
  object-position: center;
  background: var(--bg-2);
}
.gallery-item__label {
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--text-2);
  text-align: center;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  white-space: nowrap;
}

/* --- Feature Showcase with real screenshot --- */
.feature-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 80px;
}
.feature-showcase--reverse { direction: rtl; }
.feature-showcase--reverse > * { direction: ltr; }

.feature-showcase__text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.feature-showcase__text .badge { align-self: flex-start; }
.feature-showcase__text h3 {
  font-size: clamp(1.4rem, 3.6vw, 1.75rem);
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.feature-showcase__text p {
  color: var(--text-2);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0;
}
.feature-showcase__text .check-list { margin-top: 8px; }

.feature-showcase__img {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
}
.feature-showcase__img:hover {
  transform: scale(1.03);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 40px var(--brand-glow);
}
.feature-showcase__img img {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 24px;
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox__img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: var(--r-lg);
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  object-fit: contain;
}
.lightbox__close {
  position: absolute;
  top: 24px;
  right: 32px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(var(--fg-rgb),0.12);
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox__close:hover { background: rgba(var(--fg-rgb),0.25); }
.lightbox__caption {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(var(--fg-rgb),0.75);
  font-size: 0.9rem;
  text-align: center;
  padding: 8px 24px;
  background: rgba(0,0,0,0.5);
  border-radius: var(--r-sm);
  max-width: 80vw;
}
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(var(--fg-rgb),0.1);
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox__nav:hover { background: rgba(var(--fg-rgb),0.25); }
.lightbox__nav--prev { left: 24px; }
.lightbox__nav--next { right: 24px; }

/* --- Hero screenshot --- */
.hero__screenshot {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), 0 0 60px var(--brand-glow);
  transition: transform 0.4s ease;
  cursor: pointer;
}
.hero__screenshot:hover { transform: scale(1.02); }
.hero__screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Keyboard-operable image triggers (gallery, showcase, hero) --- */
.gallery-item[role="button"],
.feature-showcase__img[role="button"],
.hero__screenshot[role="button"] {
  cursor: pointer;
}
.gallery-item[role="button"]:focus-visible,
.feature-showcase__img[role="button"]:focus-visible,
.hero__screenshot[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: rgba(var(--bg2-rgb), 0.9);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, border-color 0.2s, background 0.2s;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  border-color: var(--brand);
  background: rgba(var(--accent-rgb), 0.18);
}
@media (max-width: 600px) {
  .back-to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .contact-layout { grid-template-columns: 1fr; gap: 36px; }
  .feature-showcase {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .feature-showcase--reverse { direction: ltr; }
  .gallery-item { width: 290px; }
  .gallery-item img { height: 180px; }
}

@media (max-width: 600px) {
  .contact-form { padding: 20px; }
  .contact-form__row { grid-template-columns: 1fr; }
  .gallery-item { width: 250px; }
  .gallery-item img { height: 155px; }
}

/* ===== Terminal block ===== */
.terminal { max-width: 620px; margin: 48px auto 0; }
.terminal__tabs { display: flex; gap: 4px; }
.terminal__tab {
  font: inherit; font-size: 0.8rem; font-weight: 500; cursor: pointer;
  padding: 8px 16px; color: var(--text-3); background: none;
  border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0;
  transition: color 0.2s;
}
.terminal__tab:hover { color: var(--text); }
.terminal__tab.is-active {
  color: var(--text); background: rgba(var(--fg-rgb), 0.06); border-color: var(--border-light);
}
.terminal__box {
  background: rgba(var(--fg-rgb), 0.05); border: 1px solid var(--border);
  border-radius: 0 var(--r-md) var(--r-md) var(--r-md);
  box-shadow: rgba(var(--fg-rgb), 0.12) 0 1px 0 0 inset; overflow: hidden;
}
.terminal__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.terminal__dots { display: flex; gap: 8px; }
.terminal__dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.terminal__dots i:nth-child(2) { background: #febc2e; }
.terminal__dots i:nth-child(3) { background: #28c840; }
.terminal__copy {
  background: none; border: 0; cursor: pointer; font: inherit; font-size: 0.78rem;
  color: var(--text-3); transition: color 0.2s;
}
.terminal__copy:hover, .terminal__copy[data-done] { color: var(--text); }
.terminal pre { padding: 24px 20px; overflow-x: auto; font-size: 0.9rem; line-height: 1.6; }
.terminal__prompt { color: var(--brand-2); }

/* ===== Retro CRT theme (toggle: data-crt) ===== */
html[data-crt='on'] body { text-shadow: 0 0 6px rgba(var(--accent-rgb), 0.35); }
html[data-crt='on'] h1, html[data-crt='on'] h2, html[data-crt='on'] h3 { text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.55); }
html[data-crt='on'] .btn--primary { text-shadow: none; }
html[data-crt='on'] body::before {
  content: ''; position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0, rgba(0, 0, 0, 0.22) 1px, transparent 1px, transparent 3px);
}
html[data-crt='on'] body::after {
  content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  animation: crt-flicker 6s steps(1) infinite;
}
@keyframes crt-flicker { 0%, 96%, 100% { opacity: 1; } 97% { opacity: 0.86; } 98% { opacity: 1; } 99% { opacity: 0.9; } }
html[data-crt='on'] h1::after {
  content: '_'; display: inline-block; margin-left: 4px; color: var(--brand);
  animation: crt-blink 1s steps(1) infinite;
}
@keyframes crt-blink { 50% { opacity: 0; } }
html[data-crt='on'] img { filter: sepia(0.35) saturate(1.1) hue-rotate(-8deg); }
@media (prefers-reduced-motion: reduce) { html[data-crt='on'] body::after, html[data-crt='on'] h1::after { animation: none; } }

/* ===== Appearance overrides ===== */
html[data-particles='off'] #heroCanvas { display: none; }
html[data-motion='reduced'] *, html[data-motion='reduced'] *::before, html[data-motion='reduced'] *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
html[data-mode='light'] .gradient-text { background: var(--brand); -webkit-background-clip: text; background-clip: text; }

/* ===== Appearance panel ===== */
.ap-fab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  height: 36px; padding: 0 14px; font: inherit; font-size: 0.86rem; font-weight: 500;
  color: var(--text); background: rgba(var(--fg-rgb), 0.06); border: 1px solid var(--border-light);
  border-radius: 100px; transition: border-color 0.2s, background 0.2s;
}
.ap-fab:hover { border-color: var(--brand); background: rgba(var(--accent-rgb), 0.14); }
.ap-fab[aria-expanded='true'] { border-color: var(--brand); }
.ap-fab:not(.ap-fab--nav) { position: fixed; right: 16px; top: 16px; z-index: 10001; }
@media (max-width: 720px) { .ap-fab__txt { display: none; } .ap-fab { width: 36px; padding: 0; } }
.ap-panel {
  position: fixed; right: 16px; top: calc(var(--nav-h) + 8px); z-index: 10001;
  width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - var(--nav-h) - 24px); overflow-y: auto;
  color: var(--text); background: var(--bg-2); border: 1px solid var(--border-light);
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); font-family: var(--font-body);
  text-shadow: none;
}
.ap-panel[hidden], .ap-page[hidden] { display: none; }
.ap-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.ap-head h2 { font-size: 1.15rem; text-transform: none; letter-spacing: 0; text-shadow: none; }
.ap-x { background: none; border: 0; color: var(--text-2); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.ap-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 12px; }
.ap-tab {
  flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  padding: 12px 6px; font: inherit; font-size: 0.85rem; color: var(--text-3);
}
.ap-tab.is-active { color: var(--text); border-bottom-color: var(--brand); }
.ap-body { padding: 8px 20px 20px; display: grid; }
.ap-label { display: block; margin: 16px 0 8px; font-size: 0.82rem; color: var(--text-2); }
.ap-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.ap-chip {
  font: inherit; font-size: 0.82rem; cursor: pointer; padding: 10px 8px; color: var(--text-2);
  background: rgba(var(--fg-rgb), 0.05); border: 1px solid transparent; border-radius: 8px;
}
.ap-chip:hover { color: var(--text); }
.ap-chip.is-active { color: var(--text); border-color: var(--brand); background: rgba(var(--accent-rgb), 0.14); }
.ap-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.ap-swatch {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; background: var(--sw);
  border: 2px solid transparent; outline: 2px solid transparent; outline-offset: 2px;
}
.ap-swatch.is-active { outline-color: var(--sw); border-color: var(--bg-2); }
.ap-cname { margin-top: 8px; font-size: 0.85rem; color: var(--text-2); }
.ap-select {
  width: 100%; font: inherit; font-size: 0.9rem; color: var(--text); padding: 10px 12px;
  background: rgba(var(--fg-rgb), 0.06); border: 1px solid var(--border-light); border-radius: 8px;
}
.ap-select option { background: var(--bg-2); color: var(--text); }
.ap-toggle { display: flex; gap: 10px; align-items: center; margin-top: 16px; font-size: 0.88rem; cursor: pointer; }
.ap-toggle input { accent-color: var(--brand); width: 16px; height: 16px; }
.ap-note { margin: 4px 0 0 26px; font-size: 0.76rem; color: var(--text-3); }
.ap-reset {
  margin-top: 22px; font: inherit; font-size: 0.85rem; cursor: pointer; color: var(--text);
  background: none; border: 1px solid var(--border-light); border-radius: 8px; padding: 10px;
}
.ap-reset:hover { border-color: var(--brand); }
