/* ---------------------------------------------------------
   Tokens
--------------------------------------------------------- */
:root{
  --bg:        #0F0C09;
  --surface:   #1C1611;
  --surface-2: #241C15;
  --line:      #3E2A1B;
  --line-soft: #2A2019;
  --wood-mid:  #8B5A2B;
  --wood-lt:   #C89B6B;
  --paper:     #E9DFCE;
  --paper-dim: #A79C89;
  --brass:     #C9A227;
  --brass-dim: #8C7220;

  --display: "Fraunces", Georgia, serif;
  --body:    "Inter", -apple-system, sans-serif;
  --mono:    "IBM Plex Mono", monospace;

  --gap: 18px;
  --radius: 3px;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

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

button{ font-family: inherit; }

::selection{ background: var(--brass-dim); color: var(--paper); }

/* focus visibility, kept even though we style buttons custom */
a:focus-visible, button:focus-visible{
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

/* ---------------------------------------------------------
   Hero
--------------------------------------------------------- */
.hero{
  position: relative;
  height: 100svh;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  background-image: url("photos/01.jpg");
  background-size: cover;
  background-position: 50% 35%;
}

.hero__scrim{
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15,12,9,0.55) 0%, rgba(15,12,9,0.15) 30%, rgba(15,12,9,0.35) 60%, rgba(15,12,9,0.96) 100%);
}

.hero__content{
  position: relative;
  z-index: 1;
  padding: 0 clamp(20px, 6vw, 72px) clamp(48px, 8vh, 90px);
  max-width: 900px;
  width: 100%;
  min-width: 0;
}

.eyebrow{
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wood-lt);
  margin: 0 0 14px;
}

