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

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

:root {
  --bg: #F4F0E6;
  --text: #111111;
  --muted: #888880;
  --placeholder: #D8D3C8;
  --placeholder-dark: #C2BDB2;
  --border: #E0DBD0;
}

html {
  font-family: 'Space Mono', monospace;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='256' height='256'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/></filter><rect width='256' height='256' filter='url(%23n)'/></svg>");
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 80px;
}

/* ── Nav ── */
nav {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
  text-transform: lowercase;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--text); }

/* ── Labels ── */
.eyebrow {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Hero ── */
.hero {
  padding: 56px 0 0;
}

.hero-text {
  padding-bottom: 36px;
}

.hero .eyebrow {
  margin-bottom: 20px;
}

.hero-name {
  font-size: clamp(48px, 6vw, 88px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.0;
  margin-bottom: 28px;
  text-transform: lowercase;
}

.hero-bio {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  max-width: 360px;
  line-height: 1.9;
}

/* ── Card Hero ── */
.hero-cards-outer {
  /* Bleed past the container's right padding so cards scroll to the edge */
  margin-right: -80px;
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 80px), transparent 100%);
  mask-image: linear-gradient(to right, black calc(100% - 80px), transparent 100%);
}

.hero-cards {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 20px 80px 48px 0;
}

.hero-cards::-webkit-scrollbar { display: none; }

.hc-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.09);
  border-radius: 18px;
  padding: 10px 10px 13px;
  box-shadow: 0 3px 18px rgba(0,0,0,0.09);
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
}

.hc-photo {
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
}

.hc-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1);
}


.hc-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  margin-top: 9px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Pile (kept for later) ── */
.hero-pile {
  position: relative;
  height: 520px;
  cursor: default;
}

.pile-card {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  aspect-ratio: var(--aspect);
  z-index: var(--z);
  transform: rotate(var(--rot));
  transform-origin: center center;
  transition:
    transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  text-decoration: none;
  color: var(--text);
  display: block;
}

.pile-card:hover {
  transform: rotate(calc(var(--rot) * 0.15)) scale(1.07) translateY(-6px);
  z-index: 100;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.14);
}

.pile-card-face {
  width: 100%;
  height: 100%;
  background: var(--placeholder);
  border-radius: 15px;
  object-fit: cover;
  display: block;
}

