*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #1a1a1a;
  --text: #fff;
  --text-muted: #999;
  --max-width: 1500px;
  --side-pad: 40px;
}

body {
  font-family:
    "Roboto Flex",
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    Helvetica,
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  opacity: 0.7;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px var(--side-pad);
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-title {
  font-size: 18px;
  font-weight: 400;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13px;
  font-weight: 400;
}

.site-nav a {
  color: var(--text);
  transition: opacity 0.2s;
}

.site-nav a:hover {
  opacity: 0.7;
  color: var(--text);
}

.site-nav a.active {
  color: var(--text);
}

.header-social {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 12px;
}

.header-social a {
  display: flex;
  align-items: center;
  color: var(--text);
  transition: opacity 0.2s;
}

.header-social a:hover {
  opacity: 0.7;
}

.header-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

/* Project Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 60px var(--side-pad) 60px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.project-card {
  display: block;
}

.project-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  transition: opacity 0.3s;
}

.project-card:hover img {
  opacity: 0.85;
}

.project-card .project-title {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 400;
}

/* Work Detail Page */
.work-detail {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px var(--side-pad) 0;
}

/* Hero section: title+desc left, image right */
.work-hero {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 80px;
  align-items: start;
  margin-bottom: 80px;
}

.work-hero .hero-text h2 {
  font-size: 38px;
  font-weight: 400;
  margin-bottom: 24px;
  line-height: 1.2;
}

.work-hero .hero-text .description {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
}

.work-hero .hero-image-wrap {
  width: 100%;
}

/* Alternating two-column sections */
.work-section {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 80px;
  align-items: start;
  margin-bottom: 80px;
}

.work-section:nth-child(even) {
  grid-template-columns: 3fr 2fr;
}

.work-section:nth-child(even) .section-image {
  order: -1;
}

.work-section h4 {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 16px;
}

.work-section .section-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}

.work-section .section-image img,
.work-hero .hero-image-wrap img {
  width: 100%;
}

/* Full-width image sections (no text) */
.work-images-full {
  max-width: 700px;
  margin: 0 auto 80px;
}

/* Prev/Next Navigation */
.work-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #333;
  padding: 40px var(--side-pad);
  max-width: var(--max-width);
  margin: 0 auto;
}

.work-pagination a {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  transition: color 0.2s;
  font-size: 14px;
}

.work-pagination a:hover {
  color: var(--text);
  opacity: 1;
}

.work-pagination .pagination-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.work-pagination .pagination-title {
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
}

.work-pagination .pagination-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.work-pagination .pagination-next .pagination-text {
  text-align: right;
}

.work-pagination svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  flex-shrink: 0;
}

/* Carousel */
.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  position: relative;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.carousel-slide.active {
  position: relative;
  opacity: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.carousel:hover .carousel-btn {
  opacity: 0.8;
}

.carousel-btn:hover {
  opacity: 1 !important;
}

.carousel-prev {
  left: 12px;
}

.carousel-next {
  right: 12px;
}

/* About Page */
.about-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px var(--side-pad) 80px;
  text-align: center;
}

.about-page .portrait {
  max-width: 500px;
  width: 100%;
  object-fit: contain;
  margin: 0 auto 40px;
}

.about-page .bio {
  font-size: 20px;
  line-height: 1.6;
  font-weight: 400;
  margin-bottom: 32px;
}

.about-page .cta {
  display: inline-block;
  font-size: 14px;
  color: var(--text);
  border: 1px solid var(--text);
  border-radius: 999px;
  padding: 12px 28px;
  transition:
    background 0.2s,
    color 0.2s;
}

.about-page .cta:hover {
  background: var(--text);
  color: var(--bg);
  opacity: 1;
}

/* Journal Page */
.journal-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px var(--side-pad) 80px;
}

.journal-page h2 {
  font-size: 24px;
  margin-bottom: 40px;
}

.journal-empty {
  color: var(--text-muted);
  font-size: 15px;
}

/* Responsive */
@media (max-width: 900px) {
  :root {
    --side-pad: 24px;
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .work-hero {
    grid-template-columns: 1fr;
  }

  .work-section,
  .work-section:nth-child(even) {
    grid-template-columns: 1fr;
  }

  .work-section:nth-child(even) .section-image {
    order: 0;
  }

  .work-pagination {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  .work-pagination .pagination-next .pagination-text {
    text-align: center;
  }
}

@media (max-width: 600px) {
  .site-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    gap: 32px;
    font-size: 20px;
    z-index: 100;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
    z-index: 101;
  }

  .header-social {
    display: none;
  }

  .site-nav.open .header-social {
    display: flex;
    justify-content: center;
  }

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