/* =============================================================================
   PortfoGallery — Designer Portfolio
   Built from the "Full page design review" handoff bundle.
   All colours, sizes, easings and timings below are taken verbatim from the
   design source; nothing here is invented.
   ========================================================================== */

/* -----------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette */
  --bg:            #0A0A0A;
  --bg-overlay:    #0C0C0C;
  --surface:       #141414;
  --surface-2:     #1A1A1A;
  --surface-sunken: #0F0F0F;  /* sits just below --surface */
  --text:          #FEFFFD;
  --text-muted:    #949494;
  --text-dim:      #4F4F4F;
  --solid-hover:   #E0E0E0;

  --line:          rgba(255, 255, 255, 0.12);
  --line-strong:   rgba(255, 255, 255, 0.20);
  --line-ring:     rgba(255, 255, 255, 0.30);

  /* Type */
  --font: "Helvetica Neue", Helvetica, Inter, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --shell:   1440px;
  --gutter:  clamp(24px, 5vw, 80px);
  --radius:  16px;
  --radius-sm: 12px;
  --header-h: 90px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back: cubic-bezier(0.3, 1.6, 0.4, 1);

  /* Runtime-tunable (see CONFIG in main.js) */
  --grain: 0.05;
}

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

/* No `scroll-behavior: smooth` here on purpose. main.js owns scrolling (the
   inertial wheel loop), and a CSS smooth scroll running at the same time
   fights it: every frame the loop's scrollTo would restart the browser's
   animation. Anchor links are eased in JS instead, through that same loop. */

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

body { overflow-x: hidden; }

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

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

button { font: inherit; color: inherit; }

h1, h2, h3, p, figure, blockquote { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--text); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Anchor targets clear the fixed header */
[id] { scroll-margin-top: var(--header-h); }

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

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 300;
  padding: 12px 20px;
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform 250ms var(--ease);
}
.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--bg);
}

/* Custom cursor swaps out the native one on fine-pointer devices */
body.cc-on,
body.cc-on a,
body.cc-on button { cursor: none; }

/* -----------------------------------------------------------------------------
   3. Atmosphere — film grain + ambient light beams
   -------------------------------------------------------------------------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 120;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 280px 280px;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.ambient__beam {
  position: absolute;
  display: block;
  width: 120vmax;
  height: 38vmax;
  transform: rotate(-24deg);
  filter: blur(60px);
}
.ambient__beam--top {
  left: -28vmax; top: -14vmax;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.05), transparent 70%);
}
.ambient__beam--bottom {
  right: -28vmax; bottom: -14vmax;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.04), transparent 70%);
}

.page { position: relative; z-index: 1; }

.container {
  max-width: var(--shell);
  margin-inline: auto;
}

/* -----------------------------------------------------------------------------
   4. Shared type & primitives
   -------------------------------------------------------------------------- */
.t-bright { color: var(--text); }
.t-muted  { color: var(--text-muted); }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.h-display {
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: pretty;
}

.rule {
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.rule--full { border-top: 1px solid var(--line); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Word-mask wrapper used by hero lines, section headings and menu links */
.mask {
  display: block;
  overflow: hidden;
}
.mask__inner { display: inline-block; }

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-muted);
}
.chips--dark .chip { background: var(--surface-2); }

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 300ms ease, color 300ms ease, border-color 300ms ease;
}
.btn__arrow {
  display: inline-block;
  transition: transform 300ms ease;
}
.btn:hover .btn__arrow { transform: translateX(4px); }

.btn--sm { padding: 12px 22px; font-size: 12px; gap: 10px; }
.btn--md { padding: 15px 26px; font-size: 13px; }
.btn--lg { padding: 18px 30px; font-size: 13px; }

.btn--solid {
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
}
.btn--solid:hover { background: var(--solid-hover); color: var(--bg); }

.btn--outline {
  border-color: var(--line);
  color: var(--text);
}
.btn--outline:hover { background: var(--text); color: var(--bg); }

