/* ========== TOKENS ========== */
:root {
  --chocolate-cosmos: #5E1823;
  --ivory: #FFFDEF;
  --goldilocks: #F9C379;
  --frozenwater: #BCD6BD;
  --onyx: #0E0E2C;
  --onyx-light: #3E3E56;
  --paper: #f6efe4;
  --panel: rgba(255, 255, 255, 0.42);
  --line: rgba(23, 27, 44, 0.14);
  --shadow: rgba(25, 19, 21, 0.12);
  --font-heading: 'Cormorant SC', Georgia, serif;
  --font-body: 'EB Garamond', Georgia, serif;

  --radius: 6px;
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

/* ========== BASE ========== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--onyx);
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.6;
}

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

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.8rem, 7vw, 5.2rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; letter-spacing: 0.05em; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(64px, 10vw, 120px); }
.section--tint { background: var(--panel); }

.section--dark {
  background: var(--chocolate-cosmos);
  color: var(--ivory);
}
.section--dark .eyebrow { color: var(--goldilocks); }
.section--dark .card p { color: rgba(255, 253, 239, 0.75); }
.section--dark .lead { color: rgba(255, 253, 239, 0.85); }
.section--dark .feature { border-top-color: rgba(255, 253, 239, 0.2); }
.section--dark .feature__num { color: var(--goldilocks); }
.section--dark .feature p { color: rgba(255, 253, 239, 0.75); }

.section--dark .btn--dark {
  background: var(--ivory);
  border-color: var(--ivory);
  color: var(--chocolate-cosmos);
}
.section--dark .btn--dark:hover {
  background: var(--goldilocks);
  border-color: var(--goldilocks);
}
.section--dark .btn--outline {
  border-color: var(--ivory);
  color: var(--ivory);
}
.section--dark .btn--outline:hover {
  background: var(--ivory);
  color: var(--chocolate-cosmos);
}

.eyebrow {
  font-family: var(--font-heading);
  letter-spacing: 0.15em;
  color: var(--chocolate-cosmos);
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.3rem;
  color: var(--onyx-light);
  max-width: 34ch;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-block;
  padding: 0.7em 1.6em;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  border: 1px solid var(--onyx);
  transition: background 0.2s, color 0.2s;
}
.btn--dark { background: var(--onyx); color: var(--ivory); }
.btn--dark:hover { background: var(--chocolate-cosmos); border-color: var(--chocolate-cosmos); }
.btn--outline { background: transparent; color: var(--onyx); }
.btn--outline:hover { background: var(--onyx); color: var(--ivory); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.btn-row--center { justify-content: center; margin-top: 3rem; }

.link-arrow {
  font-family: var(--font-heading);
  text-decoration: none;
  color: var(--chocolate-cosmos);
}
.link-arrow:hover { text-decoration: underline; }

/* ========== NAV ========== */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 239, 228, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.nav__logo {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 600;
  text-decoration: none;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--onyx);
}

.brand-mark {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}

.brand-block:hover .brand-name { color: var(--chocolate-cosmos); }

.nav__menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav__menu > a:not(.btn),
.dropdown__toggle {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--onyx);
}
.nav__menu > a:not(.btn):hover,
.dropdown__toggle:hover { color: var(--chocolate-cosmos); }

.nav__cta { font-size: 1rem; padding: 0.5em 1.3em; }

.caret { font-size: 0.7em; }

.dropdown { position: relative; }

.dropdown__list {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 170px;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 0;
  box-shadow: 0 10px 30px var(--shadow);
}
.dropdown.is-open .dropdown__list { display: block; }

.dropdown__list a {
  display: block;
  padding: 8px 18px;
  text-decoration: none;
}
.dropdown__list a:hover { background: var(--panel); }

.nav__toggle {
  display: none;
  background: none;
  border: 0;
  width: 36px;
  height: 36px;
  cursor: pointer;
  padding: 0;
}
.nav__toggle span {
  display: block;
  height: 1.5px;
  background: var(--onyx);
  margin: 7px 4px;
  transition: transform 0.2s;
}
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ========== HERO ========== */
.hero { padding-block: clamp(56px, 9vw, 110px); }

.hero__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
}

.tags {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tags li {
  font-family: var(--font-heading);
  padding: 0.25em 1em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--onyx-light);
}

.intro-portrait {
  display: flex;
  justify-content: center;
}

.intro-portrait img {
  width: 440px;
  max-width: 100%;
  border-radius: 28px;
  box-shadow: 0 26px 60px var(--shadow);
}

