/* ==========================================================================
   LENTE BINARIA v4 — Cinematographic Premium Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   FONTS — Variable fonts for performance
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=Outfit:wght@300;400;500;600;700&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@300;400;500&display=swap');

/* --------------------------------------------------------------------------
   CSS CUSTOM PROPERTIES — Cinematographic Premium
   -------------------------------------------------------------------------- */
:root {
  /* Backgrounds — Deep cinematic black */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a26;
  --bg-elevated: #1e1e2a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);

  /* Accent — Warm amber / Gold (the "lens") */
  --accent: #d4a03c;
  --accent-light: #e8c06a;
  --accent-dark: #b8862e;
  --accent-muted: rgba(212, 160, 60, 0.08);
  --accent-glow: rgba(212, 160, 60, 0.15);
  --accent-glow-strong: rgba(212, 160, 60, 0.3);

  /* Gradients */
  --gradient-accent: linear-gradient(135deg, #d4a03c 0%, #e8c06a 50%, #f0d488 100%);
  --gradient-accent-subtle: linear-gradient(135deg, rgba(212,160,60,0.06) 0%, rgba(232,192,106,0.02) 100%);
  --gradient-dark: linear-gradient(180deg, #0a0a0f 0%, #12121a 100%);
  --gradient-hero: radial-gradient(ellipse at 70% 20%, rgba(212,160,60,0.08) 0%, transparent 55%);
  --gradient-section: radial-gradient(ellipse at 50% 0%, rgba(212,160,60,0.04) 0%, transparent 70%);
  --gradient-spotlight: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(212,160,60,0.08) 0%, transparent 50%);

  /* Text */
  --text-primary: #f5f0e8;
  --text-secondary: #a09888;
  --text-tertiary: #6a6258;
  --text-muted: #4a4440;
  --text-on-accent: #0a0a0f;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-strong: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --glass-blur: 20px;
  --glass-blur-heavy: 40px;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.04);
  --border-accent: rgba(212, 160, 60, 0.2);
  --border-accent-hover: rgba(212, 160, 60, 0.4);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px var(--accent-glow);
  --shadow-glow-lg: 0 0 48px var(--accent-glow-strong);

  /* Typography */
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Font Sizes — Fluid */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 2rem;        /* 32px */
  --text-4xl: 2.5rem;      /* 40px */
  --text-5xl: 3.5rem;      /* 56px */
  --text-6xl: 4.5rem;      /* 72px */
  --text-7xl: 6rem;        /* 96px */
  --text-hero: clamp(3rem, 8vw, 7rem);
  --text-section: clamp(2rem, 5vw, 4rem);

  /* Spacing — 8px scale */
  --space-2xs: 0.25rem;    /* 4px */
  --space-xs: 0.5rem;      /* 8px */
  --space-sm: 1rem;        /* 16px */
  --space-md: 1.5rem;      /* 24px */
  --space-lg: 2rem;        /* 32px */
  --space-xl: 3rem;        /* 48px */
  --space-2xl: 4rem;       /* 64px */
  --space-3xl: 6rem;       /* 96px */
  --space-4xl: 8rem;       /* 128px */
  --space-5xl: 12rem;      /* 192px */

  /* Layout */
  --container-max: 1400px;
  --container-narrow: 900px;
  --container-wide: 1600px;
  --header-height: 72px;
  --grid-gap: var(--space-lg);

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

  /* Motion — Cinematic easing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
  --duration-instant: 0.1s;
  --duration-fast: 0.2s;
  --duration-normal: 0.4s;
  --duration-slow: 0.6s;
  --duration-slower: 0.8s;
  --duration-reveal: 1.2s;

  /* Z-index layers */
  --z-behind: -1;
  --z-base: 1;
  --z-card: 10;
  --z-header: 100;
  --z-menu: 200;
  --z-modal: 400;
  --z-loader: 500;
  --z-transition: 600;
}

