/* Shared base: fonts, design tokens, reset and the site-wide primitives
   (labels, CTAs, the .af-r scroll reveal). Every page loads this first.
   Design system: black/light rhythm, Figtree, mono labels, #35E07F. */

@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

/* Lenis smooth-scroll required styles (assets/js/smooth.js) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

:root {
  --af-bg-dark: #050505;
  --af-bg-light: #efeeec;
  --af-ink-l: #f2f2f2;
  /* Display headings sitting on the dark ground. Separate from
     --af-ink-l because that one is body copy too: titles were drifting
     across six different near-whites, and this is the single value for
     them. Titles on the light panels keep their dark ink instead. */
  --title-on-dark: #d8d8d8;
  --af-ink-d: #1a1a1a;
  --af-soft-l: #9a9a9a;
  --af-soft-d: #6b6b6b;
  --af-green: #35E07F;
  --af-line-l: rgba(255, 255, 255, 0.15);
  --af-line-d: rgba(0, 0, 0, 0.16);
  --af-mono: Figtree, "Figtree Fallback", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--af-bg-dark);
  color: var(--af-ink-l);
  font-family: "Figtree", sans-serif;
  overflow-x: hidden;
}

/* ---- one colour for every big title on the dark ground ----
   These headings previously took whatever colour they inherited, which
   is why the site had several near-whites doing the same job. Listed
   explicitly rather than as `h1, h2` so that headings on the light
   panels keep their dark ink. */
.af-hero-title,
.ft-title,
.fq-heading,
.ct-title,
.ct-modal-title,
.pj-title,
.tc-title,
.sv-title,
body.about-page h2,
#sx-body h3,
/* The case studies alternate dark and light bands using one class for
   the heading, so the light bands are excluded by name rather than the
   heading being recoloured everywhere. */
.af-sec:not(.af-light) .af-h2 { color: var(--title-on-dark); }

/* keyboard users land here first; visually hidden until focused */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 999;
  padding: 12px 18px;
  background: var(--af-green);
  color: #04170c;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 0 0 6px 0;
  transform: translateY(-120%);
  transition: transform 180ms ease;
}
.skip-link:focus { transform: translateY(0); }

/* scroll-target marker for in-page hash links (#works, #services) */
.anchor { position: relative; top: -1px; }

/* a visible focus ring everywhere, since most interactive elements here
   suppress the default outline for their hover treatments */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--af-green);
  outline-offset: 3px;
  border-radius: 2px;
}

@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;
    scroll-behavior: auto !important;
  }
}

.af-label {
  display: block;
  font-family: var(--af-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--af-green);
  margin-bottom: 3.5vh;
}
.af-cta {
  display: inline-flex;
  align-items: center;
  gap: 1.6em;
  font-family: var(--af-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  padding-bottom: 0.8em;
  position: relative;
  white-space: nowrap;
}
.af-cta::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--af-green);
  transform-origin: right;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}
.af-cta:hover::after { transform: scaleX(0.35); }
.af-cta .af-arrow { color: var(--af-green); transition: transform 0.45s cubic-bezier(0.19,1,0.22,1); }
.af-cta:hover .af-arrow { transform: translateX(7px); }

/* ---- top nav ---- */
@keyframes afBlink { 50% { opacity: 0; } }

/* ---- hero: interactive wave strips ---- */
.af-hero {
  position: relative;
  min-height: 84vh;   /* compact cover, matches the services hero */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20vh 6vw 7vh;
  background: #020403;   /* near-black for the particle ocean */
}
/* background video under the mesh — same green technique as the home hero:
   a #35E07F layer with mix-blend-mode: hue recolors the video, then a soft
   darkener keeps the particles and text readable */
.af-hero-video {
  position: absolute;
  inset: 0;
  isolation: isolate;   /* hue blends against the video only, not the page */
}
.af-hero-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.af-hero-hue { position: absolute; inset: 0; background: #35E07F; mix-blend-mode: hue; }
.af-hero-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }
.af-hero-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 32%;
  background: linear-gradient(rgba(2, 4, 3, 0), #020403 96%);
}
/* dark top band: keeps the blend-mode nav readable over the bright video */
.af-hero-video::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 26%;
  background: linear-gradient(rgba(2, 4, 3, 0.92), rgba(2, 4, 3, 0));
}
#af-mesh {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* scroll glitch wipe: light slices snap in over the hero as the intro
   section arrives (built + scrubbed by about.js, same as home keyfacts) */