.btn--surface {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn--surface:hover { background: var(--text); color: var(--bg); }

.btn--block {
  align-self: stretch;
  justify-content: space-between;
}

/* -----------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  border-bottom: 1px solid transparent;
  transition: background 400ms ease, border-color 400ms ease;
}
.header.is-stuck {
  background: rgba(10, 10, 10, 0.55);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.header__inner {
  max-width: var(--shell);
  margin-inline: auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand__mark {
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: block;
  border-radius: 999px;
  border: 1px solid var(--line);
  background-image: url("../img/avatar.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand__name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brand__name-a { color: var(--text); }
.brand__name-b { color: var(--text-muted); }

.header__actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  padding: 8px 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text);
}
.menu-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
}
.menu-toggle__bars span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  transition: transform 300ms var(--ease);
}
.menu-toggle:hover .menu-toggle__bars span:first-child { transform: translateX(-3px); }
.menu-toggle:hover .menu-toggle__bars span:last-child  { transform: translateX(3px); }

/* -----------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
@keyframes pg-rise {
  from { transform: translateY(112%); }
  to   { transform: translateY(0); }
}
@keyframes pg-fade {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Bottom padding clears the showreel strip pinned above. */
  padding: 150px var(--gutter) 340px;
  overflow: hidden;
}

.hero__title {
  font-weight: 500;
  font-size: clamp(56px, 8.5vw, 132px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}
.hero__title .mask:first-child { padding-bottom: 0.05em; }
.hero__title .mask:last-child  { padding-bottom: 0.08em; }
.hero__line-1 { animation: pg-rise 900ms var(--ease) both; }
.hero__line-2 { animation: pg-rise 900ms var(--ease) 120ms both; }

.hero__lede {
  margin-top: 32px;
  max-width: 520px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
  animation: pg-fade 900ms var(--ease) 500ms both;
}

.hero__actions {
  margin-top: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 28px;
  animation: pg-fade 900ms var(--ease) 620ms both;
}
/* Showreel — scrolling strip of project imagery --------------------------- */
.showreel {
  position: absolute;
  left: 0; right: 0;
  bottom: 48px;
  overflow: hidden;
  pointer-events: none;
  animation: pg-fade 900ms var(--ease) 760ms both;
  /* Soften both ends so the strip reads as continuing past the viewport. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.showreel__track {
  display: flex;
  will-change: transform;
}
.showreel__seq {
  display: flex;
  flex: none;
  align-items: center;
  gap: 20px;
  padding-right: 20px;
}

.showreel__item {
  position: relative;
  flex: none;
  /* Re-enable hit-testing on the cards only, so the gaps stay click-through. */
  pointer-events: auto;
  height: clamp(150px, 19vw, 250px);
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  overflow: hidden;
  background: repeating-linear-gradient(45deg, #101010 0, #101010 14px, #161616 14px, #161616 28px);
}
/* Every tile is a website screenshot, so they all share the 16:9 ratio.
   Width comes from the ratio, not the image, so the loop measures the same
   whether or not the photos have loaded. */
.showreel__item--wide,
.showreel__item--tall,
.showreel__item--square { aspect-ratio: 16 / 9; }

.showreel__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 500ms ease;
}
.showreel__item.has-image .showreel__img { opacity: 1; }
.showreel__item.has-image .showreel__label { display: none; }

.showreel__label {
  position: relative;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(10, 10, 10, 0.6);
  padding: 6px 12px;
  border-radius: 6px;
  text-align: center;
}

/* -----------------------------------------------------------------------------
   7. About
   -------------------------------------------------------------------------- */
.about { padding: clamp(120px, 13vw, 180px) var(--gutter); }

.about__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 64px;
  align-items: start;
}
.about__title { font-size: clamp(40px, 5vw, 76px); }

.about__body { max-width: 520px; }
.about__body .eyebrow { margin-bottom: 24px; }

.about__quote {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  text-wrap: pretty;
}
/* Once JS has split the quote into words, each one fades up from dim to bright
   as it passes through the viewport. */
.about__quote.is-split {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.3em;
  color: var(--text-dim);
}
.about__quote .word {
  color: var(--text-dim);
  transition: color 250ms linear;
}
.about__quote .word.is-lit { color: var(--text); }

/* Heading word reveal (applied by JS) */
.h-display.is-split {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.28em;
}
.h-display .mask {
  display: inline-block;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}
.h-display .word {
  display: inline-block;

  /* No will-change here on purpose: this selector repeats per item, and
     promoting every one of them exhausts the mobile layer budget. */
}

/* -----------------------------------------------------------------------------
   8. Stats
   -------------------------------------------------------------------------- */
.stats { padding: 0 var(--gutter) clamp(120px, 12vw, 180px); }

.stats__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: stretch;
}