/* --------------------------------------------------------------------------
   LIGHT MODE
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  --bg-primary: #FAFAF8;
  --bg-secondary: #F0EFEB;
  --bg-tertiary: #E8E6E0;
  --bg-elevated: #FFFFFF;
  --bg-card: rgba(0, 0, 0, 0.02);
  --bg-card-hover: rgba(0, 0, 0, 0.04);

  --accent: #b8862e;
  --accent-light: #d4a03c;
  --accent-dark: #9a7024;
  --accent-muted: rgba(184, 134, 46, 0.08);
  --accent-glow: rgba(184, 134, 46, 0.15);
  --accent-glow-strong: rgba(184, 134, 46, 0.25);

  --gradient-accent: linear-gradient(135deg, #b8862e 0%, #d4a03c 50%, #e8c06a 100%);
  --gradient-hero: radial-gradient(ellipse at 70% 20%, rgba(184,134,46,0.06) 0%, transparent 55%);

  --text-primary: #1a1714;
  --text-secondary: #5a5348;
  --text-tertiary: #8a8278;
  --text-muted: #b0a898;
  --text-on-accent: #FAFAF8;

  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-bg-strong: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-border-hover: rgba(0, 0, 0, 0.12);

  --border: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.04);
  --border-accent: rgba(184, 134, 46, 0.3);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.12);
}

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

html {
  font-size: 16px;
  scroll-behavior: auto; /* Managed by Lenis */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  cursor: auto;
}

body.no-scroll {
  overflow: hidden;
}

::selection {
  background-color: var(--accent);
  color: var(--text-on-accent);
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out-quart);
}

ul, ol {
  list-style: none;
}

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

@media (hover: none) and (pointer: coarse) {
  button { cursor: pointer; }
}

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

/* --------------------------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-hero);
  letter-spacing: -0.03em;
  font-weight: 800;
}

h2 {
  font-size: var(--text-section);
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
}

h4 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h5 {
  font-size: var(--text-lg);
  font-weight: 600;
}

h6 {
  font-size: var(--text-base);
  font-weight: 600;
}

p {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

p:last-child {
  margin-bottom: 0;
}

strong, b {
  font-weight: 600;
}

small {
  font-size: var(--text-sm);
}

/* Serif accent text */
.text-serif {
  font-family: var(--font-serif);
  font-style: italic;
}

/* Mono tag text */
.text-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   LAYOUT
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

.section {
  position: relative;
  padding: var(--space-4xl) 0;
  overflow: hidden;
}

.section--alt {
  background-color: var(--bg-secondary);
}

.section--dark {
  background-color: var(--bg-primary);
}

/* Grain overlay for sections */
.section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.section > * {
  position: relative;
  z-index: var(--z-base);
}

/* Section header pattern */
.section-header {
  max-width: 750px;
  margin-bottom: var(--space-3xl);
}

.section-header--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-header__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-md);
  padding: var(--space-2xs) var(--space-sm);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  background: var(--accent-muted);
}

.section-header__title {
  margin-bottom: var(--space-md);
}

.section-header__subtitle {
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 600px;
}

.section-header--center .section-header__subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   GRID SYSTEM
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Bento grid */
.grid--bento {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(200px, auto);
}

.grid--bento .grid__item--span-2 { grid-column: span 2; }
.grid--bento .grid__item--span-3 { grid-column: span 3; }
.grid--bento .grid__item--span-2-rows { grid-row: span 2; }

@media (max-width: 1024px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--bento { grid-template-columns: repeat(2, 1fr); }
  .grid--bento .grid__item--span-3 { grid-column: span 2; }
}

@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .grid--bento { grid-template-columns: 1fr; }
  .grid--bento .grid__item--span-2,
  .grid--bento .grid__item--span-3 { grid-column: span 1; }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* --------------------------------------------------------------------------
   UTILITY CLASSES
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-tertiary); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hidden on mobile/desktop */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-glow);
}