.pile-card-label {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.pile-card:hover .pile-card-label {
  opacity: 1;
  transform: translateY(0);
}

/* ── Sections ── */
.section {
  padding: 48px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

/* ── Project Cards ── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.project-card {
  text-decoration: none;
  color: var(--text);
  display: block;
  cursor: pointer;
}

.card-thumb-wrap {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
}

.card-thumb {
  background: var(--placeholder);
  width: 100%;
  height: 220px;
  margin-bottom: 0;
  border-radius: 0;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: block;
  object-fit: cover;
}

.project-card:hover .card-thumb {
  transform: scale(1.03);
}

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 20px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 100%);
}

.card-meta {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 5px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
  color: #fff;
}

/* ── Logo Grid ── */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 920px;
  margin: 0 auto;
}

.logo-cell {
  border-radius: 15px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px;
  overflow: hidden;
  transition: transform 0.25s ease;
  cursor: default;
}

.logo-cell:hover {
  transform: scale(1.05);
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* ── Footer ── */
footer {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.footer-name {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  display: block;
  margin-bottom: 8px;
}

.footer-email {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-email:hover { color: var(--text); }

.footer-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.footer-links a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── Project Pages ── */
.project-hero {
  padding: 44px 0 12px;
}

.project-section {
  padding: 40px 0;
}

.project-hero + .project-section {
  padding-top: 16px;
}

/* ── Nav back link (project pages) ── */
.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-back {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 20px;
  opacity: 0.5;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.nav-back:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--text);
  opacity: 1;
}

/* ── Project hero two-column ── */
.project-hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 56px;
  transition: color 0.2s;
}

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

.project-title {
  font-size: clamp(52px, 7.5vw, 96px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 28px;
}

.project-blurb {
  font-size: 14px;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.8;
}

/* DW hero logo */
.dw-hero-logo {
  display: block;
  width: 100%;
  height: auto;
}

/* RH hero logo */
.rh-hero-logo {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
}

/* Outlined blurb box */
.project-blurb-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
}

.project-section {
  padding: 56px 0;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}

/* Placeholder shapes */
.ph-full {
  background: var(--placeholder);
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 15px;
}

.ph-43 {
  background: var(--placeholder);
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 15px;
}

.ph-11 {
  background: var(--placeholder);
  width: 100%;
  aspect-ratio: 1;
  border-radius: 15px;
}

.ph-tall {
  background: var(--placeholder);
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 15px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

/* ── Brand Foundation ── */
.brand-marks-panel {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 40px;
}

.brand-mark-item {
  flex: 1;
  background: #F0E7D6;
  border-radius: 15px;
  padding: 40px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.brand-mark-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 88px;
  flex: 1;
}

.brand-mark-img {
  max-height: 88px;
  max-width: 140px;
  width: auto;
  filter: brightness(0) saturate(100%) invert(20%) sepia(96%) saturate(700%) hue-rotate(192deg) brightness(90%);
}

.brand-mark-divider {
  display: none;
}

.brand-mark-label {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.sub-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.brand-colors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.swatch-block {
  border-radius: 15px;
  aspect-ratio: 4 / 3;
  margin-bottom: 14px;
}

.swatch-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.swatch-hex {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.project-img-full {
  width: 100%;
  border-radius: 15px;
  display: block;
  object-fit: cover;
}

.project-img-square {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 15px;
  display: block;
  object-fit: cover;
  object-position: center center;
}

.project-img-story {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 15px;
  display: block;
  object-fit: cover;
}

.project-img-site {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 15px;
  display: block;
  object-fit: cover;
  object-position: top center;
}

.texture-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.texture-img {
  width: 100%;
  border-radius: 15px;
  display: block;
}

.icons-banner {
  background: #F0E7D6;
  border-radius: 15px;
  overflow: hidden;
}

.icons-banner-img {
  width: 100%;
  height: auto;
  display: block;
}

.coldbrew-banner {
  border-radius: 15px;
  height: 420px;
  overflow: hidden;
}

.coldbrew-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

/* ── Thumbnail Grid (left-to-right) ── */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* ── Masonry Grid (emails) ── */
.masonry-grid {
  columns: 3;
  column-gap: 12px;
}

.lb-trigger {
  width: 100%;
  display: block;
  border-radius: 15px;
  break-inside: avoid;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.lb-trigger:hover {
  opacity: 0.82;
}

/* masonry grid needs its own spacing */
.masonry-grid .lb-trigger {
  margin-bottom: 12px;
}

/* ── Lightbox ── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

#lb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

#lb-img {
  position: relative;
  max-width: 88vw;
  max-height: 88vh;
  border-radius: 12px;
  z-index: 1;
  object-fit: contain;
}

#lb-close {
  position: absolute;
  top: 24px;
  right: 32px;
  z-index: 2;
  background: none;
  border: none;
  color: white;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#lb-close:hover { opacity: 1; }

#lb-prev,
#lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: white;
  font-size: 36px;
  padding: 14px 20px;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
  font-family: inherit;
}

#lb-prev:hover,
#lb-next:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.22);
}

#lb-prev { left: 28px; }
#lb-next { right: 28px; }

/* ── Section description ── */
.section-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 20px;
  margin-bottom: 0;
}

/* ── Mixed thumbnail grid (2-3-2-3-2) ── */
.thumb-grid-mixed {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.thumb-grid-mixed img {
  margin-bottom: 0;
  width: 100%;
  display: block;
  border-radius: 15px;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* 2-wide rows: positions 1, 2, 6, 7, 11, 12 */
.thumb-grid-mixed img:nth-child(1),
.thumb-grid-mixed img:nth-child(2),
.thumb-grid-mixed img:nth-child(6),
.thumb-grid-mixed img:nth-child(7),
.thumb-grid-mixed img:nth-child(11),
.thumb-grid-mixed img:nth-child(12) { grid-column: span 3; }

/* 3-wide rows: positions 3, 4, 5, 8, 9, 10 */
.thumb-grid-mixed img:nth-child(3),
.thumb-grid-mixed img:nth-child(4),
.thumb-grid-mixed img:nth-child(5),
.thumb-grid-mixed img:nth-child(8),
.thumb-grid-mixed img:nth-child(9),
.thumb-grid-mixed img:nth-child(10) { grid-column: span 2; }

/* ── Horizontal scroll sections ── */
.scroll-section {
  position: relative;
}

.scroll-arrow {
  display: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* ── Tablet: stack hero ── */
@media (max-width: 960px) {
  .project-hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .container {
    padding: 0 24px;
  }

  .hero {
    padding: 48px 0 0;
  }

  .hero-text {
    padding-bottom: 28px;
  }

  .hero-bio {
    max-width: 100%;
  }

  .hero-cards-outer {
    margin-right: -24px;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 48px), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 48px), transparent 100%);
  }

  .hero-cards {
    padding: 16px 24px 40px 0;
  }

  .hc-card {
    flex: 0 0 210px;
  }

  .section {
    padding: 40px 0;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .grid-3 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .logo-grid {
    gap: 8px;
  }

  .logo-cell {
    padding: 18px;
  }

  .brand-marks-panel {
    flex-wrap: wrap;
  }

  .brand-mark-item {
    flex: 1 1 calc(50% - 6px);
  }

  .masonry-grid {
    columns: 2;
  }

  footer .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 36px;
  }

  .project-title {
    font-size: clamp(48px, 12vw, 72px);
  }

  .back-link {
    margin-bottom: 48px;
  }

  /* Center RH logo on mobile */
  .rh-hero-logo {
    max-width: 220px;
    margin: 0 auto;
  }

  /* Tighten project page section spacing */
  .project-section {
    padding: 24px 0;
  }

  .project-hero {
    padding: 36px 0 8px;
  }

  /* DW logo: extra padding on mobile so it reads smaller */
  .dw-hero-logo {
    padding: 12px 24px;
  }

  /* Poster scroll: portrait cards preserve 9:16 ratio */
  .poster-scroll-row > img {
    width: 52% !important;
    height: auto !important;
    flex: 0 0 52% !important;
    aspect-ratio: 9 / 16 !important;
    object-fit: cover !important;
    scroll-snap-stop: always;
  }

  /* DW thumbnails: tighter on mobile */
  .thumb-grid {
    gap: 6px;
  }
  .thumb-grid .lb-trigger {
    border-radius: 8px;
  }

  /* Sale scroll: give 16:9s breathing room on edges */
  .sale-scroll-row {
    padding-inline: 12px;
  }

  /* Thumb grid: collapse to 2-col */
  .thumb-grid-mixed {
    grid-template-columns: repeat(2, 1fr);
  }
  .thumb-grid-mixed img {
    grid-column: span 1 !important;
  }

  /* Horizontal scroll sections */
  .scroll-row {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px;
  }
  .scroll-row::-webkit-scrollbar { display: none; }
  .scroll-row > img {
    scroll-snap-align: center;
    flex: 0 0 80% !important;
    margin-bottom: 0;
    height: auto;
    min-width: 0 !important;
    aspect-ratio: unset !important;
    object-fit: unset !important;
    align-self: flex-start;
  }

  /* Sale section: all images same height, 16:9s bleed, 4:5 centers */
  .sale-scroll-row > img {
    height: 205px !important;
    width: auto !important;
    flex: 0 0 auto !important;
    min-width: unset !important;
    scroll-snap-stop: always;
  }
  .scroll-arrow {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    background: rgba(244, 240, 230, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(0,0,0,0.08) !important;
    border-radius: 50%;
    font-size: 18px;
    color: var(--text);
    line-height: 1;
  }
  .scroll-arrow.prev { left: 8px; }
  .scroll-arrow.next { right: 8px; }
}

/* ── Rolling Hills page — brand blue typography ── */
.rh-page {
  --text: #00559F;
  --muted: #629BD3;
  --border: #C5D9EE;
}

.rh-page .nav-logo,
.rh-page .nav-back {
  color: #00559F;
}

.rh-page .footer-name,
.rh-page .footer-email,
.rh-page .footer-links a {
  color: #00559F;
}

.rh-page .footer-email:hover,
.rh-page .footer-links a:hover {
  color: #629BD3;
}

.rh-page .swatch-name,
.rh-page .swatch-hex {
  color: #00559F;
}
