/* ==========================================================================
   Affinity Ink — theme.css
   Design tokens, reset, typography, header, footer and shared components.

   Direction: cinematic. Near-black ground, full-bleed photography carrying
   every section, one signature red held back for actions and rules only.
   The studio's own storefront neon and the black-and-white shot of a needle
   in skin are the two images the whole site is built around.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Ground — near-black with a cool bias, never pure #000 */
  --ground:      #08090B;
  --ground-2:    #0C0E11;
  --surface:     #12151A;
  --surface-hi:  #191D23;

  /* Ink — warm off-white against the cool ground */
  --ink:        #F4F2EE;
  --ink-2:      #B9B5AE;
  --ink-3:      #7C7972;

  /* The one accent: the studio's existing Affinity red */
  --red:        #D6361C;
  --red-hi:     #F0553A;
  --red-dim:    rgba(214, 54, 28, 0.34);
  --red-faint:  rgba(214, 54, 28, 0.10);
  --on-red:     #FFFFFF;

  --line:       rgba(185, 181, 174, 0.15);
  --line-soft:  rgba(185, 181, 174, 0.08);

  /* Shadows carry the ground's hue rather than neutral black */
  --shadow-md:  0 14px 34px -18px rgba(2, 4, 8, 0.9);
  --shadow-lg:  0 40px 90px -40px rgba(2, 4, 8, 0.98);

  --display: "Big Shoulders Display", "Oswald", "Arial Narrow", sans-serif;
  --label:   "Oswald", "Arial Narrow", sans-serif;
  --body:    "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-mega:  clamp(3.25rem, 12vw, 10rem);
  --fs-h1:    clamp(2.5rem, 7.5vw, 6rem);
  --fs-h2:    clamp(1.9rem, 4.6vw, 3.6rem);
  --fs-h3:    clamp(1.15rem, 2vw, 1.5rem);
  --fs-lead:  clamp(1.02rem, 1.5vw, 1.25rem);
  --fs-body:  1.0625rem;
  --fs-small: 0.9375rem;
  --fs-label: 0.7rem;

  --sp-1: 0.25rem; --sp-2: 0.5rem;  --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.5rem;  --sp-6: 2rem;    --sp-7: 3rem;    --sp-8: 4rem;
  --sp-9: 6rem;    --sp-10: 8rem;

  --wrap:   80rem;
  --gutter: clamp(1.15rem, 4vw, 3rem);
  --section: clamp(3.5rem, 9vw, 7rem);

  /* Radius by role, not one value stamped on everything */
  --r-tight: 1px;
  --r-soft:  4px;
  --r-round: 999px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur:  240ms;

  --z-nav: 60;
  --z-grain: 40;
  --z-skip: 90;
}

/* --------------------------------------------------------------------------
   2. Reset and base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Clip sideways here rather than only on body. With overflow-x on body
     alone the used overflow-y becomes auto and which element counts as the
     scroll container stops being predictable across engines - which breaks
     anything reading scroll position, the parallax included. */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: var(--red-faint);
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; background-color: var(--surface); }

/* The hidden attribute must beat every component display rule below it. */
[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 0.94; text-wrap: balance; }
h1, h2 { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.008em; }
h3 { font-family: var(--label); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.15; }

p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

/* One focus treatment for the entire site. Never removed anywhere. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--red-hi);
  outline-offset: 3px;
  border-radius: var(--r-soft);
}

::selection { background: var(--red); color: var(--on-red); }

/* --------------------------------------------------------------------------
   3. Utilities
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  min-width: 0;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 54rem; }

.section { padding-block: var(--section); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--alt { background: var(--ground-2); }

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

.skip-link {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -130%);
  z-index: var(--z-skip);
  background: var(--red); color: var(--on-red);
  font-family: var(--label); font-size: var(--fs-label);
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.85rem 1.4rem;
  border-radius: 0 0 var(--r-soft) var(--r-soft);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus-visible { transform: translate(-50%, 0); color: var(--on-red); }

/* Eyebrow — a label with a red rule running into it */
.eyebrow {
  display: flex; align-items: center; gap: var(--sp-3);
  font-family: var(--label); font-size: var(--fs-label); font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--red-hi);
  margin: 0 0 var(--sp-4);
}
.eyebrow::before {
  content: ""; flex: none;
  width: 34px; height: 2px; background: var(--red);
}