/* ========== PLACEHOLDERS (swap for <img>) ========== */
.placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #e4dbcd, #d4c7b4);
  border-radius: var(--radius);
  color: var(--onyx-light);
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
}
.placeholder--phone {
  aspect-ratio: 9 / 16;
  max-width: 320px;
  margin-inline: auto;
  border-radius: 36px;
  border: 10px solid var(--onyx);
}
.placeholder--card { aspect-ratio: 4 / 3; margin-bottom: 1.2rem; }
.placeholder--wide { aspect-ratio: 16 / 9; margin-bottom: 1.2rem; }

/* ========== CARDS ========== */
.card-grid {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
  margin-top: 3rem;
}
.card-grid--4 { grid-template-columns: repeat(4, 1fr); }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }

.card p { color: var(--onyx-light); }

.meta {
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  color: var(--chocolate-cosmos);
  margin-bottom: 0.3rem;
}

/* ========== TESTIMONIALS ========== */
.quote {
  margin: 0;
  padding: 2rem;
  background: var(--ivory);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}
.quote blockquote {
  margin: 0;
  font-style: italic;
  font-size: 1.2rem;
}
.quote figcaption { display: flex; flex-direction: column; }
.quote figcaption span { color: var(--onyx-light); font-size: 1rem; }

/* ========== FOOTER ========== */
.footer {
  background: var(--chocolate-cosmos);
  color: var(--paper);
  padding-block: 72px 32px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 32px;
}
.footer__grid a:not(.brand-block) {
  display: block;
  text-decoration: none;
  color: rgba(255, 253, 239, 0.7);
  margin-bottom: 0.4rem;
}
.footer__grid a:hover { color: var(--ivory); }

.footer__col--right { text-align: right; }

.footer .brand-block { color: var(--ivory); }
.footer .brand-block:hover .brand-name { color: var(--goldilocks); }

.footer__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--goldilocks);
  font-size: 1rem;
  color: rgba(255, 253, 239, 0.7);
}
.footer__bottom p { margin: 0; }

.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.socials a { text-decoration: none; }
.socials a:hover { color: var(--ivory); }

/* ========== PROJECT PAGE ========== */
.project-hero { padding-block: clamp(48px, 8vw, 96px) 0; }
.project-hero .link-arrow { display: inline-block; margin-bottom: 2rem; }
.project-hero .lead { max-width: 46ch; }
.project-hero--spaced { padding-bottom: clamp(24px, 4vw, 48px); }
.hero__text .lead { max-width: none; }

.project-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 3rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.project-meta dt {
  font-family: var(--font-heading);
  letter-spacing: 0.1em;
  color: var(--chocolate-cosmos);
}
.project-meta dd { margin: 0; }

.placeholder--cover { aspect-ratio: 16 / 8; }
.placeholder--square { aspect-ratio: 1; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
  margin-top: 3rem;
}
.feature {
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.feature__num {
  display: block;
  font-family: var(--font-heading);
  color: var(--chocolate-cosmos);
  margin-bottom: 0.6rem;
}
.feature p { color: var(--onyx-light); }

/* Project blocks as links (only those with an href react on hover) */
a.feature {
  display: block;
  text-decoration: none;
  color: inherit;
}
a.feature .placeholder,
a.feature img { transition: transform 0.3s, box-shadow 0.3s; }
a.feature h3 { transition: color 0.2s; }

a.feature[href]:hover .placeholder,
a.feature[href]:hover img {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px var(--shadow);
}
a.feature[href]:hover h3 { color: var(--chocolate-cosmos); }
.section--dark a.feature[href]:hover h3 { color: var(--goldilocks); }
a.feature[href]:focus-visible {
  outline: 2px solid var(--goldilocks);
  outline-offset: 6px;
}

/* Space above the line matches the space between the line and the image (1.2rem) */
.section--projects { padding-top: 1.2rem; }
.section--projects .feature-grid { margin-top: 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 3rem;
}

.gallery--mosaic {
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: repeat(2, minmax(180px, 22vw));
}
.gallery--mosaic > :first-child { grid-row: span 2; }
.gallery--mosaic > :last-child { grid-column: span 2; }

/* ========== CAROUSEL ========== */
.carousel {
  overflow: hidden;
  margin-top: 3rem;
}

.carousel__track {
  display: flex;
  width: max-content;
  animation: carousel-scroll 45s linear infinite;
}
.carousel:hover .carousel__track { animation-play-state: paused; }

/* Each mosaic is one panel; padding-right matches the 16px gap between images */
.carousel .gallery--mosaic {
  flex: 0 0 auto;
  width: min(760px, 85vw);
  margin: 0;
  padding-right: 16px;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: repeat(2, clamp(130px, 18vw, 210px));
}
.carousel .gallery--mosaic > :first-child { grid-row: span 2; grid-column: auto; }

/* Collaborators: circular logos/photos with caption */
.carousel--collab .carousel__track { animation-duration: 40s; }

.collab {
  flex: 0 0 auto;
  width: 200px;
  margin: 0;
  padding-right: 32px; /* space between circles, keeps the loop seamless */
  text-align: center;
}
.collab__photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--ivory);
}
.collab figcaption { margin-top: 0.9rem; line-height: 1.3; }
.collab figcaption strong { display: block; font-weight: 600; }
.collab__year {
  display: block;
  font-size: 0.95rem;
  color: var(--onyx-light);
}

