/* ============================================
   GLOBAL STYLES — Thiébaud Reimann Portfolio
   ============================================ */

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

:root {
  --bg: #080808;
  --bg-2: #0e0e0e;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.18);

  --text: #f0ede8;
  --text-muted: rgba(240,237,232,0.4);
  --text-subtle: rgba(240,237,232,0.22);

  --accent: #c8ff00;
  --accent-2: #00ffd5;
  --accent-glow: rgba(200,255,0,0.15);
  --accent-glow-2: rgba(0,255,213,0.12);

  --font-display: 'Syne', sans-serif;
  --font-mono: 'DM Mono', monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Custom Cursor ---- */
#cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out-expo),
              height 0.3s var(--ease-out-expo),
              background 0.3s ease,
              opacity 0.3s ease;
  mix-blend-mode: difference;
}

#cursor-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(200,255,0,0.055) 0%, transparent 70%);
  transition: left 0.6s var(--ease-out-expo), top 0.6s var(--ease-out-expo);
}

body:has(a:hover) #cursor,
body:has(button:hover) #cursor {
  width: 40px;
  height: 40px;
  background: rgba(200,255,0,0.2);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }

/* ---- Selection ---- */
::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

p {
  line-height: 1.7;
  font-weight: 400;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- Section base ---- */
section {
  position: relative;
  z-index: 2;
}

/* ---- Utilities ---- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

@media (max-width: 768px) {
  .container { padding: 0 1.5rem; }
}

/* ---- Animated gradient background ---- */
.bg-gradient-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-gradient-mesh::before {
  content: '';
  position: absolute;
  width: 80vw;
  height: 80vw;
  top: -30vw;
  right: -20vw;
  background: radial-gradient(circle, rgba(200,255,0,0.04) 0%, transparent 60%);
  animation: meshFloat1 18s ease-in-out infinite alternate;
}

.bg-gradient-mesh::after {
  content: '';
  position: absolute;
  width: 60vw;
  height: 60vw;
  bottom: -20vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(0,255,213,0.04) 0%, transparent 60%);
  animation: meshFloat2 22s ease-in-out infinite alternate;
}

@keyframes meshFloat1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-5vw, 8vw) scale(1.1); }
}
@keyframes meshFloat2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(6vw, -5vw) scale(1.15); }
}

/* ---- Noise texture overlay ---- */
.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

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

/* ---- Glass card ---- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---- Tag pill ---- */
.tag {
  display: inline-block;
  padding: 0.3em 0.8em;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}
