/* =========================================================
   Daniel Ignatius Lee — shared design system
   Palette: kalamata maroon + peruvian clay
   Type: Instrument Serif (display) · Inter (body) · JetBrains Mono (meta)
   ========================================================= */

:root {
  --maroon: #5a1c0f;
  --maroon-deep: #3d1208;
  --maroon-soft: #6e2514;
  --clay: #bfaa96;
  --clay-light: #d7c4ad;
  --clay-dark: #8f7f6c;
  --ink: #1c0e08;
  --cream: #efe6da;
  --success: #9ae2b0;

  --bg: var(--maroon);
  --fg: var(--clay);
  --accent: var(--clay-light);

  --pad-x: 40px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg); color: var(--fg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 300; font-size: 16px; line-height: 1.5;
  min-height: 100vh; overflow-x: hidden;
  cursor: none;
  transition: background .6s ease, color .6s ease;
}
a { color: inherit; }
::selection { background: var(--clay); color: var(--maroon-deep); }
img { max-width: 100%; display: block; }

/* Grain */
body.grain-on::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1000;
  opacity: .16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1.2 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* Cursor */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 1100;
  will-change: transform; mix-blend-mode: difference;
}
.cursor-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--clay-light); transform: translate(-50%,-50%); }
.cursor-ring { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--clay); transform: translate(-50%,-50%); transition: width .25s, height .25s, opacity .25s, background .2s; }
.cursor-ring.hover { width: 72px; height: 72px; background: var(--clay); border-color: var(--clay); mix-blend-mode: normal; opacity: .2; }
@media (hover: none) { body { cursor: auto; } .cursor-dot, .cursor-ring { display: none; } }

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 22px var(--pad-x);
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in oklab, var(--fg) 15%, transparent);
}
.nav .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.nav .brand .logo {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--fg); color: var(--bg);
  display: grid; place-items: center;
  font-family: 'Instrument Serif', serif; font-style: italic; font-size: 20px; line-height: 1;
}
.nav .brand .name { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.nav .links { display: flex; gap: 28px; }
.nav .links a {
  color: var(--fg); text-decoration: none;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  position: relative; padding: 6px 0; opacity: .72; transition: opacity .25s;
}
.nav .links a::before {
  content: attr(data-num); position: absolute; top: -9px; left: -4px;
  font-size: 8px; opacity: .5;
}
.nav .links a:hover { opacity: 1; }
.nav .links a.active { opacity: 1; }
.nav .links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--fg);
}
.nav .contact-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border: 1px solid var(--fg); border-radius: 999px;
  color: var(--fg); text-decoration: none;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  transition: background .25s, color .25s;
}
.nav .contact-pill:hover { background: var(--fg); color: var(--bg); }
.nav .contact-pill .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #6ece8a;
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(110,206,138,.5); }
  70%  { box-shadow: 0 0 0 8px rgba(110,206,138,0); }
  100% { box-shadow: 0 0 0 0 rgba(110,206,138,0); }
}

