/* Summerhouse Land, by Roderick Gordon
   Palette and type take their cue from the book itself: Stanley Donwood's
   black-and-white linocut, uncoated paper stock, silver foil on black board. */

:root {
  --paper: #f6f3ec;
  --paper-warm: #efeae0;
  --ink: #16130f;
  --ink-soft: #575046;
  --ink-faint: #8a8177;
  --board: #0f0d0c;
  --board-soft: #1c1917;
  --silver: #c9c3b8;
  --rule: rgba(22, 19, 15, 0.14);
  --rule-dark: rgba(246, 243, 236, 0.16);

  --font-display: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'EB Garamond', ui-serif, Georgia, 'Times New Roman', serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --wide: 78rem;

  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.9rem);
  --step-0: clamp(1.09rem, 1.03rem + 0.3vw, 1.28rem);
  --step-1: clamp(1.3rem, 1.19rem + 0.55vw, 1.66rem);
  --step-2: clamp(1.6rem, 1.36rem + 1.2vw, 2.35rem);
  --step-3: clamp(2.05rem, 1.55rem + 2.5vw, 3.6rem);
  --step-4: clamp(2.6rem, 1.6rem + 5vw, 6rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  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 {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  font-feature-settings: 'kern' 1, 'liga' 1, 'onum' 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-display);
  font-size: var(--step--1);
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- layout ---------- */

.wrap {
  width: min(100% - var(--gutter) * 2, var(--wide));
  margin-inline: auto;
}

.prose {
  width: min(100% - var(--gutter) * 2, var(--measure));
  margin-inline: auto;
}

.prose > * { margin-block: 0; }
.prose > * + * { margin-top: 1.15em; }

.prose h2 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.018em;
  margin: 2.4em 0 0;
}

.prose h3 {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 2em 0 0;
}

.prose a { text-decoration: underline; text-decoration-color: var(--ink-faint); }
.prose a:hover { text-decoration-color: currentColor; }

.section { padding-block: clamp(3.5rem, 9vw, 7.5rem); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ---------- header ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 90;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}

.masthead__inner {
  width: min(100% - var(--gutter) * 2, var(--wide));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand__mark { width: 1.6rem; height: 1.6rem; flex: none; }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.1rem); }

.nav a {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding-block: 0.4rem;
  position: relative;
  transition: color 0.2s var(--ease);
}

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

.nav a[aria-current='page'] { color: var(--ink); }

.nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.15rem;
  height: 1px;
  background: var(--ink);
}

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.5rem 0.7rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ink);
}

@media (max-width: 46rem) {
  .nav__toggle { display: block; }

  .nav {
    position: fixed;
    inset: 4.25rem 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1.5rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  }

  .nav[data-open='true'] { opacity: 1; transform: none; pointer-events: auto; }

  .nav a {
    padding-block: 0.95rem;
    border-bottom: 1px solid var(--rule);
    font-size: 0.85rem;
  }

  .nav a[aria-current='page']::after { display: none; }
}

/* ---------- hero ---------- */

.hero {
  background: var(--board);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}

.hero__inner {
  width: min(100% - var(--gutter) * 2, var(--wide));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding-block: clamp(3.5rem, 9vw, 7rem);
}

@media (max-width: 54rem) {
  .hero__inner { grid-template-columns: 1fr; text-align: left; }
}

.hero__eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--silver);
  margin: 0 0 1.4rem;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}

.hero__byline {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 0.7rem + 0.6vw, 1.05rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--silver);
  margin: 1.5rem 0 0;
}

.hero__lede {
  font-size: var(--step-1);
  line-height: 1.45;
  color: color-mix(in srgb, var(--paper) 82%, transparent);
  margin: 1.9rem 0 0;
  max-width: 36ch;
  text-wrap: pretty;
}

.hero__art {
  margin: 0;
  box-shadow: 0 2.5rem 5rem rgba(0, 0, 0, 0.55);
}

.hero__art img { width: 100%; }

/* ---------- buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.95rem 1.6rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:hover { transform: translateY(-1px); }

.btn--solid {
  background: var(--paper);
  color: var(--board);
  border-color: var(--paper);
}
.btn--solid:hover { background: var(--silver); border-color: var(--silver); }

.btn--ghost { color: var(--paper); }
.btn--ghost:hover { background: rgba(246, 243, 236, 0.1); }

.btn--ink {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn--ink:hover { background: var(--board-soft); }

.btn--outline { color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }

/* ---------- page header ---------- */

.pagehead {
  position: relative;
  background: var(--board);
  color: var(--paper);
  overflow: hidden;
}

.pagehead__media {
  position: absolute;
  inset: 0;
}

.pagehead__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  opacity: 0.55;
}

/* Scrim keeps the heading legible over whichever part of the photograph
   the crop happens to land on. */
.pagehead__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(15, 13, 12, 0.94) 0%, rgba(15, 13, 12, 0.74) 42%, rgba(15, 13, 12, 0.34) 100%);
}

.pagehead__inner {
  position: relative;
  width: min(100% - var(--gutter) * 2, var(--wide));
  margin-inline: auto;
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
}

.pagehead__title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

