/* ===========================================
   Navigation
   =========================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding-top: env(safe-area-inset-top, 0px);
  min-height: var(--nav-offset);
  height: auto;
  box-sizing: border-box;
  background-color: rgba(250, 250, 248, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  transition: box-shadow var(--transition);
}

.nav--scrolled {
  box-shadow: 0 1px 0 var(--color-border);
}

.nav__container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 max(var(--space-6), env(safe-area-inset-right, 0px))
    0 max(var(--space-6), env(safe-area-inset-left, 0px));
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: 0.05em;
  color: var(--color-text);
  transition: opacity var(--transition);
}

.nav__logo:hover {
  opacity: 0.7;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav__links a {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  transition: color var(--transition);
  position: relative;
  padding-bottom: 2px;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: width var(--transition);
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--color-text);
}

.nav__links a.active::after,
.nav__links a:hover::after {
  width: 100%;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-2);
  margin-right: calc(-1 * var(--space-2));
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav__toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===========================================
   Mobile Navigation
   =========================================== */

@media (max-width: 768px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    width: min(320px, 86vw);
    max-width: calc(100vw - var(--space-6));
    background-color: var(--color-bg);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    /* Keep menu compact: start after status bar only (not nav height) */
    padding-top: calc(env(safe-area-inset-top, 0px) + var(--space-6));
    padding-left: var(--space-6);
    padding-right: max(var(--space-6), env(safe-area-inset-right, 0px));
    padding-bottom: max(var(--space-6), env(safe-area-inset-bottom, 0px));
    gap: var(--space-2);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    overscroll-behavior: none;
    z-index: 1001;
  }

  .nav__links.open {
    transform: translateX(0);
  }

  .nav__links a {
    font-size: var(--text-base);
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
  }

  .nav__links li:last-child a {
    border-bottom: none;
  }

  .nav__container {
    padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
    padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
  }
}

/* ===========================================
   Hero Section
   =========================================== */

.hero {
  min-height: calc(85vh - var(--nav-offset));
  display: flex;
  align-items: center;
  padding-top: var(--nav-offset);
}

.hero__container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-16) max(var(--space-6), env(safe-area-inset-left, 0px))
    var(--space-16) max(var(--space-6), env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: var(--space-16);
  width: 100%;
}

.hero__photo {
  flex-shrink: 0;
}

.hero__photo-img {
  display: block;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  border: 3px solid var(--color-border);
  background-color: var(--color-surface);
}

.hero__photo-placeholder {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background-color: var(--color-surface);
  border: 3px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-5xl);
  color: var(--color-text-secondary);
  font-weight: var(--weight-bold);
}

.hero__content {
  flex: 1;
}

.hero__greeting {
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}

.hero__tagline {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  font-weight: var(--weight-normal);
  font-style: italic;
  margin-bottom: var(--space-6);
}

.hero__description {
  font-size: var(--text-lg);
  max-width: 520px;
  margin-bottom: var(--space-6);
}

/* Homepage: shorter hero, no duplicate nav CTAs */
.hero--compact {
  min-height: auto;
  align-items: center;
}

.hero--compact .hero__container {
  padding-top: var(--space-8);
  padding-bottom: var(--space-10);
  gap: var(--space-10);
  align-items: center;
}

.hero--compact .hero__photo-img,
.hero--compact .hero__photo-placeholder {
  width: 180px;
  height: 180px;
}

.hero--compact .hero__content {
  min-width: 0;
  max-width: min(40rem, 100%);
}

.hero--compact .hero__greeting {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
  line-height: 1.15;
}

/* Long credential lines read better upright + slightly smaller than body */
.hero--compact .hero__credentials {
  font-style: normal;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-5);
  letter-spacing: 0.01em;
}

.hero--compact .hero__credentials-line {
  display: block;
}

.hero--compact .hero__credentials-line + .hero__credentials-line {
  margin-top: 0.35em;
}

.hero--compact .hero__description {
  font-size: var(--text-lg);
  line-height: 1.75;
  margin-bottom: 0;
  max-width: none;
  color: var(--color-text);
}

/* Equal-weight hero CTAs (Option 1 + 2 merge) */
.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-2);
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-accent);
  padding: var(--space-2) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: transparent;
  transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}

.hero__cta:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-hover);
  background-color: rgba(59, 89, 152, 0.04);
}

