/* Nocturne marketing site, shared design system */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #fafaf9;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #ccfbf1;
  --danger: #991b1b;
  --success: #166534;
  --code-bg: #f1f5f9;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 760px;
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

/* Top nav */
.nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, 0.85);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-brand-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-brand-sub {
  font-weight: 500;
  color: var(--text-subtle);
  font-size: 0.85rem;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.active {
  color: var(--accent);
}

/* Layout */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

main.wide {
  max-width: 1000px;
}

/* Hero */
.hero {
  margin-bottom: 3.5rem;
}

.hero-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 3rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.hero-sub {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
  max-width: 640px;
  font-weight: 400;
}

.hero-meta {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-subtle);
  font-style: italic;
}

/* Typography */
h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 3.5rem 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 2.5rem 0 0.75rem;
  color: var(--text);
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
  color: var(--text);
}

p {
  margin: 0 0 1.15rem;
  color: var(--text);
}

p.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.65;
}

strong { font-weight: 600; color: var(--text); }
em { font-style: italic; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

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

ul, ol {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
}

li { margin-bottom: 0.4rem; }

li::marker { color: var(--text-subtle); }

/* Callouts */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 1.1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.75rem 0;
  color: var(--text);
}

.callout p:last-child { margin-bottom: 0; }

.callout-quote {
  font-size: 1.15rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.94rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text);
  font-size: 0.88rem;
  text-transform: none;
  letter-spacing: 0;
}

tr:last-child td { border-bottom: none; }

td strong { color: var(--text); }

/* Code */
code {
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--text);
}

pre {
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  background: var(--code-bg);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  color: var(--text);
}

pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

/* CTA */
.cta-section {
  margin: 4rem 0 2rem;
  padding: 2.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-align: center;
}

.cta-section h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
  font-size: 1.6rem;
}

.cta-section p {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid var(--accent);
  transition: all 0.15s;
  letter-spacing: 0.005em;
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  color: white;
}

.btn-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.85rem;
  background: var(--bg-elevated);
}

footer a {
  color: var(--text-muted);
}

/* Index page special styles */
.hero-index {
  text-align: center;
  padding: 4rem 1.5rem 2rem;
  max-width: 820px;
  margin: 0 auto;
}

.hero-index h1 {
  font-size: 3.75rem;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
}

.hero-index .hero-sub {
  font-size: 1.35rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 880px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 980px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.card p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-grow: 1;
  font-size: 0.94rem;
}

.card a {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Savings calculator form */
.calc-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  margin: 2rem 0;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

@media (max-width: 720px) {
  .calc-grid { grid-template-columns: 1fr; }
  .hero h1, .hero-index h1 { font-size: 2.25rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.85rem; }
  main { padding: 2rem 1.25rem 4rem; }
  .calc-wrap { padding: 1.5rem; }
}

.calc-inputs h3, .calc-outputs h3 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--text);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.field small {
  display: block;
  font-size: 0.78rem;
  color: var(--text-subtle);
  margin-top: 0.25rem;
  line-height: 1.5;
}

.field input[type="number"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.output-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.output-row:last-child { border-bottom: none; }

.output-label {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.output-value {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.output-big {
  text-align: center;
  padding: 1.75rem 1rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
  margin-top: 1.5rem;
}

.output-big .output-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.output-big .output-value {
  font-size: 2.25rem;
  color: var(--accent-hover);
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

.verdict {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  border-left: 3px solid var(--border-strong);
  background: var(--bg);
}

.verdict.good {
  border-left-color: var(--success);
  background: #f0fdf4;
  color: #14532d;
}

.verdict.great {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.verdict.small {
  border-left-color: var(--text-subtle);
  background: var(--code-bg);
  color: var(--text-muted);
}

/* System diagram ASCII box */
.diagram {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  background: var(--code-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  white-space: pre;
}

/* Print */
@media print {
  .nav, .cta-section .btn, footer { display: none; }
  body { background: white; color: black; font-size: 11pt; }
  main { padding: 0; max-width: 100%; }
  .cta-section { background: none; border: 1px solid #999; box-shadow: none; }
  table { box-shadow: none; }
  h1, h2, h3 { color: black; }
  a { color: black; text-decoration: underline; }
}
