/* Headings use Michroma (Google Fonts), a wide, squared typeface that matches the wordmark. */

:root {
  --graphite: #16181b;   /* dark ground, matches the dark Onyx photography */
  --graphite-2: #212429;
  --stone: #e3e0da;      /* studio backdrop from the product photography */
  --paper: #f3f2ef;
  --ice: #c3e2fc;        /* fill of the R mark */
  --cobalt: #2f86e0;     /* edge of the R mark */
  --ink: #16181b;
  --mute: #686c73;
  --mute-dark: #a2a6ad;
  --line: rgba(22, 24, 27, .14);
  --line-dark: rgba(243, 242, 239, .16);

  --display: "Michroma", "Eurostile Extended", sans-serif;
  --body: "Manrope", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.display { font-family: var(--display); font-weight: 400; text-transform: uppercase;
  letter-spacing: .01em; line-height: 1.12; margin: 0; }

/* Top bar */
.bar { position: absolute; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; gap: 24px;
  padding: 18px var(--gutter); color: var(--paper); }
/* Top-left mark. The canvas is square and 1.21x the mark's width so it can spin without clipping;
   it overhangs the 44px slot the mark sits in. */
.bar__home { position: relative; display: block; width: 44px; height: 30px; }
.bar__mark { position: absolute; left: 50%; top: 50%; width: 53px; aspect-ratio: 1; transform: translate(-50%, -50%); }
img.bar__mark { width: 44px; aspect-ratio: auto; }
.bar__nav { display: flex; gap: clamp(14px, 2.4vw, 32px); margin-left: auto; font-size: 15px; }
.bar__nav a, .bar__status { text-decoration: none; }
.bar__nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.bar__status { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #7dff9a; }
@media (max-width: 720px) { .bar__nav { display: none; } .bar__status { margin-left: auto; } }

/* Hero */
.hero { position: relative; min-height: 100svh; background: var(--graphite); color: var(--paper);
  display: grid; grid-template-rows: 1fr auto auto; overflow: hidden;
  padding: 110px var(--gutter) clamp(24px, 4vw, 48px); }
.hero__mark { align-self: center; justify-self: center; width: min(78vw, 780px, 80svh);
  animation: rise 1.4s cubic-bezier(.2,.7,.1,1) both; }
.hero__mark img { width: 100%; height: auto; filter: drop-shadow(0 30px 60px color-mix(in srgb, var(--cobalt) 25%, transparent)); }
.hero__word { margin: clamp(24px, 4vw, 48px) 0 0; animation: fade 1s .5s both; }
.hero__word img { width: 100%; height: auto; filter: invert(1); }
.hero__foot { display: flex; justify-content: space-between; align-items: end; gap: 32px;
  margin-top: clamp(20px, 3vw, 36px); padding-top: 20px; border-top: 1px solid var(--line-dark);
  animation: fade 1s .8s both; }
.hero__lede { margin: 0; max-width: 34em; font-size: clamp(17px, 1.6vw, 21px); color: var(--paper); }
.hero__lines { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.hero__lines li { border: 1px solid var(--line-dark); border-radius: 999px; padding: 6px 14px;
  font-size: 14px; color: var(--mute-dark); }
@media (max-width: 720px) { .hero__foot { flex-direction: column; align-items: start; } }
@keyframes rise { from { opacity: 0; transform: translateY(40px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hero__mark, .hero__word, .hero__foot { animation: none; } }

/* About */
.about { padding: clamp(80px, 12vw, 160px) 0; }
/* Statement across the top, then the text with the headshot to its right */
/* minmax(0, 1fr): the column is the screen width, never stretched by the portrait row inside it */
.about__grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "statement" "row";
  gap: clamp(32px, 5vw, 72px) clamp(32px, 6vw, 96px); align-items: start; }
.about__statement { grid-area: statement; max-width: 18em; justify-self: center; text-align: center; }
.about__row { grid-area: row; display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); max-width: 52em; justify-self: center; }
.about__body { flex: 1; min-width: 0; }
.about__body p:last-child { margin-bottom: 0; }
/* Portrait width is set from the text height in app.js; 120px is the fallback */
.about__photo { flex: none; width: var(--photo-w, 120px); max-width: 36%; margin: 0; }
.about__photo img, .about__photo-empty { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.about__photo-empty { display: grid; place-items: center; border: 1px dashed var(--line); background: rgba(22,24,27,.03);
  color: var(--mute); font-size: 14px; }
.about__statement { font-size: clamp(28px, 3.6vw, 52px); }
/* Phones: sized to the screen so the longest word, PERFORMANCE, fits without widening the page */
@media (max-width: 600px) { .about__statement { font-size: 6.2vw; } .about__row { width: 100%; } }
.about__body p { margin: 0 0 1.1em; max-width: 36em; text-align: center; }
.facts { margin: 36px 0 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 9em 1fr; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--mute); }
.facts dd { margin: 0; font-weight: 500; }

/* Work */
.work { background: var(--stone); padding: clamp(72px, 10vw, 140px) 0; }
/* Section heading centred, with the "View all packs" link (homepage) or the filters (Portfolio page) below it */
.work__head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px;
  margin-bottom: clamp(28px, 4vw, 48px); }
.work__head h2 { font-size: clamp(32px, 5vw, 72px); }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.filters button { border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 8px 16px; font-size: 15px; }
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(12px, 1.6vw, 22px);
  grid-template-columns: repeat(12, 1fr); }
.projects li { grid-column: span 4; }
.projects li.is-wide { grid-column: span 8; }
.projects li[hidden] { display: none; }
@media (max-width: 960px) { .projects li, .projects li.is-wide { grid-column: span 6; } }
@media (max-width: 560px) { .projects li, .projects li.is-wide { grid-column: span 12; } }

.card { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.card__media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #d6d2cb; }
/* Wide tiles take their height from the narrow tile beside them. */
.projects li.is-wide .card { height: 100%; display: flex; flex-direction: column; }
.projects li.is-wide .card__media { aspect-ratio: auto; flex: 1; min-height: 0; }
.projects li.is-wide .card__media img { position: absolute; inset: 0; object-position: 50% 35%; }
@media (max-width: 960px) {
  .projects li.is-wide .card__media { aspect-ratio: 4 / 5; flex: none; }
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--zoom, 1));
  transform-origin: var(--focus, 50% 50%); transition: transform .6s cubic-bezier(.2,.7,.1,1); }
