/* Act 2. Near-black ground, brand colours used as light. */

/* Ambient light. Two slow drifting orbs, cheap because they only move. */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.aurora::before, .aurora::after {
  content: "";
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.17;
}

.aurora::before {
  background: radial-gradient(circle, var(--magenta), transparent 62%);
  top: -26vmax;
  left: -16vmax;
  animation: drift-a 26s var(--ease-in-out) infinite alternate;
}

.aurora::after {
  background: radial-gradient(circle, var(--cyan), transparent 62%);
  bottom: -30vmax;
  right: -18vmax;
  animation: drift-b 32s var(--ease-in-out) infinite alternate;
}

@keyframes drift-a {
  to { transform: translate3d(14vw, 10vh, 0) scale(1.18); }
}

@keyframes drift-b {
  to { transform: translate3d(-12vw, -8vh, 0) scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .aurora::before, .aurora::after { animation: none; }
}

/* Fine grain over everything, so flat fills never look like flat fills. */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%27160%27 height=%27160%27%3E%3Cfilter id=%27n%27%3E%3CfeTurbulence type=%27fractalNoise%27 baseFrequency=%270.8%27 numOctaves=%274%27/%3E%3C/filter%3E%3Crect width=%27160%27 height=%27160%27 filter=%27url(%23n)%27 opacity=%270.42%27/%3E%3C/svg%3E");
}

/* Hero */

.hero {
  min-height: min(92svh, 920px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: var(--sp-6);
  padding-block: var(--sp-6) var(--sp-7);
}

/* On phones the headline and the call come first; the mark follows, smaller. */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-block: var(--sp-6); }
  .hero__visual { max-width: 320px; margin-inline: auto; width: 100%; }
}

.hero__title {
  font-size: var(--step-5);
  line-height: 0.93;
  letter-spacing: -0.045em;
  margin-bottom: var(--sp-4);
}

/* The padding gives descenders room inside the reveal mask, so the "y" of
   "Properly." is not cut flat; the negative margin keeps the line spacing. */
.hero__line { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }

/* Each line rides up from its own mask. Set by JS once fonts are ready. The hidden
   start only applies under .motion, so a page whose scripts fail stays readable. */
.hero__line > span { display: block; }

.motion .hero__line > span {
  transform: translateY(105%);
  opacity: 0;
}

.motion .is-revealed .hero__line > span {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.9s var(--ease-out), opacity 0.6s linear;
}

.is-revealed .hero__line:nth-child(2) > span { transition-delay: 0.08s; }
.is-revealed .hero__line:nth-child(3) > span { transition-delay: 0.16s; }

/* The payoff word carries the palette. */
.hero__line--accent > span {
  background: linear-gradient(100deg, var(--magenta) 10%, var(--violet) 45%, var(--cyan) 78%, var(--amber));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hue-slide 9s var(--ease-in-out) infinite alternate;
}

@keyframes hue-slide {
  to { background-position: 100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__line--accent > span { animation: none; }
  .hero__line > span { transform: none; opacity: 1; }
}

.hero__proof {
  margin-top: var(--sp-4);
  color: var(--text-faint);
  font-size: var(--step--1);
}

.hero__visual {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
}

/*
 * The Forward mark, rebuilt in CSS 3D.
 *
 * Four panes on their own Z planes inside a perspective scene, lit by a
 * moving sheen. It reads as glass, costs no WebGL context, and degrades to a
 * static mark when motion is reduced.
 */

.mark3d {
  width: min(100%, 480px);
  aspect-ratio: 1;
  perspective: 1100px;
  perspective-origin: 50% 45%;
}

.mark3d__stage {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 6deg)) rotateY(var(--ry, -16deg));
  transition: transform 0.6s var(--ease-out);
  animation: mark-float 14s var(--ease-in-out) infinite alternate;
}

@keyframes mark-float {
  from { transform: rotateX(4deg) rotateY(-20deg) translateZ(0); }
  to { transform: rotateX(10deg) rotateY(-8deg) translateZ(26px); }
}

/*
 * Each pane is one piece of the real logo, cut out with the full icon's viewBox,
 * so the four layers line up exactly when seen straight on. The lean is already
 * in the artwork; depth comes from pushing each layer onto its own Z plane.
 */
