/* ==========================================================================
   TIGER WOLF — design system
   Palette, type and grid per the build brief. Light only by design: the brand
   has a fixed palette and a dark variant would misrepresent it.
   ========================================================================== */

@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* ---- brand palette (build brief) ---- */
  --forest: #142e21;
  --cream: #f4eee1;
  --champagne: #ded9b1;
  --grey: #8a9189;
  --grey-text: #6b736a;   /* readable small text, replaces --grey for copy */
  --white: #ffffff;
  --ink: #0d1a13;

  /* ---- semantic ---- */
  --bg: var(--cream);
  --fg: var(--forest);
  --fg-muted: var(--grey-text);
  --rule: rgba(20, 46, 33, 0.14);

  /* ---- type ---- */
  --font-display: 'Archivo', 'Arial Black', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Display: brief specifies weight 800, width 125%, tracking .20em */
  --display-stretch: 125%;
  --display-weight: 800;
  --display-track: 0.2em;

  --t-hero: clamp(2.125rem, 7vw, 5rem);
  --t-title: clamp(1.625rem, 4vw, 2.75rem);
  --t-section: clamp(1.125rem, 2vw, 1.5rem);
  --t-label: 0.6875rem;
  --t-nav: 0.75rem;
  --t-body: 1.0625rem;
  --t-small: 0.8125rem;

  /* ---- grid: deliberately tight gutters, 3–8px per the brief ---- */
  --gutter: 4px;
  --page-pad: 16px;
  --max-w: 1440px;
  --content-w: 68ch;

  --space-section: clamp(3.5rem, 8vw, 7rem);
}

@media (min-width: 750px) {
  :root { --gutter: 6px; --page-pad: 24px; }
}
@media (min-width: 1200px) {
  :root { --gutter: 8px; --page-pad: 32px; }
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--t-body);
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* Respect the user's motion preference everywhere. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- type utilities ---- */
.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--display-track);
  text-transform: uppercase;
  line-height: 0.95;
  /* Tracking adds trailing space after the final glyph; pull it back so
     the text optically aligns with the left edge of the block. */
  margin-right: calc(var(--display-track) * -1);
}
.hero-type { font-size: var(--t-hero); }
.page-title { font-size: var(--t-title); }
.section-title { font-size: var(--t-section); }

/* Style names run long ("Textured Quarter-Zip Polo"). At full display
   tracking a long name eats the whole measure, so give it its own ceiling
   and let it wrap on a tighter line. */
.style-title {
  font-size: clamp(1.25rem, 2.4vw, 1.875rem);
  line-height: 1.05;
  max-width: 22ch;
}

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

.label {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--display-track);
  text-transform: uppercase;
  font-size: var(--t-label);
  line-height: 1;
  color: var(--fg-muted);
}

.prose { max-width: var(--content-w); }
.prose p { margin: 0 0 1.1em; }
.small { font-size: var(--t-small); color: var(--fg-muted); }

/* ---- layout ---- */
.wrap {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}
.bleed { width: 100%; }
.section { margin-block: var(--space-section); }
.stack > * + * { margin-top: 1rem; }

/* Skip link: visible only on focus. */
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--page-pad);
  top: 8px;
  z-index: 100;
  background: var(--forest);
  color: var(--cream);
  padding: 0.5rem 0.75rem;
  border-radius: 2px;
}

/* ---- header ---- */
.site-header {
  background: var(--forest);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 0.875rem var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.site-header__mark { display: block; }
.site-header__mark img {
  width: clamp(150px, 20vw, 208px);
  height: auto;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: clamp(0.875rem, 3vw, 2.25rem);
}
.site-nav a {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--display-track);
  text-transform: uppercase;
  font-size: var(--t-nav);
  text-decoration: none;
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a:focus-visible { border-bottom-color: var(--champagne); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--champagne); }

/* Archivo at 125% width with .20em tracking is far wider than its point size
   suggests, so four nav items overrun a phone before the type looks small.
   Stack the header and pull both the size and the tracking in, rather than
   hiding items behind a menu button for a four-link nav. */
@media (max-width: 719px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
    padding-block: 0.75rem;
  }
  .site-header__mark img { width: 132px; }
  .site-nav { width: 100%; }
  .site-nav ul { flex-wrap: wrap; gap: 0.5rem 0.9rem; }
  .site-nav a { font-size: 0.625rem; letter-spacing: 0.1em; padding-block: 0.2rem; }
}

/* ==========================================================================
   MEDIA
   Every slot is sized by aspect-ratio so the page never reflows while images
   load, which matters most on the hero. Ratios match the spec sent to Malcolm.
   ========================================================================== */
.media {
  position: relative;
  overflow: hidden;
  background: var(--champagne);
}
/* eleventy-img wraps every image in <picture>, so the img is a grandchild of
   .media, not a child. Descendant selectors throughout — a child selector
   here silently drops object-fit and the frame renders at its natural size
   cropped to the top-left corner. */
.media > picture { display: block; width: 100%; height: 100%; }
.media img,
.media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.r-4x5  { aspect-ratio: 4 / 5; }
.r-3x2  { aspect-ratio: 3 / 2; }
.r-1x1  { aspect-ratio: 1 / 1; }
.r-16x9 { aspect-ratio: 16 / 9; }