.card:hover .card__media img { transform: scale(calc(var(--zoom, 1) * 1.035)); }
@media (prefers-reduced-motion: reduce) { .card__media img { transition: none; } }
.card__meta { display: flex; justify-content: center; align-items: baseline; gap: 12px; padding: 12px 2px 0; }
.card__title { font-family: var(--display); font-size: clamp(14px, 1.15vw, 17px); text-transform: uppercase; }

/* Reel */
.reel { position: relative; background: var(--graphite); color: var(--paper); }
.reel__video { width: 100%; aspect-ratio: 16 / 9; max-height: 92svh; object-fit: cover; }
.reel__caption { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding-bottom: 20px; max-width: none; }
.reel__caption p { margin: 0; font-size: 15px; text-shadow: 0 1px 12px rgba(0,0,0,.5); }
.reel__caption strong { font-family: var(--display); font-weight: 400; text-transform: uppercase; margin-right: 10px; }
.reel__toggle { background: rgba(22,24,27,.6); border: 1px solid var(--line-dark); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; color: var(--paper); backdrop-filter: blur(6px); }

/* Process */
.process { padding: clamp(80px, 11vw, 150px) 0; text-align: center; }
.process h2 { font-size: clamp(30px, 4.4vw, 64px); }
.process__intro { max-width: 38em; margin: 20px auto clamp(32px, 5vw, 64px); color: var(--mute); font-size: 18px; }
.process figure { margin: 0; }
.process__board img { width: 100%; height: auto; }
.process figcaption { margin-top: 10px; font-size: 14px; color: var(--mute); }

