/*
 * Theme 2: "Swiss Modernist"
 * Aesthetic: International Typographic Style / Swiss Design
 * Font: Neue Haas Grotesk (Helvetica Neue) + Playfair Display for contrast
 * Palette: Cream paper, charcoal text, Swiss red accent
 */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/dm-sans-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: 'DM Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/dm-sans-latin-ext.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: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-sans-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: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-sans-latin-ext.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: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/dm-sans-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: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/dm-sans-latin-ext.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: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/dm-sans-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: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/dm-sans-latin-ext.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: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/playfair-display-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: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/playfair-display-latin-ext.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: 'Playfair Display';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/fonts/playfair-display-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: 'Playfair Display';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/fonts/playfair-display-latin-ext.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;
}

:root {
  --bg-primary: #faf8f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #3d3d3d;
  --text-muted: #8a8a8a;
  --accent: #e63946;
  --accent-light: rgba(230, 57, 70, 0.08);
  --border: #e8e4df;
  --border-heavy: #1a1a1a;
}

/* ─── Reset & Base ─────────────────────────────────────────────────────────── */

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

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

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  font-weight: 300;
}

/* ─── Typography ───────────────────────────────────────────────────────────── */

h1,
h2,
h3,
h4 {
  font-family: 'Playfair Display', serif;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 0.5em;
  font-weight: 900;
}

h1 {
  font-size: 3.5rem;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.3rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* Link icon for inline content links */
.timeline__content a[href^="http"]::after,
.timeline__achievements a[href^="http"]::after,
#main-content>h1~p a[href^="http"]::after,
#main-content>h1~ul a[href^="http"]::after,
#main-content>h1~ol a[href^="http"]::after {
  content: '';
  display: inline-block;
  width: 0.65em;
  height: 0.65em;
  margin-left: 0.2em;
  vertical-align: super;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e63946' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ─── Focus Styles ─────────────────────────────────────────────────────────── */

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ─── Layout ───────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-secondary);
  border-bottom: 3px solid var(--border-heavy);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  align-items: center;
}

.nav-link {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-link--active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

#main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  border-top: 3px solid var(--border-heavy);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background-color: var(--border-heavy);
  color: white;
  text-decoration: none;
  transition: background-color 0.2s;
}

.footer-social__link:hover {
  background-color: var(--accent);
  color: white;
}

/* ─── Page Intro ───────────────────────────────────────────────────────────── */

.page-intro {
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-size: 1.15rem;
  max-width: 55ch;
  font-weight: 300;
}

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

.hero {
  margin-bottom: 4rem;
  padding: 0 0 3rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero__avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  transform: rotate(-5deg);
}

.hero__subtitle {
  color: var(--accent);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
}

.about {
  margin-bottom: 4rem;
}

.about__positioning {
  font-size: 1.25rem;
  line-height: 1.7;
  max-width: 60ch;
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.key-results {
  list-style: none;
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  margin: 0 0 1.5rem 0;
  max-width: 60ch;
}

.key-results li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-primary);
}

.about__summary {
  font-size: 1rem;
  line-height: 1.9;
  max-width: 60ch;
  font-weight: 300;
  color: var(--text-secondary);
}

.skills-snapshot {
  margin-bottom: 4rem;
}

.featured-projects {
  margin-bottom: 4rem;
}

.projects-list--home {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
  .projects-list--home {
    grid-template-columns: repeat(3, 1fr);
  }
}

.section-link {
  margin-top: 1.25rem;
}

.section-link a {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.section-link a:hover {
  color: var(--text-primary);
}

.connect {
  margin-bottom: 3rem;
}

.link-list {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0;
}

.link-list__item {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background-color: var(--bg-card);
  border: 2px solid var(--border-heavy);
  color: var(--text-primary);
  font-weight: 500;
  transition: box-shadow 0.2s;
  text-decoration: none;
  cursor: pointer;
}

.link-list__item:hover {
  box-shadow: 8px 8px 0 var(--border-heavy);
  color: var(--text-primary);
  text-decoration: none;
}

.link-list__item:hover .link-list__icon {
  background-color: var(--accent);
  color: white;
}

.link-list__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background-color: var(--accent);
  color: white;
}

/* ─── Skills ───────────────────────────────────────────────────────────────── */

.skills-category {
  margin-bottom: 2rem;
  background-color: var(--bg-card);
  border: 2px solid var(--border-heavy);
  padding: 2rem;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}

.skills-category:hover {
  transform: translateY(-3px);
  box-shadow: 8px 8px 0 var(--border-heavy);
}

.skills-category h2 {
  font-size: 1.3rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-heavy);
  margin-bottom: 1rem;
  color: var(--accent);
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin-top: 0.75rem;
}

.tag {
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  background-color: var(--accent-light);
  color: var(--text-primary);
  font-weight: 500;
  border: 1px solid var(--border);
}

/* ─── Projects ─────────────────────────────────────────────────────────────── */

