@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500&family=Space+Mono:wght@400;700&display=swap');

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

:root {
  --ink: #111111;
  --paper: #ffffff;
  --line: #e4e4e4;
  --muted: #6b6b6b;
  --header-font: 'Oswald', sans-serif;
  --body-font: 'Space Mono', monospace;
  --max-width: 1720px;
  --gutter: 45px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body-font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px var(--gutter) 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-title {
  font-family: var(--header-font);
  font-weight: 300;
  font-size: 1.9rem;
  letter-spacing: 0.02em;
}

.site-title a {
  display: block;
}

.site-nav {
  font-family: var(--header-font);
  font-weight: 300;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.site-nav a {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

.site-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.site-social svg {
  width: 100%;
  height: 100%;
  fill: var(--ink);
}

/* ---------- Homepage grid ---------- */

.portfolio-grid {
  max-width: var(--max-width);
  margin: 40px auto 120px;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 60px;
  row-gap: 70px;
}

.grid-item {
  display: block;
}

.grid-item figure {
  overflow: hidden;
}

.grid-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease;
}

.grid-item:hover img {
  transform: scale(1.02);
}

.grid-item h2 {
  font-family: var(--header-font);
  font-weight: 300;
  font-size: 1.3rem;
  margin-top: 18px;
  letter-spacing: 0.01em;
  max-width: 95%;
}

@media (max-width: 1100px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 50px;
    row-gap: 60px;
  }
}

@media (max-width: 800px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    row-gap: 60px;
  }
  .site-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    padding-top: 30px;
  }
  .site-nav {
    order: 3;
  }
}

/* ---------- Project detail page ---------- */

.project-title {
  font-family: var(--header-font);
  font-weight: 300;
  font-size: 2rem;
  text-align: center;
  line-height: 1.25;
  max-width: 1100px;
  margin: 20px auto 30px;
  padding: 0 var(--gutter);
}

.project-body {
  max-width: 800px;
  margin: 0 auto 90px;
  padding: 0 var(--gutter);
  font-family: var(--body-font);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--muted);
}

.project-body p {
  margin-bottom: 1.6em;
}

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

/* ---------- Carousel ---------- */

.carousel {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto 40px;
  padding: 0 var(--gutter);
}

.carousel-track-wrap {
  position: relative;
  overflow: hidden;
  height: 68vh;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease;
}

.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px;
  z-index: 2;
}

.carousel-arrow svg {
  width: 28px;
  height: 28px;
  stroke: var(--ink);
}

.carousel-arrow.prev {
  left: 5px;
}

.carousel-arrow.next {
  right: 5px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.carousel-dots button {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  background: var(--line);
  cursor: pointer;
  padding: 0;
}

.carousel-dots button.active {
  background: var(--ink);
}

@media (max-width: 800px) {
  .project-title {
    font-size: 1.5rem;
    margin: 25px auto 20px;
  }
  .carousel-track-wrap {
    height: 50vh;
  }
  .project-body {
    font-size: 0.8rem;
  }
}

/* ---------- Placeholder / coming soon ---------- */

.coming-soon {
  max-width: var(--max-width);
  margin: 0 auto 140px;
  padding: 0 var(--gutter);
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- Project prev/next nav ---------- */

.project-nav {
  max-width: var(--max-width);
  margin: 0 auto 100px;
  padding: 0 var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  font-family: var(--header-font);
  font-weight: 300;
  font-size: 1.4rem;
}

.project-nav a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.project-nav .prev-link {
  text-align: left;
}

.project-nav .next-link {
  text-align: right;
  margin-left: auto;
  flex-direction: row-reverse;
}

.project-nav svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink);
  flex-shrink: 0;
  margin-top: 0.3em;
}

@media (max-width: 800px) {
  .project-nav {
    font-size: 1.1rem;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  justify-content: center;
  padding: 40px var(--gutter) 80px;
}

.site-footer a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.site-footer svg {
  width: 100%;
  height: 100%;
  fill: var(--ink);
}