/* Services */
.services { background: var(--graphite); color: var(--paper); padding: clamp(80px, 11vw, 150px) 0; }
.services__grid { display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center; gap: clamp(32px, 5vw, 64px); }
.services h2 { font-size: clamp(28px, 3.6vw, 52px); max-width: 16em; }
.services__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; width: 100%; max-width: 56em; }
.services__list li { padding: 22px 0; border-top: 1px solid var(--line-dark); }
.services__list h3 { margin: 0 0 8px; font: 400 clamp(15px, 1.25vw, 18px)/1.3 var(--display); letter-spacing: .01em; text-transform: uppercase; color: var(--ice); }
.services__list p { margin: 0; color: var(--mute-dark); }
@media (max-width: 860px) { .services__grid, .services__list { grid-template-columns: 1fr; } }

/* Contact */
.contact { background: var(--graphite); color: var(--paper); padding: clamp(90px, 12vw, 170px) 0 32px; }
.contact__title { font-size: clamp(32px, 5.6vw, 84px); max-width: 14em; }
.contact__links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 16px 40px; margin: clamp(32px, 4vw, 56px) 0 clamp(80px, 10vw, 140px); }
.contact__email { font-family: var(--display); font-size: clamp(15px, 2.4vw, 32px); letter-spacing: .01em; color: var(--ice);
  text-underline-offset: 8px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.contact__email:hover { color: #fff; }
.contact__li { font-size: 18px; text-underline-offset: 5px; }
.contact__base { border-top: 1px solid var(--line-dark); padding-top: 28px; }
.contact__word { width: 100%; height: auto; filter: invert(1); opacity: .9; }
.contact__base p { margin: 20px 0 0; font-size: 14px; color: var(--mute-dark); }

/* Project viewer */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--graphite); color: var(--paper); overflow-y: auto; }
.viewer::backdrop { background: var(--graphite); }
/* Pack name centred between Previous (left) and Next/Close (right). Equal side columns keep the name
   in the true centre; on narrower screens the name takes its own row with the buttons below. */
.viewer__bar { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "start head end"; align-items: center; gap: 12px 20px;
  padding: 18px var(--gutter); background: rgba(22,24,27,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-dark); }
