/* ─── Variables ──────────────────────────────────────────────────────────── */

:root {
  --bg:       #252220;
  --text:     #E8E4DC;
  --muted:    #888480;
  --accent:   #E8960A;
  --border:   #3A3633;
  --max-w:    900px;
  --pad-x:    clamp(1.5rem, 6vmin, 5rem);
  --section-gap: clamp(4rem, 8vw, 7rem);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */

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

/* ─── Base ───────────────────────────────────────────────────────────────── */

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

body {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
}

/* ─── Container ──────────────────────────────────────────────────────────── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ─── Navigation ─────────────────────────────────────────────────────────── */

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--bg);
  padding: 1.125rem var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

#nav.scrolled {
  border-bottom: 1px solid var(--border);
}

.nav-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
}

.nav-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

/* ─── Sections ───────────────────────────────────────────────────────────── */

section {
  padding: var(--section-gap) 0;
}

.section-header {
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.section-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

.section-rule {
  border: none;
  border-top: 2px solid var(--accent);
  width: 2.5rem;
  margin: 0;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: var(--accent);
  color: #252220;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.625rem 1.25rem;
  min-height: 44px;
  min-width: 44px;
  transition: background-color 0.15s ease;
}

.btn:hover {
  background-color: #F0A828;
  color: #252220;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.btn.btn-secondary {
  background-color: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.btn.btn-secondary:hover {
  background-color: transparent;
  color: #F0A828;
  box-shadow: inset 0 0 0 2px #F0A828;
}

.btn.btn-secondary:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */

#hero {
  padding-top: calc(var(--section-gap) + 3.5rem);
  padding-bottom: var(--section-gap);
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.hero-photo {
  margin-bottom: 2rem;
}

.hero-photo img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(100%);
  background-color: var(--border);
}

#hero h1 {
  font-size: clamp(3.75rem, 11vw, 7.5rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-positioning {
  font-size: 1.0625rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 40ch;
  margin-bottom: 1.75rem;
}

.hero-rule {
  border: none;
  border-top: 2px solid var(--accent);
  margin-bottom: 1.75rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
}

/* ─── About ──────────────────────────────────────────────────────────────── */

#about {
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-body p {
  font-size: 1.0625rem;
  line-height: 1.72;
  max-width: 58ch;
}

.about-body p + p {
  margin-top: 1.25rem;
}

.about-aside {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.aside-block h3 {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.375rem;
}

.aside-block p {
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* ─── Experience ─────────────────────────────────────────────────────────── */

#experience {
  border-top: 1px solid var(--border);
}

.timeline {
  --node-gap: 1.75rem;   /* space from line centre to content */
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: var(--node-gap);
}

/* Vertical line — pinned to left:0 of the timeline, centred with translateX(-50%) */
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background-color: var(--border);
}

.timeline-item {
  padding: 2rem 0 2rem 1rem;
  position: relative;
}

/* Node shares the same axis as the line (left:0 on the timeline = left:-node-gap on the item) */
.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--node-gap));
  top: 2.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--muted);
  transform: translateX(-50%);
}

.timeline-item:first-child {
  padding-top: 0;
}

.timeline-item:first-child::before {
  top: 0.2rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.timeline-role {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

.timeline-dates {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-company {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.5rem;
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.company-logo {
  height: 16px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.company-logo--tall {
  height: 20px;
}

.company-logo--large {
  height: 22px;
}

.company-logo--xl {
  height: 26px;
}

.timeline-desc {
  font-size: 0.9375rem;
  line-height: 1.68;
  max-width: 62ch;
}

/* ─── Case Studies ───────────────────────────────────────────────────────── */

#case-studies {
  border-top: 1px solid var(--border);
}

.case-studies-placeholder {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.case-studies-placeholder p {
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.65;
}

.case-studies-placeholder a {
  color: var(--text);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.case-studies-placeholder a:hover {
  text-decoration-thickness: 2px;
}

.case-studies-placeholder a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

/* ─── Contact ────────────────────────────────────────────────────────────── */

#contact {
  border-top: 1px solid var(--border);
}

.contact-body {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.contact-body > p {
  font-size: 1.0625rem;
  line-height: 1.65;
  max-width: 50ch;
}

.contact-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}

footer p {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ─── Shared utilities ───────────────────────────────────────────────────── */

.ext,
.meta {
  font-size: 0.85em;
  color: var(--muted);
}

.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;
}

/* ─── Reduced motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .nav-links {
    gap: 1rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-aside {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
  }

  .timeline-header {
    flex-direction: column;
    gap: 0.25rem;
  }
}

@media (max-width: 480px) {
  .nav-links {
    display: none;
  }
}
