/* =====================================================
   CSS CUSTOM PROPERTIES
   ===================================================== */
:root {
  --color-bg:       #161618;
  --color-bg-deep:  #0C0C0D;
  --color-text:     #EBEBEB;
  --color-accent:   #2A2A2B;
  --color-muted:    rgba(235, 235, 235, 0.68);
  --color-subtle:   rgba(235, 235, 235, 0.25);
  --color-faint:    rgba(235, 235, 235, 0.1);
  --color-border:   #383838;
  --color-card-bg:  #202022;
  --color-hover:    rgba(235, 235, 235, 0.06);

  --font-display:   'Cormorant Garamond', Georgia, serif;
  --font-body:      'Inter', system-ui, sans-serif;

  --space-xs:       0.5rem;
  --space-sm:       1rem;
  --space-md:       2rem;
  --space-lg:       4rem;
  --space-xl:       8rem;

  --radius-sm:      4px;
  --radius-md:      8px;
  --radius-lg:      16px;

  --transition:      0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: 0.2s ease;

  --max-width:     1280px;
  --header-height: 72px;
}

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

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

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
}

::-webkit-scrollbar       { width: 3px; }
::-webkit-scrollbar-track  { background: var(--color-bg-deep); }
::-webkit-scrollbar-thumb  { background: var(--color-accent); }

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

/* =====================================================
   GRAIN TEXTURE OVERLAY
   ===================================================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  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");
  background-repeat: repeat;
  background-size: 128px;
}

/* =====================================================
   CUSTOM CURSOR
   Both elements are position:fixed at 0,0.
   JS positions them via transform — no left/top needed.
   ===================================================== */
#cursorRing {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(235, 235, 235, 0.25);
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}

#cursorRing.is-hovering {
  width: 48px;
  height: 48px;
  border-color: rgba(235, 235, 235, 0.6);
}

#cursorDot {
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--color-text);
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  transition: opacity 0.2s ease;
}

/* On desktop (pointer: fine) suppress the browser hand cursor everywhere
   so the custom cursor ring is never interrupted by a native pointer.
   Gated behind .has-custom-cursor — main.js only adds that class once the
   custom cursor actually initializes. If JS is disabled, fails to load, or
   errors, the class is never set and the native cursor stays visible. */
@media (pointer: fine) {
  .has-custom-cursor,
  .has-custom-cursor *,
  .has-custom-cursor *::before,
  .has-custom-cursor *::after {
    cursor: none !important;
  }
}

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

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  color: var(--color-muted);
  max-width: 65ch;
}

a {
  color: var(--color-text);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

a:hover { opacity: 0.65; }

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

ul, ol { list-style: none; }

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

/* =====================================================
   LAYOUT UTILITIES
   ===================================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.section     { padding-block: var(--space-xl); }
.section--sm { padding-block: var(--space-lg); }

.grid     { display: grid; gap: var(--space-md); }
.grid--2  { grid-template-columns: repeat(2, 1fr); }
.grid--3  { grid-template-columns: repeat(3, 1fr); }
.grid--4  { grid-template-columns: repeat(4, 1fr); }

.flex          { display: flex; align-items: center; }
.flex--between { justify-content: space-between; }
.flex--center  { justify-content: center; }

.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Skip link — visually hidden until focused (keyboard / screen reader) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
  padding: 0.75em 1.25em;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  border-radius: 2px;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
  opacity: 1;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9em 2em;
  border-radius: 2px;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn--primary {
  background-color: var(--color-text);
  color: var(--color-bg);
}
.btn--primary:hover {
  background-color: rgba(235, 235, 235, 0.85);
  color: var(--color-bg);
  opacity: 1;
}

.btn--outline {
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn--outline:hover {
  background-color: var(--color-hover);
  border-color: rgba(235, 235, 235, 0.2);
  opacity: 1;
}

.btn--ghost { color: var(--color-muted); }
.btn--ghost:hover { color: var(--color-text); opacity: 1; }

.btn svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}
.btn:hover svg { transform: translateX(4px); }

/* =====================================================
   SECTION HEADER
   ===================================================== */
.section-header { margin-bottom: var(--space-lg); }
.section-header--centered { text-align: center; }
.section-header--centered p { margin-inline: auto; }

.section-eyebrow {
  display: inline-block;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
}

.section-divider {
  display: inline-block;
  width: 32px;
  height: 1px;
  background-color: var(--color-muted);
  vertical-align: middle;
  margin-right: var(--space-xs);
}

/* =====================================================
   SCROLL REVEAL
   ===================================================== */
/* Hidden start state only when JS is available (html.js, set in header.php).
   Without JS the class is absent, so .reveal stays fully visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.js .reveal.is-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; }
