/* ============================================
   BASE — Reset, Custom Properties, Typography
   ============================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: var(--color-bg);
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  /* Ensure background extends to cover safe areas */
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
}

/* Fixed black overlay to cover status bar area - prevents any content from showing behind it */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Cover the status bar area - use safe area or minimum 44px for status bar height */
  height: max(env(safe-area-inset-top, 0px), 44px);
  background-color: var(--color-bg);
  z-index: 9999;
  pointer-events: none;
  /* Ensure it stays fixed even when scrolling */
  will-change: transform;
}

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

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

ul, ol {
  list-style: none;
}

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

input, textarea {
  font: inherit;
  border: none;
  outline: none;
}

/* --- Custom Properties --- */
:root {
  /* Colors — Cinematic dark palette with warm gold accent */
  --color-bg:          #0a0a0a;
  --color-bg-alt:      #111111;
  --color-bg-card:     #161616;
  --color-bg-elevated: #1a1a1a;
  --color-surface:     rgba(255, 255, 255, 0.03);
  --color-border:      rgba(255, 255, 255, 0.08);

  --color-text:        #e8e6e3;
  --color-text-muted:  #8a8a8a;
  --color-text-dim:    #5a5a5a;

  --color-accent:      #c9a84c;
  --color-accent-soft: rgba(201, 168, 76, 0.15);
  --color-accent-glow: rgba(201, 168, 76, 0.4);

  --color-white:       #ffffff;
  --color-black:       #000000;

  /* Typography */
  --font-heading: 'Playfair Display', 'Georgia', serif;
  --font-body:    'Inter', 'Helvetica Neue', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Spacing scale */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Layout */
  --max-width:     1200px;
  --max-width-sm:  800px;
  --nav-height:    80px;
  --border-radius: 8px;

  /* Transitions */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast:   200ms;
  --duration-normal: 400ms;
  --duration-slow:   800ms;

  /* Shadows */
  --shadow-sm:  0 2px  8px  rgba(0, 0, 0, 0.3);
  --shadow-md:  0 4px  16px rgba(0, 0, 0, 0.4);
  --shadow-lg:  0 8px  32px rgba(0, 0, 0, 0.5);
  --shadow-xl:  0 16px 64px rgba(0, 0, 0, 0.6);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-white);
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: clamp(1.1rem, 2vw, 1.35rem); }

p {
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  color: var(--color-text);
}

.text-accent {
  color: var(--color-accent);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  font-weight: 500;
}

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

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

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

::-webkit-scrollbar-thumb {
  background: var(--color-text-dim);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* --- Film grain overlay (cinematic texture) --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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");
}
