/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--container-pad);
  height: var(--nav-height);
  border-bottom: 1px solid var(--nav-border);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--nav-border);
  transition: background 180ms ease, border-color 180ms ease;
}

.nav-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-logo:hover {
  text-decoration: none;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  flex-wrap: wrap;
  margin-left: auto;
}

.nav-links a {
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  position: relative;
  transition: color 180ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 2px;
  border-radius: 99px;
  background: var(--accent-warm);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms var(--ease-out);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 72px var(--container-pad) 56px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 360px;
  height: 180px;
  top: -90px;
  right: 8%;
  border-radius: 50%;
  background: rgba(128, 176, 157, 0.10);
  filter: blur(4px);
  pointer-events: none;
}

[data-theme="light"] .hero {
  background: var(--bg-gradient);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 22px;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 18px;
  color: var(--text);
}

.hero-desc {
  font-size: 15px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.75;
}

/* ── Section ── */
.section {
  margin-bottom: 48px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.section-header-action {
  justify-content: space-between;
}

.section-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 180ms ease, transform 180ms var(--ease-out);
}

.section-action:hover {
  color: var(--accent);
  text-decoration: none;
  transform: translateX(3px);
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* ── Card ── */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: 0 0 0 1px transparent;
  transition: background 220ms var(--ease-out), border-color 220ms var(--ease-out), transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
  text-decoration: none;
  display: block;
  color: inherit;
}

.card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-4px);
  text-decoration: none;
  color: inherit;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-icon);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}

.card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 16px;
  overflow-wrap: break-word;
}

.card-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow-wrap: break-word;
}

.card-features {
  list-style: none;
  margin-bottom: 16px;
}

.card-features li {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  padding: 2px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.card-features li::before {
  content: '·';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── New Card Highlight ── */
.card-new {
  border-color: color-mix(in srgb, var(--accent-warm) 42%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-warm) 8%, transparent) 0%, var(--surface) 60%);
}

.card-featured {
  border-color: color-mix(in srgb, var(--accent-warm) 48%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-warm) 9%, transparent), var(--surface) 62%);
}

.card-icon-wordmark {
  color: var(--accent-warm);
  border: 1px solid color-mix(in srgb, var(--accent-warm) 55%, transparent);
  font: 600 20px/1 Georgia, serif;
}

.new-tag {
  position: absolute;
  top: -1px;
  right: 20px;
  background: var(--accent-warm);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 0 0 6px 6px;
  letter-spacing: 0.03em;
}

.card-notice {
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 14px;
  line-height: 1.55;
}

.price-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.price-tag span {
  color: var(--accent);
}

/* ── Badges ── */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-badge);
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-live {
  background: rgba(34, 197, 94, 0.12);
  color: var(--badge-live);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-wip {
  background: rgba(107, 114, 128, 0.12);
  color: var(--badge-wip);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.badge-service {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ── About Strip ── */
.about-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}

.about-strip h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.about-strip p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
}

.about-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

/* ── Placeholder Page ── */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px var(--container-pad);
  min-height: calc(100vh - var(--nav-height) - 80px);
}

.placeholder-page h1 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.placeholder-page p {
  color: var(--muted);
  font-size: 15px;
  max-width: 400px;
  line-height: 1.75;
}

/* ── Buttons ── */
.btn-outline {
  padding: 8px 20px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms var(--ease-out);
  text-decoration: none;
  display: inline-block;
}

.btn-outline:active,
button:active {
  transform: scale(0.98);
}

.btn-outline:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  text-decoration: none;
  color: var(--text);
}

/* ── Footer ── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px var(--container-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer p {
  font-size: 13px;
  color: var(--muted2);
}

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

.footer-links a {
  font-size: 12px;
  color: var(--muted2);
  text-decoration: none;
}

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

/* ── Page wrapper ── */
.page-main {
  padding: 48px 0 80px;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .about-strip {
    grid-template-columns: 1fr;
  }

  .about-actions {
    align-items: flex-start;
  }

  .nav-links {
    gap: 16px;
  }

  /* Hero */
  .hero {
    padding: 48px 20px 32px;
  }

  /* Card padding on mobile */
  .card {
    padding: 16px;
  }

  /* Section padding */
  .section {
    padding: 32px 20px;
  }

  /* Footer */
  .footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .card-grid,
  .card-grid-4 {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 40px 16px 28px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .hero h1 {
    font-size: clamp(1.4rem, 7vw, 1.8rem);
  }
}

/* ── Theme Toggle ── */
.theme-picker {
  position: relative;
  flex-shrink: 0;
  margin-left: 20px;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--muted);
  font: inherit;
}

.theme-toggle-caption {
  max-width: 72px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keep the desktop control compact; the menu carries the full text labels. */
.nav > .theme-picker .theme-toggle-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav > .theme-picker .theme-toggle {
  width: 40px;
  min-height: 32px;
  justify-content: center;
  gap: 0;
  padding: 5px 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.nav > .theme-picker .theme-toggle:hover,
.nav > .theme-picker .theme-toggle:focus-visible {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.theme-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 400;
  width: 224px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(0,0,0,.22);
}

.theme-menu[hidden] { display: none; }
.theme-menu > button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: center;
  width: 100%;
  gap: 7px;
  padding: 9px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}
.theme-menu > button:hover, .theme-menu > button:focus-visible, .theme-menu > button.is-selected { background: var(--surface-hover); color: var(--text); }
.theme-menu-symbol { color: var(--accent-warm); font-size: 16px; text-align: center; }
.theme-menu > button strong, .theme-menu > button small { display: block; }
.theme-menu > button strong { font-size: 12px; font-weight: 600; }
.theme-menu > button small { margin-top: 2px; color: var(--muted2); font-size: 10px; }
.theme-menu-check { color: var(--accent); font-size: 14px; opacity: 0; text-align: center; }
.theme-menu > button.is-selected .theme-menu-check { opacity: 1; }
.theme-menu-drawer { position: static; width: 100%; margin-top: 8px; box-shadow: none; }
.nav-drawer-toggle .theme-picker { margin-left: auto; }
.nav-drawer-toggle .theme-toggle-caption { max-width: none; }

.toggle-track {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 22px;
  background: rgba(59,130,246,0.25);
  border-radius: 11px;
  border: 1px solid rgba(59,130,246,0.35);
  transition: background 0.2s, border-color 0.2s;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #60a5fa;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.toggle-thumb::after {
  content: '🌙';
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

[data-theme="light"] .toggle-track {
  background: rgba(245,158,11,0.15);
  border-color: rgba(245,158,11,0.3);
}

[data-theme="light"] .toggle-thumb {
  transform: translateX(18px);
  background: #f59e0b;
}

[data-theme="light"] .toggle-thumb::after {
  content: '☀️';
}

/* ── Mobile Nav Hamburger ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

.nav-hamburger span {
  width: 18px;
  height: 2px;
  background: var(--muted);
  border-radius: 1px;
  transition: background 0.15s;
  display: block;
}

/* ── Nav Drawer ── */
.nav-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
}

.nav-drawer.open {
  display: block;
}

.nav-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}

.nav-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 260px;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.nav-drawer-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  align-self: flex-end;
  padding: 4px 8px;
  margin-bottom: 16px;
}

.nav-drawer-panel a {
  display: block;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}

.nav-drawer-panel a:hover,
.nav-drawer-panel a.active {
  color: var(--text);
}

.nav-drawer-panel a.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-drawer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 0;
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

/* ── Responsive: Show/Hide ── */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav > .theme-picker {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }
}
