/* =============================================================================
   TabLocal — landing page
   Uses tokens from ../colors_and_type.css. Dark theme only.
   ============================================================================= */

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

html, body {
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  background-image: var(--dot-grid);
  background-size: 24px 24px;
  background-position: 0 0;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(199, 242, 92, 0.025), transparent 70%);
  z-index: 0;
}

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

/* =============================================================================
   Skip link
   ============================================================================= */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 200;
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: var(--fg-on-accent);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-bottom: none;
}
.skip-link:focus { top: 0; }

/* =============================================================================
   Header
   ============================================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  padding: 0 var(--space-7);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(11, 13, 17, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--fg);
  border-bottom: none;
}
.brand:hover { border-bottom-color: transparent; }

.brand-mark {
  width: 24px;
  height: 24px;
  color: var(--fg);
}

.brand-name {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}
.brand-name-dim { font-weight: var(--weight-regular); color: var(--fg-secondary); }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  justify-self: center;
}
.site-nav a {
  font-size: var(--text-sm);
  color: var(--fg-secondary);
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--fg); border-bottom-color: var(--fg-tertiary); }

/* =============================================================================
   Buttons
   ============================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:hover { border-bottom-color: transparent; }

.btn-sm { height: 32px; padding: 0 var(--space-3); font-size: var(--text-sm); }

.btn-primary {
  background: var(--accent);
  color: var(--fg-on-accent);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface); }
.btn-ghost:active { background: var(--surface-raised); }

/* =============================================================================
   Layout containers
   ============================================================================= */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-7);
}

section + section { margin-top: var(--space-10); }

.section-header {
  margin-bottom: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.section-header h2 { max-width: 32ch; }

/* =============================================================================
   Hero
   ============================================================================= */

.hero {
  padding: var(--space-9) 0 var(--space-9);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  align-items: flex-start;
}

.hero .eyebrow { margin-bottom: var(--space-1); }

.hero-title {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: var(--weight-semibold);
  margin: 0;
  max-width: 18ch;
}
.hero-title-accent {
  color: var(--accent);
  font-style: normal;
}

.hero-sub {
  font-size: var(--text-lg);
  line-height: 1.45;
  color: var(--fg-secondary);
  max-width: 56ch;
  margin: 0;
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.hero-actions .btn { height: 44px; padding: 0 var(--space-5); font-size: var(--text-md); }

.hero-stats {
  margin: var(--space-7) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 640px;
}
.hero-stats > div {
  padding: var(--space-4) var(--space-4) var(--space-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.hero-stats dt {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-tertiary);
}
.hero-stats dd {
  margin: 0;
  font-size: var(--text-md);
  color: var(--fg);
}
.hero-stats code {
  background: transparent;
  padding: 0;
  font-size: var(--text-sm);
  color: var(--fg);
}

/* =============================================================================
   Demo frame
   ============================================================================= */

.demo-frame {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-popover);
}

.demo-frame-chrome {
  height: 36px;
  background: var(--ink-2);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  position: relative;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-4);
}
.dot-r { background: #E25C5C; }
.dot-y { background: #F5C242; }
.dot-g { background: #5CB87E; }
.demo-frame-host {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--text-xs);
  color: var(--fg-tertiary);
  letter-spacing: 0.01em;
}

.demo-frame-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 0;
  background: var(--ink-1);
}

/* =============================================================================
   Features
   ============================================================================= */

.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.feature {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.feature:hover { border-color: var(--border); }

.feature-color {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.feature h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
}
.feature p {
  color: var(--fg-secondary);
  font-size: var(--text-md);
  line-height: 1.5;
  margin: 0;
}
.feature code {
  font-size: 0.88em;
  background: var(--surface-raised);
  color: var(--fg);
}

/* =============================================================================
   FAQ
   ============================================================================= */

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

.faq-item {
  border-bottom: 1px solid var(--border-subtle);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-5) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--fg);
  transition: color var(--dur-fast) var(--ease-out);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover .chev { color: var(--fg); }

.chev {
  flex: none;
  color: var(--fg-tertiary);
  transition: transform var(--dur-base) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.faq-item[open] .chev { transform: rotate(180deg); color: var(--fg); }

.faq-body {
  padding: 0 0 var(--space-5);
  color: var(--fg-secondary);
  max-width: 70ch;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.faq-body p { color: var(--fg-secondary); }
.faq-body code {
  background: var(--surface-raised);
  color: var(--fg);
  font-size: 0.88em;
}

.perm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.perm-list li {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  font-size: var(--text-md);
  color: var(--fg-secondary);
}
.perm-list li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--fg-tertiary);
  border-radius: 1px;
  transform: translateY(-2px);
}

/* =============================================================================
   Footer
   ============================================================================= */

.site-footer {
  max-width: 1080px;
  margin: var(--space-10) auto 0;
  padding: var(--space-7);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.foot-brand .brand-mark { width: 28px; height: 28px; color: var(--fg); }
.foot-brand .brand-name {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}
.foot-brand .caption {
  font-family: var(--font-mono);
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-tertiary);
  font-size: var(--text-xs);
}

.foot-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.foot-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--fg-secondary);
  font-size: var(--text-sm);
  border-bottom: 1px solid transparent;
}
.foot-link:hover { color: var(--fg); border-bottom-color: var(--fg-tertiary); }
.foot-sep { color: var(--fg-tertiary); }

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 720px) {
  .site-header { padding: 0 var(--space-5); gap: var(--space-3); }
  .site-nav { display: none; }
  main { padding: var(--space-7) var(--space-5); }
  .hero { padding: var(--space-7) 0; }
  .hero-title { font-size: clamp(36px, 9vw, 48px); }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stats > div { padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
  .hero-stats > div:last-child { border-bottom: 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .demo-frame-host { display: none; }
  .site-footer { padding: var(--space-5); flex-direction: column; align-items: flex-start; }
}
