/* =========================================================
   Pex — website design system
   Dark / night-mode, sky-blue (AI) accent, pixel-brand touches
   ========================================================= */

@font-face {
  font-family: "Retro Computer";
  src: url("../fonts/RetroComputer.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #eaf6fb;
  --bg-elevated: #dcedf6;
  --bg-card: #fffaf0;
  --bg-card-hover: #fff2d9;
  --border: rgba(50, 36, 15, 0.12);
  --border-strong: rgba(50, 36, 15, 0.22);

  --text: #2a2015;
  --text-muted: #5c5240;
  --text-faint: #8a8170;

  /* Repurposed as the app's palette: sky blue (primary), soft cyan, wood/gold */
  --purple: #3fa8cf;
  --purple-strong: #1d89b6;
  --purple-deep: #145f7d;
  --pink: #4fc3e0;
  --blue: #1f7fae;
  --orange: #c9862c;
  --primary-rgb: 29, 137, 182;
  --orange-rgb: 201, 134, 44;

  --gradient-brand: linear-gradient(120deg, #145f7d 0%, #3fa8cf 38%, #4fc3e0 70%, #ffcc33 100%);
  --gradient-purple: linear-gradient(135deg, #1d89b6, #4fb8d9);
  --gradient-text: linear-gradient(90deg, #1d89b6, #4fc3e0);

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;

  --shadow-glow: 0 0 60px rgba(var(--primary-rgb), 0.18);
  --shadow-card: 0 20px 40px -20px rgba(40, 60, 20, 0.16);

  --container: 1160px;
  --header-h: 76px;

  --font-display: "Retro Computer", "Courier New", monospace;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

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

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--purple-deep); color: #fff; }

/* ---------- Background ambience ---------- */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
}

body::before {
  width: 560px;
  height: 560px;
  top: -180px;
  right: -160px;
  background: radial-gradient(circle, var(--purple-strong), transparent 70%);
}

body::after {
  width: 480px;
  height: 480px;
  bottom: -160px;
  left: -140px;
  background: radial-gradient(circle, var(--pink), transparent 70%);
  opacity: 0.22;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 108px 0; position: relative; }
.section--tight { padding: 72px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--purple-strong);
  margin-bottom: 20px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--gradient-purple);
  box-shadow: 0 0 12px var(--purple);
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.section-heading {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-heading h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 16px;
}

.section-heading p {
  color: var(--text-muted);
  font-size: 17px;
}

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-purple);
  color: #fff;
  box-shadow: 0 10px 30px -8px rgba(var(--primary-rgb), 0.55);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -6px rgba(var(--primary-rgb), 0.7); }

.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: rgba(42, 32, 21, 0.03);
}

.btn-ghost:hover { border-color: var(--purple-strong); background: rgba(var(--primary-rgb), 0.08); }

/* ---------- Store badges ---------- */
.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.store-badge:hover {
  transform: translateY(-2px);
  border-color: var(--purple-strong);
  background: var(--bg-card-hover);
}

.store-badge svg { width: 26px; height: 26px; flex-shrink: 0; }

.store-badge .store-badge-copy { display: flex; flex-direction: column; line-height: 1.15; }
.store-badge .store-badge-copy small { font-size: 11px; color: var(--text-faint); }
.store-badge .store-badge-copy span { font-size: 16px; font-weight: 700; }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.navbar.is-scrolled {
  background: rgba(234, 246, 251, 0.82);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 15px;
}

.brand img { width: 36px; height: 36px; border-radius: 9px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a:hover { color: var(--text); }

.nav-links a.is-active { color: var(--text); }

.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -20px;
  height: 2px;
  background: var(--gradient-purple);
}

.nav-cta { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ---------- Language switcher ---------- */
.lang-switcher { position: relative; }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.lang-toggle:hover,
.lang-toggle[aria-expanded="true"] { border-color: var(--purple-strong); color: var(--text); background: rgba(var(--primary-rgb), 0.08); }

.lang-toggle svg { width: 16px; height: 16px; flex-shrink: 0; }

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 110;
}

.lang-menu.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.lang-menu li { display: block; }

.lang-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: calc(var(--radius-sm) - 4px);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-menu button:hover { background: var(--bg-card-hover); color: var(--text); }

.lang-menu li[data-lang].is-active button { color: var(--purple-strong); font-weight: 700; }

@media (max-width: 720px) {
  .lang-toggle { padding: 0 10px; }
  .lang-toggle .lang-current { display: none; }
}

/* The pixel "Retro Computer" display font only covers basic Latin (no
   accented characters, em dashes or arrows). For non-English languages,
   fall back to the plain monospace stack on the few elements that use it,
   so an accented word doesn't render with one glyph in a different font. */
html:not([lang="en"]) .eyebrow,
html:not([lang="en"]) .hero-meta div strong,
html:not([lang="en"]) .showcase-tagline {
  font-family: "Courier New", monospace;
}

/* ---------- Hero ---------- */
.hero {
  padding: calc(var(--header-h) + 72px) 0 100px;
  position: relative;
}

.hero .container.hero-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 48px;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  margin-bottom: 22px;
}

.hero p.lead {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto 34px;
}

.hero-copy { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 640px; }

.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px 28px;
  row-gap: 24px;
  margin-top: 40px;
}

.hero-meta div strong {
  display: block;
  font-size: 22px;
  font-family: var(--font-display);
  color: var(--text);
}

.hero-meta div span { font-size: 13px; color: var(--text-faint); }

.hero-visual { width: 100%; display: flex; justify-content: center; }
.hero-visual img { width: 100%; max-width: 980px; display: block; }

/* ---------- Feature cards ---------- */
#features .section-heading {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