.viewer__head { grid-area: head; text-align: center; }
.viewer__nav--start { grid-area: start; justify-self: start; }
.viewer__nav--end { grid-area: end; justify-self: end; }
@media (max-width: 1200px) {
  .viewer__bar { grid-template-columns: auto auto; grid-template-areas: "head head" "start end"; justify-content: space-between; }
}
.viewer__cat { margin: 0 0 4px; font-size: 14px; color: var(--mute-dark); }
.viewer__title { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(22px, 3vw, 40px); text-transform: uppercase; }
.viewer__nav { display: flex; gap: 6px; flex-wrap: wrap; }
.viewer__nav button { background: transparent; border: 1px solid var(--line-dark); border-radius: 999px; padding: 8px 14px; font-size: 14px; }
.viewer__nav button:hover { border-color: var(--paper); }
.viewer__close { background: var(--paper) !important; color: var(--ink) !important; }
/* --cols is set from a pack's galleryColumns in app.js */
.viewer__grid { columns: var(--cols, 3) var(--col-min, 320px); column-gap: 14px; padding: 20px var(--gutter) 60px; }
.viewer__grid > * { break-inside: avoid; margin-bottom: 14px; }
.viewer__grid button { display: block; width: 100%; padding: 0; border: 0; background: #2a2d32; cursor: zoom-in; }
.viewer__grid img, .viewer__grid video { width: 100%; height: auto; }

/* Zoom */
.zoom { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(10,11,13,.96); }
.zoom::backdrop { background: rgba(10,11,13,.96); }
.zoom[open] { display: grid; place-items: center; }
.zoom img { max-width: 92vw; max-height: 88dvh; object-fit: contain; }
.zoom__btn, .zoom__close { position: absolute; background: rgba(243,242,239,.1); color: var(--paper);
  border: 1px solid var(--line-dark); border-radius: 999px; }
.zoom__btn { top: 50%; translate: 0 -50%; width: 52px; height: 52px; font-size: 28px; line-height: 1; }
.zoom__prev { left: 16px; } .zoom__next { right: 16px; }
.zoom__close { top: 16px; right: 16px; padding: 8px 16px; font-size: 14px; }

/* Pack description, facts and CADs: one centred column */
.viewer__intro { display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center; gap: clamp(24px, 4vw, 48px);
  padding: clamp(28px, 4vw, 56px) var(--gutter) clamp(20px, 3vw, 36px); max-width: var(--max); margin-inline: auto; }
.viewer__about, .viewer__side { width: 100%; max-width: 46em; }
.viewer__about p { margin: 0 auto 1em; max-width: 38em; font-size: clamp(17px, 1.4vw, 19px); color: var(--paper); }
.viewer__about:empty { display: none; }
.facts--dark { margin: 0; border-top-color: var(--line-dark); }
.facts--dark div { border-bottom-color: var(--line-dark); }
.facts--dark dt { color: var(--mute-dark); }
.facts dt { display: flex; align-items: center; gap: 10px; }
/* In a pack, each fact is centred: icon and label above the value */
.viewer__intro .facts div { grid-template-columns: 1fr; justify-items: center; gap: 6px; }
.viewer__intro .facts dt { justify-content: center; }
.fact-icon { width: 22px; height: 22px; flex: none; }

/* Optional film behind a pack's description and facts */
.viewer__intro.has-backdrop { position: relative; isolation: isolate; max-width: none; overflow: hidden;
  min-height: min(78svh, 720px); align-content: end; padding-top: clamp(120px, 20vh, 240px); }
.viewer__backdrop { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.viewer__intro.has-backdrop::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(22,24,27,.45) 0%, rgba(22,24,27,.66) 45%, rgba(22,24,27,.93) 100%); }
.viewer__intro.has-backdrop .viewer__about p { text-shadow: 0 1px 14px rgba(0,0,0,.45); }

/* CADs: a full-width row under the description and facts, centred on one line */
/* CADs and illustrations: use transparent PNGs (or SVGs) so they sit straight on the page, with no box behind them */
/* Each CAD is its artboard width (set as --artboard in app.js) x --cad-scale, so every pack shows garments at one scale.
   0.4 shows the Seamless Run artboard (464 wide) at about 186px on desktop; 0.275 at about 128px on phones.
   A row too wide for the screen scrolls sideways. Auto margins centre a row that fits
   (justify-content: center would cut off the start of a row that overflows). */
.cads { --cad-scale: .4; grid-column: 1 / -1; justify-self: stretch; display: flex; flex-wrap: nowrap; align-items: flex-end;
  gap: clamp(12px, 2vw, 32px); overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 10px;
  scrollbar-width: thin; scrollbar-color: rgba(243,242,239,.35) transparent; }
.cads img { flex: none; width: calc(var(--artboard, 0) * var(--cad-scale) * 1px); height: auto; }
.cads img:first-child { margin-left: auto; }
.cads img:last-child { margin-right: auto; }
@media (max-width: 600px) { .cads { --cad-scale: .275; } }
.viewer__intro.has-backdrop .facts--dark dt { color: rgba(243,242,239,.78); }

/* Gymshark rights notice under each pack's facts */
.rights { margin: 18px auto 0; max-width: 46em; font-size: 12px; line-height: 1.5; color: var(--mute-dark); }
.viewer__intro.has-backdrop .rights { color: rgba(243,242,239,.7); }

