:root {
  /* Global colors, fonts, spacing, and reusable design values. */
  --background: #f8f6f1;
  --surface: #eeeae1;
  --surface-deep: #e5dfd3;
  --ink: #151713;
  --muted: #676861;
  --line: #dfdace;
  --accent: #397266;
  --accent-deep: #244f47;
  --white: #fffdf8;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Manrope", Arial, sans-serif;
  --shadow: 0 20px 70px rgba(31, 27, 20, 0.08);
  --radius: 1.3rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3 {
  margin: 0;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.18;
  z-index: 100;
  pointer-events: none;
  background-image: radial-gradient(rgba(20, 20, 18, 0.26) 0.55px, transparent 0.55px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
}

.container {
  width: min(1160px, calc(100% - 3rem));
  margin: 0 auto;
}

/* Header / Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 1.15rem;
  background: rgba(248, 246, 241, 0.83);
  backdrop-filter: blur(18px);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: var(--white);
  background: var(--ink);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.3rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.nav-links > a:not(.button):hover,
.footer-inner a:hover,
.contact-links a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0 1.65rem;
  border-radius: 999px;
  color: var(--white);
  background: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 180ms ease, background 180ms ease;
}

.button:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
}

.button-small {
  min-height: 2.65rem;
  padding: 0 1.4rem;
  color: var(--white);
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: minmax(350px, 0.95fr) minmax(400px, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  min-height: calc(100vh - 5.7rem);
  padding: 4.3rem 0 5.8rem;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.35rem;
  margin-bottom: 3.25rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.availability-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #6d996e;
  box-shadow: 0 0 0 5px rgba(109, 153, 110, 0.13);
  animation: availability-pulse 1.8s ease-in-out infinite;
}

@keyframes availability-pulse {
  0%,
  100% {
    background: #6d996e;
    box-shadow:
      0 0 0 5px rgba(109, 153, 110, 0.13),
      0 0 0 0 rgba(109, 153, 110, 0);
  }

  50% {
    background: #8ee29a;
    box-shadow:
      0 0 0 5px rgba(109, 153, 110, 0.17),
      0 0 22px 8px rgba(142, 226, 154, 0.48);
  }
}

.eyebrow {
  margin-bottom: 1.25rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 640px;
  font-size: clamp(3.3rem, 5.7vw, 5.35rem);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 0.98;
}

.serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
}

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

.hero h1 span {
  display: inline-block;
  font-style: italic;
}

.hero-intro {
  max-width: 515px;
  margin-top: 1.85rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 2.55rem;
}

.text-link {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  font-weight: 700;
  font-size: 0.94rem;
}

.text-link span {
  color: var(--accent);
  font-size: 1.25rem;
  transition: transform 180ms ease;
}

.text-link:hover span {
  transform: translate(3px, -3px);
}

.hero-visual {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.portrait-card {
  position: relative;
  width: min(100%, 680px);
  max-width: 100%;
  min-width: 0;
  padding-bottom: 2rem;
}

.certificate-frame {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 0.55rem solid var(--white);
  border-radius: 0.9rem;
  background: var(--white);
  box-shadow: var(--shadow);
}

.certificate-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.certificate-image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 220ms ease;
}

.certificate-trigger:hover .certificate-image,
.certificate-trigger:focus-visible .certificate-image {
  transform: scale(1.025);
}

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

.certificate-modal {
  width: min(94vw, 1100px);
  max-height: 94vh;
  padding: 2.8rem 1rem 1rem;
  border: 0;
  border-radius: 0.85rem;
  background: var(--white);
  box-shadow: var(--shadow);
}

.certificate-modal::backdrop {
  background: rgba(17, 19, 21, 0.82);
}

.certificate-modal img {
  display: block;
  width: 100%;
  max-height: calc(94vh - 3.8rem);
  object-fit: contain;
}

.certificate-close {
  position: absolute;
  top: 0.35rem;
  right: 0.6rem;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  background: transparent;
  cursor: pointer;
}

.floating-card {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 253, 248, 0.93);
  border-radius: 0.72rem;
  box-shadow: var(--shadow);
}

.floating-card span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.floating-card strong {
  font-size: 0.92rem;
}

.bottom-card {
  bottom: 0;
  left: 0;
  min-width: 7.8rem;
}

.bottom-card strong {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--accent);
}

/* Quick Highlights */
.numbers {
  padding: 2.65rem 0;
  border-block: 1px solid var(--line);
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.number-grid div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.35rem 1.2rem;
  border-right: 1px solid var(--line);
}

.number-grid div:last-child {
  border-right: 0;
}

.number-grid strong {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  font-weight: 400;
}

.number-grid span {
  max-width: 86px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.section {
  padding: clamp(5.2rem, 9vw, 7.7rem) 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: clamp(2.6rem, 5vw, 4rem);
}

.section-heading .eyebrow {
  margin-bottom: 0.9rem;
}

.section-heading h2 {
  font-size: clamp(2.35rem, 4vw, 3.35rem);
  font-weight: 600;
  letter-spacing: -0.065em;
}

.section-heading > p {
  max-width: 330px;
  color: var(--muted);
  line-height: 1.7;
}

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

/* Home Lab Experience */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.lab-card {
  display: flex;
  flex-direction: column;
  min-height: 395px;
  padding: clamp(1.35rem, 2vw, 1.7rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.75), rgba(255, 253, 248, 0.34)),
    var(--surface);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.lab-card:hover {
  transform: translateY(-5px);
  border-color: rgba(57, 114, 102, 0.38);
  box-shadow: var(--shadow);
}

.lab-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.2rem;
}

.lab-number {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  color: var(--white);
  background: var(--ink);
  font-family: var(--serif);
  font-size: 1.3rem;
}

.lab-card h3 {
  margin-bottom: 0.85rem;
  font-size: 1.32rem;
  line-height: 1.25;
  letter-spacing: -0.05em;
}

.lab-summary {
  color: var(--muted);
  line-height: 1.7;
}

.lab-list {
  display: grid;
  gap: 0.7rem;
  margin: 1.45rem 0 1.6rem;
  padding: 0;
  list-style: none;
}

.lab-list li {
  position: relative;
  padding-left: 1.1rem;
  color: #3f423b;
  font-size: 0.9rem;
  line-height: 1.55;
}

.lab-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--accent);
}

