/* ============================================
   ZEEMISH — Design System
   ============================================ */

/* --- Google Fonts loaded per-page via <link> --- */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Core palette */
  --bg: #0b1c21;
  --surface: #112830;
  --surface-hover: #163139;
  --border: #204550;
  --text: #e4f2f4;
  --text-dim: #68a8ae;
  --accent: #6eeee4;
  --accent-glow: rgba(110, 238, 228, 0.22);

  /* Category colors — sessions */
  --cat-breath: #6eeee4;
  --cat-focus: #8b5cf6;
  --cat-body: #fb923c;
  --cat-rest: #818cf8;

  /* Category colors — audio */
  --cat-frequency: #8b5cf6;
  --cat-noise: #6eeee4;
  --cat-nature: #22c55e;
  --cat-ambient: #818cf8;
  --cat-rhythm: #f59e0b;
  --cat-instrument: #ec4899;
  --cat-sequencer: #f97316;
  --cat-therapeutic: #06b6d4;
  --cat-utility: #7a7a90;

  /* Category colors — tools */
  --cat-absorb: #3b82f6;
  --cat-reveal: #f43f5e;
  --cat-slow: #a3e635;
  --cat-edge: #f59e0b;

  /* Category colors — listens */
  --cat-listen-seeing: #f59e0b;
  --cat-listen-patterns: #22c55e;
  --cat-listen-thinking: #8b5cf6;
  --cat-listen-body: #fb923c;
  --cat-listen-night: #818cf8;
  --cat-listen-edge: #f87171;

  /* Spacing */
  --radius: 12px;
  --pad: 24px;
  --gap: 16px;

  /* Transitions */
  --ease: 0.25s ease;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Subtle grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.2;
}

.mono {
  font-family: 'Space Mono', monospace;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--ease);
}
a:hover {
  opacity: 0.8;
}

/* --- Tool Navigation --- */
.tool-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px var(--pad);
  font-size: 0.85rem;
  color: var(--text-dim);
  user-select: none;
}

.nav-logo {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: -0.02em;
}

.nav-divider {
  opacity: 0.3;
}

.nav-tool-name {
  color: var(--text-dim);
  font-weight: 400;
}

/* --- Tool Container --- */
.tool-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: var(--pad);
  text-align: center;
}

/* --- Tool Footer --- */
.tool-footer {
  padding: 16px var(--pad);
  text-align: center;
  font-size: 0.8rem;
}
.tool-footer a {
  color: var(--text-dim);
  transition: color var(--ease);
}
.tool-footer a:hover {
  color: var(--accent);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--text); opacity: 0.7;
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text-dim);
}

/* --- Inputs --- */
.input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--ease);
  width: 100%;
}
.input:focus {
  border-color: var(--accent);
}
.input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

textarea.input {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad);
  transition: all var(--ease);
}
.card:hover {
  background: var(--surface-hover);
  border-color: rgba(255,255,255,0.06);
}

/* --- Utility --- */
.text-dim {
  color: var(--text-dim);
}
.text-accent {
  color: var(--accent);
}
.text-center {
  text-align: center;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* --- Fade animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  :root {
    --pad: 16px;
  }
  .tool-container {
    min-height: calc(100vh - 100px);
  }
}
