/* HAVN — Catalogue. Gallery-book layout with a standing contents index (v3 rebuild) */

@font-face {
  font-family: "Zodiak";
  src: url("../assets/fonts/Zodiak-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: "Zodiak";
  src: url("../assets/fonts/Zodiak-VariableItalic.woff2") format("woff2");
  font-weight: 200 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("../assets/fonts/GeneralSans-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --paper: #f7f5f1;
  --paper-2: #efece5;
  --ink: #1a1917;
  --ink-2: #55524c;
  --ink-3: #8f8b83;
  --moss: #6b7263;
  --hair: rgba(26, 25, 23, 0.12);
  --serif: "Zodiak", Georgia, serif;
  --sans: "General Sans", "Helvetica Neue", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.66;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--moss); color: var(--paper); }

.label {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Shell: standing index + pages ---------- */
.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: clamp(28px, 5vw, 96px);
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 64px);
}

/* Standing contents index */
.index {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: clamp(28px, 4vw, 52px) 0 40px;
  display: flex;
  flex-direction: column;
}

.index-brand {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.index-sub { margin-bottom: clamp(26px, 4vw, 46px); }

.contents { display: flex; flex-direction: column; gap: 2px; }
.contents a {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 7px 0;
  color: var(--ink-3);
  font-size: 14px;
  transition: color 0.25s ease;
}
.contents a .no {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  flex: none;
  color: var(--ink-3);
  transition: color 0.25s ease;
}
.contents a .dots {
  flex: 1;
  border-bottom: 1px dotted var(--hair);
  transform: translateY(-0.3em);
  min-width: 14px;
}
.contents a:hover { color: var(--ink); }
.contents a.is-current { color: var(--ink); }
.contents a.is-current .no { color: var(--moss); }

/* Signature interaction: the index shows a plate on hover */
.peek {
  margin-top: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.peek.is-on { opacity: 1; transform: none; }
.peek img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  margin-bottom: 8px;
}
.peek span { display: block; }

.index-foot { padding-top: 18px; }

/* ---------- Pages ---------- */
.pages { min-width: 0; padding-bottom: clamp(50px, 8vw, 110px); }

.leaf { padding: clamp(56px, 10vw, 150px) 0 0; }
.leaf:first-child { padding-top: clamp(36px, 6vw, 78px); }

.leaf-head { margin-bottom: clamp(22px, 3.4vw, 40px); }
.leaf-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.012em;
  margin-top: 10px;
}
.leaf-head p {
  max-width: 46ch;
  color: var(--ink-2);
  margin-top: 14px;
  font-size: 17px;
}

/* Opening plate */
.opening h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 7vw, 6.2rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
  margin: 16px 0 26px;
}
.opening h1 em { font-style: italic; }
.opening .lede {
  max-width: 52ch;
  font-size: clamp(17px, 1.8vw, 20px);
  color: var(--ink-2);
  margin-bottom: clamp(28px, 4vw, 52px);
}
.opening-plate { margin-bottom: 14px; }
.opening-plate img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.plate-cap {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  flex-wrap: wrap;
}

/* ---------- Catalogue entries ---------- */
.entry {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: clamp(20px, 3.4vw, 56px);
  align-items: end;
  padding: clamp(30px, 5vw, 64px) 0;
  border-top: 1px solid var(--hair);
}
.entry:first-of-type { border-top: none; }

.entry-plate { overflow: hidden; }
.entry-plate img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.entry:hover .entry-plate img { transform: scale(1.03); }

.entry-facts h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.entry-facts .kind { color: var(--ink-2); margin-bottom: 18px; }
.fact {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
  color: var(--ink-2);
}
.fact .dots { flex: 1; border-bottom: 1px dotted var(--hair); transform: translateY(-0.3em); }
.fact b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.entry-facts .price {
  font-family: var(--serif);
  font-size: 1.42rem;
  margin-top: 16px;
}
.entry-facts .ask {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--moss);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* ---------- Spreads (full-bleed rooms) ---------- */
.spread { padding-top: clamp(40px, 6vw, 76px); }
.spread img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}
.spread-cap {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  flex-wrap: wrap;
}

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 2.4vw, 34px);
  padding-top: clamp(18px, 2.6vw, 34px);
}
.duo figure img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.duo figcaption { padding-top: 9px; }

/* ---------- Materials ---------- */
.mat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3.4vw, 52px);
  align-items: center;
}
.mat-note {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.34;
  font-weight: 300;
}
.mat-note cite {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 18px;
}
.mat-stack { display: grid; gap: clamp(12px, 2vw, 22px); }
.mat-stack img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.mat-stack figcaption { padding-top: 8px; }

/* ---------- Colophon rows (numbers, static) ---------- */
.rows { border-top: 1px solid var(--hair); }
.row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: clamp(14px, 2.6vw, 34px);
  align-items: baseline;
  padding: clamp(14px, 2vw, 22px) 0;
  border-bottom: 1px solid var(--hair);
}
.row .fig {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.row p { color: var(--ink-2); max-width: 54ch; }

/* ---------- Visit ---------- */
.visit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(22px, 4vw, 60px);
  padding-top: clamp(46px, 7vw, 96px);
  align-items: start;
}
.visit h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.visit h2 em { font-style: italic; }
.visit-lines { border-top: 1px solid var(--hair); }
.visit-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 15px;
}
.visit-row .dots { flex: 1; border-bottom: 1px dotted var(--hair); transform: translateY(-0.3em); }
.visit-row b { font-weight: 500; }
.visit .go {
  display: inline-block;
  margin-top: 22px;
  border: 1px solid var(--ink);
  padding: 13px 26px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: background 0.28s ease, color 0.28s ease;
}
.visit .go:hover { background: var(--ink); color: var(--paper); }

.colophon {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: clamp(34px, 5vw, 66px);
  margin-top: clamp(34px, 5vw, 66px);
  border-top: 1px solid var(--hair);
}
.colophon nav { display: flex; gap: 20px; flex-wrap: wrap; }
.colophon a:hover { color: var(--moss); }

/* ---------- Entrance ---------- */
.rise { opacity: 0; transform: translateY(18px); transition: opacity 0.85s ease, transform 0.85s cubic-bezier(0.22, 1, 0.36, 1); }
.rise.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; transition: none; }
  .entry-plate img { transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; gap: 0; }
  .index {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 20;
    background: var(--paper);
    padding: 14px 0 12px;
    border-bottom: 1px solid var(--hair);
    flex-direction: row;
    align-items: baseline;
    gap: 18px;
    overflow-x: auto;
  }
  .index-brand { font-size: 22px; margin-bottom: 0; flex: none; }
  .index-sub, .peek, .index-foot { display: none; }
  .contents { flex-direction: row; gap: 16px; }
  .contents a { padding: 0; white-space: nowrap; }
  .contents a .dots { display: none; }
  .entry { grid-template-columns: 1fr; align-items: start; }
  .mat { grid-template-columns: 1fr; }
  .visit { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .duo { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .spread img { aspect-ratio: 4 / 3; }
  .opening-plate img { aspect-ratio: 4 / 3; }
}
