/* FitNote — Bike Fit Measurement Estimator Styles */
:root {
  --bg: #0f1115;
  --bg-elevated: #181b22;
  --bg-card: #1e2230;
  --bg-input: #141720;
  --border: #2a2f3d;
  --border-focus: #4a9eff;
  --text: #e8eaf0;
  --text-muted: #8b91a5;
  --text-heading: #f0f2f8;
  --accent: #4a9eff;
  --accent-soft: rgba(74, 158, 255, 0.12);
  --accent-glow: rgba(74, 158, 255, 0.25);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  --max-w: 1200px;
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: #7ab8ff; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 20px;
  background: var(--accent);
  color: #000;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 1000;
}
.skip-link:focus { top: 8px; }

/* Header */
.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-heading);
  font-weight: 700;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.logo-icon { color: var(--accent); }

.site-nav {
  display: flex;
  gap: 4px;
}
.site-nav a {
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}
.site-nav a:hover {
  color: var(--text-heading);
  background: var(--accent-soft);
}

/* Hero */
.hero {
  padding: 60px 0 40px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero-tagline {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.hero-copy h1 {
  font-size: 2.4rem;
  line-height: 1.2;
  color: var(--text-heading);
  margin-bottom: 16px;
}
.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 24px;
  max-width: 500px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-visual {
  display: flex;
  justify-content: center;
}
.hero-illustration {
  width: 100%;
  max-width: 360px;
  height: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover {
  background: #6aafff;
  color: #000;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.btn-text {
  background: transparent;
  color: var(--accent);
  padding: 6px 10px;
  font-weight: 500;
}
.btn-text:hover { background: var(--accent-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* Calculator Section */
.calculator-section {
  padding: 40px 0 60px;
}
.calc-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  align-items: start;
}

.calc-input-panel,
.calc-results-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.panel-title {
  font-size: 1.15rem;
  color: var(--text-heading);
  margin-bottom: 20px;
}

/* Unit Toggle */
.unit-toggle {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 20px;
  width: fit-content;
}
.unit-btn {
  padding: 6px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}
.unit-btn.active {
  background: var(--accent);
  color: #000;
}

/* Form Fields */
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-heading);
  margin-bottom: 4px;
}
.field input[type="number"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  transition: border-color var(--transition);
}
.field input[type="number"]:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field input[type="number"]::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}
.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Bike Type Fieldset */
.bike-type-field {
  border: none;
  padding: 0;
  margin: 0 0 20px;
}
.bike-type-field legend {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-heading);
  margin-bottom: 8px;
}
.bike-type-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bike-type-option {
  cursor: pointer;
}
.bike-type-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.bike-type-card {
  display: block;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  transition: all var(--transition);
}
.bike-type-card strong {
  display: block;
  color: var(--text-heading);
  font-size: 0.9rem;
}
.bike-type-card small {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.bike-type-option input:checked + .bike-type-card {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.bike-type-option input:focus-visible + .bike-type-card {
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* Saved Fits */
.saved-fits {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.saved-fits h3 {
  font-size: 0.9rem;
  color: var(--text-heading);
  margin-bottom: 10px;
}
.saved-fits ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.saved-fits li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
}
.saved-fits li span {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-fits li button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-family: var(--font);
  flex-shrink: 0;
}
.saved-fits li button:hover {
  background: var(--accent-soft);
}

/* Results Panel */
.results-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  text-align: center;
  color: var(--text-muted);
  gap: 16px;
}
.results-placeholder p {
  max-width: 280px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.results-actions {
  display: flex;
  gap: 6px;
}

.result-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.result-metric {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.metric-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.metric-label small {
  text-transform: none;
  letter-spacing: 0;
}
.metric-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}
.metric-range {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.result-details h3 {
  font-size: 0.9rem;
  color: var(--text-heading);
  margin-bottom: 10px;
}
.geo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.geo-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.geo-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.geo-table tr:last-child td {
  border-bottom: none;
}

.result-notes {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text);
}
.result-notes p + p {
  margin-top: 8px;
}

/* Info Sections */
.info-section {
  padding: 50px 0;
}
.info-section.alt-bg {
  background: var(--bg-elevated);
}
.info-section h2 {
  font-size: 1.5rem;
  color: var(--text-heading);
  margin-bottom: 24px;
}
.container.narrow {
  max-width: 720px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.step-num {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.step-card h3 {
  font-size: 1rem;
  color: var(--text-heading);
  margin-bottom: 8px;
}
.step-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.note-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.note-card h3 {
  font-size: 1rem;
  color: var(--text-heading);
  margin-bottom: 10px;
}
.note-card p,
.note-card li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.note-card ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.note-card.warning {
  border-color: rgba(251, 191, 36, 0.3);
}
.note-card.warning h3 {
  color: var(--warning);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
}
.faq-list details {
  border-bottom: 1px solid var(--border);
}
.faq-list details:first-child {
  border-top: 1px solid var(--border);
}
.faq-list summary {
  padding: 16px 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-heading);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.faq-list details[open] summary::after {
  content: '−';
}
.faq-list details p {
  padding: 0 0 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 999;
  transition: opacity 0.3s ease;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-brand .logo-text {
  color: var(--text-heading);
  font-weight: 700;
  font-size: 1rem;
}
.footer-brand p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.footer-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-nav a {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.footer-nav a:hover { color: var(--text); }
.footer-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Print Styles */
@media print {
  .site-header,
  .site-footer,
  .hero,
  .info-section,
  .results-actions,
  .calc-input-panel,
  .toast,
  .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .calculator-section { padding: 0; }
  .calc-layout { display: block; }
  .calc-results-panel {
    border: none;
    padding: 0;
    background: transparent;
  }
  .result-metric { border: 1px solid #ccc; }
  .metric-value { color: #000; }
  .geo-table th, .geo-table td { border-color: #ccc; color: #000; }
}

/* Responsive */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { display: none; }
  .hero-copy h1 { font-size: 1.8rem; }

  .calc-layout { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .container { padding: 0 14px; }
  .site-nav { gap: 2px; }
  .site-nav a { padding: 4px 8px; font-size: 0.82rem; }
  .hero { padding: 40px 0 24px; }
  .hero-copy h1 { font-size: 1.5rem; }
  .calc-input-panel, .calc-results-panel { padding: 18px; }
  .bike-type-options { gap: 6px; }
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