.mark3d__pane {
  position: absolute;
  inset: 0;
  transform: translateZ(var(--z, 0px));
}

.mark3d__pane img {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 26px 34px var(--pane-glow));
}

/* Specular sweep, masked to the pane's own outline so it never spills into the gaps.
   The mask path is absolute because url() inside a custom property resolves against
   the page, not this stylesheet. */
.mark3d__pane::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(118deg, transparent 40%, rgba(255, 255, 255, 0.5) 50%, transparent 60%)
    no-repeat;
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-mask: var(--pane-mask) center / 100% 100% no-repeat;
  mask: var(--pane-mask) center / 100% 100% no-repeat;
  animation: sheen 7s var(--ease-in-out) infinite;
}

@keyframes sheen {
  0%, 62% { background-position: 100% 0; }
  100% { background-position: 0% 0; }
}

/* Nearest pane top right, furthest bottom left, so the mark tips towards the reader. */

.mark3d__pane--tl {
  --z: 46px;
  --pane-glow: rgba(255, 46, 136, 0.45);
  --pane-mask: url("/assets/img/mark/pane-tl.svg");
}

.mark3d__pane--tr {
  --z: 70px;
  --pane-glow: rgba(22, 200, 232, 0.45);
  --pane-mask: url("/assets/img/mark/pane-tr.svg");
}

.mark3d__pane--tr::after { animation-delay: 0.5s; }

.mark3d__pane--bl {
  --z: 22px;
  --pane-glow: rgba(131, 82, 242, 0.45);
  --pane-mask: url("/assets/img/mark/pane-bl.svg");
}

.mark3d__pane--bl::after { animation-delay: 1s; }

.mark3d__pane--br {
  --z: 46px;
  --pane-glow: rgba(255, 170, 31, 0.45);
  --pane-mask: url("/assets/img/mark/pane-br.svg");
}

.mark3d__pane--br::after { animation-delay: 1.5s; }

@media (prefers-reduced-motion: reduce) {
  .mark3d__stage { animation: none; }
  .mark3d__pane::after { animation: none; }
}

/* Scroll reveal. Hidden only under .motion, which an inline script in the head
   removes again if the modules never start, so content is never held hostage. */
.motion .reveal { opacity: 0; transform: translateY(26px); }

.motion .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal:nth-child(2) { transition-delay: 0.06s; }
.reveal:nth-child(3) { transition-delay: 0.12s; }
.reveal:nth-child(4) { transition-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* The cost of the manual way */
.cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: var(--sp-6);
}

.cost {
  background: var(--void);
  padding: var(--sp-5) var(--sp-4);
  transition: background 0.3s var(--ease-out);
}

.cost:hover { background: var(--surface); }

.cost__stat {
  font-family: var(--font-display);
  font-size: var(--step-1);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.cost:nth-child(1) .cost__stat { color: var(--magenta-text); }
.cost:nth-child(2) .cost__stat { color: var(--cyan-text); }
.cost:nth-child(3) .cost__stat { color: var(--violet-text); }
.cost:nth-child(4) .cost__stat { color: var(--amber-text); }

.cost__label { color: var(--text-dim); font-size: var(--step--1); line-height: 1.5; }

/* Offer cards */
.offers { display: grid; gap: var(--sp-4); margin-top: var(--sp-6); }

@media (min-width: 900px) {
  .offers { grid-template-columns: repeat(3, 1fr); }
}

.offer {
  position: relative;
  padding: var(--sp-5);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--void) 70%);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}

.offer:hover { transform: translateY(-4px); border-color: var(--hairline-strong); }

/* Each card owns one brand colour, so the three read as a set. */
.offer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.8;
}

.offer:nth-child(1) { --accent: var(--magenta); }
.offer:nth-child(2) { --accent: var(--cyan); }
.offer:nth-child(3) { --accent: var(--amber); }

.offer__name { margin: 0 0 var(--sp-2); font-size: var(--step-2); }
.offer__summary { color: var(--text); font-weight: 500; margin-bottom: var(--sp-3); }
.offer__body { color: var(--text-dim); font-size: var(--step--1); line-height: 1.65; }

