:root {
  --navy: #0f172a;
  --blue: #2563eb;
  --cyan: #06b6d4;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-strong: #f1f5f9;
  --text: #1e293b;
  --muted: #64748b;
  --line: #dbe3ef;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-strong: #172033;
  --text: #e5edf7;
  --muted: #9aa8bb;
  --line: #263449;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

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

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

.section-pad {
  padding: 112px 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  align-items: center;
  min-height: 78px;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: var(--navy);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--text);
  line-height: 1.2;
}

.brand small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 26px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.nav-menu a {
  position: relative;
  padding: 8px 0;
  transition: color 180ms ease;
}

.nav-menu a:hover,
.nav-menu a.is-active,
.text-link:hover {
  color: var(--blue);
}

.nav-menu a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--blue);
  content: "";
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 220ms ease;
}

.nav-menu a:hover::after,
.nav-menu a.is-active::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 8px;
}

.control-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
}

.control-btn.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.theme-toggle {
  min-width: 104px;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  margin: 6px 0;
  background: var(--text);
}

.hero {
  min-height: calc(100vh - 78px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--surface-strong) 78%, transparent) 0 1px, transparent 1px 100%),
    linear-gradient(var(--surface), var(--bg));
  background-size: 80px 100%, auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  align-items: center;
  gap: 82px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 36px;
  height: 2px;
  background: var(--cyan);
  content: "";
}

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

