/* Maqam (maqam.dev) — Night Ink & Zen Blueprint Design System
 * Locked Palette: #0D0F14 (Canvas) + #F4EFE6 (Warm Paper) + #14B8A6 (10% Accent)
 */

:root {
  --bg: #0D0F14;
  --surface: #141821;
  --surface-elevated: #1A202C;
  --border: rgba(244, 239, 230, 0.12);
  --border-accent: rgba(20, 184, 166, 0.4);
  --text: #F4EFE6;
  --text-muted: rgba(244, 239, 230, 0.72);
  --text-subtle: rgba(244, 239, 230, 0.52);
  --accent: #14B8A6;
  --accent-dim: rgba(20, 184, 166, 0.14);
  --warn: #F59E0B;
  --danger: #EF4444;
  --ok: #10B981;
  --radius: 12px;
  --max-w: 960px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(20, 184, 166, 0.08), transparent 60%),
    var(--bg);
}

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

a:hover {
  text-decoration: underline;
}

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

/* Header */
header.site-header {
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 15, 20, 0.88);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand .ar {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
}

nav.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.92rem;
}

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

nav.nav-links a:hover,
nav.nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 72px 0 48px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 18px;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  max-width: 18ch;
}

.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 28px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.94rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #071312;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #2dd4bf;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
}

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

/* Sections & Cards */
section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

h3 {
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.card.highlight {
  border-color: var(--border-accent);
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.metric-label {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.code-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  background: #090b0f;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
}

/* Forms */
.email-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 520px;
  margin-top: 16px;
}

input[type="email"],
input[type="number"],
select {
  background: #090b0f;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
}

input[type="email"] {
  flex: 1 1 240px;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-note {
  font-size: 0.84rem;
  color: var(--text-subtle);
  margin-top: 10px;
}

/* Calculator Specific */
.calc-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 820px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field label strong {
  color: var(--text);
  font-family: var(--font-mono);
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.field select,
.field input[type="number"] {
  width: 100%;
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  border: 1px solid var(--border);
}

.grade-A, .grade-B { background: rgba(16, 185, 129, 0.16); color: var(--ok); border-color: rgba(16, 185, 129, 0.4); }
.grade-C { background: rgba(245, 158, 11, 0.16); color: var(--warn); border-color: rgba(245, 158, 11, 0.4); }
.grade-D, .grade-F { background: rgba(239, 68, 68, 0.16); color: var(--danger); border-color: rgba(239, 68, 68, 0.4); }

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
}

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

.stat-row .mono {
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  margin-top: 40px;
  font-size: 0.88rem;
  color: var(--text-subtle);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

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

.prose {
  max-width: 70ch;
}

.prose p, .prose li {
  color: var(--text-muted);
}