.offer__points { margin-top: var(--sp-4); display: grid; gap: 0.6rem; }

.offer__points li {
  display: flex;
  gap: 0.65rem;
  font-size: var(--step--1);
  color: var(--text-dim);
  line-height: 1.45;
}

.offer__points li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}

/* Process. A line that draws itself as you scroll past. */
.process { position: relative; margin-top: var(--sp-6); display: grid; gap: var(--sp-5); }

@media (min-width: 860px) {
  .process { grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
  .process::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--hairline);
  }
  /* Drawn with a transform rather than width, so it never triggers layout. */
  .process::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--cyan);
    transform-origin: left;
    transform: scaleX(var(--draw, 0));
    transition: transform 1.4s var(--ease-out);
  }
}

.step__dot {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  background: var(--void);
  border: 1px solid var(--hairline-strong);
  color: var(--text-dim);
  position: relative;
  z-index: 1;
  margin-bottom: var(--sp-3);
}

.step__name { font-size: var(--step-1); margin-bottom: 0.5rem; }
.step__body { color: var(--text-dim); font-size: var(--step--1); line-height: 1.6; }

/* Principles */
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--sp-5);
  margin-top: var(--sp-6);
}

.principle { border-left: 1px solid var(--hairline-strong); padding-left: var(--sp-4); }
.principle h3 { font-size: var(--step-1); margin-bottom: 0.6rem; }
.principle p { color: var(--text-dim); font-size: var(--step--1); line-height: 1.6; }

/* FAQ. Native details, so it works without JavaScript. */
.faq { margin-top: var(--sp-6); border-top: 1px solid var(--hairline); }

.faq details {
  border-bottom: 1px solid var(--hairline);
  padding: var(--sp-4) 0;
}

.faq summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: var(--step-1);
  letter-spacing: -0.02em;
  transition: color 0.2s var(--ease-out);
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--cyan-text); }

.faq summary::after {
  content: "";
  flex: none;
  width: 13px;
  height: 13px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.3s var(--ease-out);
}

.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }

.faq details p {
  margin-top: var(--sp-3);
  color: var(--text-dim);
  max-width: 60ch;
  line-height: 1.65;
}

/* Closing call to action */
.cta {
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  overflow: hidden;
  background: radial-gradient(90% 140% at 50% 0%, var(--surface-2), var(--void) 70%);
}

.cta h2 { font-size: var(--step-3); margin-bottom: var(--sp-3); }
.cta p { color: var(--text-dim); max-width: 52ch; margin-inline: auto; }
.cta .btn-row { justify-content: center; }

/* Prose pages: about, privacy, terms */
.prose { max-width: 66ch; }
.prose h2 { font-size: var(--step-2); margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
.prose p { color: var(--text-dim); margin-bottom: var(--sp-3); line-height: 1.7; }
.prose p:first-of-type { color: var(--text); }

.page-head { padding-block: var(--sp-8) var(--sp-5); }
.page-head h1 { font-size: var(--step-4); margin-bottom: var(--sp-4); }
.page-head__meta { color: var(--text-faint); font-size: var(--step--1); }

/* Case studies, placeholder state */
.placeholder-note {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-4);
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: var(--sp-6);
}

.placeholder-note__tag {
  flex: none;
  font-family: var(--font-body);
  font-size: var(--step--1);
  color: var(--void);
  background: var(--amber);
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  font-weight: 700;
}

.placeholder-note h2 { font-size: var(--step-1); margin-bottom: 0.5rem; }
.placeholder-note p { color: var(--text-dim); font-size: var(--step--1); line-height: 1.6; }

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-4);
}

/* Placeholders read as empty through the dashed edge and dim text, not through
   opacity, which would drag the text below contrast. */
.case {
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--radius);
  padding: var(--sp-5);
}

.case__job { font-size: var(--step-1); font-family: var(--font-display); color: var(--text-dim); margin-bottom: var(--sp-2); }
.case__result { color: var(--text-faint); font-size: var(--step--1); }
.case__sector { color: var(--text-faint); font-size: var(--step--1); margin-top: var(--sp-3); }

