/* ============================================================
   MATCHBOX — site styles
   One stylesheet for both pages (index.html and work.html).

   Sections, in order:
     1. Brand tokens        the colours and fonts, defined once
     2. Reset & base        sane defaults
     3. Layout              the container and spacing rhythm
     4. Header & footer     shared top and bottom of every page
     5. Type                headlines, body copy, labels
     6. Homepage            hero, who-list, process, call to action
     7. Work page           the card grid and expanding detail
     8. Motion & focus      accessibility bits
   ============================================================ */


/* ------------------------------------------------------------
   1. BRAND TOKENS
   Defined once here, used everywhere below as var(--name).
   Change a value here and it changes across the whole site.
   Source: Matchbox Brand Kit, 5 Aug 2026.
   ------------------------------------------------------------ */

:root {
  /* Colour */
  --carbon:    #0A0A0A;   /* Carbon Black — the default page ground */
  --dire-wolf: #282828;   /* Dire Wolf — rules, borders, card edges */
  --chrome:    #B8B8B8;   /* Chrome Silver — body copy */
  --bone:      #F9F6EE;   /* Bone White — headlines and emphasis */
  --red:       #DC0000;   /* Hot Red — the accent. Used sparingly. */
  --deep-red:  #8B0000;   /* Deep Red — hover and pressed states only */

  /* Type */
  --display: 'Bebas Neue', Impact, 'Arial Narrow Bold', sans-serif;
  --body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:    'Space Mono', 'Courier New', monospace;

  /* Spacing rhythm. Everything steps through these rather than
     using arbitrary numbers, which is what keeps the grid strict. */
  --gap-xs: 8px;
  --gap-s:  16px;
  --gap-m:  28px;
  --gap-l:  48px;
  --gap-xl: 88px;

  /* Layout widths */
  --page:  1120px;   /* outer limit of the whole page */
  --prose: 660px;    /* reading column — long text never gets wider */
}


/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--carbon);
  color: var(--chrome);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.75;
  min-height: 100vh;
  /* Stops long words shoving the layout sideways on narrow phones. */
  overflow-wrap: break-word;
}

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

a {
  color: var(--bone);
  text-decoration-color: var(--dire-wolf);
  text-underline-offset: 3px;
}

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


/* ------------------------------------------------------------
   3. LAYOUT
   ------------------------------------------------------------ */

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 24px;
}

/* The thin ruled line used as a structural divider throughout.
   Straight from the brand guidelines: precision-instrument aesthetic. */
.rule {
  border: none;
  border-top: 1px solid var(--dire-wolf);
  margin: 0;
}

.section {
  padding: var(--gap-l) 0;
}

/* Long-form reading text is held to a narrow column even on a wide
   screen, because lines longer than about 75 characters are hard to
   track back to the start of. */
.prose {
  max-width: var(--prose);
}

@media (min-width: 900px) {
  .section { padding: var(--gap-xl) 0; }
  .page    { padding: 0 40px; }
}


/* ------------------------------------------------------------
   4. HEADER & FOOTER
   ------------------------------------------------------------ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-s);
  padding: 24px 0;
  border-bottom: 1px solid var(--dire-wolf);
}

.site-header__logo {
  width: 148px;
  flex-shrink: 0;
}

.site-header__logo img {
  width: 100%;
}

.site-nav {
  display: flex;
  gap: var(--gap-m);
}

.site-nav a {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--chrome);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--bone);
  border-bottom-color: var(--red);
}

/* The page you are currently on. */
.site-nav a[aria-current="page"] {
  color: var(--bone);
  border-bottom-color: var(--dire-wolf);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-s);
  justify-content: space-between;
  align-items: center;
  padding: var(--gap-m) 0;
  border-top: 1px solid var(--dire-wolf);
}

.site-footer p,
.site-footer a {
  font-family: var(--mono);
  font-size: 0.688rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chrome);
  opacity: 0.5;
  text-decoration: none;
}

.site-footer a:hover { opacity: 1; }


/* ------------------------------------------------------------
   5. TYPE
   clamp() sets a minimum size, a size that scales with the screen
   width, and a maximum. One line replaces a pile of breakpoints.
   ------------------------------------------------------------ */

/* Big display headline — Bebas Neue, always uppercase. */
.display {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.75rem, 9vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--bone);
}

.display--sm {
  font-size: clamp(2rem, 5.5vw, 3.25rem);
}

/* The single red word or phrase in a headline. */
.accent { color: var(--red); }

/* Small uppercase label that names a section. */
.label {
  font-family: var(--mono);
  font-size: 0.688rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chrome);
  opacity: 0.5;
  margin-bottom: var(--gap-m);
}

/* Body paragraphs. */
.body-copy p + p { margin-top: var(--gap-m); }

.body-copy strong {
  color: var(--bone);
  font-weight: 500;
}

.lead {
  font-size: clamp(1.063rem, 2.4vw, 1.25rem);
  line-height: 1.6;
  color: var(--chrome);
}


/* ------------------------------------------------------------
   6. HOMEPAGE
   ------------------------------------------------------------ */

.hero {
  padding: var(--gap-l) 0 var(--gap-l);
}

.hero__headline { margin-bottom: var(--gap-m); }

.hero__sub { max-width: var(--prose); }

@media (min-width: 900px) {
  .hero { padding: 104px 0 var(--gap-xl); }
}

/* — Who this is for: a ruled list with a small red marker — */

.who-list { list-style: none; }

.who-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--gap-s);
  padding: var(--gap-m) 0;
  border-bottom: 1px solid var(--dire-wolf);
  max-width: var(--prose);
}

.who-list li:first-child { border-top: 1px solid var(--dire-wolf); }

