:root {
  color-scheme: light;
  --background: #f8f7f3;
  --surface: #ffffff;
  --surface-muted: #eeeeee;
  --text: #171717;
  --muted-text: #555555;
  --border: #d9d9d9;
  --accent: #000000;
  --accent-dark: #000000;
  --focus: #b85c00;
  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.65;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  transform: translateY(-150%);
  border-radius: 4px;
  background: var(--text);
  color: #fff;
  padding: 0.6rem 0.9rem;
}
.skip-link:focus { transform: translateY(0); }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(23, 23, 23, 0.08);
  background: rgba(248, 247, 243, 0.92);
  backdrop-filter: blur(16px);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
}
.brand {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}
.nav-actions { display: inline-flex; gap: 0.35rem; align-items: center; }
.language-link {
  min-width: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
  color: var(--muted-text);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
}
.language-link.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 34vw);
  min-height: calc(100vh - 64px);
}
.hero-content {
  align-self: start;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 5rem clamp(1.5rem, 5vw, 4rem);
}
.hero-image {
  min-height: 420px;
  background: linear-gradient(90deg, rgba(248, 247, 243, 0.2), rgba(23, 23, 23, 0.08)), url("../images/penpaper.webp") center / cover;
}
.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; line-height: 1.12; }
h1 { max-width: 11ch; font-size: clamp(3.2rem, 6vw, 5.8rem); }
h2 { max-width: 780px; font-size: clamp(2rem, 4vw, 3.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0; }
p + p { margin-top: 1rem; }
.lead {
  max-width: 560px;
  margin-top: 1.2rem;
  color: var(--accent-dark);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.28;
}
.intro { max-width: 600px; margin-top: 1.6rem; color: var(--muted-text); }
.social-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  transition: transform 160ms ease, border-color 160ms ease;
}
.social-links a:hover { border-color: var(--accent); transform: translateY(-2px); }
.section {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 3rem;
  padding: 5.5rem max(1.25rem, calc((100vw - var(--max-width)) / 2));
}
.section.muted { background: var(--surface-muted); }
.section-heading { align-self: start; }
.section-body { max-width: 760px; color: var(--muted-text); }
.section-body h3 { margin-top: 2rem; color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 1.25rem;
}
.card p { margin-top: 0.75rem; color: var(--muted-text); }
.check-list, .tag-list { margin: 1rem 0 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 1.6rem; }
.check-list li + li { margin-top: 0.5rem; }
.check-list li::before { position: absolute; left: 0; color: var(--accent); content: "✓"; font-weight: 800; }
.experience-list { display: grid; gap: 2.5rem; }
.timeline-item {
  display: grid;
  grid-template-columns: minmax(180px, 0.6fr) minmax(0, 1.4fr);
  gap: 2rem;
  color: var(--muted-text);
}
.timeline-item h3 { color: var(--text); }
.role, .date { margin-top: 0.35rem; }
.date { color: var(--accent-dark); font-weight: 700; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tag-list li {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 0.35rem 0.8rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 650;
}
.skills { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--border); }
.skills div {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.skills dt { color: var(--text); font-weight: 800; }
.skills dd { margin: 0; color: var(--muted-text); }
.contact { background: #000; color: #fff; }
.contact .eyebrow, .contact .section-body, .contact .section-body h3 { color: rgba(255, 255, 255, 0.86); }
.contact .check-list li::before { color: #ffffff; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  border: 1px solid #fff;
  border-radius: 6px;
  background: #fff;
  color: var(--accent-dark);
  padding: 0.55rem 1rem;
  font-weight: 800;
  text-decoration: none;
}
.button.secondary { background: transparent; color: #fff; }
.button.secondary.dark {
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}
.legal-page,
.error-page {
  padding: 5.5rem max(1.25rem, calc((100vw - var(--max-width)) / 2));
}
.legal-content,
.error-content {
  max-width: 760px;
}
.legal-content h1,
.error-content h1 {
  max-width: none;
  font-size: clamp(2.8rem, 6vw, 5rem);
}
.legal-content h2 {
  margin-top: 2.5rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}
.legal-content p {
  color: var(--muted-text);
}
.legal-content .lead {
  color: var(--accent-dark);
}
.legal-content a {
  color: var(--accent-dark);
  font-weight: 700;
}
.updated {
  margin-top: 3rem;
  font-size: 0.95rem;
}

@media (max-width: 860px) {
  body { font-size: 17px; }
  .hero { grid-template-columns: 1fr; }
  .hero-content { margin: 0; max-width: none; padding: 4rem 1.25rem 3rem; }
  .hero-image { min-height: 240px; order: -1; }
  .section { grid-template-columns: 1fr; gap: 1.8rem; padding-top: 4rem; padding-bottom: 4rem; }
  .legal-page, .error-page { padding-top: 4rem; padding-bottom: 4rem; }
  .grid, .timeline-item, .skills div { grid-template-columns: 1fr; }
  h1 { max-width: 100%; font-size: 3.4rem; }
}

@media (max-width: 520px) {
  .nav { padding-inline: 1rem; }
  .brand { font-size: 0.95rem; }
  h1 { font-size: 2.8rem; }
  .lead { font-size: 1.25rem; }
  .hero-content, .section { padding-inline: 1rem; }
  .card { padding: 1rem; }
}