@keyframes carousel-scroll {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .carousel { overflow-x: auto; }
  .carousel__track { animation: none; }
}

.split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: end;
  gap: 32px;
  margin-bottom: 3rem;
}

.next-project {
  border-top: 1px solid var(--line);
}
.next-project__link {
  display: block;
  padding-block: clamp(48px, 8vw, 96px);
  text-decoration: none;
}
.next-project__title {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.6rem);
  transition: color 0.2s;
}
.next-project__link:hover .next-project__title { color: var(--chocolate-cosmos); }

/* ========== CASE STUDY ========== */
/* Label on the left, content on the right */
.cs-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 2.4fr;
  gap: clamp(24px, 5vw, 72px);
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
}
.cs-row:first-child { border-top: 0; padding-top: 0; }
.cs-row h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

.cs-text { max-width: 62ch; }
.cs-text p { color: var(--onyx-light); }

.cs-list {
  margin: 0 0 1em;
  padding-left: 1.2em;
  color: var(--onyx-light);
}
.cs-list li { margin-bottom: 0.4em; }

/* Text with a small photo beside it */
.cs-media {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  align-items: start;
  gap: clamp(20px, 4vw, 48px);
}
.cs-media--reverse .cs-figure { order: -1; }

.cs-figure { margin: 0; }
.cs-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--onyx-light);
}

.placeholder--small { aspect-ratio: 4 / 3; }
.placeholder--thumb { aspect-ratio: 1; }

/* Row of small photos */
.cs-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 1.5rem;
}

/* Numbered insights, text only */
.cs-insights {
  list-style: none;
  counter-reset: insight;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 48px;
  margin: 3rem 0 0;
  padding: 0;
}
.cs-insights--3 { grid-template-columns: repeat(3, 1fr); gap: 32px; }
.cs-insights li {
  counter-increment: insight;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.cs-insights li::before {
  content: counter(insight, decimal-leading-zero);
  display: block;
  font-family: var(--font-heading);
  color: var(--chocolate-cosmos);
  margin-bottom: 0.4rem;
}
.cs-insights p { color: var(--onyx-light); }

/* Key numbers */
.cs-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 3rem;
}
.cs-stats__num {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1;
  margin-bottom: 0.6rem;
}
.section--dark .cs-stats p { color: rgba(255, 253, 239, 0.75); }

.cs-quote {
  margin: 0 0 1.5rem;
  padding-left: 1.2rem;
  border-left: 2px solid var(--chocolate-cosmos);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--onyx);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
  .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .card-grid--3 { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .cs-insights--3 { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .project-meta { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: repeat(3, 1fr); }
  .footer__grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .nav__toggle { display: block; }

  .nav__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 24px var(--gutter) 32px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .nav__menu.is-open { display: flex; }

  .dropdown__list {
    position: static;
    transform: none;
    box-shadow: none;
    margin-top: 8px;
  }

  .hero__grid,
  .split,
  .cs-row,
  .cs-media,
  .cs-insights,
  .cs-stats,
  .card-grid--2 { grid-template-columns: 1fr; }

  .cs-row { gap: 12px; }
  .cs-media--reverse .cs-figure { order: 0; }

  .gallery--mosaic {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    grid-auto-rows: 160px;
  }
  .gallery--mosaic > :first-child { grid-row: span 1; grid-column: span 2; }
}

@media (max-width: 480px) {
  .card-grid--4,
  .feature-grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
