/* =========================================
   Stuart Wilson — Resume
   Aesthetic: Aviation Instrument / Editorial
   ========================================= */

:root {
  --midnight: #080c18;
  --deep: #0d1224;
  --surface: #111830;
  --surface-light: #182040;
  --amber: #c8a44e;
  --amber-dim: #a6893f;
  --amber-glow: #e8c45a;
  --text-primary: #e2e4ea;
  --text-secondary: #8e93a8;
  --text-muted: #5c6178;
  --border: rgba(200, 164, 78, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.06);
}

/* === Reset === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--midnight);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

/* === Film Grain Overlay === */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* === Header === */
header {
  position: relative;
  padding: 80px 0 56px;
  text-align: center;
  background: var(--deep);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(200, 164, 78, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.header-inner {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 32px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid var(--amber);
  color: var(--amber);
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.2rem;
  margin-bottom: 24px;
  animation: fadeDown 0.8s ease both;
}

header h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 3.2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 12px;
  animation: fadeDown 0.8s 0.1s ease both;
}

.tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 36px;
  animation: fadeDown 0.8s 0.2s ease both;
}

.tag-sep {
  color: var(--amber-dim);
  font-weight: 300;
}

nav {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  animation: fadeDown 0.8s 0.3s ease both;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--amber);
  transition: width 0.3s;
}

nav a:hover {
  color: var(--amber);
}

nav a:hover::after {
  width: 100%;
}

/* === Main === */
main {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 32px 64px;
}

/* === Sections === */
section {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border-subtle);
}

section:last-child {
  border-bottom: none;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 32px;
  padding-left: 20px;
  position: relative;
}

.section-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 1px;
  background: var(--amber);
}

/* === Reveal Animation === */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === About === */
.about-text {
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--text-secondary);
  max-width: 700px;
}

.about-text::first-line {
  color: var(--text-primary);
}

/* === Timeline === */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--amber-dim), var(--border-subtle));
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -32px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--amber);
  background: var(--midnight);
  z-index: 1;
}

.timeline-item:first-child .timeline-marker {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(200, 164, 78, 0.3);
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.job-header h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: #fff;
}

.job-title {
  font-size: 0.88rem;
  color: var(--amber-dim);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.dates {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-transform: uppercase;
}

.timeline-content ul {
  list-style: none;
  padding: 0;
}

.timeline-content li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.timeline-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.timeline-content li strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* === Skills === */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}

.skill-category h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 14px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  transition: border-color 0.3s, color 0.3s;
}

.skill-tag:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* === Education === */
.education-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.edu-item {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 24px;
  transition: border-color 0.3s, transform 0.3s;
}

.edu-item:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}

.edu-icon {
  color: var(--amber-dim);
  margin-bottom: 14px;
}

.edu-item h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.4;
}

.edu-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Contact === */
.contact-block {
  display: flex;
  gap: 16px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  color: var(--amber);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}

.contact-link:hover {
  background: var(--surface-light);
  border-color: var(--amber-dim);
  transform: translateY(-2px);
}

.contact-link .arrow {
  opacity: 0.5;
  transition: opacity 0.3s, transform 0.3s;
}

.contact-link:hover .arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* === Footer === */
footer {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--border-subtle);
}

/* === Keyframes === */
@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Responsive === */
@media (max-width: 640px) {
  header {
    padding: 56px 0 40px;
  }

  header h1 {
    font-size: 2.2rem;
  }

  .tagline {
    font-size: 0.82rem;
    gap: 8px;
  }

  nav {
    gap: 20px;
  }

  main {
    padding: 0 20px 48px;
  }

  section {
    padding: 48px 0 40px;
  }

  .job-header {
    flex-direction: column;
    gap: 2px;
  }

  .education-grid {
    grid-template-columns: 1fr;
  }

  .contact-link {
    width: 100%;
    justify-content: center;
  }

  .contact-block {
    flex-direction: column;
  }
}

/* === Print === */
@media print {
  .grain { display: none; }

  body {
    background: #fff;
    color: #111;
    font-size: 11pt;
  }

  header {
    background: #fff;
    border-bottom: 2px solid #111;
    padding: 16px 0;
  }

  header h1 { color: #111; }
  .tagline { color: #555; }
  nav { display: none; }
  .header-badge { display: none; }

  section {
    padding: 16px 0;
    page-break-inside: avoid;
  }

  .section-label { color: #111; }
  .section-label::before { background: #111; }

  .timeline::before { background: #ccc; }
  .timeline-marker { border-color: #111; }

  .skill-tag {
    background: #f5f5f5;
    border-color: #ddd;
    color: #333;
  }

  .edu-item {
    background: #f9f9f9;
    border-color: #ddd;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