.hero__cta .arrow {
  transition: transform var(--transition);
}

.hero__cta:hover .arrow {
  transform: translateX(3px);
}

@media (max-width: 768px) {
  .hero {
    min-height: auto;
  }

  .hero__container {
    flex-direction: column;
    text-align: center;
    padding: var(--space-12) max(var(--space-4), env(safe-area-inset-left, 0px))
      var(--space-12) max(var(--space-4), env(safe-area-inset-right, 0px));
    gap: var(--space-8);
  }

  .hero__photo-img,
  .hero__photo-placeholder {
    width: 160px;
    height: 160px;
  }

  .hero__greeting {
    font-size: var(--text-3xl);
  }

  .hero__tagline {
    font-size: var(--text-lg);
  }

  .hero__description {
    font-size: var(--text-base);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero__cta-row {
    justify-content: center;
    gap: var(--space-3);
  }

  .hero--compact .hero__container {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
    gap: var(--space-6);
    align-items: center;
  }

  .hero--compact .hero__content {
    max-width: 100%;
  }

  .hero--compact .hero__credentials {
    font-size: var(--text-sm);
  }

  .hero--compact .hero__description {
    font-size: var(--text-base);
    line-height: 1.7;
  }
}

@media (max-width: 480px) {
  .hero--compact .hero__photo-img,
  .hero--compact .hero__photo-placeholder {
    width: 140px;
    height: 140px;
  }

  .hero--compact .hero__greeting {
    font-size: var(--text-2xl);
  }
}

/* ===========================================
   Home: CV + Contact strip (Option 2)
   =========================================== */

.home-about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  max-width: 900px;
  margin: 0 auto;
}

.home-about-card {
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-white);
  transition: box-shadow var(--transition);
}

.home-about-card:hover {
  box-shadow: var(--shadow-md);
}

.home-about-card .section-label {
  margin-bottom: var(--space-3);
}

.home-about-card__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.home-about-card__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-5);
}

@media (max-width: 768px) {
  .home-about-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================================
   Buttons
   =========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-6);
  min-height: 44px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.btn--primary:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn--outline:hover {
  background-color: var(--color-accent);
  color: var(--color-white);
  transform: translateY(-1px);
}

.btn--ghost {
  color: var(--color-accent);
  padding: var(--space-2) 0;
}

.btn--ghost:hover {
  color: var(--color-accent-hover);
}

.btn--ghost .arrow {
  transition: transform var(--transition);
}

.btn--ghost:hover .arrow {
  transform: translateX(4px);
}

/* ===========================================
   Section Header
   =========================================== */

.section-header {
  margin-bottom: var(--space-12);
}

.section-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
}

/* ===========================================
   Project Cards
   =========================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.project-card {
  display: block;
  color: inherit;
  text-decoration: none;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.project-card__thumbnail {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-card__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Portrait covers: anchor crop to top (e.g. character header, year, stats) */
.project-card__thumbnail--cover-top img {
  object-position: top center;
}

.project-card__thumbnail-placeholder {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  opacity: 0.5;
}

.project-card__thumbnail--badged {
  position: relative;
}

.project-card__thumbnail-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 1;
  margin: 0;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  pointer-events: none;
}

.project-card__body {
  padding: var(--space-6);
}

.project-card__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.project-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.project-card__link {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transition: color var(--transition);
}

.project-card__link:hover {
  color: var(--color-accent-hover);
}

@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Home featured work: four equal-width columns; minmax(0,1fr) avoids overflow skew */
.projects-grid.projects-grid--home-featured {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.projects-grid.projects-grid--home-featured > .project-card {
  min-width: 0;
  width: 100%;
}

@media (max-width: 1024px) {
  .projects-grid.projects-grid--home-featured {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .projects-grid.projects-grid--home-featured {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===========================================
   Tags / Pills
   =========================================== */

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  background-color: var(--color-bg);
  white-space: nowrap;
}

.tag--accent {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background-color: rgba(59, 89, 152, 0.05);
}

/* ===========================================
   Photography Teaser (Home Page)
   =========================================== */

.photo-teaser-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.photo-teaser-item {
  aspect-ratio: 1;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition);
}

.photo-teaser-item:hover {
  transform: scale(1.03);
}

.photo-teaser-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 600px) {
  .photo-teaser-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===========================================
   Photography Page - Highlight Grid
   =========================================== */

.photo-highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  align-items: start;
}

/* Masonry-style gallery: fills vertical space without grid “row hole” gaps */
.photo-highlight-grid--masonry {
  display: block;
  width: 100%;
  column-count: 4;
  column-gap: var(--space-5);
}

.photo-highlight-grid--masonry .photo-highlight-item {
  display: block;
  width: 100%;
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: var(--space-5);
}

@media (max-width: 1024px) {
  .photo-highlight-grid--masonry {
    column-count: 3;
  }
}

@media (max-width: 768px) {
  .photo-highlight-grid--masonry {
    column-count: 2;
    column-gap: var(--space-4);
  }

  .photo-highlight-grid--masonry .photo-highlight-item {
    margin-bottom: var(--space-4);
  }
}

@media (max-width: 480px) {
  .photo-highlight-grid--masonry {
    column-count: 1;
  }
}

.photo-highlight-item {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition);
  cursor: pointer;
  display: block;
}

