:root {
  --bg-primary: #0D1117;
  --bg-surface: #161B22;
  --bg-raised: #1C232D;
  --border: #30363D;
  --text-primary: #E6EDF3;
  --text-muted: #8B949E;
  --accent: #F5A623;
  --accent-strong: #D4920A;
  --navy: #2C3E50;
  --radius: 12px;
}

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

html, body { height: 100%; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Cabinet Grotesk", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-mark svg { width: 100%; height: 100%; }

.brand-text { display: flex; flex-direction: column; }

.brand-name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.brand-tag {
  font-size: 12px;
  color: var(--text-muted);
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  font-family: inherit;
  font-weight: 500;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1A1206;
  font-weight: 700;
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

/* ---------- layout ---------- */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 460px) 1fr;
  gap: 24px;
  padding: 24px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  align-items: start;
}

/* ---------- preview ---------- */

.preview-card {
  position: sticky;
  top: 86px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.preview-stage {
  aspect-ratio: 400 / 430;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, rgba(245, 166, 35, 0.13), transparent 70%),
    var(--bg-primary);
  padding: 24px;
}

.preview-stage svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}

.preview-stage svg .fennec-bg { fill: transparent; }

.preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.fennec-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: var(--text-muted);
}

.bg-picker { display: flex; gap: 6px; }

.bg-swatch {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
}
.bg-swatch.active { border-color: var(--accent); }
.bg-swatch.none {
  background:
    linear-gradient(45deg, #3a444f 25%, transparent 25%, transparent 75%, #3a444f 75%),
    linear-gradient(45deg, #3a444f 25%, transparent 25%, transparent 75%, #3a444f 75%),
    #222a33;
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}

/* ---------- controls ---------- */

.controls { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.control-group {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
}

.control-group > h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
}

.option {
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 6px 4px 7px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.12s, transform 0.05s;
  font-family: inherit;
  color: var(--text-primary);
}
.option:hover { border-color: var(--accent); }
.option:active { transform: scale(0.97); }
.option.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 14px rgba(245, 166, 35, 0.15);
}

.option .thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg-primary);
  display: flex;
}
.option .thumb svg { width: 100%; height: 100%; }

.option .opt-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.option.active .opt-label { color: var(--accent); }

.swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
  transition: transform 0.08s, border-color 0.12s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.35); }

/* ---------- footer ---------- */

.site-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .preview-card { position: static; max-width: 460px; margin: 0 auto; width: 100%; }
}
