/* ============================================================
   SEMSEY TECHNOLOGIES — THEME SYSTEM + MOBILE ADAPTIVE
   ============================================================ */

:root {
  --bg: #050816;
  --bg-alt: #0b1020;
  --text: #f9fafb;
  --muted: #9ca3af;
  --accent: #4f46e5;
  --accent2: #22c55e;
  --card: #0b1020;
  --border: #1f2933;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.75);
  --shadow-subtle: 0 10px 30px rgba(15, 23, 42, 0.6);
  --nav-height: 60px;
  --transition-fast: 0.18s ease-out;
  --bg-pattern: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg-pattern);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   THEMES
   ============================================================ */

body.theme-neon {
  --bg: #050816;
  --bg-alt: #0b1020;
  --text: #f9fafb;
  --muted: #9ca3af;
  --accent: #4f46e5;
  --accent2: #22c55e;
  --card: #0b1020;
  --border: #1f2933;
  --bg-pattern: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
}

body.theme-minimal {
  --bg: #050505;
  --bg-alt: #0f0f0f;
  --text: #e5e5e5;
  --muted: #9f9f9f;
  --accent: #888888;
  --accent2: #aaaaaa;
  --card: #141414;
  --border: #262626;
  --bg-pattern: linear-gradient(to bottom, #0a0a0a, #050505);
}

body.theme-light {
  --bg: #ffffff;
  --bg-alt: #f3f4f6;
  --text: #111827;
  --muted: #4b5563;
  --accent: #4f46e5;
  --accent2: #22c55e;
  --card: #ffffff;
  --border: #e5e7eb;
  --bg-pattern: #ffffff;
}

body.theme-solarized {
  --bg: #002b36;
  --bg-alt: #073642;
  --text: #eee8d5;
  --muted: #93a1a1;
  --accent: #b58900;
  --accent2: #268bd2;
  --card: #073642;
  --border: #586e75;
  --bg-pattern: #002b36;
}

body.theme-mono {
  --bg: #111111;
  --bg-alt: #1a1a1a;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --accent: #888888;
  --accent2: #b3b3b3;
  --card: #1f1f1f;
  --border: #333333;
  --bg-pattern: linear-gradient(to bottom, #1a1a1a, #111111);
}

body.theme-terminal {
  --bg: #000000;
  --bg-alt: #001900;
  --text: #00ff66;
  --muted: #00b34a;
  --accent: #00ff66;
  --accent2: #00ff66;
  --card: #001900;
  --border: #004d1a;
  --bg-pattern: #000000;
}

body.theme-blue {
  --bg: #0a1a2f;
  --bg-alt: #11263d;
  --text: #dce7f7;
  --muted: #9fb3d9;
  --accent: #4ea1ff;
  --accent2: #7cc7ff;
  --card: #11263d;
  --border: #1f3b5c;
  --bg-pattern: linear-gradient(to bottom, #0a1a2f, #071526);
}

/* ============================================================
   NAVIGATION (BASE)
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  background: rgba(3, 7, 18, 0.92);
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(14px);
  z-index: 50;
}

.nav-inner {
  width: 100%;
  max-width: 1120px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.nav-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
}

/* Chip nav */

.nav-links-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.nav-links-chip::-webkit-scrollbar {
  display: none;
}

.nav-links-chip a {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
}

.nav-links-chip a.active {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  border-color: transparent;
}

.nav-links-chip a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background var(--transition-fast);
}

.nav-links-chip a:hover::after {
  background: rgba(255, 255, 255, 0.2);
}

/* Hamburger button */

.nav-hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}

/* Appearance button */

.nav-appearance-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.7);
}

/* Light Minimal nav override */

body.theme-light .nav {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  backdrop-filter: none;
}

body.theme-light .nav-brand {
  color: #111827;
}

body.theme-light .nav-appearance-btn {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
  box-shadow: none;
}

/* ============================================================
   DRAWER NAV
   ============================================================ */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease-out;
  z-index: 60;
}

.drawer-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--card);
  border-right: 1px solid var(--border);
  box-shadow: 12px 0 30px rgba(15, 23, 42, 0.6);
  transform: translateX(-100%);
  transition: transform 0.22s ease-out;
  display: flex;
  flex-direction: column;
  z-index: 70;
}

.drawer.visible {
  transform: translateX(0);
}