.intro-card {
  flex: 1 1 320px;
  min-height: 400px;
  padding: clamp(28px, 3vw, 44px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.intro-card__title {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.intro-card__text {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  text-wrap: pretty;
}
.intro-card__cta {
  margin-top: auto;
  padding: 10px 10px 10px 24px;
  font-size: 13px;
  letter-spacing: 0.08em;
}
.intro-card__avatar {
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: block;
  border-radius: 999px;
  background-image: url("../img/avatar.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* Two columns so the four stats read as one 2x2 block beside the intro card. */
.stats__grid {
  flex: 2 1 520px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
@media (max-width: 560px) {
  .stats__grid { grid-template-columns: minmax(0, 1fr); }
}
/* Slightly darker than the intro card beside them, so that one still reads
   as the primary panel. */
.stat {
  background: var(--surface-sunken);
  padding: clamp(24px, 2.5vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stat__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.stat__value {
  font-size: clamp(44px, 4.5vw, 68px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat__label {
  font-size: 14px;
  color: var(--text-muted);
}
.stat__text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* -----------------------------------------------------------------------------
   9. Services
   -------------------------------------------------------------------------- */
.services { padding: 0 var(--gutter) clamp(120px, 12vw, 180px); }

/* No horizontal dividers — each service is bounded by its white left rule
   alone, as in the reference. */
.service {
  position: relative;
  border-radius: var(--radius);
  padding: 56px clamp(16px, 3vw, 40px);
  background: transparent;
  transition: background 400ms ease;
}
.service__num-wrap {
  position: absolute;
  top: 36px;
  right: clamp(16px, 3vw, 40px);

  /* No will-change here on purpose: this selector repeats per item, and
     promoting every one of them exhausts the mobile layer budget. */
}
.service__num {
  display: inline-block;
  font-size: clamp(72px, 9vw, 150px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  opacity: 0.12;
  transition: opacity 400ms ease;
}
.service__body {
  position: relative;
  max-width: 640px;
  /* Bright rule, matching the reference mockup. */
  border-left: 1px solid var(--text);
  padding-left: clamp(20px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.service__title {
  font-size: clamp(30px, 3.4vw, 52px);
  font-weight: 400;
  letter-spacing: -0.02em;
  transition: transform 400ms ease;
}
.service__text {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
}

@media (hover: hover) and (pointer: fine) {
  .service:hover { background: var(--surface); }
  .service:hover .service__num { opacity: 0.4; }
  .service:hover .service__title { transform: translateX(12px); }
}

/* -----------------------------------------------------------------------------
   10. Projects
   -------------------------------------------------------------------------- */
.projects { padding: 0 var(--gutter) clamp(100px, 10vw, 160px); }

.projects__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 64px;
}
.projects__head .eyebrow { padding-bottom: 16px; }
.projects__title {
  font-size: clamp(40px, 5vw, 76px);
  max-width: 680px;
  text-align: right;
}
.projects__title.is-split { justify-content: flex-end; }

.project {
  position: sticky;
  top: var(--header-h);
  margin-bottom: 32px;
  padding: clamp(24px, 3.5vw, 56px);
  overflow: hidden;
  transform-origin: top center;

  /* No will-change here on purpose: this selector repeats per item, and
     promoting every one of them exhausts the mobile layer budget. */
}
.project__ghost {
  position: absolute;
  /* Sits behind the copy so the content above it no longer needs its own
     positioning, which is what lets the stretched link cover the whole card. */
  z-index: -1;
  top: -0.12em;
  right: 24px;
  font-size: clamp(180px, 22vw, 320px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  opacity: 0.06;
  pointer-events: none;

  /* No will-change here on purpose: this selector repeats per item, and
     promoting every one of them exhausts the mobile layer budget. */
}
/* Deliberately not positioned: the stretched link's ::after must resolve
   against .project (the card), not against this row. */
.project__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 24px;
}
.project__title {
  font-size: clamp(28px, 3vw, 46px);
  font-weight: 400;
  letter-spacing: -0.02em;
}
/* Stretched link: the title is the real anchor, but its ::after covers the
   whole card so anywhere on the card is clickable. Keeps one link per card
   for screen readers instead of wrapping everything in an <a>. */
.project__link { text-decoration: none; }
.project__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
}
.project__link:hover { color: var(--text-muted); }
.project__year {
  font-size: 15px;
  color: var(--text-dim);
}
.project__text {
  position: relative;
  margin-top: 20px;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
}
.project .chips {
  position: relative;
  margin-top: 24px;
}
.project__frame {
  position: relative;
  margin-top: 40px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 44vh;
}
.project__media {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(45deg, #101010 0, #101010 14px, #161616 14px, #161616 28px);
  transition: transform 600ms ease, filter 600ms ease;

  /* No will-change here on purpose: this selector repeats per item, and
     promoting every one of them exhausts the mobile layer budget. */
}
.project__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 500ms ease;
}
/* Only revealed once the file actually loads — otherwise the designed
   placeholder stays put. Drop images into assets/img/projects/ to swap in. */
.project__media.has-image .project__img { opacity: 1; }
.project__media.has-image .project__placeholder { display: none; }

.project__placeholder {
  position: relative;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(10, 10, 10, 0.6);
  padding: 8px 14px;
  border-radius: 6px;
  text-align: center;
}

@media (hover: hover) and (pointer: fine) {
  .project:hover .project__media {
    filter: contrast(1.06) brightness(1.05);
  }
}

/* -----------------------------------------------------------------------------
   11. FAQ
   -------------------------------------------------------------------------- */
.faq { padding: 0 var(--gutter) clamp(100px, 10vw, 160px); }

.faq__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: flex-start;
}
.faq__intro { flex: 1 1 360px; }
.faq__intro .eyebrow { margin-bottom: 24px; }
.faq__title {
  font-size: clamp(34px, 3.6vw, 56px);
  line-height: 1.1;
  max-width: 560px;
}

.faq__list {
  flex: 1.2 1 460px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.faq__item { overflow: hidden; }
.faq__q { font: inherit; }

.faq__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 16.5px;
  font-weight: 400;
  text-align: left;
  padding: 22px 24px;
}
.faq__icon {
  width: 28px; height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line-ring);
  font-size: 16px;
  line-height: 1;
  color: var(--text-muted);
  transition: transform 400ms var(--ease);
}
.faq__trigger[aria-expanded="true"] .faq__icon { transform: rotate(45deg); }

.faq__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 450ms var(--ease);
}
.faq__panel.is-open { grid-template-rows: 1fr; }
.faq__panel-clip { overflow: hidden; }
.faq__a {
  padding: 0 24px 22px;
  max-width: 560px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* -----------------------------------------------------------------------------
   12. Closing CTA
   -------------------------------------------------------------------------- */
.closing {
  position: relative;
  padding: clamp(120px, 14vw, 200px) var(--gutter);
  text-align: center;
}
.closing__title {
  font-size: clamp(48px, 7vw, 110px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
}
.closing__actions {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}
.closing .btn--lg { padding: 18px 32px; }

/* -----------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
.footer {
  position: relative;
  z-index: 1;
  padding: 72px var(--gutter) 0;
  border-top: 1px solid var(--line);
}
.footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px 64px;
}
.footer__pitch {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.footer__mark {
  width: 48px; height: 48px;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background-image: url("../img/avatar.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
.footer__title {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 400;
  letter-spacing: -0.02em;
}
.footer__text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
}
.footer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 72px;
}
.footer__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer__col-title {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.footer__link {
  font-size: 15px;
  color: var(--text-muted);
  transition: color 300ms ease;
}
.footer__link:hover { color: var(--text); }
.footer__link--strong {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__legal {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.footer__wordmark-clip {
  overflow: hidden;
  margin-top: 32px;
}
.footer__wordmark {
  font-size: clamp(64px, 14.6vw, 224px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.78;
  white-space: nowrap;
  text-align: center;
  margin-bottom: -0.16em;
  will-change: transform;
}

/* -----------------------------------------------------------------------------
   14. Menu overlay
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-overlay);
  display: flex;
  flex-direction: column;
  padding: 20px var(--gutter) 48px;
  overflow: auto;
  clip-path: circle(0.4% at 94% 4%);
  visibility: hidden;
  transition: clip-path 700ms var(--ease), visibility 0s 750ms;
}
.overlay.is-open {
  clip-path: circle(165% at 94% 4%);
  visibility: visible;
  transition: clip-path 700ms var(--ease), visibility 0s 0s;
}

.overlay__bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.overlay__label {
  font-size: 15px;
  color: var(--text-muted);
}
.overlay__close {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text);
}
.overlay__close-icon {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line-ring);
  font-size: 13px;
  transition: background 300ms ease, color 300ms ease;
}
.overlay__close:hover .overlay__close-icon {
  background: var(--text);
  color: var(--bg);
}

.overlay__nav {
  margin: auto 0;
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.overlay__nav .mask { padding-bottom: 2px; }

.overlay__link {
  display: inline-block;
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  transform: translateY(115%);
  transition: transform 650ms var(--ease);
}
.overlay.is-open .overlay__link { transform: translateY(0); }
.overlay.is-open .overlay__link { transition-delay: 260ms; }
.overlay.is-open .mask:nth-child(1) .overlay__link { transition-delay: 260ms; }
.overlay.is-open .mask:nth-child(2) .overlay__link { transition-delay: 330ms; }
.overlay.is-open .mask:nth-child(3) .overlay__link { transition-delay: 400ms; }
.overlay.is-open .mask:nth-child(4) .overlay__link { transition-delay: 470ms; }

.overlay__link-text {
  display: inline-block;
  transition: transform 400ms var(--ease);
}
.overlay__link-line {
  display: block;
  height: 2px;
  width: 0;
  background: var(--text);
  transition: width 450ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .overlay__link:hover .overlay__link-text { transform: translateX(16px); }
  .overlay__link:hover .overlay__link-line { width: 100%; }
}

.overlay__foot {
  flex-shrink: 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.overlay__foot .btn--md { padding: 16px 28px; font-size: 12px; }
.overlay__contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
}
.overlay__contact a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* -----------------------------------------------------------------------------
   15. Custom cursor
   -------------------------------------------------------------------------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
  will-change: transform;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--text);
  mix-blend-mode: difference;
  z-index: 200;
}
.cursor-ring {
  width: 64px; height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  display: grid;
  place-items: center;
  z-index: 199;
  transition: opacity 300ms ease, background 250ms ease, border-color 250ms ease;
}
.cursor-ring__label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--bg);
  opacity: 0;
  transition: opacity 200ms ease;
}

.cursor-ring.is-big {
  background: rgba(255, 255, 255, 0.92);
  mix-blend-mode: difference;
  border-color: transparent;
}
.cursor-ring.is-view {
  background: var(--text);
  mix-blend-mode: normal;
  border-color: var(--text);
}
.cursor-ring.is-view .cursor-ring__label { opacity: 1; }

/* -----------------------------------------------------------------------------
   16. Reveal states (set by JS before the element scrolls into view)
   -------------------------------------------------------------------------- */
[data-reveal].is-hidden {
  opacity: 0;
  transform: translateY(32px);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}

.h-display .word.is-hidden { transform: translateY(112%); }

/* -----------------------------------------------------------------------------
   16b. Touch devices: drop the full-viewport compositing effects
        Both of these force the browser to recomposite the entire screen on
        every scroll frame. On a phone that shows up as flicker and stutter,
        and neither is load-bearing for the design.
   -------------------------------------------------------------------------- */
@media (hover: none), (pointer: coarse), (max-width: 760px) {
  /* Fixed, blended overlay across the viewport */
  body::after { display: none; }

  /* backdrop-filter over a scrolling page is the single most expensive
     thing here; a near-opaque background reads almost the same. */
  .header.is-stuck {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(10, 10, 10, 0.94);
  }

  /* Large blurred beams get re-rasterised whenever layers are evicted. */
  .ambient { display: none; }
}

/* -----------------------------------------------------------------------------
   17. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  :root { --header-h: 84px; }

  .projects__title { text-align: left; }
  .projects__title.is-split { justify-content: flex-start; }
  .projects__head { align-items: flex-start; }
}

@media (max-width: 760px) {
  .header__cta { display: none; }
  .header__actions { gap: 0; }

  .hero { padding-bottom: 230px; }
  .hero__actions { gap: 20px; }
  .showreel { bottom: 28px; }

  .about__inner { gap: 40px; }
  .faq__inner { gap: 36px; }

  .service { padding: 40px 0; }
  .service__num-wrap { top: 24px; right: 0; }

  .footer__legal { margin-top: 48px; }
}

@media (max-width: 520px) {
  .btn--lg { padding: 16px 26px; }
  .footer__nav { gap: 32px 48px; }
  .overlay__foot { align-items: flex-start; }
}

/* -----------------------------------------------------------------------------
   18. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .overlay { transition: visibility 0s 0s; }
  .project { position: static; }
}
