/* Vinyl Weight Placement Calculator — Stylesheet */
:root {
  --bg: #1a1410;
  --bg-card: #241e18;
  --bg-input: #2e2620;
  --text: #e8ddd2;
  --text-muted: #9e8e7e;
  --accent: #d4844a;
  --accent-hover: #e0955a;
  --accent-dim: #a06030;
  --border: #3d3328;
  --success: #7ab87a;
  --warning: #d4a84a;
  --danger: #c95a5a;
  --radius: 8px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

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

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.logo:hover { color: var(--accent); text-decoration: none; }
.logo svg { color: var(--accent); flex-shrink: 0; }

.site-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}
.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.3rem;
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}

/* Hero */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #1a1410; }
.btn-primary:hover { background: var(--accent-hover); color: #1a1410; text-decoration: none; }
.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); text-decoration: none; }

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

.calc-panel h2, .diagram-panel h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.preset-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--accent-dim);
  background: transparent;
  color: var(--accent);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
.preset-btn:hover { background: rgba(212, 132, 74, 0.15); }

.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.form-row input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
}
.form-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.form-row small {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.result-area {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(122, 184, 122, 0.1);
  border: 1px solid rgba(122, 184, 122, 0.3);
  display: none;
}
.result-area.visible { display: block; }
.result-area h3 { font-size: 1.1rem; margin-bottom: 10px; color: var(--success); }
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(122, 184, 122, 0.15);
  font-size: 0.95rem;
}
.result-row:last-child { border-bottom: none; }
.result-value { font-weight: 700; color: var(--success); }

.warning-area {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: rgba(212, 168, 74, 0.1);
  border: 1px solid rgba(212, 168, 74, 0.3);
  font-size: 0.9rem;
  color: var(--warning);
  display: none;
}
.warning-area.visible { display: block; }

/* Diagram */
.diagram-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}
.diagram-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}
.saved-setup {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  display: none;
}
.saved-setup.visible { display: block; }

/* Info Section */
.info-section { padding: 60px 0; border-top: 1px solid var(--border); }
.info-section h2 { font-size: 1.6rem; margin-bottom: 32px; text-align: center; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.info-card h3 { font-size: 1rem; margin-bottom: 8px; color: var(--accent); }
.info-card p { font-size: 0.9rem; color: var(--text-muted); }

.force-explainer { margin-bottom: 48px; }
.force-explainer h3 { font-size: 1.2rem; margin-bottom: 20px; }
.force-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.force-card {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.force-low { background: rgba(212, 168, 74, 0.08); border-color: rgba(212, 168, 74, 0.3); }
.force-ok { background: rgba(122, 184, 122, 0.08); border-color: rgba(122, 184, 122, 0.3); }
.force-high { background: rgba(201, 90, 90, 0.08); border-color: rgba(201, 90, 90, 0.3); }
.force-card h4 { font-size: 0.95rem; margin-bottom: 8px; }
.force-card p { font-size: 0.88rem; color: var(--text-muted); }

.common-mistakes { margin-bottom: 48px; }
.common-mistakes h3 { font-size: 1.2rem; margin-bottom: 16px; }
.common-mistakes ul { list-style: none; }
.common-mistakes li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-muted);
  padding-left: 20px;
  position: relative;
}
.common-mistakes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.common-mistakes li:last-child { border-bottom: none; }

.worn-stylus h3 { font-size: 1.2rem; margin-bottom: 12px; }
.worn-stylus p { font-size: 0.92rem; color: var(--text-muted); max-width: 750px; }

/* Reference Section */
.reference-section { padding: 60px 0; border-top: 1px solid var(--border); }
.reference-section h2 { font-size: 1.6rem; margin-bottom: 8px; text-align: center; }
.ref-note { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }

.table-wrap { overflow-x: auto; margin-bottom: 48px; }
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.ref-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.ref-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.ref-table tr:hover td { background: rgba(255,255,255,0.02); }

.edge-cases { margin-bottom: 48px; }
.edge-cases h3 { font-size: 1.2rem; margin-bottom: 16px; }
.edge-cases p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.upgrade-note h3 { font-size: 1.2rem; margin-bottom: 12px; }
.upgrade-note p { font-size: 0.92rem; color: var(--text-muted); max-width: 750px; }

/* Footer */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.site-footer p { margin-bottom: 6px; }
.last-updated { margin-top: 12px; font-size: 0.78rem; }

/* Print */
@media print {
  .site-header, .site-footer, .presets, .form-actions, .nav-toggle, .diagram-panel, .info-section, .reference-section { display: none !important; }
  .calc-layout { display: block; }
  .result-area.visible { display: block !important; border: 2px solid #333; }
  body { background: #fff; color: #000; }
}

/* Responsive */
@media (max-width: 860px) {
  .calc-layout { grid-template-columns: 1fr; }
  .diagram-panel { order: -1; }
}

@media (max-width: 600px) {
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    gap: 12px;
  }
  .nav-toggle { display: block; }
  .hero { padding: 50px 0 40px; }
  .hero h1 { font-size: 1.6rem; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; text-align: center; }
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { 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;
}
