/* ==========================================================================
   HERRE STUDIO — BASE.CSS  v2
   01. Design Tokens   02. Selection   03. Reset
   04. Root Elements   05. Typography  06. Utilities
   ========================================================================== */


/* --------------------------------------------------------------------------
   01. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {

  /* ── Sidebar / Nav constant ─────────────────────────────────────────── */
  --sidebar-w:  70px;

  /* ── Typography scale (fluid) ──────────────────────────────────────── */
  --fs-hero:    clamp(3.5rem, 8vw, 6rem);
  --fs-h1:      clamp(2.5rem, 5vw, 5rem);
  --fs-h2:      clamp(1.75rem, 3vw, 3rem);
  --fs-h3:      clamp(1.25rem, 2.5vw, 2.25rem);
  --fs-h4:      1.5rem;
  --fs-h5:      1.25rem;
  --fs-h6:      1rem;
  --fs-body:    1rem;
  --fs-sm:      0.875rem;
  --fs-xs:      0.75rem;
  --fs-tiny:    0.625rem;
  --fs-numeral: clamp(6rem, 10vw, 10rem);

  /* ── Line heights ───────────────────────────────────────────────────── */
  --lh-tight:   1;
  --lh-snug:    1.25;
  --lh-normal:  1.5;
  --lh-relaxed: 1.625;

  /* ── Font weights ───────────────────────────────────────────────────── */
  --fw-light:   300;
  --fw-normal:  400;
  --fw-bold:    700;
  --fw-heavy:   900;

  /* ── Font families ──────────────────────────────────────────────────── */
  --font-sans:  "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  --font-serif: "Times New Roman", Times, serif;
  --font-mono:  "Courier New", Courier, monospace;

  /* ── Spacing rhythm ─────────────────────────────────────────────────── */
  --sp-2xs: 0.25rem;
  --sp-xs:  0.5rem;
  --sp-sm:  0.75rem;
  --sp-md:  1rem;
  --sp-lg:  1.5rem;
  --sp-xl:  2rem;
  --sp-2xl: 3rem;
  --sp-3xl: 4.5rem;
  --sp-4xl: 6rem;

  /* ── Shape ──────────────────────────────────────────────────────────── */
  --radius-sm: 4px;
  --radius-md: 8px;

  /* ── Transitions ────────────────────────────────────────────────────── */
  --ease-smooth: cubic-bezier(0.6, 0, 0.8, 1.6);
  --ease-out:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur-fast:    0.2s;
  --dur-mid:     0.3s;
  --dur-slow:    0.6s;
  --dur-intro:   1.5s;

  /* ── Z-index scale ──────────────────────────────────────────────────── */
  --z-base:     1;
  --z-overlay:  100;
  --z-menu:     1000;
  --z-nav:      10000;
  --z-cursor:   -10;  /* sits above everything in its layer */

  /* ── Light theme (default) ──────────────────────────────────────────── */
  --bg-primary:   #fafafa;
  --bg-secondary: #f1f1f1;
  --bg-canvas:    #ffffff;

  --text-primary:   #050505;
  --text-secondary: #050505;
  --text-tertiary:  #141414;
  --text-muted:     #555555;
  --text-dim:       #c0c0c0;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-light:  #cccccc;

  --accent-red:  #ff0000;
  --accent-gold: rgba(255, 215, 0, 1);
}

/* Dark mode overrides */
body.dark-mode {
  --bg-primary:   #050505;
  --bg-secondary: #141414;
  --bg-canvas:    #050505;

  --text-primary:   #f9f9f9;
  --text-secondary: #cccccc;
  --text-tertiary:  #171717;
  --text-muted:     #666666;
  --text-dim:       #a3a3a3;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light:  #333333;
}


/* --------------------------------------------------------------------------
   02. SELECTION
   -------------------------------------------------------------------------- */
::selection {
  color: var(--accent-gold);
  background: #000000;
}


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


/* --------------------------------------------------------------------------
   04. ROOT ELEMENTS
   -------------------------------------------------------------------------- */
html {
  font-size: 16px;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-normal);
  line-height: var(--lh-normal);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  overflow-y: scroll;
  cursor: default;
  /* Transition theme changes smoothly */
  transition:
    background-color var(--dur-slow) ease,
    color var(--dur-slow) ease;
}


/* --------------------------------------------------------------------------
   05. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  overflow-wrap: break-word;
  hyphens: auto;
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-tight); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-normal); }
h4 { font-size: var(--fs-h4); line-height: var(--lh-normal); }
h5 { font-size: var(--fs-h5); line-height: var(--lh-normal); }
h6 { font-size: var(--fs-h6); line-height: var(--lh-normal); font-weight: var(--fw-heavy); }

p {
  max-width: 60ch;
  text-wrap: balance;
}

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

ul, ol {
  list-style: none;
}

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

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


/* --------------------------------------------------------------------------
   06. UTILITIES
   -------------------------------------------------------------------------- */

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

.bold {
  font-weight: var(--fw-bold);
  letter-spacing: 0.03em;
}

/* Full glassmorphism surface */
.blur {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  border-top: 0.5px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    1.5px 3px 5px rgba(0, 0, 0, 0.3),
    inset 0 0.13vmin white,
    inset 0 0.18vmin lightblue,
    inset 0.1vmin 0.1vmin lightcyan;
  transition: background-color var(--dur-mid);
}

/* Light blur only */
.blur-s {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color var(--dur-mid);
}

/* Visually hidden (accessibility) */
.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;
}

/* Reduced motion — honour user preference */
@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;
  }
}
