:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #f1f5f9;
  --card-line: #e5e7eb;
  --card-bg: #f9fafb;
  --chip-bg: #f3f4f6;
  --chip-text: #4b5563;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--blue-hover);
}

button {
  font: inherit;
}

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

.site-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 72px;
}

.site-header,
.section,
.site-footer {
  max-width: 896px;
  margin: 0 auto;
}

.site-header {
  padding: 32px 0;
}

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

h1 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.site-role {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.locale-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  padding-top: 4px;
}

.locale-toggle a {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.locale-toggle a.active {
  color: var(--text);
}

.locale-toggle span {
  color: #d1d5db;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.contact-row a {
  font-size: 0.95rem;
}

.section {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
}

.section-tight {
  padding-top: 24px;
}

.section-title {
  margin: 0 0 24px;
  font-size: 1.5rem;
  line-height: 1.2;
}

.feature-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: 20px;
}

.feature-thumb {
  width: 192px;
  height: 112px;
  flex: 0 0 auto;
}

.feature-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: #111827;
}

.feature-copy {
  min-width: 0;
}

.meta-row {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.meta-row span {
  color: #9ca3af;
}

.feature-copy h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.35;
}

.feature-summary {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.93rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  transition: box-shadow 0.2s ease;
}

.project-card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.project-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.35;
}

.project-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.split-media {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.split-media .media-tile {
  width: calc(50% - 4px);
}

.media-button {
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.media-tile,
.card-video,
.card-image,
.pipeline-tile,
.private-tile {
  width: 100%;
  height: 132px;
  border-radius: 8px;
}

.media-tile img,
.media-tile video,
.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: #111827;
}

.media-tile video,
.card-video {
  object-fit: contain;
  background: #111827;
}

.card-video {
  margin-bottom: 12px;
}

.card-image {
  margin-bottom: 12px;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 1.75rem;
  opacity: 0.8;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.media-button:hover .play-overlay,
.feature-thumb:hover .play-overlay {
  background: rgba(0, 0, 0, 0.36);
  opacity: 1;
}

.pipeline-tile,
.private-tile {
  display: grid;
  place-items: center;
  padding: 16px;
  margin-bottom: 12px;
  text-align: center;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #fff;
}

.pipeline-tile strong,
.private-tile strong {
  font-size: 1.25rem;
  line-height: 1.1;
}

.pipeline-tile span,
.private-tile span {
  margin-top: 8px;
  color: #cbd5e1;
  font-size: 0.74rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 0.72rem;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.84rem;
}

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

.skill-block h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.skill-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.skill-block li {
  position: relative;
  padding-left: 14px;
}

.skill-block li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  text-align: center;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  font-size: 0.92rem;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.82);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 1040px);
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: auto;
  border-radius: 16px;
  background: #111827;
  color: #fff;
  padding: 16px;
}

.modal-close {
  display: inline-flex;
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.modal-title {
  margin: 12px 0 16px;
  font-size: 1.1rem;
}

.modal-body img,
.modal-body video {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 10px;
  background: #020617;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-shell {
    padding: 0 16px 56px;
  }

  .site-header {
    padding: 24px 0;
  }

  .header-row,
  .feature-card {
    flex-direction: column;
  }

  .feature-thumb {
    width: 100%;
    height: 160px;
  }

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

  .section {
    padding: 28px 0 40px;
  }

  .contact-row {
    gap: 10px 14px;
  }
}
