/* ==========================================================================
   Sylvia Wrath — main stylesheet
   Sizes come from the 1336 px design. Values in cqi scale with the width of
   their section: 1cqi = 1% of it, so 310px at 1336 = 310 / 1336 * 100 = 23.204cqi.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --red: #cc0000;
  --linen: #faf0e6;
  --ink: #1d1d1b;
  --overlay-hover: rgb(29 29 27 / 0.65);
  --overlay-gate: rgb(29 29 27 / 0.85);

  --font-display: "nickel-gothic-variable", "Arial Narrow", sans-serif;
  --font-body: "source-sans-pro", "Source Sans 3", system-ui, sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

html:has(.gate[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.125rem;          /* 18px */
  line-height: 1.3333;          /* 24px */
}

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

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* ---------- Landing ---------- */
.hero {
  container: hero / inline-size;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--red);
  color: var(--ink);
}

.hero__inner { inline-size: fit-content; }

.hero__title,
.hero__tagline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "slnt" 0, "wdth" 100;
  text-transform: uppercase;
}

.hero__title {
  font-size: 23.204cqi;         /* 310px at 1336 */
  line-height: 0.7323;          /* 227px */
}

.hero__line { display: block; }

.hero__tagline {
  margin-top: 0.4576em;         /* matches the 22px gap under WRATH */
  font-size: 4.416cqi;          /* 59px at 1336 */
  line-height: 0.4576;          /* 27px */
  letter-spacing: 0.014em;
  text-align: end;
}

/* ---------- Gallery ---------- */
.gallery {
  container: gallery / inline-size;   /* full width, so cqi matches the design */
  padding-block: max(2.5rem, 3.67cqi) max(3rem, 4.2cqi);
}

.gallery__header,
.gallery__notice { padding-inline: var(--gutter); text-align: center; }

.gallery__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "slnt" 0, "wdth" 100;
  text-transform: uppercase;
  font-size: max(1.375rem, 2.919cqi);   /* 39px at 1336 */
  line-height: 1.0256;                  /* 40px */
  text-wrap: balance;
}

.brand {
  display: block;
  margin-bottom: 0.28em;
  color: var(--red);
}

.brand__small { font-size: 0.6667em; } /* 26px against 39px — scales with it */

.gallery__intro {
  max-width: 31.5em;
  margin: 0 auto;
  text-wrap: pretty;
}

.gallery__intro:first-of-type { margin-top: 0.75rem; }

.accent { color: var(--red); }
.link-prefix { color: var(--ink); }

.gallery__notice { margin: 2rem 0 0; }

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7.036cqi;                         /* 94px at 1336 */
  width: 83.08cqi;                       /* 4 × 207px + 3 × 94px at 1336 */
  margin: max(2rem, 4.19cqi) auto 0;
  padding: 0;
  list-style: none;
}

@container gallery (width < 1000px) {
  .gallery__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: calc(100% - 2 * var(--gutter));
    gap: clamp(1rem, 5cqi, 2.5rem);
  }
}

@container gallery (width < 700px) {
  .gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container gallery (width < 440px) {
  .gallery__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Gallery card ---------- */
.card {
  container-type: inline-size;
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.card__img {
  width: 100%;
  background: rgb(29 29 27 / 0.08);     /* placeholder until the image loads */
}

.card__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8%;
  background: var(--overlay-hover);
  color: var(--linen);
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card__title {
  font-weight: 600;
  font-size: min(17.874cqi, 2.3125rem);  /* 37px on a 207px card, never larger */
  line-height: 1.027;                    /* 38px */
  overflow-wrap: anywhere;
}

@media (hover: hover) {
  .card:hover .card__overlay { opacity: 1; }
}

.card:focus-visible .card__overlay,
.card.is-revealed .card__overlay { opacity: 1; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 2rem var(--gutter) 2.5rem;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
}

.site-footer p { margin: 0; }

/* ---------- Age gate ---------- */
.gate {
  width: min(34rem, 100% - 2rem);
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 0;
  border-top: 0.75rem solid var(--red);
  background: var(--linen);
  color: var(--ink);
}

.gate::backdrop { background: var(--overlay-gate); }

.gate__panel {
  display: grid;
  justify-items: center;
  gap: 2rem;
  padding: clamp(2rem, 6vw, 3rem) clamp(1.25rem, 5vw, 2.5rem) 1.5rem;
  text-align: center;
}

.gate__panel[hidden] { display: none; }

.gate__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "slnt" 0, "wdth" 100;
  text-transform: uppercase;
  font-size: clamp(1.625rem, 6vw, 2.4375rem); /* up to 39px */
  line-height: 1.0256;
  text-wrap: balance;
}

.gate__title > span { display: block; }
.gate__accent { color: var(--red); }

.gate__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.btn {
  min-width: 7.5rem;
  min-height: 3rem;
  padding: 0.6em 1.75em;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 700 1.125rem/1 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

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

.btn--primary { border-color: var(--red); background: var(--red); color: var(--linen); }
.btn--primary:hover { border-color: var(--ink); background: var(--ink); }

.gate .btn:focus-visible { outline-color: var(--ink); }

.gate__legal {
  font-weight: 400;
  font-size: 1rem;
}

/* ---------- Legal pages ---------- */
.legal {
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) var(--gutter) 2rem;
}

.legal__title {
  margin: 1.5rem 0 2rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "slnt" 0, "wdth" 100;
  text-transform: uppercase;
  font-size: 2.4375rem;
  line-height: 1.0256;
}

.legal h2 { margin: 2rem 0 0.5rem; font-size: 1.125rem; line-height: 1.3333; }
.legal p { margin: 0; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