.drawer-topbar {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.drawer-links {
  padding: 10px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-links a {
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
}

.drawer-links a.active {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
}

/* ============================================================
   NAV MODE OVERRIDES
   ============================================================ */

/* Default: theme-based auto mode (used when nav-style = auto) */

/* Light Minimal → drawer, dark themes → chip */

body.theme-light.nav-auto .nav-links-chip {
  display: none;
}

body.theme-light.nav-auto .nav-hamburger-btn {
  display: inline-flex;
}

body.theme-neon.nav-auto .nav-links-chip,
body.theme-minimal.nav-auto .nav-links-chip,
body.theme-solarized.nav-auto .nav-links-chip,
body.theme-mono.nav-auto .nav-links-chip,
body.theme-terminal.nav-auto .nav-links-chip,
body.theme-blue.nav-auto .nav-links-chip {
  display: flex;
}

body.theme-neon.nav-auto .nav-hamburger-btn,
body.theme-minimal.nav-auto .nav-hamburger-btn,
body.theme-solarized.nav-auto .nav-hamburger-btn,
body.theme-mono.nav-auto .nav-hamburger-btn,
body.theme-terminal.nav-auto .nav-hamburger-btn,
body.theme-blue.nav-auto .nav-hamburger-btn {
  display: none;
}

/* Forced chip mode */

body.nav-chip .nav-links-chip {
  display: flex !important;
}

body.nav-chip .nav-hamburger-btn {
  display: none !important;
}

/* Forced drawer/system mode */

body.nav-drawer .nav-links-chip,
body.nav-system .nav-links-chip {
  display: none !important;
}

body.nav-drawer .nav-hamburger-btn,
body.nav-system .nav-hamburger-btn {
  display: inline-flex !important;
}

/* Light Minimal drawer colors */

body.theme-light .drawer {
  background: #ffffff;
  border-right-color: #e5e7eb;
}

body.theme-light .drawer-topbar {
  background: #f3f4f6;
  border-bottom-color: #e5e7eb;
  color: #6b7280;
}

body.theme-light .drawer-links a {
  color: #4b5563;
}

body.theme-light .drawer-links a.active {
  background: linear-gradient(90deg, #4f46e5, #22c55e);
  color: #fff;
}

/* ============================================================
   PAGE LAYOUT
   ============================================================ */

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 48px) 20px 40px;
  flex: 1;
}

/* ============================================================
   CONTENT BLOCKS
   ============================================================ */

.hero {
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero p {
  font-size: 14px;
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 10px;
}

.block {
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-subtle);
}

.block h2 {
  font-size: 16px;
  margin-bottom: 8px;
}

.block p,
.block ul {
  font-size: 13px;
  color: var(--muted);
}

/* ============================================================
   CARDS
   ============================================================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.card {
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 14px;
  box-shadow: var(--shadow-subtle);
}

.card h3 {
  font-size: 14px;
  margin-bottom: 6px;
}

.card p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.tag {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border);
}

.tag.stable { color: #22c55e; border-color: #22c55e; }
.tag.experimental { color: #eab308; border-color: #eab308; }
.tag.broken { color: #f97316; border-color: #f97316; }
.tag.progress { color: #38bdf8; border-color: #38bdf8; }

/* ============================================================
   SUPPORT BOX
   ============================================================ */

.support-box {
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 14px;
  margin: 10px 0;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 20px;
  font-size: 11px;
  color: var(--muted);
}

/* ============================================================
   APPEARANCE MODAL
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.modal h2 {
  font-size: 16px;
  margin-bottom: 4px;
}

.modal p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.modal label {
  font-size: 12px;
  margin-bottom: 4px;
  display: block;
}

.modal select {
  width: 100%;
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 12px;
  margin-bottom: 10px;
}

.preview-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.preview-swatch {
  flex: 1;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-buttons button {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.modal-buttons button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
}

/* ============================================================
   CONSENT SHEET
   ============================================================ */

.consent-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.7);
  padding: 12px 16px 14px;
  font-size: 12px;
  color: var(--muted);
  display: none;
  z-index: 90;
}

.consent-sheet.visible {
  display: block;
}

.consent-sheet p {
  margin-bottom: 8px;
}

.consent-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.consent-buttons button {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.consent-buttons button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
}

/* ============================================================
   MOBILE LAYOUT
   ============================================================ */

@media (max-width: 640px) {
  body {
    font-size: 16px;
    line-height: 1.55;
  }

  .nav {
    padding: 8px 10px;
    height: auto;
  }

  .nav-inner {
    gap: 8px;
  }

  .nav-appearance-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .nav-links-chip a {
    font-size: 13px;
  }

  .page {
    padding-top: 150px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero p,
  .block p,
  .block ul,
  .card p {
    font-size: 15px;
  }

  .modal {
    max-width: 92%;
    padding: 16px;
    border-radius: 14px;
  }

  .modal-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .modal-buttons button {
    width: 100%;
    padding: 10px;
    font-size: 14px;
  }

  .consent-sheet {
    font-size: 13px;
  }
}

/* Light Minimal mobile nav tweaks */

@media (max-width: 640px) {
  body.theme-light .nav {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  }
}

/* ============================================================
   CONTACT FORM — FIXED ALIGNMENT
   ============================================================ */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px; /* matches block spacing */
  margin-top: 16px;
}

.contact-form label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  display: block;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form button.primary {
  align-self: flex-start; /* aligns with left edge of form */
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  margin-top: 4px;
}

/* Mobile improvements */
@media (max-width: 640px) {
  .contact-form {
    gap: 20px;
  }

  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    font-size: 16px;
    padding: 14px 16px;
  }

  .contact-form button.primary {
    width: 100%;
    text-align: center;
    padding: 14px;
    font-size: 16px;
  }
}
/* ============================================================
   DIFFERENTIATION: HAMBURGER DRAWER vs SYSTEM DRAWER
   ============================================================ */

/* HAMBURGER DRAWER (nav-drawer) */
body.nav-drawer .drawer {
  width: 240px;
  border-right: 1px solid var(--border);
  border-radius: 0 12px 12px 0;
  box-shadow: 8px 0 20px rgba(0,0,0,0.35);
}

body.nav-drawer .drawer-topbar {
  display: none; /* no top bar */
}

/* SYSTEM DRAWER (nav-system) */
body.nav-system .drawer {
  width: 260px;
  border-right: 2px solid var(--border);
  border-radius: 0; /* hard OS edges */
  box-shadow: 14px 0 32px rgba(0,0,0,0.55);
}

body.nav-system .drawer-topbar {
  display: flex; /* keep top bar */
}