.projects-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .projects-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  position: relative;
  background-color: var(--bg-card);
  border: 2px solid var(--border-heavy);
  padding: 2rem;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 8px 8px 0 var(--border-heavy);
}

.project-card h2 a,
.project-card__link {
  color: var(--accent);
  text-decoration: none;
}

.project-card h2 a:hover,
.project-card__link:hover {
  color: var(--accent);
}

.project-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.project-card h2 {
  font-size: 1.3rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-heavy);
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.project-card__description {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.25rem;
  font-weight: 300;
}

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

.timeline {
  position: relative;
  padding-left: 3rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--border-heavy);
}

.timeline__entry {
  position: relative;
  margin-bottom: 3rem;
}

.timeline__marker {
  position: absolute;
  left: -2.4rem;
  top: 0.6rem;
  width: 14px;
  height: 14px;
  background-color: var(--accent);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--border-heavy);
}

.timeline__content {
  background-color: var(--bg-card);
  border: 2px solid var(--border-heavy);
  padding: 2rem;
  transition: box-shadow 0.2s;
  cursor: default;
}

.timeline__content:hover {
  box-shadow: 8px 8px 0 var(--border-heavy);
}

.timeline__content h2 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
  color: var(--accent);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-heavy);
}

.timeline__company {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.timeline__dates {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.timeline__description {
  line-height: 1.8;
  margin-bottom: 1.25rem;
  font-weight: 300;
}

.timeline__achievements-heading {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
}

.timeline__achievements {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.25rem;
}

.timeline__achievements li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--text-secondary);
  padding-left: 1.5rem;
  position: relative;
}

.timeline__achievements li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 2px;
  background-color: var(--accent);
}

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

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .site-nav {
    flex-direction: column;
    padding: 1rem;
  }

  .nav-link {
    padding: 0.6rem 0;
    width: 100%;
  }

  #main-content {
    padding: 2rem 1rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  .hero {
    padding: 1.5rem 0;
    margin-bottom: 2rem;
  }

  .timeline {
    padding-left: 2rem;
  }

  .timeline__marker {
    left: -1.4rem;
    width: 10px;
    height: 10px;
  }

  .timeline__content {
    padding: 1.25rem;
  }

  .project-card {
    padding: 1.25rem;
  }
}

@media (min-width: 481px) and (max-width: 1023px) {
  .site-nav {
    justify-content: center;
  }

  #main-content {
    padding: 3rem 2rem;
  }
}

/* ─── Utility ──────────────────────────────────────────────────────────────── */

.error-page {
  text-align: center;
  padding: 4rem 0;
}

.error-page__code {
  font-family: 'Playfair Display', serif;
  font-size: 8rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-page__message {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

.error-page__nav {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

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

/* ─── Scroll-Triggered Animation ────────────────────────────────────────────── */

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate {
  opacity: 0;
  transform: translateY(30px);
}

.animate.in {
  animation: slideUp 0.5s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .animate {
    opacity: 1;
    transform: none;
    animation: none;
  }

  #main-content .anchor-highlight {
    animation: none;
    background-color: rgba(230, 57, 70, 0.08);
  }
}

/* ─── Project Page Prose ───────────────────────────────────────────────────── */

.breadcrumb {
  margin-bottom: 2rem;
}

.breadcrumb__link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  transition: color 0.2s;
}

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

#main-content>h1~h2,
#main-content>h1~h3,
#main-content>h1~p,
#main-content>h1~ul,
#main-content>h1~ol {
  max-width: 70ch;
}

#main-content>h1~h2 {
  font-size: 1.3rem;
  color: var(--accent);
}

/* TL;DR summary section: first ul directly after h1 */
#main-content>h1+ul {
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  margin-bottom: 2.5rem;
}

#main-content>h1+ul li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
  color: var(--text-primary);
  font-weight: 400;
}

#main-content>h1+ul a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

#main-content>h1+ul a:hover {
  border-bottom-color: var(--accent);
}

/* Scroll offset for anchor links under sticky header */
#main-content [id] {
  scroll-margin-top: 6rem;
}

#main-content span[id] {
  display: block;
  height: 0;
  overflow: visible;
}

/* Visual highlight for anchor targets */
@keyframes anchorFade {

  0%,
  40% {
    background-color: rgba(230, 57, 70, 0.12);
  }

  100% {
    background-color: transparent;
  }
}

#main-content .anchor-highlight {
  animation: anchorFade 2.5s ease-out;
  border-radius: 3px;
}

#main-content>h1~h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
}

#main-content>p {
  margin-bottom: 1.25rem;
}

#main-content>ul,
#main-content>ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  list-style: disc;
}

#main-content>ul li,
#main-content>ol li {
  margin-bottom: 0.5rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

#main-content>ul li::marker {
  color: var(--accent);
}

#main-content>h2 {
  margin-top: 2.5rem;
}

#main-content>h3 {
  margin-top: 1.75rem;
}
