:root {
  --ink: #1a1c14;
  --night: #12140e;
  --linen: #ece8dc;
  --paper: #f4f0e4;
  --olive: #3f4f33;
  --brass: #c4a574;
  --terra: #a45a3a;
  --cream: #f3eadc;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Figtree, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--night);
  min-height: 100dvh;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.stage {
  min-height: 100dvh;
  background: var(--linen);
}

.phone {
  width: 100%;
  margin: 0;
  min-height: 100dvh;
  background: var(--linen);
  position: relative;
}

.still {
  position: relative;
  min-height: 92dvh;
  color: var(--cream);
  isolation: isolate;
  overflow: hidden;
}

.still-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  z-index: -2;
  filter: saturate(0.82) contrast(1.08) brightness(0.78);
}

.still-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(18, 20, 14, 0.35) 0%, rgba(18, 20, 14, 0) 28%),
    linear-gradient(180deg, rgba(18, 20, 14, 0.2) 0%, rgba(18, 20, 14, 0.08) 38%, rgba(18, 20, 14, 0.92) 100%);
}

.still-place {
  position: absolute;
  left: 0;
  top: 46%;
  margin: 0;
  transform: translate(-36%, -50%) rotate(-90deg);
  transform-origin: center;
  font-size: 11px;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--brass);
  white-space: nowrap;
}

.still-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 18px 0 18px;
}

.still-top img {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(0.92) sepia(0.18);
}

.langs { display: flex; gap: 2px; }
.langs a {
  text-decoration: none;
  font-size: 10px;
  letter-spacing: 0.2em;
  padding: 6px 7px;
  color: var(--cream);
  opacity: 0.45;
}
.langs a.is-on {
  opacity: 1;
  box-shadow: inset 0 -1px 0 var(--brass);
}

.still-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48px;
  padding: 0 28px 0 36px;
}

.still-title h1 {
  margin: 0;
  font-family: Fraunces, "Iowan Old Style", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(64px, 22vw, 92px);
  line-height: 0.78;
  letter-spacing: -0.03em;
}

.tag {
  margin: 14px 0 0;
  max-width: 18em;
  font-family: Fraunces, Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.35;
  color: color-mix(in srgb, var(--cream) 88%, transparent);
}

.hours {
  margin: 16px 0 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
}

.toc {
  position: relative;
  z-index: 2;
  margin-top: -28px;
  padding: 26px 22px 10px;
  background: var(--linen);
  border-radius: 22px 22px 0 0;
}

.toc-kicker {
  margin: 0 0 14px;
  font-size: 10px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--olive);
}

.toc-row,
.line-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.toc-row {
  text-decoration: none;
  padding: 11px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--olive) 16%, transparent);
  font-family: Fraunces, Georgia, serif;
  font-size: 22px;
  font-weight: 500;
}

.toc-row:last-of-type { border-bottom: 0; }

.toc-name { flex: 0 1 auto; }
.toc-lead {
  flex: 1 1 auto;
  min-width: 16px;
  border-bottom: 1px dotted color-mix(in srgb, var(--ink) 35%, transparent);
  transform: translateY(-4px);
}
.toc-go {
  font-family: Figtree, sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--olive);
}

.toc-row.is-on .toc-name { color: var(--olive); }

.course { padding: 8px 0 12px; }
.course-h {
  padding: 28px 22px 6px;
}
.course-h h2 {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--olive);
}

.spread,
.line {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 22px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.spread-photo {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #d9d0be;
}
.spread-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.spread:hover .spread-photo img { transform: scale(1.03); }
.spread.is-sold .spread-photo img,
.line.is-sold .line-thumb { filter: grayscale(1) contrast(0.92); opacity: 0.8; }

.ribbon,
.star {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 5px 9px;
  background: var(--night);
  color: var(--cream);
}
.star { left: auto; right: 12px; background: var(--olive); }

.spread-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 12px;
}
.spread-meta h3,
.line-row h3 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.05;
}
.line-row h3 { font-size: 20px; }

.price {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--olive);
  white-space: nowrap;
  font-size: 13px;
}

.spread-story,
.line-story {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: color-mix(in srgb, var(--ink) 68%, transparent);
}

.line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: calc(100% - 32px);
  padding: 12px 0;
  border-top: 1px solid color-mix(in srgb, var(--olive) 14%, transparent);
  margin-bottom: 0;
}
.line-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  flex: 0 0 64px;
  background: #d9d0be;
}
.line-copy { flex: 1; min-width: 0; }
.line-sold,
.line-feat {
  display: inline-block;
  margin-top: 6px;
  margin-right: 10px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terra);
}
.line-feat { color: var(--olive); }