/* Booking and enquiry form */
.book-grid { display: grid; gap: var(--sp-6); align-items: start; }

@media (min-width: 940px) {
  .book-grid { grid-template-columns: 0.9fr 1.1fr; gap: var(--sp-7); }
  /* Side by side, the calendar starts level with the call steps. */
  .book-grid .booking-slot { margin-top: 0; }
}

/* The calendar is the main way in, so it sits beside the call steps and the
   written alternative runs underneath both. */
.book-grid__wide { grid-column: 1 / -1; }

.expect li {
  display: flex;
  gap: 0.8rem;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-dim);
}

.expect li::before {
  content: counter(expect);
  counter-increment: expect;
  font-weight: 600;
  color: var(--cyan-text);
  flex: none;
  min-width: 1ch;
}

.expect { counter-reset: expect; margin-top: var(--sp-4); }

.booking-slot {
  margin-top: var(--sp-5);
  padding: var(--sp-5);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
}

.booking-slot h3 { font-size: var(--step-1); margin-bottom: 0.6rem; }
.booking-slot p { color: var(--text-dim); font-size: var(--step--1); max-width: var(--measure); }
.booking-slot .btn-row { margin-top: var(--sp-4); }

.booking-slot__note { margin-top: var(--sp-4); }
.booking-slot__note a { color: var(--cyan-text); }

/* Calendly's inline layout wants about 700px of height. On a phone the date
   grid and the time list stack, so it gets more. */
.booking-frame {
  display: block;
  width: 100%;
  height: 700px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

@media (max-width: 600px) {
  .booking-slot.is-open { padding: var(--sp-3); }
  .booking-frame { height: 820px; }
}

.form h2 { font-size: var(--step-2); margin-bottom: var(--sp-2); }

.form {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: var(--sp-5);
  background: linear-gradient(180deg, var(--surface), var(--void) 80%);
}

.field { margin-bottom: var(--sp-4); }

.field label {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.field__optional { color: var(--text-faint); font-weight: 400; }

.field input, .field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: var(--step-0);
  color: var(--text);
  background: var(--void);
  border: 1px solid var(--control-edge);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.field input:focus-visible, .field textarea:focus-visible {
  border-color: var(--cyan);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 30%, transparent);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }

.field--invalid input, .field--invalid textarea { border-color: var(--danger); }

.field--invalid input:focus-visible, .field--invalid textarea:focus-visible {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 30%, transparent);
}

.field__error {
  display: block;
  margin-top: 0.4rem;
  font-size: var(--step--1);
  color: var(--danger);
}

/* Honeypot. Hidden from people, reachable by bots. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__result {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
}

.form__result h3 { font-size: var(--step-1); margin-bottom: 0.4rem; }
.form__result p { color: var(--text-dim); font-size: var(--step--1); }
.form__result[data-state="ok"] { border-color: var(--cyan); }
.form__result[data-state="error"] { border-color: var(--danger); }

.form__result a { color: var(--cyan-text); }

/* Services page, long form offers */
.offer-long {
  padding-block: var(--sp-7);
  border-top: 1px solid var(--hairline);
  display: grid;
  gap: var(--sp-5);
}

@media (min-width: 900px) {
  .offer-long { grid-template-columns: 0.8fr 1.2fr; gap: var(--sp-7); }
}

.offer-long:nth-of-type(1) { --accent: var(--magenta-text); }
.offer-long:nth-of-type(2) { --accent: var(--cyan-text); }
.offer-long:nth-of-type(3) { --accent: var(--amber-text); }

.offer-long h2 { font-size: var(--step-2); }
.offer-long__summary { font-size: var(--step-1); color: var(--text); margin-bottom: var(--sp-3); }
.offer-long__body { color: var(--text-dim); margin-bottom: var(--sp-4); line-height: 1.7; }

/*
 * Without motion, the page is simply finished. Reveal and hero hidden states
 * already depend on .motion, so only the process line needs telling here.
 */
html:not(.motion) .process { --draw: 1; }

/* The 1995 replay needs the modules, so it goes when scripting does. */
@media (scripting: none) {
  .site-footer .replay-95 { display: none; }
}
