/* Design tokens: edit these variables to quickly change the site's look and spacing. */
:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #172033;
  --muted: #637083;
  --line: #dbe3ee;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #e8f0ff;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.1);
  --radius: 8px;
  --max-width: 1120px;
}

/* Base reset and document defaults. */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

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

/* Shared accessibility helpers. */
.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;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-140%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Sticky header and navigation styles, including the mobile menu button. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 249, 252, 0.88);
  border-bottom: 1px solid rgba(219, 227, 238, 0.8);
  backdrop-filter: blur(16px);
}

.nav {
  width: min(100% - 32px, var(--max-width));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.nav-links a[aria-current="location"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.nav-links .nav-resume {
  background: var(--text);
  color: #fff;
}

.nav-links .nav-resume:hover {
  background: var(--accent-strong);
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 180ms ease, opacity 180ms ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(4) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Shared page section layout and heading styles. */
.section {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
  padding: 96px 0;
}

/* Hero section: main intro, portrait, highlights, and call-to-action buttons. */
.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: 56px;
  padding-top: 72px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  max-width: 760px;
  font-size: clamp(3.25rem, 9vw, 6.6rem);
  letter-spacing: 0;
}

h2 {
  max-width: 720px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 0;
}

h3 {
  font-size: 1.35rem;
}

.hero-tagline {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 720px;
  margin: 30px 0 0;
}

.hero-highlights div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
}

.hero-highlights dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-highlights dd {
  margin: 4px 0 0;
  color: var(--text);
  font-weight: 850;
  line-height: 1.25;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

/* Reusable button styles used in the hero and other action areas. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
}

.btn.primary:hover {
  background: var(--accent-strong);
}

.btn.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.btn.text {
  color: var(--accent-strong);
}

.btn.text:hover {
  background: var(--accent-soft);
}

.hero-visual {
  position: relative;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 12%;
  z-index: -1;
  border-radius: 30px;
  background: var(--accent-soft);
  transform: rotate(-8deg);
}

.hero-visual img {
  width: min(100%, 440px);
  aspect-ratio: 1;
  margin-left: auto;
  border: 8px solid var(--surface);
  border-radius: 28px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

/* About section layout. */
.section-heading {
  margin-bottom: 34px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.about-grid p,
.contact-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

/* Skills section category cards and pill lists. */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.skill-group {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.05);
}

.skill-group h3 {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-list li {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 750;
  text-align: center;
}

/* Project cards and project technology tags. */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  display: flex;
  min-height: 380px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(23, 32, 51, 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.project-number {
  margin: 0 0 42px;
  color: var(--accent-strong);
  font-weight: 900;
}

.project-card p:not(.project-number):not(.project-impact) {
  margin: 16px 0 24px;
  color: var(--muted);
}

.project-impact {
  margin: 0 0 24px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 650;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.project-tags li {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: none;
  transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.project-links a:hover {
  background: var(--accent-soft);
  border-color: #b7ccff;
  text-decoration: underline;
  transform: translateY(-1px);
}

/* Contact callout panel and social links. */
.contact-panel {
  max-width: 820px;
  padding: 44px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow);
}

.contact-panel .eyebrow {
  color: #93c5fd;
}

.contact-panel p {
  margin-top: 18px;
  color: #dbeafe;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  font-style: normal;
}

.contact-links a {
  display: inline-flex;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: background 180ms ease;
}

.contact-links a:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Footer. */
.site-footer {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
  padding: 28px 0 42px;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
}

/* Tablet and small laptop layout adjustments. */
@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 72px;
    right: 16px;
    left: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    justify-content: center;
  }

  .nav-links .nav-resume {
    margin-top: 4px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    min-height: auto;
    padding-top: 64px;
  }

  .hero-visual img {
    width: min(100%, 360px);
    margin: 0 auto;
  }

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

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

  .hero-highlights {
    grid-template-columns: 1fr;
  }
}

/* Phone layout adjustments. */
@media (max-width: 560px) {
  .section {
    width: min(100% - 24px, var(--max-width));
    padding: 70px 0;
  }

  .hero {
    padding-top: 48px;
  }

  h1 {
    font-size: clamp(3rem, 16vw, 4.2rem);
  }

  .hero-actions,
  .contact-links {
    flex-direction: column;
  }

  .btn,
  .contact-links a {
    width: 100%;
  }

  .skill-group {
    padding: 18px;
  }

  .contact-panel {
    padding: 28px 20px;
  }

  .project-card {
    min-height: auto;
  }
}

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