.hero__title{
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(38px, 9vw, 108px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  color: var(--paper);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Manual break point for long titles — add
   <br class="hero__title-break"> at the desired split point in the title.
   Always active, so the title breaks at a real word boundary at every
   screen size instead of the browser guessing (and possibly breaking
   mid-word) when a long title doesn't fit on one line. */
.hero__title-break{ display: block; content: ""; }

.hero__sub{
  font-size: clamp(15px, 1.6vw, 19px);
  line-height: 1.5;
  color: var(--paper-dim);
  max-width: 46ch;
  margin: 0;
}

.hero__scroll{
  position: absolute;
  right: clamp(20px, 6vw, 72px);
  bottom: 28px;
  z-index: 1;
  background: none;
  border: none;
  color: var(--wood-lt);
  cursor: pointer;
  padding: 8px;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
  animation: bob 2.4s ease-in-out infinite;
}
.hero__scroll:hover{ opacity: 1; transform: translateY(2px); }

@keyframes bob{
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.hero__home{
  position: absolute;
  top: clamp(20px, 4vh, 32px);
  left: clamp(20px, 6vw, 72px);
  z-index: 1;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--wood-lt);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.hero__home:hover{ opacity: 1; color: var(--brass); }
.hero__home:focus-visible{ opacity: 1; }

/* ---------------------------------------------------------
   Spec bar
--------------------------------------------------------- */
.specs{
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.specs__row{
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px clamp(20px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.spec{
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 2px solid var(--line);
  padding-left: 14px;
}

.spec__label{
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.spec__value{
  font-size: 14.5px;
  color: var(--paper);
}

@media (max-width: 760px){
  .specs__row{ grid-template-columns: repeat(2, 1fr); }
  .chapter__head{ flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---------------------------------------------------------
   Chapters + grid
--------------------------------------------------------- */
main{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 72px);
}

.chapter{ padding: 84px 0 40px; }

.chapter__head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 16px;
}

.chapter__title{
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 36px);
  margin: 0;
  color: var(--paper);
}

.chapter__note{
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--paper-dim);
  margin: 0;
}

.chapter__specs{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 24px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 28px;
}

@media (max-width: 760px){
  .chapter__specs{ grid-template-columns: repeat(2, 1fr); }
}

.grid-empty{
  grid-column: 1 / -1;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--paper-dim);
}

.grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 294px;
  grid-auto-flow: dense;
  gap: var(--gap);
}

.cell{
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: zoom-in;
  grid-column: span 2;
  grid-row: span 1;
}

.cell.span-wide{ grid-column: span 4; }
.cell.span-tall{ grid-row: span 2; }

/* Tall photo with no landscape neighbor to sit beside — center it in the
   row instead of leaving the empty space bunched to one side. */
.cell.span-tall-center{ grid-column: 2 / span 2; grid-row: span 2; }

@media (min-width: 761px){
  .cell:not(.span-wide):not(.span-tall-center){ grid-column: span 2; }
}

/* "The Piece" gets its own wider grid so a lone portrait photo (no
   landscape neighbor to sit beside) can run wider than a standard tall
   cell elsewhere, while staying centered under the full-width shots. */
@media (min-width: 761px){
  #grid-piece{ grid-template-columns: repeat(6, 1fr); }
  #grid-piece .cell.span-wide{ grid-column: span 6; }
  #grid-piece .cell.span-tall-center{ grid-column: 2 / span 4; }
}

.cell img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1), filter 0.4s ease;
  filter: saturate(0.94) brightness(0.96);
}

.cell:hover img{
  transform: scale(1.035);
  filter: saturate(1) brightness(1);
}

.cell__frame{
  position: absolute;
  inset: 0;
  border: 1px solid rgba(233,223,206,0.08);
  border-radius: var(--radius);
  pointer-events: none;
  transition: border-color 0.3s ease;
}
.cell:hover .cell__frame{ border-color: rgba(201,162,39,0.45); }

.cell__tag{
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper);
  background: rgba(15,12,9,0.55);
  border: 1px solid rgba(233,223,206,0.15);
  backdrop-filter: blur(3px);
  padding: 3px 8px;
  border-radius: 2px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.cell:hover .cell__tag{ opacity: 1; transform: translateY(0); }

@media (max-width: 760px){
  .grid{ grid-template-columns: repeat(2, 1fr); grid-auto-rows: 240px; }
  .cell{ grid-column: span 2 !important; grid-row: span 1 !important; }
  .cell.span-tall{ grid-row: span 2 !important; }
  .cell.span-tall-center{ grid-row: span 2 !important; }
}

/* ---------------------------------------------------------
   Wavy grain divider between chapters
--------------------------------------------------------- */
.divider{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 72px);
  color: var(--wood-mid);
  opacity: 0.6;
}
.divider svg{
  width: 100%;
  height: 40px;
  display: block;
}
.divider path{
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.site-footer{
  text-align: center;
  padding: 60px 20px 70px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--paper-dim);
  letter-spacing: 0.03em;
}

/* ---------------------------------------------------------
   Lightbox
--------------------------------------------------------- */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8,6,4,0.96);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.is-open{ display: flex; }

.lightbox__figure{
  margin: 0;
  max-width: min(1100px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox__figure img{
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  opacity: 0;
  transform: scale(0.985);
  animation: lbIn 0.35s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes lbIn{
  to{ opacity: 1; transform: scale(1); }
}

.lightbox__figure figcaption{
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--paper-dim);
  text-align: center;
  max-width: 70ch;
}

.lightbox__count{
  color: var(--brass);
  flex-shrink: 0;
}

.lightbox__close{
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: none;
  color: var(--paper);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}
.lightbox__close:hover{ opacity: 1; }

.lightbox__nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--paper);
  font-size: 44px;
  line-height: 1;
  cursor: pointer;
  padding: 10px 16px;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
.lightbox__nav:hover{ opacity: 1; }
.lightbox__nav--prev{ left: 6px; }
.lightbox__nav--next{ right: 6px; }

@media (max-width: 600px){
  .lightbox{ padding: 16px; }
  .lightbox__nav{ font-size: 32px; padding: 6px 10px; }
  .lightbox__close{ top: 10px; right: 12px; }
}
