:root {
  --bg: #f7f9fd;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: rgba(31, 55, 110, 0.12);
  --line-strong: rgba(31, 55, 110, 0.2);
  --text: #18253f;
  --muted: #61708b;
  --accent: #2b66e3;
  --shadow: 0 12px 32px rgba(46, 78, 140, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top, rgba(43, 102, 227, 0.08), transparent 30%),
    linear-gradient(180deg, #fbfcff 0%, #f4f7fc 100%);
}

a {
  color: inherit;
}

img,
video {
  width: 100%;
  display: block;
}

.site-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.page-stack {
  display: grid;
  gap: 28px;
  padding-bottom: 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(12px);
}

.brand {
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.nav-links a,
.footer-links a,
.card-link {
  text-decoration: none;
  color: var(--muted);
}

.nav-links a:hover,
.footer-links a:hover,
.card-link:hover {
  color: var(--accent);
}

.lang-toggle {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.hero-panel,
.content-section,
.detail-hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding: 54px 24px 42px;
}

.hero-avatar {
  width: 108px;
  margin: 0 0 6px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 10px 26px rgba(43, 102, 227, 0.16);
}

.hero-avatar img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 18%;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 4px;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.08;
  font-weight: 700;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 2.7vw, 2.4rem);
  line-height: 1.16;
  font-family: "Georgia", "Times New Roman", serif;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  line-height: 1.3;
}

.hero-subtitle,
.hero-lede,
.section-header p,
.project-card p,
.timeline-content p,
.footer p,
.company-card p {
  color: var(--muted);
  line-height: 1.75;
}

.hero-subtitle {
  margin: 0;
  max-width: 46rem;
  font-size: 1.02rem;
}

.hero-lede {
  margin: 0;
  max-width: 50rem;
  font-size: 1rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.95rem;
  color: var(--muted);
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  box-shadow: 0 6px 16px rgba(46, 78, 140, 0.05);
  text-decoration: none;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.hero-links a:hover {
  border-color: var(--line-strong);
  color: var(--accent);
  transform: translateY(-1px);
}

.content-section,
.detail-hero {
  padding: 28px;
}

.section-header {
  text-align: center;
  margin-bottom: 20px;
}

.project-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 320px));
  gap: 18px;
  justify-content: center;
}

.two-card-grid {
  grid-template-columns: repeat(2, minmax(300px, 400px));
  max-width: 840px;
  margin: 0 auto;
}

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

.project-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 22px rgba(46, 78, 140, 0.05);
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.project-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 14px 30px rgba(46, 78, 140, 0.1);
  transform: translateY(-2px);
}

.project-card img {
  aspect-ratio: 4 / 3.25;
  object-fit: cover;
  object-position: center 34%;
}

.project-card video {
  width: 100%;
  aspect-ratio: 4 / 3.25;
  object-fit: cover;
  display: block;
  background: #000;
}

.project-card-body {
  padding: 18px;
}

.text-card {
  background: var(--panel-soft);
}

.text-card .project-card-body {
  min-height: 100%;
}

.card-link {
  display: inline-flex;
  margin-top: 10px;
  font-weight: 600;
}

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

.gallery-category {
  appearance: none;
  display: grid;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(46, 78, 140, 0.05);
}

.gallery-category img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.gallery-category span {
  padding: 12px;
  font-size: 1rem;
  font-weight: 700;
}

.media-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 28px;
  overflow: auto;
  background: rgba(10, 15, 25, 0.72);
}

.media-dialog[hidden] {
  display: none;
}

.dialog-open {
  overflow: hidden;
}

.media-dialog-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.media-dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.media-dialog-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-family: inherit;
}

.media-dialog-head button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.media-grid {
  column-count: 4;
  column-gap: 16px;
  padding: 16px;
}

.media-tile {
  position: relative;
  display: block;
  break-inside: avoid;
  margin-bottom: 16px;
  overflow: hidden;
  background: #eef2f8;
  border-radius: 8px;
}

.media-tile img,
.media-tile video {
  width: 100%;
  height: auto;
  display: block;
}

.media-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.82rem;
}

.timeline-list {
  display: grid;
  gap: 22px;
  max-width: 860px;
  margin: 0 auto;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: start;
}

.timeline-date {
  color: var(--accent);
  font-weight: 700;
}

.timeline-content {
  padding-left: 18px;
  border-left: 2px solid rgba(43, 102, 227, 0.18);
}

.detail-page {
  padding-top: 18px;
}

.detail-hero {
  text-align: center;
  display: grid;
  justify-items: center;
}

.detail-hero p {
  max-width: 780px;
}

.company-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  padding: 22px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0 36px;
}

.footer-title {
  margin-bottom: 8px;
  font-weight: 700;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

@media (max-width: 980px) {
  .project-card-grid {
    grid-template-columns: repeat(2, minmax(260px, 320px));
    justify-content: center;
  }

  .gallery-categories {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .two-card-grid {
    grid-template-columns: repeat(2, minmax(260px, 340px));
    max-width: 720px;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 20px, 1120px);
  }

  .topbar,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-links {
    justify-content: flex-start;
  }

  .footer-links {
    align-items: flex-start;
  }

  .project-card-grid,
  .gallery-categories,
  .compact-grid,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .media-dialog {
    padding: 0;
  }

  .media-dialog-panel {
    min-height: 100vh;
    border-radius: 0;
  }

  .media-grid {
    column-count: 2;
    column-gap: 10px;
    padding: 10px;
  }

  .media-tile {
    margin-bottom: 10px;
  }

  .timeline-content {
    padding-left: 0;
    border-left: 0;
  }
}
