/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── DESIGN TOKENS ─── */
:root {
  --brown: #4a3b33;
  --brown-light: #5e4d43;
  --brown-mid: #534439;
  --brown-dark: #3a2d27;
  --cream: #f5f0eb;
  --cream-mid: #e8e0d8;
  --cream-dark: #d8cec4;
  --accent: #c4956a;
  --accent-light: #d4ac85;
  --accent-dim: rgba(196, 149, 106, 0.15);
  --text-primary: #4a3b33;
  --text-secondary: #7a6b61;
  --text-on-dark: #f5f0eb;
  --text-muted-on-dark: #b8a99e;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --nav-h: 60px;
}

/* ─── BASE ─── */
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 3rem; height: var(--nav-h);
  background: var(--brown); border-bottom: 1px solid var(--brown-light);
  transition: background 0.4s, border-color 0.4s;
}
nav.nav-light { background: var(--cream); border-bottom-color: var(--cream-mid); }
nav .logo {
  font-family: var(--font-display); font-size: 1.2rem;
  color: var(--text-on-dark); text-decoration: none; letter-spacing: 0.02em;
  transition: color 0.4s;
}
nav.nav-light .logo { color: var(--text-primary); }
nav .nav-links { display: flex; gap: 2.5rem; list-style: none; }
nav .nav-links a {
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 400;
  color: var(--text-muted-on-dark); text-decoration: none;
  letter-spacing: 0.04em; transition: color 0.3s;
}
nav.nav-light .nav-links a { color: var(--text-secondary); }
nav .nav-links a:hover { color: var(--text-on-dark); }
nav.nav-light .nav-links a:hover { color: var(--text-primary); }

/* ─── SECTION LABEL ─── */
.section-label {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 400;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent);
  display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem;
}
.section-label::before { content: ''; display: block; width: 30px; height: 1px; background: var(--accent); }

/* ─── SCROLL REVEAL ─── */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.16,1,0.3,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── LINK ARROW ─── */
.link-arrow {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 400;
  letter-spacing: 0.06em; color: var(--brown); text-decoration: none;
  transition: gap 0.3s, color 0.3s; position: relative;
}
.link-arrow::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0.4); transform-origin: left; transition: transform 0.4s;
}
.link-arrow:hover::after { transform: scaleX(1); }
.link-arrow:hover { gap: 1.1rem; color: var(--accent); }
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.3s; }
.link-arrow:hover svg { transform: translateX(4px); }

/* ─── TAGS ─── */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.75rem; }
.tag {
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 400;
  letter-spacing: 0.06em; padding: 0.35rem 0.75rem; border-radius: 2px; text-transform: uppercase;
}
.tag-dark { background: var(--brown-light); color: var(--text-muted-on-dark); }
.tag-light { background: var(--cream-mid); color: var(--text-secondary); }

/* ─── FOOTER ─── */
.footer-strip {
  background: var(--brown-dark); padding: 1.25rem 3rem;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--brown-mid);
}
.footer-strip span {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 300;
  color: var(--text-muted-on-dark); letter-spacing: 0.06em;
}

/* ─── CUSTOM CURSOR ─── */
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  * { cursor: none !important; }
}

@media (pointer: fine) {
  .cursor-dot {
    position: fixed; top: 0; left: 0;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); pointer-events: none; z-index: 9999;
    transform: translate(-50%, -50%); transition: opacity 0.25s;
  }
  .cursor-ring {
    position: fixed; top: 0; left: 0;
    width: 40px; height: 40px; border-radius: 50%;
    border: 1.5px solid var(--accent); pointer-events: none; z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.4s cubic-bezier(0.16,1,0.3,1),
                height 0.4s cubic-bezier(0.16,1,0.3,1),
                border-color 0.35s, background 0.4s cubic-bezier(0.16,1,0.3,1), opacity 0.3s;
    opacity: 0.5; background: transparent;
  }
  .cursor-ring.on-dark { border-color: var(--accent-light); opacity: 0.6; }
  .cursor-dot.on-dark { background: var(--accent-light); }
  .cursor-ring.is-hover { width: 70px; height: 70px; background: rgba(196,149,106,0.08); border-color: var(--accent-light); opacity: 0.85; }
  .cursor-dot.is-hover { opacity: 0; }
  .cursor-dot.hidden, .cursor-ring.hidden { opacity: 0 !important; }
}

@media (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* ─── SKIP LINK ─── */
.skip-link {
  position: absolute; top: -100%; left: 1rem; z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: var(--accent); color: var(--brown-dark);
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500;
  text-decoration: none; border-radius: 0 0 4px 4px;
}
.skip-link:focus { top: 0; }

/* ─── FOCUS VISIBLE ─── */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ─── SHARED RESPONSIVE ─── */
@media (max-width: 1000px) {
  nav { padding: 0 1.5rem; }
}
@media (max-width: 600px) {
  nav .nav-links { gap: 1.2rem; }
  nav .nav-links a { font-size: 0.78rem; }
}