.photo-highlight-item:hover {
  transform: scale(1.02);
}

.photo-highlight-item--wide {
  grid-column: span 2;
}

/* Natural image aspect ratio (no forced crop) */
.photo-highlight-item img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .photo-highlight-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .photo-highlight-item--wide {
    grid-column: span 2;
  }
}

@media (max-width: 480px) {
  .photo-highlight-grid {
    grid-template-columns: 1fr;
  }

  .photo-highlight-item--wide {
    grid-column: span 1;
  }
}

/* ===========================================
   Photography Page - Album Cards
   =========================================== */

.album-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

/* Exactly three albums: balanced row on desktop */
.album-grid--three {
  grid-template-columns: repeat(3, 1fr);
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

/* Five albums: single row on desktop (Home page) */
.album-grid--five {
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-5);
}

.album-card {
  display: block;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}

.album-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.album-card__cover {
  aspect-ratio: 4 / 3;
  background-color: var(--color-surface);
  overflow: hidden;
}

.album-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.album-card:hover .album-card__cover img {
  transform: scale(1.05);
}

.album-card__info {
  padding: var(--space-4) var(--space-5);
}

.album-card__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.album-card__meta {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

@media (max-width: 1024px) {
  .album-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .album-grid--three {
    grid-template-columns: repeat(3, 1fr);
    max-width: none;
  }

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

@media (max-width: 768px) {
  .album-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .album-grid--three {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .album-grid--five {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
}

@media (max-width: 480px) {
  .album-grid {
    grid-template-columns: 1fr;
  }

  .album-grid--three {
    max-width: none;
  }
}

/* ===========================================
   Project detail pages
   =========================================== */

.project-detail {
  padding-top: calc(var(--nav-offset) + var(--space-8));
  padding-bottom: var(--space-16);
}

.project-detail__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
  transition: color var(--transition);
}

.project-detail__back:hover {
  color: var(--color-accent);
}

.project-detail__header {
  margin-bottom: var(--space-12);
  max-width: 720px;
}

.project-detail__title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
}

.project-detail__lead {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.project-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.project-detail__section {
  margin-bottom: var(--space-12);
  max-width: 720px;
  /* Ensure anchored TOC links land with section heading visible below sticky nav */
  scroll-margin-top: calc(var(--nav-offset) + var(--space-6));
}

.project-detail__section h2 {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.project-detail__section p {
  margin-bottom: var(--space-4);
}

.project-detail__section p:last-child {
  margin-bottom: 0;
}

.project-detail__section ul {
  margin: var(--space-4) 0;
  padding-left: var(--space-6);
  list-style: disc;
  color: var(--color-text-secondary);
}

.project-detail__section li {
  margin-bottom: var(--space-2);
}

.project-detail__shots {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  max-width: 900px;
  margin-top: var(--space-6);
}

.project-detail__shots--compact {
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.project-detail__shot {
  margin: 0;
}

.project-detail__shot img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

/* Screenshots: avoid huge empty letterboxing from wrong intrinsic aspect ratio */
.project-detail__shot--screenshot img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  object-position: top center;
  background-color: var(--color-surface);
}

.project-detail__caption {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
}

.project-detail__placeholder {
  aspect-ratio: 16 / 10;
  background-color: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.project-detail__log-example {
  margin-top: var(--space-4);
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.55;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text);
}

.project-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

/* Responsive video embeds (YouTube, etc.) */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin-top: var(--space-4);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background-color: var(--color-text);
  aspect-ratio: 16 / 9;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Responsive embeds (Flickr album player, etc.) */
.embed-responsive {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin-top: var(--space-4);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background-color: var(--color-white);
  aspect-ratio: 16 / 9;
}

.embed-responsive iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .project-detail__title {
    font-size: var(--text-3xl);
  }

  .project-detail__shot--screenshot img {
    max-height: min(520px, 70vh);
  }
}

@media (max-width: 480px) {
  .project-detail__title {
    font-size: var(--text-2xl);
  }
}

/* ===========================================
   CV / Timeline
   =========================================== */

.cv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

.page-header .text-secondary a {
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .cv-header {
    flex-direction: column;
    align-items: stretch;
  }

  .cv-header .btn {
    width: 100%;
    justify-content: center;
  }
}

.cv-section {
  margin-bottom: var(--space-16);
}

.cv-section__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-8);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.cv-section__label::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--color-border);
}

