/* ============================================
   valmb.com - Custom Theme
   Dark mode only. Warm, deliberate, confident.
   ============================================ */

/* --- Self-Hosted Fonts --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: block;
  src: url('/fonts/inter-latin.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: 'Lora';
  font-style: normal;
  font-weight: 400 500;
  font-display: block;
  src: url('/fonts/lora-latin.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: 'Lora';
  font-style: italic;
  font-weight: 400;
  font-display: block;
  src: url('/fonts/lora-italic-latin.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;
}

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

:root {
  --bg: #121212;
  --bg-elevated: #1a1a1a;
  --text: #e8e0d4;
  --text-muted: #a09888;
  --accent: #c4933f;
  --accent-hover: #d4a34f;
  --border: #2a2a2a;
  --focus: #c4933f;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Lora', Georgia, 'Times New Roman', serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  --max-width: 720px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  background: var(--accent);
  color: var(--bg);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  z-index: 1000;
}

.skip-link:focus {
  top: var(--space-sm);
}

/* --- Focus Indicators --- */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 2.25rem; margin-bottom: var(--space-md); letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; margin-top: var(--space-lg); margin-bottom: var(--space-sm); }
h3 { font-size: 1.25rem; margin-top: var(--space-md); margin-bottom: var(--space-xs); }

p { margin-bottom: var(--space-sm); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 200ms ease;
}

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

strong { font-weight: 600; }

ul, ol {
  margin-bottom: var(--space-sm);
  padding-left: 1.5rem;
}

li { margin-bottom: var(--space-xs); }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

/* --- Header / Nav --- */
header {
  border-bottom: 1px solid var(--border);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.nav-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-name:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 200ms ease, opacity 200ms ease;
}

nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
}

nav ul a {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

nav ul a:hover,
nav ul a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* --- Main Content --- */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
  width: 100%;
}

/* --- Home Page --- */
.home {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.home-photo img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.home-content h1 {
  font-size: 2.5rem;
  margin-bottom: var(--space-xs);
}

.identity {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: var(--space-md);
}

.hook {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: var(--space-lg);
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.home-links a {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.home-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(196, 147, 63, 0.05);
}

/* --- Page Content --- */
.page {
  max-width: 100%;
}

.page h1 {
  margin-bottom: var(--space-lg);
}

.content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.content h2 {
  font-size: 1.375rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

.content h3 {
  margin-top: var(--space-lg);
}

.content ul, .content ol {
  margin-bottom: var(--space-md);
}

.content li {
  margin-bottom: var(--space-xs);
}

.content a {
  border-bottom: 1px solid rgba(196, 147, 63, 0.3);
}

.content a:hover {
  border-bottom-color: var(--accent);
}

/* --- Resume Page --- */
.resume-header {
  margin-bottom: var(--space-lg);
}

.resume-header h1 {
  margin-bottom: var(--space-xs);
}

.resume-header .subtitle {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.resume-header .contact-line {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.resume-header .contact-line a {
  color: var(--text-muted);
}

.resume-header .contact-line a:hover {
  color: var(--accent);
}

.resume-downloads {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.resume-downloads a {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  transition: border-color 200ms ease, color 200ms ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.resume-downloads a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.resume-section h2 {
  font-size: 1.25rem;
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-sm);
}

.resume-section h3 {
  font-size: 1.1rem;
  margin-top: var(--space-md);
  margin-bottom: 0.25rem;
}

.resume-section .role-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text);
}

.resume-section .role-meta {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.resume-section ul {
  margin-bottom: var(--space-md);
}

.resume-section li {
  font-size: 0.95rem;
  line-height: 1.7;
}

.skills-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.375rem 1rem;
  font-size: 0.95rem;
}

.skills-grid dt {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.skills-grid dd {
  color: var(--text);
}

/* --- Contact Page --- */
.contact-methods {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.contact-methods a {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  transition: border-color 200ms ease, color 200ms ease;
  max-width: 400px;
}

.contact-methods a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- 404 Page --- */
.error-page {
  text-align: center;
  padding-top: var(--space-xl);
}

.error-page h1 {
  font-size: 3rem;
}

.error-page p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.error-nav {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.error-nav a {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  transition: border-color 200ms ease, color 200ms ease;
}

.error-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border);
  padding: var(--space-md);
  text-align: center;
}

footer p {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* --- Print Styles --- */
@media print {
  body {
    background: white;
    color: #111;
    font-size: 11pt;
  }

  header, footer, .skip-link, .resume-downloads, .home-links, .nav-toggle {
    display: none !important;
  }

  main {
    padding: 0;
    max-width: 100%;
  }

  a { color: #111; text-decoration: underline; }
  a[href^="mailto"]::after { content: " (" attr(href) ")"; }
  h1, h2, h3 { color: #111; break-after: avoid; }

  .resume-header .subtitle { color: #333; }
  .resume-header .contact-line { color: #555; }
  .resume-section h2 { border-bottom-color: #ccc; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --space-xl: 2.5rem;
  }

  h1 { font-size: 1.75rem; }

  .home {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .home-photo {
    max-width: 240px;
  }

  .home-content h1 {
    font-size: 2rem;
  }

  .nav-toggle {
    display: flex;
  }

  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: var(--space-sm) var(--space-md);
    gap: 0;
  }

  nav ul.open {
    display: flex;
  }

  nav {
    position: relative;
    flex-wrap: wrap;
  }

  nav ul a {
    padding: var(--space-sm) 0;
    display: block;
    border-bottom: none;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }

  .skills-grid dt {
    margin-top: var(--space-xs);
  }
}
