/* ==========================================================================
 * Emre Can Simsek — Senior Product Manager
 * Core Design Tokens, Variables & Base Layout
   ========================================================================== */

:root {
  /* Warm Beige Canvas */
  --bg-main: #f8f6f0;
  --bg-warm-tint: #f3efe6;

  /* True Liquid Frosted Glass System */
  --glass-bg: rgba(255, 255, 255, 0.48);
  --glass-bg-hover: rgba(255, 255, 255, 0.72);
  --glass-bg-active: rgba(255, 255, 255, 0.85);
  --glass-bg-subtle: rgba(255, 255, 255, 0.32);

  /* Glass Specular Highlights & Rim Lighting */
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-border-subtle: rgba(255, 255, 255, 0.45);
  --glass-border-hover: rgba(255, 255, 255, 0.95);
  
  /* Glass Refraction Shadows */
  --glass-shadow-sm: 0 8px 24px 0 rgba(15, 23, 42, 0.05), inset 0 1px 1px 0 rgba(255, 255, 255, 0.9);
  --glass-shadow-md: 0 16px 36px 0 rgba(15, 23, 42, 0.08), inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.95);
  --glass-shadow-lg: 0 24px 50px 0 rgba(15, 23, 42, 0.1), inset 0 2px 2px 0 rgba(255, 255, 255, 1);

  /* Typography: Deep Black-Navy Blue */
  --text-primary: #0a1128;
  --text-heading: #070d1e;
  --text-secondary: #334155;
  --text-muted: #64748b;

  /* Accent: Subtle Forest Green */
  --accent-green: #0d8a5e;
  --accent-green-glass: rgba(13, 138, 94, 0.12);

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Motion */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: 0.18s var(--ease-out);
  --transition-base: 0.35s var(--ease-expo);

  /* Layout */
  --max-w: 1400px;
  --side-padding: 2.5rem;
}

@media (min-width: 1920px) {
  :root {
    --max-w: 1750px;
    --side-padding: 4rem;
  }
}

@media (min-width: 2560px) {
  :root {
    --max-w: 2250px;
    --side-padding: 6rem;
  }
}

@media (max-width: 768px) {
  :root {
    --side-padding: 1.25rem;
  }
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* body already sets overflow-x: hidden, but the actual scrolling root is
     the html element — leaving it at its default `visible` let off-canvas
     fixed/absolute elements (the case-study drawer, ambient background
     orbs) inflate document.documentElement.scrollWidth and cause page-level
     horizontal scroll on mobile even though body itself was clipped.
     Using `clip` rather than `hidden` here: unlike `hidden`, `clip` does not
     turn this element into a scroll container, which avoids a class of iOS
     Safari bug where overflow-driven scroll containers on <html>/<body> can
     disturb how `position: fixed` descendants (this page's nav, drawer, and
     modals) compute their containing block. */
  overflow-x: clip;
}

/* Offset all scroll target sections and anchored IDs below fixed floating navbar */
section,
article,
.case-story-section,
.case-story-compact,
.section-editorial-tag,
[id] {
  scroll-margin-top: 6rem;
}

@media (max-width: 768px) {
  section,
  article,
  .case-story-section,
  .case-story-compact,
  .section-editorial-tag,
  [id] {
    scroll-margin-top: 5rem;
  }
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.55;
  overflow-x: clip; /* see html rule above for why clip, not hidden */
  position: relative;
  min-height: 100vh;
}

/* Ambient Glass Refraction Background Gradients */
.ambient-glass-orb-1 {
  position: fixed;
  top: -120px;
  left: 15%;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 138, 94, 0.08) 0%, rgba(248, 246, 240, 0) 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.ambient-glass-orb-2 {
  position: fixed;
  top: 35%;
  right: -100px;
  width: 650px;
  height: 650px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 190, 175, 0.3) 0%, rgba(248, 246, 240, 0) 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

.ambient-glass-orb-3 {
  position: fixed;
  bottom: -150px;
  left: 20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.05) 0%, rgba(248, 246, 240, 0) 70%);
  filter: blur(45px);
  pointer-events: none;
  z-index: 0;
}

/* Custom Friendly Cursor */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-heading);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.08s ease, width 0.25s var(--ease-expo), height 0.25s var(--ease-expo);
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(15, 23, 42, 0.25);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s var(--ease-out), width 0.25s var(--ease-expo), height 0.25s var(--ease-expo);
}

.cursor-hover .cursor-dot {
  width: 10px;
  height: 10px;
  background-color: var(--accent-green);
}

.cursor-hover .cursor-ring {
  width: 44px;
  height: 44px;
  border-color: var(--accent-green);
}

/* Container */
.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;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--side-padding);
  position: relative;
  z-index: 1;
}

.section-compact {
  padding: 4.5rem 0;
  position: relative;
}

/* Typography Utilities */
.font-display {
  font-family: var(--font-heading);
}

.font-mono {
  font-family: var(--font-mono);
}

.mono-tag-glass {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 0.4rem 0.95rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-sm);
}

.mono-tag-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-green);
  border-radius: 50%;
}

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

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

/* Contextual Cursor Label Badge */
.cursor-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.cursor-hover-labeled .cursor-ring {
  width: 52px;
  height: 52px;
  background: var(--text-heading);
  border-color: var(--text-heading);
}

.cursor-hover-labeled .cursor-dot {
  opacity: 0;
}

.cursor-hover-labeled .cursor-label {
  opacity: 1;
}

/* Scroll Reveal Animation Classes */
[data-scroll-reveal] {
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  will-change: opacity, transform;
}

[data-scroll-reveal].revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-scroll-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}