.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background-color: var(--color-border);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-10);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-8) + 1px);
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--color-accent);
  border: 2px solid var(--color-bg);
}

.timeline__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
}

.timeline__meta {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.timeline__description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  max-width: 600px;
}

/* CV bullets (match PDF-style bullet points) */
ul.timeline__description {
  list-style: disc;
  padding-left: var(--space-6);
  margin: 0;
}

ul.timeline__description li {
  margin-bottom: var(--space-2);
}

ul.timeline__description li:last-child {
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .timeline {
    padding-left: var(--space-6);
  }

  .timeline::before {
    left: 3px;
  }

  .timeline__item::before {
    left: calc(-1 * var(--space-6) + 1px);
  }
}

/* ===========================================
   Skills Grid
   =========================================== */

.skills-group {
  margin-bottom: var(--space-6);
}

.skills-group__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.skills-group__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ===========================================
   Contact Page
   =========================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: start;
}

.contact-form-embed {
  width: 100%;
  max-width: 640px;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.contact-form-embed iframe {
  display: block;
  width: 100%;
  max-width: 640px;
  min-width: 0;
  height: 675px;
  border: 0;
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.1);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-info {
  padding-top: var(--space-2);
}

.contact-info--solo {
  max-width: 28rem;
  margin: 0 auto;
}

.contact-info__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-6);
}

.contact-info__item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.contact-info__item:last-child {
  border-bottom: none;
}

.contact-info__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info__icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
}

.contact-info__text {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.contact-info__text a {
  color: var(--color-accent);
  transition: color var(--transition);
}

.contact-info__text a:hover {
  color: var(--color-accent-hover);
}

.contact-info__label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .contact-form-embed iframe {
    height: 780px;
  }
}

@media (max-width: 480px) {
  .contact-form-embed iframe {
    height: 860px;
  }
}

/* ===========================================
   Footer
   =========================================== */

.footer {
  padding: var(--space-12) 0 max(var(--space-12), env(safe-area-inset-bottom, 0px));
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.footer__socials {
  display: flex;
  justify-content: center;
  gap: var(--space-5);
  margin-bottom: var(--space-4);
}

.footer__socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  transition: color var(--transition), background-color var(--transition);
}

.footer__socials a:hover {
  color: var(--color-accent);
  background-color: var(--color-surface);
}

.footer__socials svg {
  width: 20px;
  height: 20px;
}

.footer__copy {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* ===========================================
   Page Header (for inner pages)
   =========================================== */

.page-header {
  padding-top: calc(var(--nav-offset) + var(--space-16));
  padding-bottom: var(--space-8);
}

.page-header__title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-3);
}

.page-header__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  font-style: italic;
  max-width: 600px;
}

@media (max-width: 768px) {
  .page-header {
    padding-top: calc(var(--nav-offset) + var(--space-10));
  }

  .page-header__title {
    font-size: var(--text-3xl);
  }
}

/* ===========================================
   Link Arrow Animation
   =========================================== */

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-medium);
  color: var(--color-accent);
  font-size: var(--text-sm);
  transition: color var(--transition);
}

.link-arrow:hover {
  color: var(--color-accent-hover);
}

.link-arrow .arrow {
  transition: transform var(--transition);
}

.link-arrow:hover .arrow {
  transform: translateX(4px);
}

/* ===========================================
   Mobile Overlay
   =========================================== */

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.nav-overlay.active {
  display: block;
  opacity: 1;
  touch-action: none;
}