/* bottom-left anchored, same text treatment as the services hero */
.af-hero-inner { position: relative; z-index: 2; }
.af-hero .af-label { display: block; margin-bottom: 0.5vh; }
.af-hero-title {
  font-size: clamp(52px, 8.8vw, 148px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 0.96;
  margin-top: 2vh;
}
.af-hero-title em { font-style: normal; color: var(--af-green); }
.af-hero-sub {
  margin-top: 3vh;
  max-width: 52ch;
  font-size: clamp(15px, 1.3vw, 20px);
  line-height: 1.6;
  color: #c9c9c9;
}
.af-hero-meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 5vh;
  padding-top: 2.6vh;
  border-top: 1px solid var(--af-line-l);
  font-family: var(--af-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--af-soft-l);
}
.af-hero-meta b { color: var(--af-green); font-weight: 400; }

/* ---- shared section shell ---- */
.af-sec { padding: 15vh 6vw; position: relative; }
.af-sec.af-light { background: var(--af-bg-light); color: var(--af-ink-d); }
.af-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 4vw;
  margin-bottom: 8vh;
}
.af-h2 {
  font-size: clamp(38px, 4.6vw, 76px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.04;
}
.af-sec:not(.af-light) .af-sub { color: var(--af-soft-l); }
.af-sec.af-light .af-sub { color: var(--af-soft-d); }

/* scrub start; brightens to ink */
.af-intro-col .af-cta { margin-top: 5vh; color: var(--af-ink-d); }

/* ---- contact: same form as the home page ---- */

.af-form { max-width: 820px; margin: 0 auto; }
.af-f-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 4vw;
  row-gap: 6vh;
}
.af-field { display: block; }
.af-f-full { grid-column: 1 / -1; }
.af-f-label { display: block; font-size: 15.5px; font-weight: 600; }
.af-f-label i { font-style: normal; color: var(--af-green); }
.af-field input, .af-field textarea, .af-field select {
  width: 100%;
  margin-top: 0.7rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--af-ink-l);
  font-family: inherit;
  font-size: 15.5px;
  padding: 0.6rem 0;
  outline: none;
  transition: border-color 0.35s ease;
  border-radius: 0;
}
.af-field input::placeholder, .af-field textarea::placeholder { color: #7d7d7b; }
.af-field input:focus, .af-field textarea:focus, .af-field select:focus { border-color: var(--af-green); }
.af-field select {
  margin-top: 0;
  appearance: none;
  -webkit-appearance: none;
  font-weight: 600;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none'><path d='M1 1l6 6 6-6' stroke='%23f2f2f2' stroke-width='1.4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  padding: 1.05rem 2rem 1.05rem 0;
}
.af-field select option { background: #101010; color: #f2f2f2; }
.af-field textarea { resize: vertical; min-height: 74px; }

.af-f-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 8vh;
}
.af-submit {
  background: transparent;
  color: var(--af-ink-l);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  padding: 0.95rem 1.7rem;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}
.af-submit:hover { background: var(--af-green); border-color: var(--af-green); color: #fff; }
.af-sayhello { font-size: 16px; color: #d9d9d9; }
.af-sayhello a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--af-green); }

/* ---- footer ---- */
.af-footer .af-h2 { max-width: 18ch; margin: 0 auto; }

/* ---- reveals ---- */
.af-r {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s ease, transform 0.85s cubic-bezier(0.19, 1, 0.22, 1);
}
.af-r.af-in { opacity: 1; transform: none; }

/* Pages state that non-essential transitions respect reduced-motion. Honour it.
   .af-r must land visible: the IntersectionObserver may never add .af-in. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .af-r,
  .af-r.af-in { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 900px) {
  .af-sec { padding: 12vh 7vw; }
  .af-head { grid-template-columns: 1fr; align-items: start; gap: 3vh; }
                    .af-f-grid { grid-template-columns: 1fr; row-gap: 4.5vh; }
  .af-f-foot { flex-direction: column; align-items: flex-start; }
    }


/* ========================= scroll indicator =========================
   The little mouse at the bottom of a hero. Shared, because the home hero and
   the Work hero use the same one — defined once here rather than copied. Each
   hero sets its own `bottom` in its own stylesheet, which loads after this. */
.hm-mouse {
  position: absolute; left: 50%; bottom: 5vh;
  transform: translateX(-50%);
  display: block; text-decoration: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}
.hm-mouse-body {
  width: 26px; height: 42px; border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  display: flex; justify-content: center; padding-top: 8px;
  box-sizing: border-box;
  transition: border-color 0.35s ease;
}
.hm-mouse:hover .hm-mouse-body { border-color: #35E07F; }
.hm-mouse-wheel {
  width: 4px; height: 8px; border-radius: 2px; background: #fff;
  animation: hmMouse 1.8s ease-in-out infinite;
}
.hm-mouse:hover .hm-mouse-wheel { background: #35E07F; }
@keyframes hmMouse {
  0%   { transform: translateY(0);    opacity: 0; }
  20%  { opacity: 1; }
  70%  { transform: translateY(13px); opacity: 0; }
  100% { transform: translateY(13px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-mouse-wheel { animation: none; }
}