.who-marker {
  width: 6px;
  height: 6px;
  min-width: 6px;
  background: var(--red);
  margin-top: 12px;
}

/* — How it works: numbered process steps — */

.process { border-top: 1px solid var(--dire-wolf); }

.process__item {
  padding: var(--gap-m) 0;
  border-bottom: 1px solid var(--dire-wolf);
}

/* The section already ends with a divider, so the last item drops its
   own border. Otherwise you get two hairlines stacked together. */
.process__item:last-child { border-bottom: none; }

.process__number {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--red);
  margin-bottom: var(--gap-xs);
}

.process__title {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--bone);
  margin-bottom: var(--gap-xs);
}

.process__desc { max-width: var(--prose); }

/* On a wide screen the number and title sit beside the description
   rather than stacking, which makes the list scannable. */
@media (min-width: 800px) {
  .process__item {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--gap-l);
    align-items: start;
  }
  .process__number { grid-column: 1; margin-bottom: var(--gap-xs); }
  .process__title  { grid-column: 1; margin-bottom: 0; }
  .process__desc   { grid-column: 2; grid-row: 1 / 3; }
}

/* — Call to action — */

.cta__headline { margin-bottom: var(--gap-s); }

.cta__sub {
  max-width: var(--prose);
  margin-bottom: var(--gap-l);
}

/* The one red button on the page. */
.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--red);
  color: var(--bone);
  font-family: var(--display);
  font-size: 1.375rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 32px;
  border: 1px solid var(--red);
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.button:hover,
.button:focus-visible {
  background: var(--deep-red);
  border-color: var(--deep-red);
  color: var(--bone);
}

.button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Quieter secondary links below the button. */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-m);
  margin-top: var(--gap-m);
}

.contact-links a {
  font-family: var(--mono);
  font-size: 0.813rem;
  color: var(--chrome);
  text-decoration: none;
  border-bottom: 1px solid var(--dire-wolf);
  padding-bottom: 6px;   /* clears the tails on g, y and @ */
}

.contact-links a:hover {
  color: var(--bone);
  border-bottom-color: var(--red);
}

.signature {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--chrome);
  opacity: 0.5;
  margin-top: var(--gap-l);
}


/* ------------------------------------------------------------
   7. WORK PAGE
   ------------------------------------------------------------ */

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 700px)  { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .work-grid { grid-template-columns: repeat(3, 1fr); } }

/* Each card draws its own hairline with a spread shadow rather than a
   border. Neighbouring cards' lines land on exactly the same pixel, so
   they read as one continuous rule instead of doubling up — and an
   unfilled cell at the end of the grid leaves no empty box behind. */
.work-card {
  background: var(--carbon);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px var(--dire-wolf);
}

/* The clickable part of a card. It is a real <button> so that it
   works with a keyboard and screen readers without extra effort. */
.work-card__trigger {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.work-card__media {
  display: block;   /* it is a <span>, which would otherwise ignore the ratio */
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--dire-wolf);
}

.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s ease;
}

.work-card__trigger:hover .work-card__media img { opacity: 0.72; }

.work-card__text {
  padding: var(--gap-m) var(--gap-m) var(--gap-l);
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
  flex-grow: 1;
}

.work-card__meta {
  font-family: var(--mono);
  font-size: 0.688rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--chrome);
  opacity: 0.5;
}

.work-card__title {
  font-family: var(--display);
  font-size: 1.875rem;
  font-weight: 400;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--bone);
}

.work-card__summary { font-size: 0.938rem; line-height: 1.6; }

/* "Open" affordance at the bottom of each card. */
.work-card__more {
  margin-top: auto;
  padding-top: var(--gap-s);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}

/* — The panel that expands under the grid when a card is opened — */

.work-detail {
  border: 1px solid var(--dire-wolf);
  border-left: 3px solid var(--red);   /* the panel is the active thing on the page */
  margin-top: var(--gap-m);
  padding: var(--gap-l) var(--gap-m) var(--gap-l);
}

.work-detail__head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-s);
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--gap-m);
}

.work-detail__close {
  appearance: none;
  background: none;
  border: 1px solid var(--dire-wolf);
  color: var(--chrome);
  font-family: var(--mono);
  font-size: 0.688rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 16px;
  cursor: pointer;
}

.work-detail__close:hover {
  color: var(--bone);
  border-color: var(--red);
}

.work-detail__body { max-width: var(--prose); }

.work-detail__body p + p { margin-top: var(--gap-s); }

.work-detail__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-m);
  margin-top: var(--gap-m);
}

.work-detail__links a {
  font-family: var(--mono);
  font-size: 0.813rem;
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
  padding-bottom: 2px;
}

/* Image gallery inside an open panel. */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap-s);
  margin-top: var(--gap-l);
}

.gallery img { width: 100%; }

/* — Click-to-play video — */

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--dire-wolf);
  border: none;
  padding: 0;
  cursor: pointer;
  width: 100%;
  overflow: hidden;
}

.video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s ease;
}

.video:hover img { opacity: 0.75; }

/* The red play triangle sitting over the thumbnail. */
.video__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px;
  height: 68px;
  background: var(--red);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.video__play::after {
  content: '';
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent var(--bone);
  margin-left: 4px;
}

.video iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap-m);
  margin-top: var(--gap-l);
}

.video-caption {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--chrome);
  opacity: 0.6;
  margin-top: var(--gap-xs);
}


/* ------------------------------------------------------------
   8. MOTION & FOCUS
   ------------------------------------------------------------ */

/* A visible outline when navigating by keyboard. */
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* Respect the operating system setting for people who get motion
   sickness from animation. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