h1 {
  max-width: 860px;
  margin-bottom: 24px;
  color: var(--text);
  font-size: clamp(2.9rem, 6.4vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.065em;
}

h2 {
  margin-bottom: 18px;
  color: var(--text);
  font-size: clamp(2rem, 3.2vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

h3 {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 1.14rem;
  line-height: 1.35;
}

.hero-copy p,
.narrow-section p,
.section-heading p,
.download-grid p,
.project-hero p {
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-copy p {
  max-width: 720px;
  margin-bottom: 34px;
}

.hero-actions,
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 6px;
  padding: 0 18px;
  font-size: 0.9rem;
  font-weight: 800;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

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

.btn-primary {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #ffffff;
}

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

.btn-outline {
  border: 1px solid var(--blue);
  background: transparent;
  color: var(--blue);
}

.btn-outline:hover {
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  border-color: var(--blue);
  color: var(--blue);
}

.btn-card {
  border: 1px solid var(--text);
  background: transparent;
  color: var(--text);
}

.engineer-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-photo {
  overflow: hidden;
  min-height: 360px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
}

.profile-photo img {
  display: block;
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: center 18%;
}

.engineer-card-body {
  padding: 28px;
}

.card-kicker {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.engineer-card h2 {
  margin-bottom: 24px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.metric-list {
  display: grid;
  gap: 18px;
  margin: 0;
}

.metric-list div {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

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

.metric-list dd {
  margin: 5px 0 0;
  color: var(--text);
  font-weight: 700;
}

.metrics-strip {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

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

.metrics-grid div {
  min-height: 132px;
  border-left: 1px solid var(--line);
  padding: 28px 24px;
}

.metrics-grid div:last-child {
  border-right: 1px solid var(--line);
}

.metrics-grid strong,
.metrics-grid span {
  display: block;
}

.metrics-grid strong {
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.2;
}

.metrics-grid span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.muted-section {
  background: var(--bg);
}

.narrow-section {
  max-width: 840px;
}

.section-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 48px;
}

.section-top h2 {
  max-width: 820px;
}

.text-link {
  color: var(--blue);
  font-weight: 800;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skill-card,
.project-card,
.training-card,
.contact-card,
.detail-card,
.project-facts,
.download-grid {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.04);
}

.skill-card {
  padding: 28px;
}

.skill-number {
  display: block;
  margin-bottom: 26px;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 800;
}

.skill-card p,
.project-body p,
.credential-list p,
.detail-card p {
  color: var(--muted);
}

.skill-card small {
  display: block;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--text);
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  border-top: 1px solid var(--line);
  padding: 30px 0;
}

.timeline-date {
  color: var(--blue);
  font-weight: 800;
}

.timeline-content .meta {
  color: var(--muted);
  font-weight: 700;
}

.timeline-content ul {
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--text);
}

.timeline-content li + li {
  margin-top: 8px;
}

.experience-timeline {
  position: relative;
  display: grid;
  gap: 28px;
}

.experience-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.experience-period {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  border-right: 1px solid var(--line);
  padding: 30px;
  background: var(--surface-strong);
}

.experience-period span {
  color: var(--blue);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.35;
}

.experience-period strong {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.experience-body {
  padding: 30px 30px 30px 0;
}

.experience-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.experience-header h3 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.company {
  margin: 0;
  color: var(--text);
  font-weight: 900;
}

.role-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.assignment-panel {
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--bg);
}

.assignment-panel p,
.responsibility-block h4 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assignment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.assignment-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.experience-summary {
  margin-bottom: 24px;
  border-left: 4px solid var(--cyan);
  padding: 12px 0 12px 16px;
  color: var(--muted);
  font-weight: 700;
}

.responsibility-block ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.responsibility-block li {
  position: relative;
  padding-left: 24px;
  color: var(--text);
}

.responsibility-block li::before {
  position: absolute;
  top: 0.74em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  content: "";
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.project-card {
  overflow: hidden;
}

.project-image {
  display: grid;
  min-height: 190px;
  place-items: end start;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.12) 0 1px, transparent 1px 100%),
    var(--surface-strong);
  background-size: 34px 34px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-image-b {
  background-color: color-mix(in srgb, var(--surface-strong) 84%, var(--blue));
}

.project-image-c {
  background-color: color-mix(in srgb, var(--surface-strong) 88%, var(--cyan));
}

.project-body {
  padding: 26px;
}

.project-date {
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.tag-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
}

.btn-card {
  width: 100%;
}

.featured-project {
  overflow: hidden;
  max-width: 820px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.featured-project-image {
  position: relative;
  overflow: hidden;
  height: 260px;
  border-bottom: 1px solid var(--line);
}

.featured-project-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: transform 420ms ease;
}

.featured-project:hover .featured-project-image img {
  transform: scale(1.035);
}

.featured-project-body {
  padding: clamp(24px, 4vw, 34px);
}

.featured-project-body h3 {
  max-width: 620px;
  margin-bottom: 14px;
  font-size: clamp(1.55rem, 2.4vw, 2.05rem);
  letter-spacing: -0.045em;
}

.featured-project-body p {
  margin-bottom: 0;
  color: var(--muted);
}

.academic-timeline {
  position: relative;
  display: grid;
  gap: 0;
  max-width: 960px;
}

.academic-timeline::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 170px;
  width: 1px;
  background: var(--line);
  content: "";
}

.academic-item {
  position: relative;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 62px;
  padding: 0 0 34px;
}

.academic-item:last-child {
  padding-bottom: 0;
}

.academic-item::before {
  position: absolute;
  top: 8px;
  left: 161px;
  width: 18px;
  height: 18px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--line);
  content: "";
}

.academic-item.is-primary::before {
  background: var(--blue);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 14%, transparent);
}

.academic-item.is-secondary::before {
  background: var(--muted);
}

.academic-date {
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.academic-item.is-secondary .academic-date {
  color: var(--muted);
}

.academic-content {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  background: var(--surface);
}

.academic-item.is-primary .academic-content {
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.academic-item.is-secondary .academic-content {
  border-left-color: var(--line);
  background: color-mix(in srgb, var(--surface) 84%, var(--bg));
}

.academic-content h3 {
  margin-bottom: 12px;
}

.academic-item.is-primary h3 {
  font-size: 1.22rem;
}

.academic-item.is-secondary h3 {
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-size: 1.02rem;
}

.academic-content p {
  margin: 0;
}

.academic-content .institution {
  color: var(--text);
  font-weight: 800;
}

.academic-content .location {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 700;
}

.academic-note {
  margin-top: 14px !important;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

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

.certification-section {
  display: grid;
  gap: 42px;
}

.certification-category > h3 {
  margin-bottom: 18px;
  color: var(--text);
  font-size: 1.25rem;
}

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

.training-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.training-card::before {
  display: block;
  width: 54px;
  height: 4px;
  margin-bottom: 24px;
  background: var(--cyan);
  content: "";
}

.training-card:hover {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.training-year {
  display: flex;
  width: fit-content;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.training-card p {
  color: var(--muted);
}

.training-card .issuer {
  margin-bottom: 0;
  color: var(--text);
  font-weight: 800;
}

.certification-badge {
  display: flex;
  width: fit-content;
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line));
  border-radius: 999px;
  padding: 6px 10px;
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.certification-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.certification-badge-row .training-year,
.certification-badge-row .certification-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  line-height: 1;
  margin-bottom: 0;
}

.certificate-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.78);
}

.certificate-modal.is-open {
  display: flex;
}

.certificate-modal-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  width: min(1040px, 100%);
  max-height: min(86vh, 760px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.certificate-preview {
  display: grid;
  min-height: 520px;
  place-items: center;
  background: var(--bg);
}

.certificate-preview iframe,
.certificate-preview img {
  display: none;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.certificate-preview.has-pdf iframe,
.certificate-preview.has-image img {
  display: block;
}

.certificate-empty {
  max-width: 360px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.certificate-preview.has-pdf .certificate-empty,
.certificate-preview.has-image .certificate-empty {
  display: none;
}

.certificate-details {
  padding: 34px;
}

.certificate-details h3 {
  margin-bottom: 22px;
  font-size: 1.35rem;
}

.certificate-details dl {
  display: grid;
  gap: 16px;
  margin: 0 0 22px;
}

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

.certificate-details dd {
  margin: 4px 0 0;
  color: var(--text);
  font-weight: 800;
}

.certificate-description {
  color: var(--muted);
}

.certificate-modal-badge {
  display: inline-flex;
  margin-bottom: 18px;
  border-radius: 999px;
  padding: 7px 11px;
  background: color-mix(in srgb, var(--cyan) 14%, transparent);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.certificate-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.cert-grid,
.contact-grid {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 70px;
}

.credential-list {
  display: grid;
  gap: 14px;
}

.credential-list article {
  padding: 22px;
}

.credential-list span {
  color: var(--blue);
  font-weight: 800;
}

.download-panel {
  padding: 72px 0;
  background: var(--navy);
  color: #ffffff;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  padding: 34px;
}

.download-grid h2,
.download-grid p,
.download-grid .eyebrow {
  color: #ffffff;
}

.download-grid p {
  margin-bottom: 0;
  opacity: 0.76;
}

.download-grid .btn-secondary {
  border-color: rgba(255, 255, 255, 0.36);
  background: transparent;
  color: #ffffff;
}

.contact-card {
  overflow: hidden;
}

.contact-card a,
.contact-card div {
  display: block;
  padding: 24px;
}

.contact-card a + a,
.contact-card div {
  border-top: 1px solid var(--line);
}

.contact-card span,
.contact-card strong {
  display: block;
}

.contact-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-card strong {
  margin-top: 5px;
  color: var(--text);
}

.linkedin-link strong::after {
  content: " ↗";
  color: var(--blue);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 90px;
  gap: 22px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-content p {
  margin: 0;
}

.footer-content a {
  color: var(--blue);
  font-weight: 800;
}

.project-page {
  background: var(--bg);
}

.case-study-page {
  background: var(--surface);
}

.project-hero {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.case-hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--surface-strong) 78%, transparent) 0 1px, transparent 1px 100%),
    linear-gradient(var(--surface), var(--bg));
  background-size: 80px 100%, auto;
}

.project-hero-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  align-items: start;
  gap: 60px;
}

.project-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
}

.case-hero-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  align-items: start;
  gap: 64px;
}

.case-hero h1 {
  font-size: clamp(2.65rem, 5.6vw, 5.1rem);
}

.project-facts {
  padding: 26px;
}

.project-facts div + div {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.project-facts span,
.project-facts strong {
  display: block;
}

.project-facts span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-facts strong {
  margin-top: 5px;
  color: var(--text);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.detail-card {
  padding: 30px;
}

.detail-card h2 {
  font-size: 1.55rem;
}

.case-image-band {
  padding: 42px 0 0;
  background: var(--bg);
}

.case-main-image {
  overflow: hidden;
  height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.case-main-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.case-study-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  align-items: start;
  gap: 58px;
}

.case-nav {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--surface);
}

.case-nav a {
  position: relative;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  transition:
    background 180ms ease,
    color 180ms ease,
    padding-left 180ms ease;
}

.case-nav a:hover,
.case-nav a.is-active {
  background: var(--bg);
  color: var(--blue);
}

.case-nav a::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 2px;
  border-radius: 999px;
  background: var(--blue);
  content: "";
  opacity: 0;
  transform: scaleY(0.35);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.case-nav a.is-active {
  padding-left: 16px;
}

.case-nav a.is-active::before {
  opacity: 1;
  transform: scaleY(1);
}

.case-content {
  display: grid;
  gap: 24px;
}

.case-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 4vw, 42px);
  background: var(--surface);
}

.case-index {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.case-section h2 {
  font-size: clamp(1.65rem, 2.6vw, 2.35rem);
}

.case-section p {
  color: var(--muted);
}

.architecture-grid,
.results-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.architecture-grid article,
.results-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  background: var(--bg);
}

.architecture-grid strong,
.results-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 900;
}

