/* ═══════════════════════════════════════════════════════════════
   NIGHTFALL EXPRESS — Base Styles
   Resets, typography, body, global elements.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Oswald:wght@300;400;500;600;700&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

/* ── Local fonts ─────────────────────────────────────────────── */
/* Himagsikan by Jéson Garnica — CC Attribution 3.0 license     */
/* https://fontstruct.com/fontstructions/show/1563194            */
@font-face {
  font-family: 'Himagsikan';
  src: url('../fonts/himagsikan.otf') format('opentype'),
       url('../fonts/himagsikan.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Himagsikan';
  src: url('../fonts/himagsikan-italic.otf') format('opentype'),
       url('../fonts/himagsikan-italic.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%; /* Safari/iOS — suppresses auto font scaling */
}

body {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased; /* Chrome/Safari */
  /* -moz-osx-font-smoothing: grayscale — removed, unsupported in modern Firefox */
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--color-text-primary);
}

p {
  color: var(--color-text-secondary);
  line-height: 1.75;
}

a {
  color: var(--color-amber);
  text-decoration: none;
  transition: color var(--ease-fast);
}
a:hover { color: var(--color-amber-light); }

strong { font-weight: 600; }
em { font-style: italic; }

/* ── Images ──────────────────────────────────────────────────── */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

/* ── Scrollbar ───────────────────────────────────────────────── */
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--color-steel) var(--color-bg-secondary); }
/* Chrome/Safari/Edge — ignored by Firefox, no warning */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--color-steel); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-amber); }

/* ── Focus visible ───────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Screen reader only ──────────────────────────────────────── */
.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;
}

/* ── Utility ─────────────────────────────────────────────────── */
.text-amber   { color: var(--color-amber); }
.text-steel   { color: var(--color-steel-light); }
.text-muted   { color: var(--color-text-muted); }
.text-center  { text-align: center; }
.text-upper   { text-transform: uppercase; letter-spacing: 0.15em; }
.hidden       { display: none !important; }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  html { font-size: 15px; }
}
