/* ══════════════════════════════════════════════════════════════
   BASE — design tokens, reset, and components shared by every page
   ══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg:        #09090f;
  --surface:   #111118;
  --border:    #1e1e2e;
  --accent:    #d6b840;
  --accent2:   #f0e2a0;
  --accent-rgb:  214, 184, 64;
  --accent2-rgb: 240, 226, 160;
  --text:      #e2e2f0;
  --muted:     #8a8aa8;
  --mono:      'DM Mono', monospace;
  --display:   'Syne', sans-serif;
  --body:      'DM Sans', sans-serif;
  --radius:    12px;
  --max:       860px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

/* ── AMBIENT BACKDROP ────────────────────────────────────────── */
/* grain texture */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.03;
}
/* faint schematic dot-grid, fading out toward the bottom of the viewport */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(var(--accent-rgb), .5) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, black, transparent 75%);
          mask-image: radial-gradient(circle at 50% 0%, black, transparent 75%);
  opacity: 0.16;
}

/* ── SCROLL PROGRESS ─────────────────────────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 200;
  transition: width .1s linear;
}

/* ── CUSTOM CURSOR ───────────────────────────────────────────── */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity .25s ease;
}
.cursor-dot { width: 6px; height: 6px; background: var(--accent2); mix-blend-mode: difference; }
.cursor-ring {
  width: 38px; height: 38px;
  border: 1px solid var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
  transition: width .35s cubic-bezier(.16,1,.3,1), height .35s cubic-bezier(.16,1,.3,1),
              border-color .3s, background .3s, opacity .25s;
}
body.has-cursor .cursor-dot, body.has-cursor .cursor-ring { opacity: 1; }
body.has-cursor, body.has-cursor a, body.has-cursor button,
body.has-cursor .project-card, body.has-cursor .exp-item,
body.has-cursor .hero-canvas { cursor: none; }
.cursor-ring.is-link { width: 78px; height: 78px; border-color: var(--accent2); background: rgba(var(--accent-rgb), 0.1); }
.cursor-ring.is-link .cursor-label { opacity: 1; transform: scale(1); }
.cursor-ring.is-down { transform: translate(-50%, -50%) scale(0.85); }
.cursor-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent2); opacity: 0; transform: scale(0.6);
  transition: opacity .25s, transform .25s; white-space: nowrap;
}
.magnetic { transition: transform .35s cubic-bezier(.16,1,.3,1); display: inline-flex; }

/* ── NAV ─────────────────────────────────────────────────────── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 2.5rem;
  background: rgba(9,9,15,0.75);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent2);
  letter-spacing: 0.08em;
  text-decoration: none;
}
.nav-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .6);
  animation: pulse 2.4s infinite;
  flex-shrink: 0;
}
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
  text-decoration: none; letter-spacing: 0.06em; transition: color .2s;
}
.nav-links a:hover { color: var(--text); }

/* ── SHARED LAYOUT ───────────────────────────────────────────── */
section { position: relative; z-index: 1; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 2rem; }

.section-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.section-label::before {
  content: ''; width: 6px; height: 6px; background: var(--accent); flex-shrink: 0;
}
.section-label::after {
  content: ''; flex: 1; height: 1px;
  background-color: var(--border);
  background-image: linear-gradient(90deg, transparent 0%, var(--accent2) 10%, transparent 20%);
  background-size: 260% 100%;
  background-repeat: no-repeat;
  background-position: 130% 0;
  animation: traceGlint 6s linear infinite;
}

h2 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 3rem;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  transition: all .2s;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
}
.btn-primary { background: var(--accent); color: var(--bg); font-weight: 600; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent2); }

/* ── SHARED COMPONENTS: arrow list + tags ───────────────────── */
.exp-bullets { list-style: none; }
.exp-bullets li {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.2rem 0;
  display: flex; gap: 0.6rem;
}
.exp-bullets li::before { content: '→'; color: var(--accent); flex-shrink: 0; }

.project-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent2);
  background: rgba(var(--accent-rgb), .1);
  border: 1px solid rgba(var(--accent-rgb), .2);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

/* ── SCROLL-REVEAL (generic) ────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: perspective(1200px) translateY(24px) rotateX(-8deg);
  transition: opacity .6s, transform .6s cubic-bezier(.16,1,.3,1);
}
.reveal.visible { opacity: 1; transform: perspective(1200px) translateY(0) rotateX(0deg); }

/* ── FOOTER ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  position: relative; z-index: 1;
}

/* ── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .5); }
  70%  { box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}
@keyframes traceGlint {
  to { background-position: -130% 0; }
}

/* ── RESPONSIVE (shared) ─────────────────────────────────────── */
@media (max-width: 680px) {
  .site-nav { padding: 1rem 1.2rem; }
  .nav-links { gap: 1.2rem; }
}
@media (max-width: 400px) {
  .site-nav { padding: 0.85rem 0.9rem; }
  .nav-logo { font-size: 0.66rem; gap: 0.4rem; }
  .nav-links { gap: 0.8rem; }
  .nav-links a { font-size: 0.62rem; }
}

/* ── ACCESSIBILITY ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cursor-dot, .cursor-ring { display: none; }
  body.has-cursor, body.has-cursor a, body.has-cursor button,
  body.has-cursor .project-card, body.has-cursor .exp-item { cursor: auto; }
  .magnetic, .glow, .card-glow { transition: none !important; }
  .scroll-progress { transition: none; }
  .reveal, .exp-item, .project-card, .pagination-link {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .section-label::after { animation: none; }
  .hero-canvas { transition: none; }
}
