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

:root {
  --bg: #09090b;
  --surface: #111114;
  --surface-hover: #18181b;
  --border: #27272a;
  --border-hover: #52525b;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --font: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navigation ── */

header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(9,9,11,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

/* ── Logo images ── */

.logo-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

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

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

.brand-sep {
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 300;
}

.brand-section {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 400;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0;
}

.nav-links a {
  display: block;
  padding: 18px 14px;
  font-size: 0.8125rem;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

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

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

/* ── Layout ── */

main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ── Hero (Home) ── */

.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.2;
}

.hero .subheadline {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.65;
}

/* ── Support Grid (Home) ── */

.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0;
  margin: 48px 0 64px;
  border: 1px solid var(--border);
}

.support-card {
  padding: 36px 32px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.15s;
  position: relative;
}

.support-grid .support-card:not(:last-child) {
  border-right: 1px solid var(--border);
}

.support-card:hover {
  background: var(--surface-hover);
}

.card-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.support-card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}

.support-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

/* ── Buttons ── */

.btn {
  display: inline-block;
  padding: 10px 18px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid var(--border-hover);
  transition: all 0.15s;
  align-self: flex-start;
  margin-top: 10px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── Page Header (sub-pages) ── */

.page-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb a:hover {
  color: var(--text-muted);
}

.breadcrumb span {
  color: var(--text-dim);
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  line-height: 1.2;
}

.page-header p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.65;
}

/* ── Section Label ── */

.section-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 20px;
}

/* ── Categories ── */

.categories-section {
  padding: 36px 0 32px;
  border-bottom: 1px solid var(--border);
}

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: default;
  transition: all 0.15s;
}

/* ── FAQ ── */

.faq-section {
  padding: 48px 0;
}

.faq-list {
  border-top: 1px solid var(--border);
  max-width: 760px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  user-select: none;
  transition: color 0.15s;
}

.faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.2s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  color: var(--text-muted);
}

.faq-question:hover {
  color: var(--text);
}

.faq-answer {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.2s;
  padding-bottom: 0;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding-bottom: 24px;
}

/* ── Contact Info ── */

.contact-block {
  padding: 48px 0;
}

.contact-email-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.0625rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 18px 26px;
  background: var(--surface);
  transition: all 0.15s;
  letter-spacing: 0.01em;
  margin-top: 0;
}

.contact-email-link:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.email-icon {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

/* ── Topics ── */

.topics-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  margin-top: 0;
}

.topic-item {
  padding: 16px 20px;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.topic-item:last-child,
.topic-item:nth-child(3n) {
  border-right: none;
}

.topic-dot {
  width: 4px;
  height: 4px;
  background: var(--border-hover);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Contact Form ── */

.form-section {
  padding: 48px 0 64px;
  border-top: 1px solid var(--border);
}

.contact-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

input,
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.875rem;
  font-family: var(--font);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s;
  width: 100%;
  border-radius: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-hover);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2371717a' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

select option {
  background: #18181b;
  color: var(--text);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  flex-wrap: wrap;
}

.btn-submit {
  padding: 11px 26px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: var(--font);
  border-radius: 0;
}

.btn-submit:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

.form-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Footer ── */

footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  list-style: none;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}

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

/* ── Responsive ── */

@media (max-width: 768px) {
  .support-grid {
    grid-template-columns: 1fr;
  }

  .support-grid .support-card:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .topics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .topic-item:nth-child(3n) {
    border-right: 1px solid var(--border);
  }

  .topic-item:nth-child(2n) {
    border-right: none;
  }
}

@media (max-width: 640px) {
  nav {
    padding: 0 16px;
  }

  .logo-full {
    display: none;
  }

  .logo-icon {
    display: block;
  }

  .nav-links a {
    padding: 18px 10px;
    font-size: 0.75rem;
  }

  main {
    padding: 0 16px;
  }

  .hero {
    padding: 48px 0 36px;
  }

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

  .support-card {
    padding: 28px 22px;
  }

  .page-header {
    padding: 40px 0 32px;
  }

  .page-header h1 {
    font-size: 1.375rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  .topic-item {
    border-right: none !important;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 16px;
  }

  .footer-links {
    gap: 14px;
  }

  .contact-block,
  .topics-section,
  .form-section,
  .faq-section {
    padding-top: 36px;
    padding-bottom: 36px;
  }
}

/* ── Legal pages ── */

.legal-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin-top: 16px;
}

.legal-content {
  padding: 48px 0 80px;
  max-width: 700px;
}

.legal-content h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 40px;
  margin-bottom: 14px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.legal-content h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.legal-content p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 12px;
}

.legal-content p:last-child {
  margin-bottom: 0;
}

.legal-content ul {
  list-style: none;
  margin: 8px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legal-content ul li {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding-left: 18px;
  position: relative;
}

.legal-content ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}

.legal-content a {
  color: var(--text-muted);
  text-underline-offset: 3px;
  transition: color 0.15s;
}

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

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

/* ── Light mode — must come after all base rules ── */

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f3f1;
    --surface: #eae8e4;
    --surface-hover: #e1dfdb;
    --border: #cccac6;
    --border-hover: #8e8c87;
    --text: #18171a;
    --text-muted: #504e4a;
    --text-dim: #868380;
  }

  header {
    background: rgba(244, 243, 241, 0.95);
    border-bottom-color: var(--border);
  }

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

  select option {
    background: #eae8e4;
    color: #18171a;
  }

  .btn-primary:hover {
    background: #2d2c2e;
    border-color: #2d2c2e;
  }

  .btn-submit:hover {
    background: #2d2c2e;
    border-color: #2d2c2e;
  }
}
