/* ============================================================
   Raimon Luna — personal site
   Design system: paper white / ink black / event-horizon indigo
   Display: Source Serif 4 · Body: Inter · Data: JetBrains Mono
   ============================================================ */

:root {
  --paper: #FAFAF8;
  --paper-dim: #F3F2EE;
  --ink: #191919;
  --ink-soft: #3A3935;
  --gray: #6B6963;
  --rule: #E4E2DC;
  --accent: #1B2A4A;      /* event-horizon indigo */
  --accent-soft: #3E4F77;
  --accent-wash: #EEF0F5;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --max-w: 920px;
  --max-w-wide: 1120px;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover { border-bottom-color: var(--accent); }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 500; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray);
  display: block;
  margin-bottom: 0.6em;
}

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

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}
.wrap-wide {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 28px;
}

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

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  border-bottom: none;
  letter-spacing: 0.01em;
}
.brand:hover { border-bottom: none; color: var(--accent); }
.brand .dot { color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  position: relative;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.site-nav { display: flex; gap: 2.1rem; }
.site-nav a {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink-soft);
  border-bottom: none;
  padding: 4px 0;
  position: relative;
}
.site-nav a:hover { color: var(--ink); border-bottom: none; }
.site-nav a.active { color: var(--ink); }
.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: var(--accent);
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    gap: 0;
    padding: 8px 28px 18px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .site-nav a.active::after { display: none; }
}

/* ---------- orbit divider (signature element) ---------- */

.orbit-divider {
  position: relative;
  height: 1px;
  background: var(--rule);
  margin: 4rem 0;
  overflow: visible;
}
.orbit-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 8%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--paper);
}
.orbit-divider.center::before { left: 50%; }

/* ---------- buttons / pills ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.65em 1.3em;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
.btn-primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--paper); }

.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-wash);
  padding: 0.25em 0.6em;
  border-radius: 2px;
  display: inline-block;
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 5rem;
  padding: 2.2rem 0 3rem;
  color: var(--gray);
  font-size: 0.86rem;
}
.site-footer .wrap-wide {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.site-footer a { color: var(--gray); }
.site-footer a:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- utility ---------- */

.muted { color: var(--gray); }
.mono { font-family: var(--mono); }
.text-center { text-align: center; }
.section { padding: 4.5rem 0; }
.section-tight { padding: 2.5rem 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