#features .eyebrow { justify-content: center; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-purple);
  margin: 0 auto 20px;
}

.feature-icon svg { width: 24px; height: 24px; stroke: #fff; }

.feature-card h3 { font-size: 18px; margin-bottom: 10px; }
.feature-card p { color: var(--text-muted); font-size: 14.5px; }
.feature-card .tag {
  display: inline-block;
  margin-top: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--orange);
  background: rgba(var(--orange-rgb), 0.12);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---------- Screenshots ("Take a look") ---------- */
/* Keeps the original Pex AI purple/pink branding for this section only */
#screenshots {
  --purple: #8b5cf6;
  --purple-strong: #a855f7;
  --pink: #ec4899;
  --gradient-purple: linear-gradient(135deg, #7c3aed, #a855f7);
  --gradient-text: linear-gradient(90deg, #a855f7, #ec4899);
  --primary-rgb: 139, 92, 246;
  --text: #f5f0ff;
  --text-muted: #c7bce3;
  --text-faint: #9a8cc4;
  background: #07050d;
  color: var(--text);
}

#screenshots .section-heading {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

#screenshots .eyebrow { justify-content: center; }

.showcase-visual { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.showcase-visual img { width: 100%; max-width: 980px; display: block; }

.showcase-tagline {
  text-align: center;
  margin-top: 32px;
  margin-bottom: 32px;
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 32px);
  line-height: 1.4;
}

.showcase-tagline .tagline-white { color: #fff; }

/* ---------- CTA band ---------- */
.cta-band {
  border-radius: var(--radius-lg);
  padding: 64px 48px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: -2px;
  padding: 2px;
  border-radius: inherit;
  background: var(--gradient-brand);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
  pointer-events: none;
}

.cta-band h2 { font-size: clamp(26px, 3.6vw, 34px); margin-bottom: 14px; }
.cta-band p { color: var(--text-muted); margin-bottom: 32px; }
.cta-band .store-badges { justify-content: center; }
.cta-band .cta-visual { width: 100%; max-width: 640px; margin: 0 auto 32px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { color: var(--text-muted); font-size: 14.5px; max-width: 320px; margin-bottom: 20px; }

.footer-col h4 {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
}

.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { color: var(--text-muted); font-size: 14.5px; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--purple-strong); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 13px;
}

.footer-social { display: flex; gap: 14px; }
.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.footer-social a:hover { border-color: var(--purple-strong); color: var(--purple-strong); }
.footer-social svg { width: 15px; height: 15px; }

/* ---------- Legal / content pages ---------- */
.legal-header {
  padding: calc(var(--header-h) + 64px) 0 48px;
  border-bottom: 1px solid var(--border);
}

.legal-header h1 { font-size: clamp(30px, 4.5vw, 44px); margin-bottom: 14px; }
.legal-header .legal-meta { color: var(--text-faint); font-size: 14px; }
.legal-header .legal-meta strong { color: var(--text-muted); }

.legal-body {
  padding: 64px 0 120px;
}

.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  border-left: 1px solid var(--border);
  padding-left: 20px;
}

.legal-toc h4 {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.legal-toc ul { display: flex; flex-direction: column; gap: 11px; }
.legal-toc a {
  font-size: 13.5px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.legal-toc a:hover { color: var(--purple-strong); }

.legal-content { max-width: 720px; }

.legal-content h2 {
  font-size: 22px;
  margin-top: 44px;
  margin-bottom: 16px;
  padding-top: 8px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.legal-content h2:first-child { margin-top: 0; }

.legal-content h3 {
  font-size: 16.5px;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--purple-strong);
}

.legal-content p { color: var(--text-muted); margin-bottom: 14px; font-size: 15.5px; }

.legal-content ul {
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-content ul li {
  color: var(--text-muted);
  font-size: 15.5px;
  padding-left: 22px;
  position: relative;
}

.legal-content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  background: var(--purple-strong);
  border-radius: 2px;
}

.legal-content ol {
  margin: 0 0 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legal-content ol li { color: var(--text-muted); font-size: 15.5px; }

.legal-content strong { color: var(--text); }

.legal-content a { color: var(--purple-strong); text-decoration: underline; text-underline-offset: 3px; }

.legal-content .callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple-strong);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 20px 0;
  font-size: 14.5px;
  color: var(--text-muted);
}

.legal-content .contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-top: 20px;
}

.legal-content .contact-card a.email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 16px;
}

/* FAQ accordion */
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-weight: 600;
  font-size: 15.5px;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary .plus {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--purple-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.2s ease;
}

.faq-item[open] summary .plus { transform: rotate(45deg); }

.faq-item .faq-body {
  padding: 0 24px 22px;
  color: var(--text-muted);
  font-size: 15px;
}

.faq-item .faq-body ol,
.faq-item .faq-body ul {
  margin: 10px 0 10px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.faq-item .faq-body p { margin-bottom: 10px; }

.support-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0 32px;
}

.support-columns .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.support-columns .card h3 { font-size: 15.5px; margin-bottom: 8px; }
.support-columns .card p { color: var(--text-muted); font-size: 14.5px; margin-bottom: 12px; }
.support-columns .card a { color: var(--purple-strong); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { display: none; }
  .support-columns { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links { position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; background: var(--bg); flex-direction: column; justify-content: flex-start; padding: 40px 24px; gap: 26px; transform: translateX(100%); transition: transform 0.3s ease; }
  .nav-links.is-open { transform: translateX(0); }
  .nav-links a { font-size: 20px; }
  .nav-toggle { display: flex; }
  .nav-cta .btn-primary { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 76px 0; }
  .cta-band { padding: 44px 24px; }
}

@media (max-width: 480px) {
  .store-badges { flex-direction: column; align-items: stretch; }
}