.colophon {
  margin-top: 28px;
  padding: 36px 28px 56px;
  background: var(--night);
  color: color-mix(in srgb, var(--cream) 78%, transparent);
  text-align: left;
  font-size: 13px;
  line-height: 1.65;
}
.c-name {
  margin: 0 0 12px;
  font-family: Fraunces, Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--cream);
}
.colophon a { color: var(--brass); }
.wifi { margin-top: 16px; letter-spacing: 0.06em; font-size: 12px; color: var(--brass); }

.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 14, 0.62);
}
.sheet-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(428px, 100%);
  max-height: 92dvh;
  overflow: auto;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  animation: rise 0.45s var(--ease);
}
@keyframes rise {
  from { transform: translate(-50%, 24px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.sheet-x {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--linen) 80%, transparent);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.sheet-photo { aspect-ratio: 16 / 10; }
.sheet-photo img { width: 100%; height: 100%; object-fit: cover; }
.sheet-body { padding: 20px 22px 40px; }
.sheet-kicker {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--terra);
}
.sheet-body h2 {
  margin: 6px 0 10px;
  font-family: Fraunces, Georgia, serif;
  font-size: 34px;
  font-weight: 500;
}
.sheet-story { margin: 0; line-height: 1.55; }
.allergens {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 16px 0 0;
  margin: 0;
}
.allergens li {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--olive) 35%, transparent);
  padding: 4px 8px;
  color: var(--olive);
}
.sheet-price {
  margin: 18px 0 0;
  font-size: 18px;
  color: var(--olive);
}

.empty-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  text-align: center;
  background: var(--linen);
}
.empty-page img { width: 70%; max-width: 280px; margin-bottom: 24px; }
.empty-page h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  font-size: 32px;
  margin: 0 0 8px;
}
.empty-page a {
  margin-top: 18px;
  text-decoration: none;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--olive);
  box-shadow: inset 0 -1px 0 var(--brass);
  padding-bottom: 4px;
}

@media (min-width: 768px) {
  .still {
    min-height: 52vh;
  }

  .still-top {
    padding: calc(20px + env(safe-area-inset-top)) clamp(24px, 4vw, 72px) 0;
  }

  .still-title {
    padding: 0 clamp(32px, 5vw, 80px);
    max-width: 720px;
  }

  .still-title h1 {
    font-size: clamp(72px, 8vw, 120px);
  }

  .still-place {
    left: clamp(24px, 4vw, 72px);
    top: auto;
    bottom: 112px;
    transform: rotate(-90deg);
    transform-origin: left bottom;
  }

  .phone {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    grid-template-areas:
      "hero hero"
      "nav main"
      "foot foot";
  }

  .still {
    grid-area: hero;
  }

  .toc {
    grid-area: nav;
    margin-top: 0;
    border-radius: 0;
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100dvh;
    overflow-y: auto;
    padding: 36px clamp(20px, 3vw, 40px) 48px clamp(24px, 4vw, 56px);
    border-right: 1px solid color-mix(in srgb, var(--olive) 12%, transparent);
  }

  main {
    grid-area: main;
    padding: 8px clamp(16px, 3vw, 48px) 24px 0;
  }

  .course {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(20px, 3vw, 40px);
  }

  .course-h {
    grid-column: 1 / -1;
    padding: 32px clamp(16px, 2vw, 24px) 8px;
  }

  .spread {
    grid-column: 1 / -1;
    width: auto;
    margin: 0 clamp(16px, 2vw, 24px) 32px;
  }

  .spread-meta h3 { font-size: 28px; }

  .line {
    width: auto;
    margin: 0 clamp(16px, 2vw, 24px);
  }

  .line-thumb {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
  }

  .colophon {
    grid-area: foot;
    margin-top: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px clamp(24px, 6vw, 80px);
    padding: 48px clamp(24px, 5vw, 80px) 56px;
  }

  .c-name { grid-column: 1 / -1; }

  .sheet-card {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100% - 48px));
    max-height: min(88vh, 720px);
    border-radius: 20px;
    animation: sheet-in 0.45s var(--ease);
  }

  @keyframes sheet-in {
    from { transform: translate(-50%, calc(-50% + 18px)); opacity: 0; }
    to { transform: translate(-50%, -50%); opacity: 1; }
  }
}

@media (min-width: 1280px) {
  .course {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .spread {
    grid-column: span 2;
  }
}

@media (min-width: 1600px) {
  .course {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .spread {
    grid-column: span 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spread-photo img, .sheet-card { transition: none; animation: none; }
  @keyframes sheet-in {
    from, to { transform: translate(-50%, -50%); opacity: 1; }
  }
}
