/* AI Cost Management — official website (static MVP)
   System fonts only. No CDN, no external resources. */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1b1c1f;
  --muted: #4b4f57;
  --border: #dfe2e8;
  --accent: #0a58ca;
  --accent-dark: #084298;
  --focus: #0a58ca;
  --radius: 10px;
  --max-width: 1080px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

/* Accessibility: skip link + focus */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: #eef1f6;
  padding: 1px 5px;
  border-radius: 4px;
  word-break: break-all;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.container-narrow { max-width: 760px; }

.section { padding: 56px 0; }
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.75rem); margin: 0 0 16px; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin: 0 0 20px; }
h3 { font-size: 1.12rem; margin: 0 0 8px; }

.section-intro { color: var(--muted); margin-top: -8px; }

/* Header / nav */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.wordmark {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--accent-dark); }
.nav-links {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--text);
  text-decoration: none;
  padding: 6px 2px;
}
.nav-links a:hover { color: var(--accent-dark); text-decoration: underline; }
.nav .btn-small { margin-left: auto; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 22px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--accent);
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn:focus-visible { outline-color: var(--text); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
}
.btn-ghost:hover { background: #e8effb; color: var(--accent-dark); }
.btn-small { padding: 8px 14px; min-height: 40px; font-size: 0.95rem; }

/* Hero */
.hero { padding: 56px 0 64px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  align-items: center;
}
.lead { font-size: 1.08rem; color: var(--muted); margin: 0 0 24px; }
.lead strong { color: var(--text); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Schematic (clearly labeled placeholder, not a screenshot) */
.schematic {
  background: var(--surface);
  border: 1px dashed #9aa3b2;
  border-radius: var(--radius);
  padding: 14px;
}
.schematic-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.schematic-row { display: flex; gap: 10px; margin-bottom: 10px; }
.schematic-row:last-child { margin-bottom: 0; }
.schematic-block {
  flex: 1;
  background: #eef1f6;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 74px;
}
.schematic-block-lg { min-height: 120px; }
.schematic-line {
  display: block;
  height: 8px;
  background: #cfd6e2;
  border-radius: 4px;
}
.w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }
.schematic-bars { display: flex; gap: 6px; align-items: flex-end; flex: 1; }
.schematic-bars i {
  display: block;
  width: 14px;
  background: #a9b6cc;
  border-radius: 3px 3px 0 0;
}
.schematic-bars i:nth-child(1) { height: 24px; }
.schematic-bars i:nth-child(2) { height: 44px; }
.schematic-bars i:nth-child(3) { height: 32px; }
.schematic-bars i:nth-child(4) { height: 56px; }
.schematic-bars i:nth-child(5) { height: 38px; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.section-alt .card { background: var(--bg); }
.card p { margin: 0; color: var(--muted); }
.card strong { color: var(--text); }
.card-wide { grid-column: 1 / -1; }
.note {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}

.scope-note {
  margin-top: 24px;
  background: #eef1f6;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 14px 18px;
}
.scope-note p { margin: 0; color: var(--text); font-size: 0.97rem; }

/* Privacy */
.privacy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.privacy-grid ul { padding-left: 20px; color: var(--muted); }
.privacy-grid li { margin-bottom: 8px; }

/* Download spec list */
.spec-list {
  margin: 0 0 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.spec-row {
  display: flex;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.spec-row:last-child { border-bottom: none; }
.spec-row dt {
  font-weight: 600;
  min-width: 140px;
  margin: 0;
}
.spec-row dd { margin: 0; flex: 1; min-width: 200px; color: var(--muted); }
.checksum {
  word-break: break-all;
  color: var(--text);
  line-height: 1.5;
}
.download-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

/* FAQ */
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 18px;
  margin-bottom: 12px;
}
details + details { margin-top: -2px; }
summary {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 0;
  list-style: revert;
}
summary:hover { color: var(--accent-dark); }
details p {
  margin: 0 0 16px;
  color: var(--muted);
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-grid .wordmark { margin: 0 0 6px; }
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* Responsive: mobile-first down to 360px */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .privacy-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 640px) {
  .section { padding: 40px 0; }
  .hero { padding: 36px 0 44px; }
  .nav { gap: 10px; }
  .nav-links { order: 3; width: 100%; gap: 14px; }
  .nav .btn-small { margin-left: auto; }
  .spec-row { flex-direction: column; gap: 4px; }
  .spec-row dt { min-width: 0; }
  .download-actions .btn { width: 100%; text-align: center; }
  .hero-actions .btn { width: 100%; text-align: center; }
}

@media (max-width: 380px) {
  body { font-size: 15px; }
  .container { padding: 0 14px; }
  .nav-links { gap: 10px; font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