/* Portfolio page title band. Dark so the top bar's light text reads, like the homepage hero. */
.page-head { background: var(--graphite); color: var(--paper); text-align: center; padding: clamp(120px, 16vw, 200px) 0 clamp(48px, 6vw, 80px); }
.page-head__title { font-size: clamp(44px, 9vw, 140px); }
/* Phones: sized to the screen so PORTFOLIO fits across it */
@media (max-width: 600px) { .page-head__title { font-size: 11vw; } }
.page-head__lede { margin: 20px auto 0; max-width: 34em; font-size: clamp(17px, 1.6vw, 21px); color: var(--mute-dark); }
.work__head--filters { margin-bottom: clamp(20px, 3vw, 32px); }
.bar__nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

/* Homepage preview: three equal tiles and a link through to the full Portfolio page */
.projects--preview li { grid-column: span 4; }
@media (max-width: 960px) { .projects--preview li { grid-column: span 6; } .projects--preview li:nth-child(3) { display: none; } }
@media (max-width: 560px) { .projects--preview li { grid-column: span 6; } }
a.card { color: inherit; text-decoration: none; }
.work__all { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ink); border-radius: 999px;
  padding: 10px 20px; font-size: 15px; font-weight: 500; text-decoration: none; }
.work__all:hover { background: var(--ink); color: var(--paper); }

/* Loading screen (first page of a visit only) */
.site-loader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--paper);
  transition: opacity .6s ease, visibility .6s; }
.site-loader canvas { width: min(34vw, 220px); aspect-ratio: 1; }
.site-loader.is-done { opacity: 0; visibility: hidden; }

/* Homepage light/dark flip: a light hero, then sections alternate dark, light, dark down the page.
   These modifiers sit on the homepage sections only; the Portfolio page keeps its own colours. */
.bar--on-light { color: var(--ink); }
.bar--on-light .dot { background: #1f9d4a; }

.hero--light { background: var(--paper); color: var(--ink); }
.hero--light .hero__word img { filter: none; }
.hero--light .hero__lede { color: var(--ink); }
.hero--light .hero__foot { border-top-color: var(--line); }
.hero--light .hero__lines li { border-color: var(--line); color: var(--mute); }
.hero--light .hero__mark img { filter: drop-shadow(0 30px 50px color-mix(in srgb, var(--cobalt) 18%, transparent)); }

.about--dark { background: var(--graphite); color: var(--paper); }
.about--dark .facts { border-top-color: var(--line-dark); }
.about--dark .facts div { border-bottom-color: var(--line-dark); }
.about--dark .facts dt { color: var(--mute-dark); }
.about--dark .about__photo-empty { border-color: var(--line-dark); color: var(--mute-dark); }

.services--light { background: var(--paper); color: var(--ink); }
.services--light .services__list li { border-top-color: var(--line); }
/* Accent orange is too faint for small text on a light ground, so titles use ink with an orange rule */
.services--light .services__list h3 { color: var(--ink); }
.services--light .services__list li { border-top: 2px solid var(--line); }
.services--light .services__list li::before { content: ""; display: block; width: 28px; height: 2px; margin: -24px auto 22px; background: var(--cobalt); }
.services--light .services__list p { color: var(--mute); }

.work--dark { background: var(--graphite); color: var(--paper); }
.work--dark .card__title { color: var(--paper); }
.work--dark .work__all { border-color: var(--paper); color: var(--paper); }
.work--dark .work__all:hover { background: var(--paper); color: var(--ink); }

/* Hero R: water reflections drawn on a canvas laid exactly over the mark (see water-logo.js) */
.hero__mark { position: relative; }
.hero__water { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Section transition (homepage): each section opens out from an inset, rounded panel to full width
   as it scrolls into view. --p runs from 0 to 1 and is set in app.js. */
.tx-section { clip-path: inset(0 calc((1 - var(--p, 1)) * 7vw) round calc((1 - var(--p, 1)) * 36px)); }
.tx-section .tx-item { transform: translateY(calc((1 - var(--p, 1)) * 70px)); }