/* Hero: 16:9 on desktop, 4:5 on phones — two sources, not one crop. */
.hero { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--forest); }
@media (min-width: 750px) { .hero { aspect-ratio: 16 / 9; } }
.hero > picture,
.hero > img,
.hero > video { position: absolute; inset: 0; }
.hero img, .hero video {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Stand-in header: a World that has not been photographed yet shows its 4:5
   Home tile. On desktop the hero is 16:9, so a centred crop of that portrait
   frame lands on the torso and cuts the head off. Bias the crop upward until
   the real 16:9 header arrives, at which point this class is not emitted. */
@media (min-width: 750px) {
  .hero--standin img { object-position: 50% 10%; }
}

.hero__caption {
  position: absolute;
  left: var(--page-pad);
  bottom: clamp(1.25rem, 4vw, 2.5rem);
  right: var(--page-pad);
  color: var(--cream);
  /* Scrim rather than a flat overlay: keeps the image bright at the top
     while guaranteeing contrast behind the type. */
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.45);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13, 26, 19, 0.55) 0%, rgba(13, 26, 19, 0) 45%);
  pointer-events: none;
}

/* ---- grids ---- */
.grid {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 750px)  { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

/* Worlds: seven tiles never divide evenly into a 2, 3 or 4 column grid, so
   rather than leave an orphan the last one runs full width as a band. */
.grid--worlds { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 750px) { .grid--worlds { grid-template-columns: repeat(3, 1fr); } }
.grid--worlds > :last-child { grid-column: 1 / -1; }

/* Diptych: two frames that read as one spread. */
.diptych { display: grid; gap: var(--gutter); grid-template-columns: repeat(2, 1fr); }

/* World tile: image with the name sitting on it. */
.tile { position: relative; display: block; text-decoration: none; color: var(--cream); }
.tile .media { background: var(--forest); }
.tile::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13, 26, 19, 0.6) 0%, rgba(13, 26, 19, 0) 55%);
  transition: background 200ms ease;
}
.tile:hover::after,
.tile:focus-visible::after {
  background: linear-gradient(to top, rgba(13, 26, 19, 0.72) 0%, rgba(13, 26, 19, 0.1) 70%);
}
.tile__name {
  position: absolute;
  left: clamp(0.625rem, 2vw, 1.125rem);
  bottom: clamp(0.625rem, 2vw, 1.125rem);
  z-index: 1;
  font-size: clamp(0.75rem, 1.4vw, 1rem);
  color: var(--cream);
}

/* Studio-on-white frames sit on a cream page, so give them a deliberate
   white panel with a defined edge — reads as a studio plate, not a mismatch. */
.media--studio {
  background: var(--white);
  border: 1px solid var(--rule);
}
/* Studio frames show the whole garment, so contain rather than cover — and
   this needs to sit after the .media rule above to win on order. */
.media--studio img { object-fit: contain; padding: 6%; }

/* ---- footer ---- */
.site-footer {
  background: var(--forest);
  color: var(--cream);
  margin-top: var(--space-section);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.site-footer a { color: var(--champagne); }
.site-footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 750px) {
  .site-footer__grid { grid-template-columns: 1.2fr 1fr 1fr; }
}
.site-footer .small { color: rgba(244, 238, 225, 0.72); }
.site-footer__wolf {
  width: clamp(86px, 11vw, 124px);
  height: auto;
  margin-bottom: 1.25rem;
}

/* ---- form ---- */
.form { max-width: 34rem; }
.field { margin-bottom: 1.125rem; }
.field label {
  display: block;
  margin-bottom: 0.375rem;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--display-track);
  text-transform: uppercase;
  font-size: var(--t-label);
}
.field input,
.field textarea {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.8rem;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 1px;
}
.field textarea { min-height: 8rem; resize: vertical; }
.btn {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--display-track);
  text-transform: uppercase;
  font-size: var(--t-label);
  background: var(--forest);
  color: var(--cream);
  border: 0;
  border-radius: 2px;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
}
.btn:hover { background: var(--ink); }
.hp { position: absolute; left: -9999px; }

/* The reCAPTCHA widget is a fixed-width Google iframe and is the one element
   on the site we don't control the look of. Give it room and a margin so it
   reads as part of the form, and let it shrink rather than overflow on a
   narrow phone — it is 304px wide, which is more than a 320px screen has
   once the page gutters are taken off. */
.captcha { margin: 1.5rem 0 1.25rem; }
.captcha > div { max-width: 100%; }
@media (max-width: 359px) {
  .captcha {
    transform: scale(0.88);
    transform-origin: left top;
  }
}

/* Awaiting photography. Deliberately quiet: a striped box stamped with a
   slot code reads as a broken page to anyone who isn't building it, and this
   preview is being shown to Joyce and Moe. */
.is-placeholder {
  display: grid;
  place-items: center;
  background: var(--champagne);
}
.is-placeholder span {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-stretch: var(--display-stretch);
  letter-spacing: var(--display-track);
  text-transform: uppercase;
  font-size: 0.625rem;
  color: var(--forest);
  opacity: 0.55;
  text-align: center;
  line-height: 1.4;
}
