:root {
  --color-bg: oklch(0.98 0.015 75);
  --color-text: oklch(0.2 0.02 40);
  --color-text-muted: oklch(0.4 0.02 40);
  --color-text-soft: oklch(0.3 0.02 40);
  --color-text-faint: oklch(0.6 0.02 40);
  --color-accent: oklch(0.58 0.19 25);
  --color-accent-soft: oklch(0.58 0.19 25 / 0.12);
  --color-accent-text: oklch(0.45 0.12 25);
  --color-shadow: oklch(0.2 0.02 40 / 0.15);
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
}

/* Page header */
.page-header { background: var(--color-accent); padding: 48px 48px 64px; }
.back-link { display: inline-block; text-decoration: none; color: #fff; font-weight: 600; font-size: 14px; margin-bottom: 28px; }
.back-link:hover { text-decoration: underline; }
.page-header h1 { font-family: var(--font-heading); font-weight: 800; font-size: 52px; margin: 0 0 14px; color: #fff; }
.page-header p { font-size: 19px; max-width: 560px; margin: 0; color: #fff; opacity: 0.9; }

/* Content */
.content { max-width: 820px; margin: -32px auto 0; padding: 0 48px 80px; }

.intro-card { background: #fff; border-radius: 24px; padding: 40px; box-shadow: 0 20px 40px -20px var(--color-shadow); display: flex; gap: 36px; flex-wrap: wrap; }

.intro-photo { flex: 0 0 auto; width: 180px; height: 180px; border-radius: 24px; overflow: hidden; background: oklch(0.9 0.02 75); }
.intro-photo img { width: 100%; height: 100%; object-fit: cover; }

.intro-text { flex: 1 1 320px; min-width: 260px; }
.intro-text h2 { font-family: var(--font-heading); font-weight: 700; font-size: 26px; margin: 0 0 12px; }
.intro-text p { font-size: 16px; line-height: 1.7; color: var(--color-text-muted); margin: 0; }

.section-title { font-family: var(--font-heading); font-weight: 700; font-size: 18px; margin: 0 0 14px; color: var(--color-text-soft); }
.section-block { margin-top: 36px; }

/* Tags */
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { background: var(--color-accent-soft); color: var(--color-accent-text); font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.photo-item {
  aspect-ratio: 1; border-radius: 18px; overflow: hidden;
  box-shadow: 0 12px 24px -14px oklch(0.2 0.02 40 / 0.3);
  background: #fff; padding: 6px; cursor: pointer;
  transition: transform 0.2s ease;
}
.photo-item:hover, .photo-item:focus-visible { transform: scale(1.04); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block; }

/* Click-to-enlarge images (see lightbox.js) */
img.zoomable { cursor: zoom-in; }

/* Buttons */
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn { text-decoration: none; font-weight: 700; font-size: 15px; padding: 14px 22px; border-radius: 12px; display: inline-block; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-secondary { background: var(--color-accent-soft); color: var(--color-accent-text); }

/* Footer */
.page-footer { text-align: center; padding: 24px 24px 40px; font-size: 13px; color: var(--color-text-faint); }
.page-footer a { color: inherit; text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: oklch(0.15 0.02 40 / 0.8); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 40px;
  animation: fadeIn 0.2s ease; cursor: pointer;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(88vw, 900px); max-height: 82vh; object-fit: contain; border-radius: 20px;
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.5); animation: popIn 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
  cursor: default;
}
.lightbox-close { position: absolute; top: 28px; right: 36px; color: #fff; font-size: 28px; cursor: pointer; }

@keyframes popIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Generic content card (QA / Motion / UXUI bodies) */
.content-card { background: #fff; border-radius: 24px; padding: 40px; box-shadow: 0 20px 40px -20px var(--color-shadow); }
.content-card p { font-size: 17px; line-height: 1.7; color: oklch(0.35 0.02 40); margin: 0 0 28px; }
.content-card + .content-card { margin-top: 20px; }

.helper-note { font-size: 13px; color: var(--color-text-faint); margin-top: 10px; }

/* Case study real images */
.case-figure { border-radius: 16px; overflow: hidden; margin: 16px 0; background: oklch(0.97 0.01 75); }
.case-figure img { width: 100%; height: auto; display: block; }
.case-figure:first-child { margin-top: 0; }
.case-figure:last-child { margin-bottom: 0; }

.case-figure-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; align-items: flex-start; }
.case-figure-row .case-figure { flex: 1 1 200px; margin: 0; min-width: 0; }

/* Full-bleed variant — breaks out of the content-card padding for images that need to read larger */
.case-figure-bleed { margin: 16px -40px; width: calc(100% + 80px); }
@media (max-width: 640px) {
  .case-figure-bleed { margin: 16px -28px; width: calc(100% + 56px); }
}

.section-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-title-row .section-title { margin-bottom: 0; }
.section-title-row img { width: 44px; height: auto; flex: 0 0 auto; }

/* Project grid (QA page) */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.project-card {
  background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 16px 32px -18px oklch(0.2 0.02 40 / 0.18);
  display: block; text-decoration: none; color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover, .project-card:focus-visible { transform: translateY(-6px); box-shadow: 0 22px 40px -18px oklch(0.2 0.02 40 / 0.28); }
.project-thumb {
  width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  background: oklch(0.95 0.01 75); border-bottom: 2px dashed oklch(0.85 0.02 75);
  color: var(--color-text-faint); font-size: 13px; text-align: center; padding: 12px;
  overflow: hidden;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.project-thumb:has(img) { border-bottom: none; padding: 0; background: none; }
.project-card:hover .project-thumb img { transform: scale(1.06); }
.project-body { padding: 20px; }
.project-title { font-family: var(--font-heading); font-weight: 700; font-size: 17px; color: var(--color-text); margin-bottom: 6px; }
.project-link { display: block; font-size: 14px; font-weight: 600; }

/* Page header with side image/gif (no frame) */
.page-header-flex { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-header-text { flex: 1 1 320px; min-width: 240px; }
.page-header-gif { flex: 0 0 auto; width: 200px; max-width: 100%; height: auto; display: block; }

/* Video embed */
.video-embed { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 16px; overflow: hidden; margin-top: 8px; background: oklch(0.1 0 0); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.video-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.video-grid .video-embed { margin-top: 0; }

/* Mixed-orientation video grid (vertical + horizontal clips) — fixed height
   instead of a forced aspect-ratio, so a portrait clip isn't squeezed into
   a wide box. Drive's own player centers/letterboxes inside that height. */
.video-embed-auto {
  position: relative; width: 100%; height: 480px; border-radius: 16px; overflow: hidden;
  background: oklch(0.1 0 0); display: flex; align-items: center; justify-content: center;
}
.video-embed-auto iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Home page */
.navbar { display: flex; align-items: center; justify-content: space-between; padding: 28px 48px; }
.nav-brand { font-family: var(--font-heading); font-weight: 800; font-size: 20px; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-link { text-decoration: none; font-size: 14px; font-weight: 600; color: var(--color-text); }
.nav-link:hover { text-decoration: underline; }
.btn-cv { text-decoration: none; font-size: 14px; font-weight: 700; color: #fff; background: var(--color-accent); padding: 9px 16px; border-radius: 10px; }

.hero { display: flex; align-items: center; gap: 56px; max-width: 1100px; margin: 24px auto 64px; padding: 0 48px; flex-wrap: wrap; }
.hero-text { flex: 1 1 380px; min-width: 280px; }
.hero-text h1 { font-family: var(--font-heading); font-weight: 800; font-size: 56px; line-height: 1.08; margin: 0 0 20px; }
.hero-text p { font-size: 19px; line-height: 1.6; color: oklch(0.45 0.02 40); margin: 0 0 28px; max-width: 460px; }
.hero-hint { font-size: 15px; font-weight: 600; color: var(--color-accent); }
.wave { display: inline-block; animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.hero-photo { flex: 0 0 auto; width: 260px; height: 260px; border-radius: 50%; overflow: hidden; border: 6px solid #fff; box-shadow: 0 20px 40px -12px oklch(0.2 0.02 40 / 0.25); background: oklch(0.9 0.02 75); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; max-width: 1100px; margin: 0 auto; padding: 0 48px 80px; }
.nav-card {
  text-decoration: none; color: inherit; display: block; border-radius: 28px; padding: 36px;
  position: relative; min-height: 180px; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.nav-card:hover { transform: translateY(-6px); box-shadow: 0 20px 36px -14px var(--card-glow); }
.nav-card-title { font-family: var(--font-heading); font-weight: 700; font-size: 28px; margin-bottom: 10px; }
.nav-card-desc { font-size: 16px; max-width: 280px; }
.nav-card-arrow { position: absolute; right: 32px; bottom: 28px; font-size: 24px; }

.home-footer { text-align: center; padding: 24px; font-size: 13px; color: var(--color-text-faint); }

@media (max-width: 640px) {
  .page-header { padding: 36px 24px 56px; }
  .page-header h1 { font-size: 36px; }
  .content { padding: 0 20px 60px; }
  .intro-card, .content-card { padding: 28px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: 1fr; }
  .video-embed-auto { height: 360px; }
  .navbar { padding: 20px 24px; }
  .hero { padding: 0 24px; gap: 32px; }
  .hero-text h1 { font-size: 38px; }
  .card-grid { padding: 0 24px 60px; }
}