.lead { font-size: var(--fs-lead); color: var(--ink-2); line-height: 1.55; max-width: 54ch; }
.muted { color: var(--ink-2); }

/* Section heading block */
.section-head { display: grid; gap: var(--sp-4); margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head h2 { font-size: var(--fs-h2); }
.section-head .lead { max-width: 56ch; }
.section-head--split {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--sp-5) clamp(2rem, 6vw, 5rem);
  align-items: end;
}
.section-head--split > * { min-width: 0; }

/* Film grain over the whole page — breaks the flatness of large dark fields */
.grain {
  position: fixed; inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.30;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='150' height='150' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 50px;
  padding: 0.85rem 1.8rem;
  border: 1px solid transparent;
  border-radius: var(--r-tight);
  font-family: var(--label); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  cursor: pointer; touch-action: manipulation;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform 120ms var(--ease);
}
.btn--primary { background: var(--red); color: var(--on-red); border-color: var(--red); }
.btn--primary:hover { background: var(--red-hi); border-color: var(--red-hi); color: var(--on-red); }

.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--ground); }

.btn--outline-red { background: transparent; border-color: var(--red-dim); color: var(--red-hi); }
.btn--outline-red:hover { border-color: var(--red); background: var(--red-faint); color: var(--red-hi); }

.btn:active { transform: translateY(1px); }
.btn--lg { min-height: 58px; padding: 1rem 2.4rem; font-size: 0.85rem; }
.btn--sm { min-height: 42px; padding: 0.5rem 1.1rem; font-size: 0.7rem; }

/* Tertiary action that still reads as one */
.link-arrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 44px;
  font-family: var(--label); font-size: 0.76rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red-hi);
}
.link-arrow .arrow { transition: transform var(--dur) var(--ease); }
.link-arrow:hover .arrow { transform: translateX(5px); }

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0;
  z-index: var(--z-nav);
  background: rgba(8, 9, 11, 0.88);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.site-header__inner {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-5);
  min-height: 72px;
}
.site-header__inner > * { min-width: 0; }

/* The logo is cyan and magenta artwork on white. The old build bleached it
   to a solid white square with brightness(0) invert(1); it is shown here on
   its own dark plate so the real mark reads. */
.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.brand img {
  width: 46px; height: 46px;
  object-fit: contain;
  background: transparent;
  border-radius: var(--r-soft);
}
.brand__text {
  display: grid;
  font-family: var(--display);
  text-transform: uppercase;
  line-height: 0.86;
}
.brand__text b { font-weight: 800; font-size: 1.35rem; letter-spacing: 0.01em; }
.brand__text span {
  font-family: var(--label); font-weight: 400;
  font-size: 0.56rem; letter-spacing: 0.3em; color: var(--ink-3);
  margin-top: 0.28rem;
}

.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 50px; height: 50px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-tight);
  color: var(--ink);
  cursor: pointer; touch-action: manipulation;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-toggle:hover { border-color: var(--red); color: var(--red-hi); }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.site-nav ul { display: flex; align-items: center; gap: clamp(0.9rem, 2.2vw, 2rem); }
.site-nav a {
  display: inline-flex; align-items: center;
  min-height: 44px;
  font-family: var(--label); font-size: 0.76rem; font-weight: 400;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--ink-2);
  transition: color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 0 var(--red); }
.site-nav a.btn { min-height: 44px; padding: 0.6rem 1.1rem; letter-spacing: 0.14em; }
/* .site-nav a is more specific than .btn--*, so restate the button colours. */
.site-nav a.btn--outline-red { color: var(--red-hi); }
.site-nav a.btn--outline-red:hover { color: var(--red-hi); }

/* --------------------------------------------------------------------------
   6. Page hero used by every interior page
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(3.5rem, 10vw, 7rem) clamp(2.5rem, 7vw, 4.5rem);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(120% 130% at 85% 0%, rgba(214, 54, 28, 0.16), transparent 58%),
    var(--ground);
}
.page-hero h1 { font-size: var(--fs-h1); max-width: 14ch; }
.page-hero .lead { margin-top: var(--sp-5); }

/* --------------------------------------------------------------------------
   7. Closing call to action, shared by every page
   -------------------------------------------------------------------------- */
