/* ── KairosAI Tools — rethemed to match KairosAI Identity ── */

:root {
  --bg: #080808;
  --panel: #0d0d0d;
  --panel2: #111111;
  --line: rgba(255,255,255,0.08);
  --line2: rgba(255,255,255,0.05);
  --text: #f0f0ef;
  --muted: #6b6b66;
  --gold: #c9a84c;
  --gold-dim: rgba(201,168,76,0.15);
  --gold-border: rgba(201,168,76,0.25);
  --gold-glow: rgba(201,168,76,0.08);
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --shadow: 0 24px 80px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'GeistSans', Inter, system-ui, sans-serif;
  color: var(--text);
  background: #080808;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Grid background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, #141414 1px, transparent 1px),
    linear-gradient(to bottom, #141414 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: -2;
}

/* Gold glow orb */
body::after {
  content: "";
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(201,168,76,0.06), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

a { color: inherit; text-decoration: none; }

/* ── Shell ── */
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line2);
  background: rgba(8,8,8,0.85);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}

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

.brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background-image: url('kairos-logo.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--gold-border);
  box-shadow: 0 0 12px var(--gold-glow);
  overflow: hidden;
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f0f0ef;
}

.brand p {
  margin: 2px 0 0;
  font-size: 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.1em;
  color: var(--gold);
}

/* ── Nav ── */
.nav { display: flex; gap: 4px; flex-wrap: wrap; }

.nav a {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.15s;
  cursor: pointer;
}

.nav a:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

/* ── Buttons ── */
button, .button {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  transition: all 0.15s;
  cursor: pointer;
}

button:hover, .button:hover {
  border-color: rgba(201,168,76,0.4);
  color: var(--gold);
}

button.primary, .button.primary {
  background: var(--gold);
  border: none;
  color: #000;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 4px 20px rgba(201,168,76,0.2);
}

button.primary:hover, .button.primary:hover {
  background: #d4b55f;
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(201,168,76,0.3);
}

/* ── Hero ── */
.hero {
  padding: 80px 0 48px;
  max-width: 760px;
}

.kicker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.hero h2 {
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 20px 0 16px;
  font-weight: 700;
}

.gradient-text {
  background: linear-gradient(90deg, var(--gold), #e8c97a, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
  max-width: 640px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ── Stats ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line2);
  margin: 10px 0 56px;
}

.stat { padding: 20px; border-right: 1px solid var(--line2); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-size: 20px; font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--gold); }
.stat span { color: var(--muted); font-size: 12px; font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 0.06em; text-transform: uppercase; }

/* ── Section titles ── */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin: 40px 0 16px;
}

.section-title h3 {
  font-size: 22px;
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.section-title p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.category { scroll-margin-top: 80px; }

/* ── Grid + Cards ── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line2);
  border: 1px solid var(--line2);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2px;
}

.card {
  position: relative;
  background: var(--panel);
  padding: 20px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  transition: all 0.15s;
}

.card::before { display: none; }

.card:hover {
  background: #131313;
  z-index: 1;
}

.card:hover .linkline { color: var(--gold); }

.icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(201,168,76,0.06);
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.tag {
  display: inline-flex;
  width: max-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.card h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.card p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 16px;
  font-size: 13px;
}

.linkline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  margin-top: auto;
  transition: color 0.15s;
}

/* ── Footer ── */
.footer {
  padding: 40px 0 56px;
  color: var(--muted);
  margin-top: 60px;
}

.footer-box {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--panel);
  padding: 16px 20px;
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ── Tool pages ── */
.tool-hero { padding: 44px 0 16px; }
.breadcrumbs { color: var(--muted); font-size: 12px; font-family: 'JetBrains Mono', ui-monospace, monospace; margin-bottom: 10px; }
.breadcrumbs a { color: var(--gold); }
.breadcrumbs a:hover { text-decoration: underline; }
.tool-hero h2 { font-size: clamp(28px, 4vw, 48px); margin: 8px 0; letter-spacing: -0.03em; }
.tool-hero p { color: var(--muted); line-height: 1.7; max-width: 720px; font-size: 14px; }

.tool-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  margin: 14px 0 28px;
}

.tool-panel, .hero-panel, .faq-item {
  position: relative;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.tool-panel::before, .hero-panel::before, .faq-item::before { display: none; }

.tool-panel .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line2);
}

.tool-panel .head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.tool-panel .body { padding: 16px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.status { min-height: 20px; color: var(--green); font-size: 13px; font-family: 'JetBrains Mono', ui-monospace, monospace; }

.chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.value { font-weight: 700; margin-top: 4px; }

.metric-grid, .small-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.metric, .small-stat {
  border: 1px solid var(--line2);
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  padding: 12px;
}

textarea, input, select {
  background: #050505;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  transition: border-color 0.15s;
}

textarea:focus, input:focus, select:focus {
  border-color: rgba(201,168,76,0.4);
}

textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  line-height: 1.6;
}

input[type="text"], input[type="number"], select { min-height: 40px; }

.output-box, .code-output {
  width: 100%;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050505;
  color: #e0e0da;
  padding: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  overflow: auto;
  word-break: break-word;
  line-height: 1.6;
}

.output-box.small, .code-output.small { min-height: 140px; }

.preview {
  min-height: 280px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg,#111 25%,transparent 25%),
    linear-gradient(-45deg,#111 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#111 75%),
    linear-gradient(-45deg,transparent 75%,#111 75%);
  background-size: 20px 20px;
  background-position: 0 0,0 10px,10px -10px,-10px 0;
  overflow: auto;
  padding: 16px;
}

.preview.dark { background: #050505; place-items: start; }
.preview svg, .preview img { max-width: 100%; max-height: 480px; }

.file-drop {
  border: 1px dashed var(--gold-border);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  text-align: center;
  background: var(--gold-glow);
  font-size: 13px;
}

.img-preview {
  max-width: 100%;
  max-height: 240px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  display: block;
  margin: 0 auto;
}

.preview-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.swatch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatch { border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; background: var(--panel2); }
.swatch-color { height: 64px; }
.swatch-meta { padding: 10px; font-size: 12px; font-family: 'JetBrains Mono', ui-monospace, monospace; }

.muted { color: var(--muted); }

.center-note {
  display: grid;
  place-items: center;
  text-align: center;
  width: 100%;
  min-height: 200px;
  color: var(--muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
}

.range-wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
input[type="range"] { width: 200px; accent-color: var(--gold); }

.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.faq-item { padding: 16px; }
.faq-item h5 { margin: 0 0 8px; font-size: 14px; }
.faq-item p { color: var(--muted); line-height: 1.6; margin: 0; font-size: 13px; }

/* ── Responsive ── */
@media (max-width: 980px) {
  .hero { padding-top: 48px; }
  .stats, .grid, .tool-layout, .faq-grid, .metric-grid, .preview-split, .swatch-grid {
    grid-template-columns: 1fr;
  }
  .stat { border-right: 0; border-bottom: 1px solid var(--line2); }
  .nav { display: none; }
}
