@font-face {
  font-family: 'Crozet';
  src: url('./fonts/Crozet-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('./fonts/CabinetGrotesk-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('./fonts/CabinetGrotesk-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SchwarzKopf';
  src: url('./fonts/SchwarzKopf.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0f0e0c;
  --ink: #f5efe4;
  --accent: #d97757;
  --muted: rgba(245, 239, 228, 0.6);
  --rule: rgba(245, 239, 228, 0.12);
  --font-display: 'Crozet', 'Cabinet Grotesk', serif;
  --font-label: 'SchwarzKopf', 'Cabinet Grotesk', serif;
  --font-body: 'Cabinet Grotesk', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Knight cursor — PNG first (widely supported), SVG fallback, then default */
  cursor: url('./cursor-knight-32.png') 16 16, url('./cursor-knight.svg') 16 16, auto;
}

/* Interactive elements get the accent (peach) knight instead of the OS pointer */
a, button, [role="button"], label, summary {
  cursor: url('./cursor-knight-accent-32.png') 16 16, url('./cursor-knight-accent.svg') 16 16, pointer;
}
input, textarea, select {
  cursor: auto;
}

/* Glassy backdrop behind the header once it docks (secondary state).
   body.header-docked is toggled by scroll-header.js. */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(15, 14, 12, 0.45);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--rule);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

body.header-docked::before {
  opacity: 1;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Knight point-cloud backdrop (injected by knight-cloud.js) */
.knight-cloud {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============ SCROLL HEADER ============ */
.scroll-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 14vw, 11rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  max-width: 100%;
  transform-origin: 0% 0%;
  will-change: transform;
  pointer-events: none;
  z-index: 50;
}

.scroll-text a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  pointer-events: auto;
}

.scroll-text .word {
  display: inline-flex;
  margin-right: 0.18em;
  pointer-events: none;
}
.scroll-text .word:last-child { margin-right: 0; }

.scroll-text .char {
  display: inline-block;
  transform-origin: 50% 100%;
  will-change: transform, opacity;
  pointer-events: none;
}

.scroll-text .char.accent {
  color: var(--accent);
}

/* ============ NAV ============ */
.scroll-nav {
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  gap: 4.5rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  will-change: transform, opacity;
  z-index: 60;
}

@media (max-width: 640px) {
  /* Break the title after "Molly" — each word on its own line, centered */
  .scroll-text .word {
    flex: 0 0 100%;
    margin-right: 0;
    justify-content: center;
  }

  /* Stack the nav links vertically */
  .scroll-nav {
    font-size: 2.2rem;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
}

/* ============ MOBILE HAMBURGER ============ */
/* Injected by scroll-header.js. Hidden by default; only appears on mobile
   once the header has docked out of its first state. */
.nav-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 46px;
  height: 46px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 70;
}

.nav-toggle span {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.35s cubic-bezier(0.7, 0, 0.3, 1), opacity 0.25s ease;
}

body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

body.nav-open .nav-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.4s ease;
}

/* Lock background scroll while the menu is open */
body.nav-open {
  overflow: hidden;
}

.nav-overlay a {
  font-family: var(--font-label);
  font-size: clamp(2.8rem, 16vw, 5rem);
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-overlay a:hover,
.nav-overlay a:active {
  color: var(--accent);
}

/* Hamburger only exists on mobile, and only after the header docks. */
@media (max-width: 640px) {
  body.nav-docked .nav-toggle {
    display: flex;
  }
}

.scroll-nav a {
  color: var(--muted);
  text-decoration: none;
  position: relative;
  padding: 0.5rem 0.25rem;
  margin: -0.5rem -0.25rem;
  transition: color 0.4s ease;
}

.scroll-nav a:hover,
.scroll-nav a.active {
  color: var(--ink);
}

.scroll-nav a::before,
.scroll-nav a::after {
  content: '×';
  font-family: var(--font-display);
  font-size: 1.4em;
  line-height: 1;
  color: var(--accent);
  position: absolute;
  top: 50%;
  opacity: 0;
  transform: translateY(-50%) scale(0.4) rotate(-20deg);
  transition: transform 0.5s cubic-bezier(0.7, -0.3, 0.3, 1.3),
              opacity 0.3s ease;
  pointer-events: none;
}

.scroll-nav a::before {
  right: 100%;
  margin-right: 0.35em;
}

.scroll-nav a::after {
  left: 100%;
  margin-left: 0.35em;
}

.scroll-nav a:hover::before,
.scroll-nav a.active::before {
  opacity: 1;
  transform: translateY(-50%) scale(1) rotate(-10deg);
}

.scroll-nav a:hover::after,
.scroll-nav a.active::after {
  opacity: 1;
  transform: translateY(-50%) scale(1) rotate(10deg);
}

/* ============ PAGE CONTENT ============ */
.page {
  position: relative;
  z-index: 1;
  padding: 7rem 6vw 12rem;
  max-width: 1400px;
  margin: 0 auto;
}

.page-intro {
  border-top: 1px solid var(--rule);
  padding-top: 3rem;
  margin-bottom: 5rem;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: baseline;
}

@media (max-width: 720px) {
  .page-intro {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.page-intro h2 {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.page-intro p {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 42ch;
}

/* ============ HOMEPAGE SECTIONS ============ */
.home-hero {
  height: 100vh;
}

.home-section {
  position: relative;
  z-index: 1;
  padding: 7rem 6vw 8rem;
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--rule);
}

.home-section + .home-section {
  padding-top: 5rem;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
  margin-bottom: 3.5rem;
}

.section-head h2 {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.see-all {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.35s ease, gap 0.35s cubic-bezier(0.2, 0.6, 0.2, 1);
  white-space: nowrap;
}

.see-all::after {
  content: '→';
  font-family: var(--font-display);
  font-size: 1.1em;
  color: var(--accent);
  transition: transform 0.35s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.see-all:hover {
  border-bottom-color: var(--accent);
  gap: 1rem;
}

.see-all:hover::after {
  transform: translateX(4px);
}

@media (max-width: 640px) {
  .section-head {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

/* Homepage photos preview: asymmetric grid with a tall feature.
   Fixed row height + object-fit:cover so every cell fills with no gaps. */
.photos-preview {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-auto-rows: 230px;
  grid-auto-flow: dense;
  gap: 1.25rem;
}

.photos-preview .photo {
  margin: 0;
}

.photos-preview .photo .frame {
  height: 100%;
  object-fit: cover;
}

.photos-preview .photo.tall {
  grid-row: span 2;
}

@media (max-width: 900px) {
  .photos-preview {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 200px;
  }
}

@media (max-width: 640px) {
  /* Stack full-width at natural aspect ratio */
  .photos-preview {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  .photos-preview .photo.tall {
    grid-row: auto;
  }
  .photos-preview .photo .frame {
    height: auto;
  }
}

/* Homepage shop preview: 3-up */
.shop-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

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

@media (max-width: 640px) {
  .shop-preview {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ============ SHOP GRID ============ */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2.5rem 2rem;
}

.shop-item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.shop-item .thumb {
  aspect-ratio: 1 / 1;
  background: #1a1612;
  border: 1px solid var(--rule);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.shop-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.2, 0.6, 0.2, 1),
              filter 0.5s ease;
}

.shop-item:hover .thumb {
  transform: translateY(-6px);
}

.shop-item:hover .thumb img {
  transform: scale(1.04);
  filter: brightness(1.05);
}

.shop-item .thumb::after {
  content: '×';
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent);
  opacity: 0;
  transform: scale(0.5) rotate(-20deg);
  transition: opacity 0.35s ease,
              transform 0.5s cubic-bezier(0.7, -0.3, 0.3, 1.3);
  pointer-events: none;
}

.shop-item:hover .thumb::after {
  opacity: 1;
  transform: scale(1) rotate(8deg);
}

.shop-item .meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.shop-item .name {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: -0.005em;
}

.shop-item .price {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

/* ============ PHOTOS GRID ============ */
/* Dynamic mosaic — each photo's footprint is sized by its orientation
   (wide = landscape, tall = portrait, big = feature square). */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 240px;
  grid-auto-flow: dense;
  gap: 1.1rem;
}

.photos-grid .photo { margin: 0; }
.photos-grid .photo .frame { height: 100%; object-fit: cover; }

.photos-grid .photo.wide { grid-column: span 2; }
.photos-grid .photo.tall { grid-row: span 2; }
.photos-grid .photo.big  { grid-column: span 2; grid-row: span 2; }

@media (max-width: 900px) {
  .photos-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }
}

@media (max-width: 640px) {
  /* Stack: each photo full-width at its natural aspect ratio */
  .photos-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  .photos-grid .photo.wide,
  .photos-grid .photo.tall,
  .photos-grid .photo.big {
    grid-column: auto;
    grid-row: auto;
  }
  .photos-grid .photo .frame { height: auto; }
}

.photo {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
  background: var(--bg);
  transition: transform 0.5s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.photo:hover {
  transform: translateY(-4px);
}

.photo .frame {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(0.1) contrast(1.04);
  transition: filter 0.5s ease, transform 0.8s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.photo:hover .frame {
  filter: grayscale(0) contrast(1.08);
  transform: scale(1.03);
}

.photo .caption {
  position: absolute;
  left: 0.9rem;
  bottom: 0.7rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(15, 14, 12, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0.35rem 0.6rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.photo:hover .caption {
  opacity: 1;
  transform: translateY(0);
}

/* ============ LINKS LIST ============ */
.link-list {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.link-list li {
  border-bottom: 1px solid var(--rule);
}

.link-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.6rem 0.5rem;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  transition: padding-left 0.4s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.link-list a::before {
  content: '×';
  position: absolute;
  left: 0;
  top: 50%;
  font-family: var(--font-display);
  font-size: 1.8rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0;
  transform: translateY(-50%) translateX(-0.8rem) rotate(-15deg);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.7, -0.3, 0.3, 1.3);
  pointer-events: none;
}

.link-list a:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0) rotate(0);
}

.link-list a:hover {
  padding-left: 2.2rem;
}

.link-list .label {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  line-height: 1.1;
}

.link-list .where {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.4s ease;
}

.link-list a:hover .where {
  color: var(--ink);
}
