/* Earth tone palette */
:root {
  --color-bg: #f5f0e8;
  --color-bg-card: #ebe4d9;
  --color-surface: #faf8f4;
  --color-text: #3d3429;
  --color-text-muted: #7a6f63;
  --color-accent: #8b7355;
  --color-accent-dark: #6b5740;
  --color-border: #d4c9b8;
  --color-hero-overlay: rgba(61, 52, 41, 0.04);

  --font-serif: "Cormorant Garamond", "Georgia", serif;
  --font-sans: "DM Sans", system-ui, sans-serif;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(61, 52, 41, 0.08);
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

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

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

/* ── Home layout ── */

html.home-page {
  overflow: hidden;
  height: 100%;
}

body.home-page {
  overflow: hidden;
  height: 100dvh;
  overscroll-behavior: none;
}

.showcase {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.hero {
  flex-shrink: 0;
  padding: 1.25rem 1.5rem 0.5rem;
  text-align: center;
}

.hero h1 {
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.hero p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.carousel-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.carousel-label {
  flex-shrink: 0;
  padding: 0 1.5rem 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.carousel {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 0 15vw;
  scroll-padding: 0 15vw;
  height: min(70dvh, calc(100dvh - 11rem));
  align-items: stretch;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel {
  scrollbar-width: none;
}

.card {
  flex: 0 0 70vw;
  height: min(70dvh, calc(100dvh - 11rem));
  scroll-snap-align: center;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition);
}

.card:hover,
.card:focus-visible {
  box-shadow: 0 8px 32px rgba(61, 52, 41, 0.14);
  outline: none;
}

.card-image {
  flex: 1;
  min-height: 0;
  background: var(--color-bg-card);
  overflow: hidden;
}

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

.card-info {
  flex-shrink: 0;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--color-border);
}

.card-info h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 500;
}

.card-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.scroll-hint {
  flex-shrink: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0;
  padding: 0.35rem 1.5rem 0;
  letter-spacing: 0.02em;
}

.scroll-dots {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0 0.25rem;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background var(--transition), transform var(--transition);
}

.dot.active {
  background: var(--color-accent);
  transform: scale(1.25);
}

.site-footer {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

.site-footer--home {
  flex-shrink: 0;
  padding: 0.5rem 1rem 0.75rem;
  border-top: none;
  font-size: 0.7rem;
}

/* ── Project detail pages ── */

.project-page {
  min-height: 100dvh;
}

.project-nav {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
}

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

.project-detail {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.project-header {
  margin-bottom: 2rem;
}

.project-header h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 500;
  line-height: 1.2;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.project-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 1rem;
  color: var(--color-border);
}

.hero-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 2.5rem;
  background: var(--color-bg-card);
}

.case-study-section {
  margin-bottom: 2.5rem;
}

.case-study-section h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-accent-dark);
  letter-spacing: 0.02em;
}

.case-study-section p {
  margin: 0 0 1rem;
  color: var(--color-text);
}

.case-study-section p:last-child {
  margin-bottom: 0;
}

.project-nav-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.nav-project {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-project strong {
  display: block;
  color: var(--color-text);
  font-weight: 500;
}

.nav-project.next {
  text-align: right;
  margin-left: auto;
}

/* ── Desktop ── */

@media (min-width: 768px) {
  .hero {
    padding-top: 1.5rem;
  }

  .project-detail {
    padding: 3rem 1.5rem 4rem;
  }
}
