/* ===========================
   RESET & BASE
=========================== */

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

:root {
  --black: #111110;
  --white: #FAFAF8;
  --grey-light: #F2F1EE;
  --grey-mid: #C8C6C0;
  --grey-text: #6B6A66;
  --green: #818A4A;
  --purple: #D8CAE2;
  --blue: #749FC8;
  --yellow: #E5D9A9;
  --orange: #E9D0C2;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Rowan', Georgia, serif;
  --font-accent: 'Cutive Mono', monospace;
  --max-width: 1200px;
  --radius: 12px;
  --text-lg: 20px;
  --text-base: 18px;
  --text-sm: 16px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--black);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ===========================
   TYPOGRAPHY
=========================== */

h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 400;
}

h1, h2, h3, h4 {
  line-height: 1.15;
  margin-bottom: 8px;
}

/* Contextual heading spacing */
.section-title { margin-bottom: 64px; }
.about-text h2 { margin-bottom: 24px; }

/* Paragraph sizes */
.p-lg {
  font-size: var(--text-lg);
  line-height: 1.8;
}

.p-base {
  font-size: var(--text-base);
  line-height: 1.8;
}

.p-sm {
  font-size: var(--text-sm);
  line-height: 1.8;
}

/* Intro block — sizing via .p-lg / .p-base, these carry spacing only */
.intro-lead {
  margin-bottom: 16px;
}

.intro-body {
  margin-bottom: 64px;
  color: var(--grey-text);
}

/* Tags & labels */
.tag {
  font-family: var(--font-accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-text);
}

/* ===========================
   NAVIGATION
=========================== */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 60px;
  transition: background 0.3s, border-color 0.3s, transform 0.3s ease;
}

/* Per-theme initial nav background — matches hero */
body.theme-purple nav { background: var(--purple); }
body.theme-blue    nav { background: var(--blue); }
body.theme-yellow  nav { background: var(--yellow); }
body.theme-orange  nav { background: var(--orange); }
body.theme-sage    nav { background: #D1DCA8; }

/* Scrolled — transparent, dark text */
nav.nav--scrolled {
  background: transparent;
}

/* Hidden — slides up off screen (case study pages, scroll down) */
nav.nav--hidden {
  transform: translateY(-110%);
}

.nav-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--black);
  transition: color 0.3s;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
}

nav ul a {
  font-size: 14px;
  color: var(--black);
  opacity: .7;
  transition: color 0.3s;
}

nav ul a:hover {
  color: var(--black);
}

/* ===========================
   HERO
=========================== */

.hero {
  min-height: calc(100vh - 100px);
  display: flex;
  align-items: center;
  padding: 80px 40px;
  background: var(--green);
  color: var(--white);
  margin: 12px;
  border-radius: var(--radius);
}

.hero-inner {
  margin: 0 auto;
  width: 90%;
}

.hero-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-h1-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 80px;
  margin-bottom: 28px;
}

.hero-star {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}

.hero h1 {
  font-family: var(--font-serif);
  text-transform: uppercase;
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 600;
  line-height: 1.1;
  color: #ABDAFC;
  text-align: center;
}

.hero-arc-text {
  display: block;
  width: 100%;
  max-width: 700px;
  margin: 0 auto 8px;
  overflow: visible;
}

