:root {
  --nordic: #0c1436;      /* Nordic Depths - primary dark */
  --pine: #005c4d;        /* Pine Shadow - alt dark */
  --berry: #ff375b;       /* Wild Berry - primary CTA/accent */
  --sun: #ff9903;         /* Fjord Sun - highlight */
  --lavender: #dbacf5;    /* Lavender Frost - light accent */
  --haze: #fff3eb;        /* Arctic Haze - warm off-white */

  --bg: var(--nordic);
  --panel: #14204f;       /* lifted Nordic Depths for panels on dark pages */
  --accent: var(--sun);
  --accent-text: var(--nordic);
  --text: var(--haze);
  --muted: #b9c0d9;
  --danger: var(--berry);
  --border: rgba(255,255,255,0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
a { color: inherit; }
code {
  font-family: 'Poppins', monospace;
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ---------- Top navigation ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin-right: auto;
}
.nav .brand svg { flex-shrink: 0; }
.nav-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav a.active,
.nav a:hover {
  color: var(--sun);
  border-color: var(--sun);
}

/* ---------- Hero (landing page) ---------- */
.hero {
  position: relative;
  padding: 72px 32px 56px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,153,3,0.10), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(219,172,245,0.10), transparent 45%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='%23dbacf5' stroke-opacity='0.10' stroke-width='2'%3E%3Cpath d='M20 30h28a8 8 0 0 1 8 8v14a8 8 0 0 1-8 8H34l-8 8v-8h-6a8 8 0 0 1-8-8V38a8 8 0 0 1 8-8Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 220px 220px;
  opacity: 0.5;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lavender);
  border: 1px solid rgba(219,172,245,0.4);
  border-radius: 20px;
  padding: 5px 14px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.15;
  margin: 0 0 16px;
  font-weight: 600;
}
.hero h1 em {
  font-family: 'Noto Serif Display', serif;
  font-style: italic;
  font-weight: 800;
  font-stretch: condensed;
  color: var(--sun);
}
.hero p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

/* ---------- Page header (sub-pages) ---------- */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 40px 32px 8px;
  max-width: 720px;
  margin: 0 auto;
}
.page-header .icon-badge { flex-shrink: 0; }
.page-header h1 { margin: 0 0 4px; font-size: 22px; }
.page-header p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sun), var(--berry));
}
.icon-badge svg { width: 24px; height: 24px; stroke: var(--nordic); }

.page {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  border: 1px solid var(--border);
}
.card.wide { max-width: 720px; }

.top-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  font-family: inherit;
}

h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
}
p.desc {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.6;
}

.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
button, .btn {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--berry); color: var(--text); }
.btn-ghost { background: transparent; color: var(--danger); border: 2px solid var(--danger); }

.status {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
  min-height: 18px;
}
.status.recording { color: var(--berry); }

audio { width: 100%; margin-bottom: 16px; }

/* ---------- Tool grid (landing page) ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 900px;
  margin: 40px auto 0;
  padding: 0 32px 60px;
}
.tool-card {
  background: var(--haze);
  color: var(--nordic);
  border-radius: 18px;
  padding: 26px;
  text-decoration: none;
  display: block;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(0,0,0,0.35); }
.tool-card .icon-badge { margin-bottom: 16px; }
.tool-card h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
}
.tool-card p {
  font-size: 13px;
  color: #4a5178;
  margin: 0 0 14px;
  line-height: 1.55;
}
.tool-card .go {
  font-size: 13px;
  font-weight: 600;
  color: var(--berry);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--berry);
  border: 1px solid var(--berry);
  border-radius: 12px;
  padding: 2px 8px;
  margin-bottom: 10px;
}

/* ---------- Forms (callback / chat test pages) ---------- */
fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 0 20px;
  padding: 16px;
}
legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--sun);
  padding: 0 6px;
}
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
label .hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
input, textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
input::placeholder { color: rgba(255,243,235,0.35); }

.placeholder-box {
  border: 1px dashed rgba(255,255,255,0.25);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

pre.preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
