/* ============================================
   MvF Devices — main.css
   Global styles, variables, reset, typography
   ============================================ */

/* --- Self-hosted DM Sans (variable font, covers weights 400/500/700) --- */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('/assets/fonts/dm-sans-latin-regular.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('/assets/fonts/dm-sans-latin-ext-regular.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 100 1000;
  font-display: swap;
  src: url('/assets/fonts/dm-sans-latin-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 100 1000;
  font-display: swap;
  src: url('/assets/fonts/dm-sans-latin-ext-italic.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

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

/* --- Design Tokens --- */
:root {
  /* Background layers (warm-tinted darks) */
  --bg-deep:        #1a1714;
  --bg-primary:     #211e19;
  --bg-elevated:    #2a2620;
  --bg-surface:     #33302a;

  /* Amber/Gold accents */
  --accent:         #d4a843;
  --accent-hover:   #e0ba5a;
  --accent-muted:   #a07e30;
  --accent-glow:    rgba(212, 168, 67, 0.15);

  /* Text */
  --text-primary:   #e8e0d4;
  --text-secondary: #a89e8e;
  --text-muted:     #6e6558;

  /* Functional */
  --border:         #3a362f;
  --border-accent:  #5a4e3a;
  --success:        #7ab648;
  --error:          #c45a4a;

  /* Typography */
  --font-family:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:      'SF Mono', 'Fira Code', 'Consolas', monospace;

  --text-xs:        0.75rem;
  --text-sm:        0.875rem;
  --text-base:      1rem;
  --text-lg:        1.125rem;
  --text-xl:        1.25rem;
  --text-2xl:       1.75rem;
  --text-3xl:       2.25rem;
  --text-4xl:       3rem;
  --text-5xl:       3.75rem;

  /* Spacing */
  --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;

  /* Layout */
  --max-width:      1200px;
  --max-width-narrow: 800px;
  --border-radius:  8px;
  --border-radius-lg: 12px;

  /* Header */
  --header-height:  64px;
}

/* --- Base Styles --- */
body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

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

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 65ch;
}

strong {
  font-weight: 700;
  color: var(--text-primary);
}

/* --- Links --- */
a:not(.btn) {
  color: var(--accent);
  transition: color 0.2s ease;
}

a:not(.btn):hover {
  color: var(--accent-hover);
}

/* --- Layout Helpers --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

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

.section--alt {
  background-color: var(--bg-elevated);
}

.section__header {
  margin-bottom: var(--space-3xl);
}

.section__title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-md);
}

.section__subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 55ch;
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }

.mx-auto { margin-inline: auto; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Responsive --- */
@media (max-width: 1023px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }

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

@media (max-width: 639px) {
  :root {
    --text-4xl: 2.25rem;
    --text-5xl: 2.75rem;
  }

  .container {
    padding-inline: var(--space-md);
  }

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