.hero-companies {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

/* ===========================
   BUTTONS
=========================== */

.btn {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s, transform 0.15s;
}

.btn:hover {
  background: var(--green);
  transform: translateY(-1px);
}

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

.btn--outline:hover {
  background: var(--black);
  color: var(--white);
}

.link-arrow {
  font-size: 15px;
  font-weight: 500;
  color: var(--green);
  transition: gap 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.link-arrow:hover {
  gap: 8px;
}

/* ===========================
   SECTIONS
=========================== */

.section {
  padding: 100px 40px;
}



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

.text-container {
  max-width: 800px;
  margin: 0 auto;
}

/* ===========================
   PROJECT INFO
=========================== */

.project-info .tag {
  display: inline-block;
  margin-bottom: 16px;
}

.project-info h3 {
  font-family: var(--font-serif);
  text-transform: uppercase;
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 400;
  margin-bottom: 16px;
}

.project-info p {
  margin-bottom: 16px;
  opacity: .7;
}

/* ===========================
   PROJECT GRID
=========================== */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 40px;
}

/* First card: full-width banner with side-by-side layout */
.card--first {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 360px;
}

.card--first .project-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cs-header--purple .card-image img {
  object-position: right;
}

.cs-header--blue .card-image img {
  object-position: top;
}

.cs-header--orange .card-image img {
  object-position: top;
}

.cs-header--yellow .card-image img {
  object-position: bottom;
}

.cs-header--sage .card-image img {
  object-position: top;
}

/* Last card: full-width banner with side-by-side layout */
.card--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: 300px;
}

.card--wide .project-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card--wide .card-image {
  min-height: 240px;
}

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.4s;
  display: flex;
  flex-direction: column;
}

.card:not(.card--static):hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

/* Restore side-by-side grid layout for banner cards — must come after .card to win the cascade */
.card--first,
.card--wide {
  display: grid;
}

.card-image {
  flex: 1;
  min-height: 80px;
}

.project-info {
  padding: 20px;
  flex-shrink: 0;
}

/* Stretch the link to cover the entire card */
.card .link-arrow {
  color: var(--black);
}

.card .link-arrow::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.card:not(.card--static):hover .card-image img {
  transform: scale(1.05);
}

.card .tag {
  display: block;
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--black);
  opacity: .7;
}

.card h4 {
  font-family: var(--font-serif);
  text-transform: uppercase;
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 10px;
}

.project-grid .card .project-info p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===========================
   ABOUT
=========================== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 80px;
  align-items: start;
  position: relative;
  padding: 0 40px;
}

.about-text {
  z-index: 9999;
}

.about-star-deco {
  position: absolute;
  left: calc(44.5% - 3px);
  top: 2%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  pointer-events: none;
}

.about-carousel {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--grey-mid);
  position: relative;
}

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

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

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

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--black);
  z-index: 2;
  transition: background 0.2s;
}

.carousel-btn:hover {
  background: var(--white);
}

.carousel-btn--prev { left: 12px; }
.carousel-btn--next { right: 12px; }

.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dot--active {
  background: var(--white);
  transform: scale(1.35);
}

.about-text p {
  margin-bottom: 18px;
  line-height: 1.8;
}

.about-text .p-sm {
  opacity: .7;
}

.about-text p strong {
  color: var(--black);
}

/* ===========================
   FOOTER
=========================== */

footer {
  background: var(--grey-light);
  color: var(--grey-text);
  padding: 28px 28px;
  font-size: 13px;
  margin: 12px;
  border-radius: var(--radius);
}

.footer-inner {
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--grey-text);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--black);
}

/* ===========================
   RESPONSIVE
=========================== */

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

  .card {
    max-height: 500px;
  }

  /* Wide cards revert to a normal 1-col cell in the 2×2 */
  .card--wide {
    grid-column: auto;
    display: block;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-star-deco {
    display: none;
  }

  .about-carousel {
    aspect-ratio: 4/3;
    max-width: 400px;
  }

  .text-container {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  nav {
    padding: 0 20px;
  }

  footer {
    margin: 0 8px 8px;
  }

  .hero {
    margin: 8px;
    border-radius: 8px;
  }

  nav ul {
    gap: 20px;
  }

  .hero,
  .section {
    padding: 60px 20px;
  }

  .hero h1 {
    font-size: clamp(36px, 10vw, 52px);
  }

  .hero-sub {
    font-size: 18px;
  }

  .hero-h1-wrap {
    gap: 16px;
  }

  .hero-star {
    width: 28px;
    height: 28px;
  }

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

  /* Stack first card vertically at small sizes */
  .card--first {
    display: flex;
  }

  .card--first .card-image img {
    object-position: bottom;
  }

  .about-grid {
    padding: 0;
  }
}