.pagehead__sub {
  font-size: var(--step-1);
  color: color-mix(in srgb, var(--paper) 78%, transparent);
  margin: 1.1rem 0 0;
  max-width: 44ch;
  text-wrap: pretty;
}

/* ---------- editorial pieces ---------- */

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink);
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.4rem;
}

.dialogue {
  margin: 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--rule);
}

.dialogue p { margin: 0; }
.dialogue p + p { margin-top: 1.1em; }

.dialogue .speaker {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: block;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}

.chapter {
  margin-top: 3.5rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--rule);
}

.chapter__label {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-faint);
  margin: 0 0 2.2rem;
}

/* Drop cap sets the opening of the extract like a printed page. */
.chapter__body > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.4em;
  line-height: 0.78;
  padding: 0.06em 0.1em 0 0;
  color: var(--ink);
}

/* Set as a printed page: no space between paragraphs, indent instead. */
.chapter__body p { margin: 0; }
.chapter__body > p + p { text-indent: 1.6em; }

.callout {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: clamp(1.5rem, 4vw, 2.4rem);
}

.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

.downloads {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.downloads a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.downloads a:hover { border-color: var(--ink); transform: translateY(-1px); }

.downloads .meta {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ---------- figures and galleries ---------- */

.figure { margin: 0; }

.figure figcaption,
.gallery figcaption {
  font-size: var(--step--1);
  color: var(--ink-faint);
  margin-top: 0.7rem;
  line-height: 1.45;
}

.feature {
  width: min(100% - var(--gutter) * 2, var(--wide));
  margin: clamp(3rem, 7vw, 5rem) auto;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: clamp(0.6rem, 1.6vw, 1.1rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery li { margin: 0; }

.gallery button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--paper-warm);
  cursor: zoom-in;
  overflow: hidden;
  border-radius: 2px;
  position: relative;
}

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.55s var(--ease), opacity 0.3s var(--ease);
}

.gallery button:hover img { transform: scale(1.035); }

/* ---------- lightbox ---------- */

/* The UA stylesheet hides a closed <dialog> with display:none, so the open
   state has to be qualified or the chrome sits on top of the page. */
.lightbox:not([open]) { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(10, 9, 8, 0.94);
  padding: clamp(1rem, 4vw, 3rem);
  border: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  overflow: hidden;
}

.lightbox::backdrop { background: rgba(10, 9, 8, 0.94); }

.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  object-fit: contain;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.6);
}

.lightbox__caption {
  color: var(--silver);
  font-size: var(--step--1);
  text-align: center;
  margin-top: 1.1rem;
  min-height: 1.4em;
}

.lightbox__btn {
  position: absolute;
  background: rgba(246, 243, 236, 0.08);
  border: 1px solid rgba(246, 243, 236, 0.24);
  color: var(--paper);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  line-height: 1;
  transition: background-color 0.2s var(--ease);
}

.lightbox__btn:hover { background: rgba(246, 243, 236, 0.2); }
.lightbox__btn[hidden] { display: none; }

.lightbox__close { top: clamp(0.75rem, 3vw, 1.75rem); right: clamp(0.75rem, 3vw, 1.75rem); }
.lightbox__prev { left: clamp(0.5rem, 2.5vw, 1.75rem); top: 50%; transform: translateY(-50%); }
.lightbox__next { right: clamp(0.5rem, 2.5vw, 1.75rem); top: 50%; transform: translateY(-50%); }

/* ---------- editions ---------- */

.editions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: clamp(1rem, 2.5vw, 1.6rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.edition {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

.edition h3 {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
}

.edition p { margin: 0; color: var(--ink-soft); font-size: var(--step--1); line-height: 1.55; }

.edition .price {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.edition .btn { margin-top: auto; align-self: flex-start; }

.edition[data-status='sold-out'] { opacity: 0.72; }

.tag {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-faint);
}

/* ---------- dark band ---------- */

.band {
  background: var(--board);
  color: var(--paper);
}

.band .eyebrow { color: var(--silver); }
.band .prose h2 { color: var(--paper); }
.band .prose { color: color-mix(in srgb, var(--paper) 84%, transparent); }
.band a { color: var(--paper); }

/* ---------- footer ---------- */

.footer {
  background: var(--board);
  color: var(--silver);
  padding-block: clamp(3rem, 7vw, 5rem) 2.5rem;
  font-size: var(--step--1);
}

.footer__inner {
  width: min(100% - var(--gutter) * 2, var(--wide));
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
  gap: clamp(2rem, 5vw, 3.5rem);
}

.footer h2 {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 1rem;
}

.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer a { color: var(--silver); text-decoration: none; }
.footer a:hover { color: var(--paper); text-decoration: underline; }

.footer__mark { width: 2.6rem; height: 2.6rem; margin-bottom: 1.1rem; opacity: 0.85; }

.footer__base {
  width: min(100% - var(--gutter) * 2, var(--wide));
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule-dark);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  justify-content: space-between;
  color: rgba(201, 195, 184, 0.7);
  font-size: 0.8rem;
}

/* ---------- misc ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media print {
  .masthead, .footer, .gallery, .actions, .lightbox { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .pagehead { background: #fff; color: #000; }
  .pagehead__media { display: none; }
}
