/* =========================================================
   RR Portfolio — Design System
   Type: Instrument Serif (display) + Inter (body) + JetBrains Mono (meta)
   Palette: Warm cream, deep ink, burgundy / forest / ochre accents
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Surfaces */
  --cream: #F5EFE4;
  --cream-2: #EDE5D4;
  --paper: #FBF7EE;
  --ink: #161512;
  --ink-2: #2A2822;
  --ink-soft: #5A554B;
  --rule: #1615121A;

  /* Accents — same family, different hues */
  --law: #7A2E2E;      /* burgundy — Love for law */
  --research: #2F4A3A; /* forest — Rigor with research */
  --craft: #B87333;    /* ochre/copper — Curiosity with craft */

  /* Pastels (reserved for Hobbies) */
  --pastel-pink: #F7D4D4;
  --pastel-mint: #CFE8D6;
  --pastel-sky:  #CFE0F2;
  --pastel-lemon:#F5E9B8;

  /* Type */
  --display: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Scale (fluid) */
  --fs-mono: 12px;
  --fs-body: 17px;
  --fs-lede: clamp(20px, 2vw, 26px);
  --fs-h4: clamp(28px, 3vw, 40px);
  --fs-h3: clamp(36px, 4vw, 56px);
  --fs-h2: clamp(56px, 7vw, 96px);
  --fs-h1: clamp(84px, 13vw, 220px);

  /* Motion */
  --ease: cubic-bezier(.2,.7,.2,1);
  --ease-smooth: cubic-bezier(.65,.05,.36,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--cream); color: var(--ink); }

body {
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
  cursor: none; /* custom cursor replaces default */
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: none; }

::selection { background: var(--ink); color: var(--cream); }

.mono { font-family: var(--mono); font-size: var(--fs-mono); letter-spacing: .04em; text-transform: uppercase; }
.serif { font-family: var(--display); font-weight: 400; letter-spacing: -0.01em; }

/* Hairline rule */
.rule { height: 1px; background: var(--rule); width: 100%; }

/* Grid helpers */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Kinetic word reveal */
.kinetic-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.kinetic-word > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-smooth);
}
.kinetic-word.in > span { transform: translateY(0); }

/* Custom cursor (lens) */
#cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  background: var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%,-50%);
  transition: opacity .2s;
  mix-blend-mode: difference;
  filter: invert(1);
}
#cursor-lens {
  position: fixed;
  top: 0; left: 0;
  width: 140px; height: 140px;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%,-50%) scale(0);
  transition: transform .4s var(--ease);
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--cream);
  box-shadow: 0 10px 40px rgba(22,21,18,.25);
}
#cursor-lens.active { transform: translate(-50%,-50%) scale(1); }
#cursor-lens .lens-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  color: var(--ink);
  white-space: nowrap;
  font-size: 96px;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* When lens is active, hide small dot */
#cursor-dot.hidden { opacity: 0; }

/* Focusable chrome */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.pill:hover { background: var(--ink); color: var(--cream); transform: translateY(-2px); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Nav */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  mix-blend-mode: difference;
  color: var(--cream);
}
.topnav a { position: relative; }
.topnav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.topnav a:hover::after { transform: scaleX(1); }
.topnav .links { display: flex; gap: 28px; }

/* Page transition */
.page-wipe {
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 200;
  pointer-events: none;
  transform: translateY(100%);
  transition: transform .7s var(--ease-smooth);
}
.page-wipe.cover { transform: translateY(0); }
.page-wipe.reveal-out { transform: translateY(-100%); }

/* Placeholder imagery */
.placeholder {
  position: relative;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(22,21,18,.06) 0 2px,
      transparent 2px 14px
    ),
    var(--cream-2);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: .08em;
  text-transform: uppercase;
  overflow: hidden;
}
.placeholder::after {
  content: '';
  position: absolute; inset: 0;
  border: 1px dashed rgba(22,21,18,.15);
  margin: 6px;
  pointer-events: none;
}

/* Marquee */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee {
  display: flex;
  gap: 40px;
  white-space: nowrap;
  animation: marquee 40s linear infinite;
}
.marquee:hover { animation-play-state: paused; }

/* Tweaks panel */
#tweaks-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  max-width: 280px;
  box-shadow: 0 20px 50px rgba(22,21,18,.18);
  display: none;
}
#tweaks-panel.on { display: block; }
#tweaks-panel h4 { margin: 0 0 12px; font-family: var(--display); text-transform: none; font-size: 20px; font-weight: 400; letter-spacing: -.01em; }
#tweaks-panel .tweak-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); }
#tweaks-panel .opt-group { display: flex; gap: 4px; }
#tweaks-panel .opt {
  padding: 5px 9px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#tweaks-panel .opt.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