.lab-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: auto;
}

.lab-tags span {
  padding: 0.42rem 0.62rem;
  border: 1px solid rgba(57, 114, 102, 0.18);
  border-radius: 999px;
  color: var(--accent-deep);
  background: rgba(57, 114, 102, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
}

.project-card.large {
  grid-column: span 2;
}

.project-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 385px;
  overflow: hidden;
  border-radius: var(--radius);
}

.large .project-preview {
  min-height: 495px;
}

.preview-label {
  position: absolute;
  top: 1.3rem;
  left: 1.3rem;
  padding: 0.47rem 0.75rem;
  border-radius: 999px;
  color: rgba(21, 23, 19, 0.64);
  background: rgba(255, 253, 248, 0.52);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.preview-one {
  background: #e3ddd1;
}

.window {
  width: min(78%, 710px);
  padding: 0.65rem;
  border-radius: 0.62rem;
  background: var(--white);
  box-shadow: 0 20px 45px rgba(40, 33, 26, 0.11);
}

.window-bar {
  display: flex;
  gap: 0.28rem;
  margin-bottom: 0.6rem;
}

.window-bar i {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: #d9d2c5;
}

.dashboard {
  display: flex;
  gap: 0.65rem;
  height: 245px;
  padding: 0.7rem;
  background: #f4f1e9;
}

.dashboard-sidebar {
  width: 21%;
  border-radius: 0.22rem;
  background: #ece6d9;
}

.dashboard-content {
  display: grid;
  flex: 1;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.dashboard-content span {
  border-radius: 0.25rem;
  background: #fffdf9;
}

.dashboard-content span:first-child {
  grid-column: span 2;
  background: linear-gradient(170deg, #fffdf9, #f4e1d4);
}

.preview-two {
  background: #d6e2dd;
}

.phone {
  width: 158px;
  height: 292px;
  padding: 0.4rem;
  border-radius: 1.65rem;
  background: #fff;
  box-shadow: 0 25px 50px rgba(42, 55, 51, 0.14);
}

.phone-screen {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  padding: 1.5rem 0.7rem 0.7rem;
  border-radius: 1.3rem;
  background: #f5f7f4;
}

.pill {
  width: 44%;
  height: 0.4rem;
  border-radius: 99px;
  background: #cedbd5;
}

.phone-title {
  width: 83%;
  height: 1.2rem;
  border-radius: 4px;
  background: #28352d;
}

.phone-image {
  flex: 1;
  border-radius: 0.7rem;
  background: linear-gradient(140deg, #dce7e1, #99ad9d);
}

.preview-three {
  background: #ead8c8;
}

.commerce {
  display: flex;
  gap: 1.15rem;
  width: min(76%, 300px);
  padding: 0.65rem;
  border-radius: 0.4rem;
  background: var(--white);
  box-shadow: 0 25px 48px rgba(65, 44, 31, 0.09);
}

.product {
  width: 46%;
  aspect-ratio: 0.84;
  background:
    radial-gradient(ellipse at center, #d1b396 0 29%, transparent 30%),
    #f0e9df;
}

.commerce-lines {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.46rem;
  padding-top: 1rem;
}

.commerce-lines span {
  height: 0.38rem;
  border-radius: 4px;
  background: #e4dbce;
}

.commerce-lines span:nth-child(2) {
  width: 72%;
}

.commerce-lines b {
  width: 65%;
  height: 1.1rem;
  margin-top: 1rem;
  border-radius: 99px;
  background: var(--ink);
}

.project-details {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.65rem;
}

.project-type {
  margin-bottom: 0.65rem;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.project-details h3 {
  margin-bottom: 0.55rem;
  font-size: 1.47rem;
  letter-spacing: -0.05em;
}

.project-details p:last-child {
  color: var(--muted);
}

.circle-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 3rem;
  height: 3rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.2rem;
  transition: background 180ms ease, color 180ms ease;
}

.circle-arrow:hover {
  color: var(--white);
  background: var(--accent);
}

/* Work Experience */
.about {
  background: var(--surface);
}

.about-grid {
  display: grid;
  grid-template-columns: 0.93fr 1.07fr;
  gap: clamp(3rem, 7vw, 7rem);
}

.about .section-heading {
  align-items: start;
  margin: 0;
}

.large-text {
  margin-bottom: 1.65rem;
  font-size: clamp(1.2rem, 2vw, 1.38rem);
  line-height: 1.75;
  letter-spacing: -0.025em;
}

.experience {
  border-top: 1px solid #d7cfc0;
}

.experience div {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 1.4rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid #d7cfc0;
}

.experience span {
  color: var(--muted);
  font-size: 0.82rem;
}

.experience strong {
  font-size: 0.96rem;
}

/* Technical Skills */
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.3rem;
}

.service {
  min-height: 230px;
  padding: 1.6rem 1.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 200ms ease, background 200ms ease;
}

.service:hover {
  transform: translateY(-5px);
  background: var(--white);
}

.service span {
  display: block;
  margin-bottom: 3rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
}

.service h3 {
  margin-bottom: 0.8rem;
  letter-spacing: -0.04em;
}

.service p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

/* Certifications */
.credentials {
  padding-top: 0;
  padding-bottom: clamp(3.5rem, 6vw, 5rem);
}

.credential-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.3rem;
}

.training-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Education */
.education {
  padding-top: 0;
}

.education-grid {
  grid-template-columns: repeat(2, 1fr);
}

.credential {
  min-height: 195px;
  padding: 1.6rem 1.45rem;
  border-radius: var(--radius);
  background: var(--surface);
}

.credential h3 {
  margin-bottom: 0.8rem;
  font-size: 1.12rem;
  letter-spacing: -0.04em;
}

.credential > p:last-child {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

/* Contact Section */
.contact {
  padding: clamp(5.3rem, 11vw, 8.2rem) 0;
  color: var(--white);
  background: #171915;
}

.contact-inner {
  text-align: center;
}

.contact h2 {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 2.15rem;
  font-size: clamp(2.7rem, 5.2vw, 4.5rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.07em;
}

.contact h2 .serif {
  font-style: italic;
}

.email {
  display: inline-block;
  margin-bottom: 3.7rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 253, 248, 0.32);
  font-size: clamp(1.12rem, 2vw, 1.42rem);
  transition: color 180ms ease;
}

.email:hover {
  color: #cf936d;
}

.contact-form {
  width: min(100%, 700px);
  margin: -0.75rem auto 3.2rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid rgba(255, 253, 248, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.04);
  text-align: left;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  margin-bottom: 1.35rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.form-field span {
  color: #d4d1c9;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 253, 248, 0.16);
  border-radius: 0.7rem;
  padding: 0.9rem 1rem;
  color: var(--white);
  background: rgba(255, 253, 248, 0.06);
  font: inherit;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #8e8e88;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.form-field textarea {
  resize: vertical;
}

.full-width {
  grid-column: span 2;
}

.form-note {
  display: inline-block;
  margin-left: 1.1rem;
  color: #aeadab;
  font-size: 0.8rem;
}

.contact-button {
  color: var(--ink);
  background: var(--white);
}

.contact-button:hover {
  color: var(--white);
  background: var(--accent);
}

.phone-highlight {
  display: inline-flex;
  align-items: center;
  gap: 1.2rem;
  margin: 0 auto 2.7rem;
  padding: 0.95rem 1.35rem;
  border: 1px solid rgba(255, 253, 248, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.07);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.phone-highlight span {
  color: #aeadab;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.phone-highlight strong {
  color: var(--white);
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  letter-spacing: -0.04em;
}

.phone-highlight:hover {
  border-color: var(--accent);
  background: rgba(57, 114, 102, 0.18);
  transform: translateY(-2px);
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: clamp(1.3rem, 5vw, 3.8rem);
  color: #b5b4ae;
  font-size: 0.92rem;
}

/* Footer */
.site-footer {
  color: #aeadab;
  background: #171915;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  padding: 1.45rem 0 2rem;
  border-top: 1px solid rgba(255, 253, 248, 0.11);
  font-size: 0.83rem;
}

/* Scroll reveal animation */
.js .reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 650ms ease, transform 650ms cubic-bezier(0.19, 1, 0.22, 1);
}

.js .reveal-delay {
  transition-delay: 110ms;
}

.js .reveal.visible {
  opacity: 1;
  transform: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* Tablet layout */
@media (max-width: 920px) {
  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4.2rem;
    padding: 3.8rem 0 4rem;
  }

  .availability {
    margin-bottom: 2.4rem;
  }

  .hero-visual {
    justify-content: center;
  }

  .portrait-card {
    width: min(100%, 680px);
  }

  .number-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.2rem 0;
  }

  .number-grid div:nth-child(2) {
    border-right: 0;
  }

  .about-grid,
  .service-grid,
  .credential-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile layout */
@media (max-width: 700px) {
  .container {
    width: min(100% - 2rem, 560px);
  }

  .site-header {
    padding-top: 0.35rem;
  }

  .navbar {
    position: relative;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.8rem 1.2rem;
    font-size: 0.82rem;
  }

  .js .nav-toggle {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 2.7rem;
    height: 2.7rem;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
  }

  .nav-toggle span:not(.sr-only) {
    display: block;
    width: 1.32rem;
    height: 2px;
    background: var(--ink);
    transition: transform 180ms ease, opacity 180ms ease;
  }

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

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

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

  .js .nav-links {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: var(--white);
    box-shadow: var(--shadow);
  }

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

  .nav-links > a:not(.button) {
    padding: 0.85rem 0.8rem;
  }

  .button-small {
    margin-top: 0.35rem;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 15vw, 3.6rem);
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 1.4rem;
  }

  .portrait-card {
    padding-bottom: 1.6rem;
  }

  .number-grid div {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .projects,
  .lab-grid,
  .about-grid,
  .service-grid,
  .credential-grid {
    grid-template-columns: 1fr;
  }

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

  .project-card.large {
    grid-column: auto;
  }

  .project-preview,
  .large .project-preview {
    min-height: 315px;
  }

  .dashboard {
    height: 175px;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.3rem;
  }

  .service {
    min-height: auto;
  }

  .service span {
    margin-bottom: 2rem;
  }

  .experience div {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .contact-links {
    flex-wrap: wrap;
  }

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

  .full-width {
    grid-column: auto;
  }

  .contact-button {
    width: 100%;
  }

  .form-note {
    display: block;
    margin: 0.85rem 0 0;
    text-align: center;
  }

  .phone-highlight {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-radius: 1rem;
  }
}

/* Accessibility: reduce motion for users who request it. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