.case-tags {
  margin-bottom: 0;
}

.case-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}

.gallery-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 24px;
}

.gallery-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.gallery-card:hover {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.gallery-card img {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: center center;
}

.gallery-card img.gallery-image-panel,
.gallery-card img.gallery-image-cabinets {
  object-fit: cover;
  object-position: center center;
}

.gallery-card img.gallery-image-panel {
  object-position: center 45%;
}

.gallery-card img.gallery-image-cabinets {
  object-position: center center;
}

.gallery-card span {
  display: block;
  padding: 14px 16px 16px;
}

.gallery-card strong,
.gallery-card small {
  display: block;
}

.gallery-card strong {
  margin-bottom: 5px;
  color: var(--text);
  font-weight: 900;
}

.gallery-card small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.gallery-video-card {
  overflow: hidden;
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.gallery-video-card:hover {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.gallery-video-wrap {
  background: var(--navy);
  line-height: 0;
}

.gallery-video {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  background: var(--navy);
}

.gallery-video-card figcaption {
  display: block;
  padding: 14px 16px 16px;
}

.gallery-video-card strong,
.gallery-video-card p {
  display: block;
}

.gallery-video-card strong {
  margin-bottom: 5px;
  color: var(--text);
  font-weight: 900;
}

.gallery-video-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.86);
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: min(100%, 1080px);
  max-height: 82vh;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.lightbox p {
  position: absolute;
  right: 28px;
  bottom: 20px;
  left: 28px;
  margin: 0;
  color: #ffffff;
  font-weight: 800;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
}

.static-menu {
  justify-content: flex-end;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .nav {
    flex-wrap: wrap;
    padding: 14px 0;
  }

  .nav-menu {
    order: 3;
    width: 100%;
  }

  .hero-grid,
  .project-hero-grid,
  .case-hero-grid,
  .case-study-layout,
  .experience-card,
  .cert-grid,
  .contact-grid,
  .download-grid {
    grid-template-columns: 1fr;
  }

  .experience-period {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .experience-body {
    padding: 30px;
  }

  .skills-grid,
  .projects-grid,
  .training-grid,
  .training-grid-field,
  .architecture-grid,
  .results-grid,
  .gallery-grid,
  .detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .certificate-modal-panel {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .certificate-preview {
    min-height: 420px;
  }

  .featured-project-image {
    height: 240px;
  }

  .case-nav {
    position: static;
  }

  .download-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 28px, 1160px);
  }

  .section-pad {
    padding: 78px 0;
  }

  .nav {
    min-height: 72px;
    gap: 14px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-menu:not(.static-menu) {
    display: none;
    align-items: stretch;
    order: 4;
    width: 100%;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 8px;
    background: var(--surface);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .static-menu {
    order: 3;
    width: auto;
    justify-content: flex-start;
  }

  .nav-menu a {
    padding: 12px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.6rem);
  }

  .hero-grid {
    gap: 42px;
  }

  .metrics-grid,
  .skills-grid,
  .projects-grid,
  .training-grid,
  .training-grid-field,
  .architecture-grid,
  .results-grid,
  .gallery-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .certificate-modal {
    padding: 14px;
  }

  .certificate-preview {
    min-height: 300px;
  }

  .certificate-details {
    padding: 24px;
  }

  .case-main-image {
    height: 300px;
  }

  .featured-project-image {
    height: 220px;
  }

  .featured-project-image img {
    object-position: 75% center;
  }

  .academic-timeline::before {
    left: 10px;
  }

  .academic-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-left: 34px;
  }

  .academic-item::before {
    left: 1px;
  }

  .metrics-grid div,
  .metrics-grid div:last-child {
    border-right: 1px solid var(--line);
  }

  .section-top,
  .footer-content {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .experience-header {
    flex-direction: column;
  }

  .role-badge {
    align-self: flex-start;
  }
}

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