/* ═══════════════════════════════════════════════════════════════════════
   BASE.CSS — Shared foundation for entire Utah Fab project
   Loaded FIRST on every page. Page-specific sheets override as needed.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── CSS RESET ───────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  /* Firefox scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--border-neutral) var(--bg-deep);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

select {
  background: var(--bg-deep);
  border: 1px solid var(--border-neutral);
  border-radius: var(--radius);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 8px 28px 8px 12px;  /* right padding reserves space for custom arrow */
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a8a7a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
select:focus {
  border-color: var(--brand-orange-dim);
  outline: 2px solid var(--brand-orange-dim);
  outline-offset: 2px;
}

/* ── DESIGN TOKENS ───────────────────────────────────────────────────── */
:root {
  /* RGB channels for opacity-aware usage */
  --brand-orange-rgb: 255, 107, 43;
  --bg-dark-rgb:      13, 17, 23;
  --black-rgb:        0, 0, 0;
  --white-rgb:        255, 255, 255;
  --success-rgb:      0, 184, 148;
  --amber-rgb:        255, 165, 0;

  /* Brand palette */
  --brand-orange:      #ff6b2b;   /* Vibrant orange — portfolio accent     */
  --brand-orange-dim:  #e8500a;   /* De-saturated — directory / admin      */
  --brand-orange-strong:#c84009;  /* Hover/darker accent                    */
  --brand-amber:       #f0a500;   /* Secondary warm — highlights, badges   */
  --brand-amber-light: #ffb347;   /* Lighter amber — step titles           */

  /* Backgrounds */
  --bg-dark:           #0d1117;   /* Deep blue-black (portfolio)           */
  --bg-deep:           #0f0f0f;   /* Near-black (directory / admin)        */
  --bg-surface:        #181818;   /* Card / header surface                 */
  --bg-surface-alt:    #222222;   /* Hover / alternate surface             */

  /* Text */
  --text-main:         #e8e4da;   /* Primary readable text                 */
  --text-bright:       #f0ebe0;   /* High-emphasis headings                */
  --text-muted:        #8a8a7a;   /* Secondary / label text                */
  --text-dim:          #7a7672;   /* Tertiary — timestamps, hints          */

  /* Borders */
  --border-color:      rgba(255, 107, 43, 0.22);  /* Warm subtle border  */
  --border-neutral:    #2e2e2e;   /* Neutral dark divider                  */

  /* Semantic */
  --danger:            #d63031;
  --danger-dark:       #b02727;
  --success:           #00b894;
  --white:             #ffffff;
  --black:             #000000;
  --neutral-strong:    #333333;
  --text-print-muted:  #444444;

  /* Misc */
  --tag-bg:            #1e1e1e;
  --radius:            0;

  /* Fonts */
  --font-title:  'Bebas Neue', sans-serif;
  --font-mono:   'IBM Plex Mono', 'Share Tech Mono', monospace;
  --font-body:   'IBM Plex Sans', 'Barlow', sans-serif;

  /* Grid decoration */
  --grid-color:  rgba(var(--brand-orange-rgb), 0.07);

  /* Layering scale */
  --z-bg: 0;
  --z-content: 1;
  --z-corner: 2;
  --z-float: 6;
  --z-sticky: 50;
  --z-header: 100;
  --z-modal: 200;
  --z-lightbox: 1000;
  --z-lightbox-controls: 1001;
}

/* ── GLOBAL BASE STYLES ──────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(var(--brand-orange-rgb), 0.3);
  color: var(--text-bright);
}

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

/* ── SCROLLBAR ───────────────────────────────────────────────────────── */
/* Chromium / Safari */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-neutral); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-orange-dim); }

/* ── SHARED ENGINEERING DECORATIONS ──────────────────────────────────── */
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(var(--brand-orange-rgb), 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--brand-orange-rgb), 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: var(--z-bg);
}

.corner { position: absolute; width: 16px; height: 16px; pointer-events: none; z-index: var(--z-corner); }
.corner.tl { top: 16px; left: 16px; border-top: 2px solid var(--brand-orange); border-left: 2px solid var(--brand-orange); }
.corner.tr { top: 16px; right: 16px; border-top: 2px solid var(--brand-orange); border-right: 2px solid var(--brand-orange); }
.corner.bl { bottom: 16px; left: 16px; border-bottom: 2px solid var(--brand-orange); border-left: 2px solid var(--brand-orange); }
.corner.br { bottom: 16px; right: 16px; border-bottom: 2px solid var(--brand-orange); border-right: 2px solid var(--brand-orange); }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--brand-orange);
  letter-spacing: 5px;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(var(--brand-orange-rgb), 0.25);
}

.ref-tag {
  position: absolute; bottom: 18px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: rgba(var(--brand-orange-rgb), 0.3);
  letter-spacing: 3px;
  white-space: nowrap;
  pointer-events: none;
}

/* ── ENTRANCE ANIMATIONS ─────────────────────────────────────────────── */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

@keyframes revealFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── UTILITY CLASSES ─────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); border: 0;
}