/* Typography */
.serif { font-family: 'Instrument Serif', 'Times New Roman', serif; font-weight: 400; letter-spacing: -.01em; }
.mono  { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 400; }
.mono-xs { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.mono-sm { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .05em; }

/* Shared section bits */
.section { padding: 120px var(--pad-x); position: relative; }
.section-head {
  display: grid; grid-template-columns: 220px 1fr; gap: 40px;
  padding-bottom: 50px; margin-bottom: 50px;
  border-bottom: 1px solid color-mix(in oklab, var(--fg) 30%, transparent);
}
.section-head .tag { display: flex; flex-direction: column; gap: 8px; }
.section-head .tag .num { font-family: 'JetBrains Mono', monospace; font-size: 12px; opacity: .6; letter-spacing: .16em; }
.section-head .tag .label { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.section-head h2 {
  font-family: 'Instrument Serif', serif; font-weight: 400;
  font-size: clamp(40px, 6vw, 80px); line-height: 1; letter-spacing: -.02em;
  color: var(--accent);
}
.section-head h2 em { font-style: italic; }

/* Page header (below top nav) */
.page-head {
  padding: 140px var(--pad-x) 80px;
  display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end;
  border-bottom: 1px solid color-mix(in oklab, var(--fg) 30%, transparent);
}
.page-head .crumb { display: flex; gap: 14px; align-items: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; opacity: .7; margin-bottom: 28px; }
.page-head .crumb span.sep { opacity: .4; }
.page-head h1 {
  font-family: 'Instrument Serif', serif; font-weight: 400;
  font-size: clamp(72px, 12vw, 180px); line-height: .88; letter-spacing: -.025em;
  color: var(--accent);
}
.page-head h1 em { font-style: italic; }
.page-head .meta {
  display: flex; flex-direction: column; gap: 14px; min-width: 220px; text-align: right;
}
.page-head .meta .m { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .04em; opacity: .7; }
.page-head .meta .m b { display: block; font-weight: 500; opacity: 1; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 4px; }

/* Ticker */
.ticker {
  background: var(--clay); color: var(--maroon-deep);
  padding: 18px 0; overflow: hidden;
  border-top: 1px solid var(--maroon-deep);
  border-bottom: 1px solid var(--maroon-deep);
}
.ticker-track {
  display: flex; gap: 60px; animation: slide 40s linear infinite;
  white-space: nowrap; font-family: 'Instrument Serif', serif;
  font-size: 48px; font-style: italic; letter-spacing: -.01em;
}
.ticker-track > span { display: inline-flex; align-items: center; gap: 60px; padding-right: 60px; }
.ticker-track > span::after { content: "✦"; font-size: 32px; font-style: normal; }
@keyframes slide { to { transform: translateX(-50%); } }

/* Footer */
footer {
  padding: 80px var(--pad-x) 40px;
  border-top: 1px solid color-mix(in oklab, var(--fg) 30%, transparent);
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; align-items: start;
}
footer .mega {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(72px, 13vw, 200px); line-height: .85; letter-spacing: -.03em;
  color: var(--accent);
  grid-column: 1 / -1;
  padding-bottom: 40px; margin-bottom: 40px;
  border-bottom: 1px solid color-mix(in oklab, var(--fg) 30%, transparent);
}
footer .mega em { font-style: italic; }
footer .fcol { display: flex; flex-direction: column; gap: 10px; }
footer .fcol .flabel { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; opacity: .5; }
footer .fcol a { color: var(--fg); text-decoration: none; font-size: 14px; opacity: .9; }
footer .fcol a:hover { text-decoration: underline; }
footer .copy {
  grid-column: 1 / -1; display: flex; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .06em; opacity: .6;
  padding-top: 40px; margin-top: 40px;
  border-top: 1px solid color-mix(in oklab, var(--fg) 15%, transparent);
}

/* Tweaks panel */
.tweaks {
  position: fixed; right: 24px; bottom: 24px; z-index: 1500;
  width: 300px; background: var(--maroon-deep); color: var(--clay-light);
  border: 1px solid color-mix(in oklab, var(--clay-light) 30%, transparent);
  border-radius: 14px; padding: 18px;
  font-family: 'JetBrains Mono', monospace; display: none;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.tweaks.open { display: block; }
.tweaks h4 { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; font-size: 22px; margin-bottom: 14px; }
.tweaks .group { margin-bottom: 14px; }
.tweaks .group .lbl { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; opacity: .6; margin-bottom: 8px; }
.tweaks .opts { display: flex; gap: 6px; flex-wrap: wrap; }
.tweaks .opts button {
  all: unset; cursor: none;
  padding: 6px 10px; font-size: 11px; letter-spacing: .05em;
  border: 1px solid color-mix(in oklab, var(--clay-light) 30%, transparent); border-radius: 999px;
  transition: all .2s;
}
.tweaks .opts button.on { background: var(--clay-light); color: var(--maroon-deep); border-color: var(--clay-light); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 22px; border: 1px solid var(--fg); border-radius: 999px;
  color: var(--fg); text-decoration: none;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  transition: background .3s, color .3s, transform .3s;
}
.btn:hover { background: var(--fg); color: var(--bg); transform: translateY(-2px); }
.btn-solid { background: var(--fg); color: var(--bg); }
.btn-solid:hover { background: var(--cream); color: var(--maroon-deep); }

/* Responsive */
@media (max-width: 900px) {
  :root { --pad-x: 20px; }
  .nav { padding: 14px 20px; }
  .nav .links { display: none; }
  .nav .contact-pill { display: none; }
  .section-head, .page-head { grid-template-columns: 1fr; gap: 20px; }
  .page-head .meta { text-align: left; }
  footer { grid-template-columns: 1fr; gap: 24px; }
  footer .mega { font-size: 64px; }
  footer .copy { flex-direction: column; gap: 8px; }
  .section { padding: 70px var(--pad-x); }
}
