/* ═══════════════════════════════════════════════
   MAIN.CSS — Design System & Global Styles
   Portfolio — Matheus Padilha
═══════════════════════════════════════════════ */

/* ---- Google Fonts fallback import ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ════════════════════════════════════════
   CSS CUSTOM PROPERTIES (Theme Variables)
   These are animated by GSAP in animations.js
════════════════════════════════════════ */
:root {
  /* ---- Colors (light theme defaults) ---- */
  --bg:           #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-surface:   #f8f8f8;
  --text-primary:   #0a0a0a;
  --text-secondary: #444444;
  --text-muted:     #888888;
  --border:         #e0e0e0;
  --accent:         #0a0a0a;

  /* ---- Typography ---- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ---- Spacing ---- */
  --container-max:     1200px;
  --container-padding: clamp(1.25rem, 5vw, 4rem);

  /* ---- Border Radius ---- */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --radius-xl:   32px;
  --radius-full: 9999px;

  /* ---- Transitions ---- */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast:  0.15s ease;
  --transition-base:  0.3s ease;
  --transition-slow:  0.6s ease;
  --transition-expo:  0.8s var(--ease-out-expo);

  /* ---- Shadows ---- */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:  0 8px 30px rgba(0,0,0,0.10);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.12);
  --shadow-xl:  0 40px 80px rgba(0,0,0,0.15);
}

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

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

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

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

ul { list-style: none; }

img, svg { display: block; max-width: 100%; }

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: none;
}

input, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ════════════════════════════════════════
   CUSTOM CURSOR
════════════════════════════════════════ */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
}

.cursor-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: left, top;
}

.cursor-outline {
  position: absolute;
  width: 38px;
  height: 38px;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  transition:
    width  0.35s var(--ease-out-expo),
    height 0.35s var(--ease-out-expo),
    opacity 0.3s ease,
    border-radius 0.3s ease;
  will-change: left, top, width, height;
}

.cursor.is-hovering .cursor-outline {
  width: 56px;
  height: 56px;
  opacity: 0.3;
}

.cursor.is-hovering.cursor-text .cursor-outline {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
}

.cursor.is-clicking .cursor-dot {
  transform: translate(-50%, -50%) scale(0.4);
}

.cursor.is-clicking .cursor-outline {
  width: 28px;
  height: 28px;
}

/* ════════════════════════════════════════
   NOISE TEXTURE OVERLAY
════════════════════════════════════════ */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ════════════════════════════════════════
   NAVIGATION
════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  padding: 1.25rem var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  transition:
    backdrop-filter 0.5s ease,
    border-color 0.5s ease,
    background-color 0.5s ease,
    padding 0.3s ease;
}

.navbar.scrolled {
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

.nav-logo {
  flex-shrink: 0;
  z-index: 1;
}

.nav-logo-text {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--text-primary);
  transition: opacity var(--transition-fast);
}

.nav-logo:hover .nav-logo-text {
  opacity: 0.7;
}

.nav-links {
  display: flex;
  gap: 2rem;
  margin: 0 auto;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 0.25rem 0;
  transition: color var(--transition-fast);
  letter-spacing: 0.01em;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-primary);
  transition: width var(--transition-base);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  cursor: none;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-primary);
  transition: transform var(--transition-base), opacity var(--transition-base);
  transform-origin: center;
}

.nav-hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 850;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.mobile-link {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-expo);
}

.mobile-menu.is-open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.is-open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.is-open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.is-open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.is-open .mobile-link:nth-child(4) { transition-delay: 0.25s; }

.mobile-link:hover { opacity: 0.6 !important; }

/* ════════════════════════════════════════
   LAYOUT
════════════════════════════════════════ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: clamp(5rem, 10vw, 9rem) 0;
  position: relative;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.section-label span:first-child {
  color: var(--text-primary);
  font-weight: 800;
  font-size: 0.8rem;
}

.section-title {
  font-size: clamp(2rem, 4.5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.section-title em {
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.02em;
}

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8125rem 1.75rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    transform 0.2s ease,
    box-shadow 0.2s ease;
  cursor: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::before { opacity: 1; }

.btn-primary {
  background: var(--text-primary);
  color: var(--bg);
  border: 2px solid var(--text-primary);
}

.btn-primary:hover {
  background: transparent;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid transparent;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.5rem 1.125rem;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

/* ════════════════════════════════════════
   TAGS
════════════════════════════════════════ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ════════════════════════════════════════
   SCROLLBAR
════════════════════════════════════════ */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ════════════════════════════════════════
   SELECTION
════════════════════════════════════════ */
::selection {
  background: var(--text-primary);
  color: var(--bg);
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 768px) {
  .nav-links  { display: none; }
  .nav-cta    { display: none; }
  .nav-hamburger { display: flex; }
  body        { cursor: auto; }
  .cursor     { display: none; }
}
