@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  /* Observatory — warm dark instrument */
  --ink: #0c0a08;
  --ink-elev: #15120e;
  --ink-raised: #1d1812;
  --ink-pressed: #252017;
  --bone: #ece6d8;
  --bone-dim: #a39a87;
  --bone-mute: #6f6759;
  --rule: #2a241d;
  --rule-soft: #1f1a14;
  --ember: #d97757;
  --ember-soft: #3a1f15;
  --ember-deep: #a35336;
  --sage: #9bb556;
  --wheat: #d4a72c;
  --oxide: #c4524d;
  --paper: #f5efe6;
}

html,
body {
  background-color: var(--ink);
  color: var(--bone);
}

body {
  font-family: var(--font-geist), ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--ember-soft);
  color: var(--bone);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--rule);
  border: 2px solid var(--ink);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bone-mute);
}

/* Subtle grain overlay — gives the dark UI a printed-page texture without
   getting in the way of legibility. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.025;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

@layer utilities {
  .font-display {
    font-family: var(--font-instrument-serif), ui-serif, Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.01em;
  }

  .eyebrow {
    font-family: var(--font-geist-mono), ui-monospace, monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bone-mute);
  }

  .text-balance {
    text-wrap: balance;
  }

  .cursor-block {
    display: inline-block;
    width: 0.45em;
    height: 0.95em;
    background: currentColor;
    vertical-align: text-bottom;
    animation: cursor-pulse 1.05s steps(2) infinite;
  }
  @keyframes cursor-pulse {
    50% {
      opacity: 0;
    }
  }

  .reveal {
    animation: reveal 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  @keyframes reveal {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .stagger-1 {
    animation-delay: 0.08s;
  }
  .stagger-2 {
    animation-delay: 0.16s;
  }
  .stagger-3 {
    animation-delay: 0.24s;
  }
  .stagger-4 {
    animation-delay: 0.32s;
  }
}

/* Markdown — reads more like editorial prose than wiki-text */
.markdown-content p {
  margin: 0 0 0.5rem !important;
  line-height: 1.6;
}
.markdown-content p:last-child {
  margin-bottom: 0 !important;
}
.markdown-content ul,
.markdown-content ol {
  margin: 0.25rem 0 0.5rem !important;
  padding-left: 1.25rem !important;
}
.markdown-content li {
  margin: 0.125rem 0 !important;
  line-height: 1.55;
}
.markdown-content strong {
  font-weight: 600;
  color: var(--bone);
}
.markdown-content code {
  font-family: var(--font-geist-mono), ui-monospace, monospace;
  font-size: 0.86em;
  background: var(--ink-pressed);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  color: var(--ember);
}
.markdown-content pre {
  background: var(--ink-pressed);
  padding: 0.75rem 1rem;
  border-radius: 3px;
  overflow-x: auto;
  margin: 0.5rem 0;
  border: 1px solid var(--rule);
}
.markdown-content pre code {
  background: transparent;
  padding: 0;
  color: var(--bone);
  font-size: 0.85em;
}
.markdown-content a {
  color: var(--ember);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.markdown-content a:hover {
  color: var(--ember-deep);
}
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
  font-family: var(--font-instrument-serif), ui-serif, Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--bone);
  margin: 0.6rem 0 0.3rem;
}
.markdown-content h1 {
  font-size: 1.5rem;
}
.markdown-content h2 {
  font-size: 1.25rem;
}
.markdown-content h3 {
  font-size: 1.1rem;
}