.cta-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--ground-2);
}
.cta-band::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(90% 160% at 8% 100%, rgba(214, 54, 28, 0.22), transparent 62%);
}
.cta-band__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-6);
  padding-block: clamp(3rem, 8vw, 5.5rem);
}
.cta-band h2 { font-size: var(--fs-h2); }
.cta-band p { color: var(--ink-2); margin-top: var(--sp-4); max-width: 46ch; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-self: end; }

/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ground);
  padding-block: var(--sp-8) var(--sp-5);
  padding-bottom: max(var(--sp-5), env(safe-area-inset-bottom));
}
.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
  gap: var(--sp-7) var(--sp-6);
  align-items: start;
}
.site-footer .brand { margin-bottom: var(--sp-4); }
.site-footer address {
  font-style: normal;
  color: var(--ink-2);
  font-size: var(--fs-small);
  line-height: 1.8;
}
.site-footer address a {
  display: inline-block;
  padding-block: 0.65rem;
  text-decoration: underline;
  text-decoration-color: var(--red-dim);
  text-underline-offset: 0.2em;
}
.site-footer address a:hover { color: var(--red-hi); }

.footer-heading {
  font-family: var(--label); font-size: var(--fs-label);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--red-hi);
  margin-bottom: var(--sp-3);
}
.footer-list { display: flex; flex-direction: column; }
.footer-list a {
  display: inline-flex; align-items: center;
  min-height: 44px;
  color: var(--ink-2); font-size: var(--fs-small);
  transition: color var(--dur) var(--ease);
}
.footer-list a:hover { color: var(--red-hi); }

/* Terms and Privacy sit in this row and are real tap targets, so they get a
   hit area rather than being left at text height. */
.site-footer__base a {
  display: inline-block;
  padding-block: 0.85rem;
  text-decoration: underline;
  text-decoration-color: var(--red-dim);
  text-underline-offset: 0.2em;
}
.site-footer__base a:hover { color: var(--red-hi); }

.site-footer__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: var(--sp-3) var(--sp-6);
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  font-family: var(--label); font-size: var(--fs-label);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   9. Photographic plate — the shared cinematic device
   -------------------------------------------------------------------------- */
.plate {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--surface);
}
.plate img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.82) contrast(1.06);
  transition: filter 800ms var(--ease), transform 900ms var(--ease);
}
.plate--hoverable:hover img { filter: saturate(1) contrast(1.02); transform: scale(1.035); }
.plate::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--line);
}

/* --------------------------------------------------------------------------
   10. Scroll reveal
   Content ships VISIBLE. The hidden state is only armed by JS when motion is
   welcome, and a timer clears it regardless, so nothing can strand at zero.
   -------------------------------------------------------------------------- */
.js-reveal.is-armed { opacity: 0; transform: translateY(20px); }
.js-reveal.is-armed.is-visible {
  opacity: 1; transform: none;
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js-reveal.is-armed { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   11. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 64rem) {
  .site-footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-footer__grid > :first-child { grid-column: 1 / -1; }
  .cta-band__inner { grid-template-columns: minmax(0, 1fr); }
  .cta-band__actions { justify-self: start; }
  .section-head--split { grid-template-columns: minmax(0, 1fr); align-items: start; }
}

@media (max-width: 52rem) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    left: calc(var(--gutter) * -1); right: calc(var(--gutter) * -1);
    top: 100%;
    display: none;
    background: var(--ground-2);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-3) var(--gutter) var(--sp-6);
  }
  .site-nav[data-open="true"] { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li + li { border-top: 1px solid var(--line); }
  .site-nav a { min-height: 58px; font-size: 0.9rem; color: var(--ink); }
  .site-nav li:last-child { border-top: 0; }
  .site-nav a.btn { margin-top: var(--sp-4); width: 100%; min-height: 54px; }
}

@media (max-width: 34rem) {
  .site-footer__grid { grid-template-columns: minmax(0, 1fr); }
  .brand__text b { font-size: 1.15rem; }
}
