/* ==========================================================================
   Aurum Designs — coming soon
   Palette comes from config.json (inlined as --c-* and --text vars), as do
   the Helvetica Now Display @font-face rules (see build.py).
   ========================================================================== */

:root {
  --text-quiet: #8e9bb6;
  --text-muted: #7d89a6;
  --hairline: rgba(181, 193, 217, 0.16);
  --tint: rgba(181, 193, 217, 0.05);
  --button-ink: #02040b;

  --font: "Aurum Helvetica Now Display", "Helvetica Now Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* Type scales with width and, on desktop, height, so a 14" laptop
     (about 1512×860 in the browser) gets ~78px headlines, not ~110px. */
  --headline-size: clamp(2.375rem, 1rem + 6.4vw, 3.25rem);
  --lead-size: clamp(1rem, 0.9rem + 0.28vw, 1.1875rem);
  --selector-size: clamp(1.375rem, 0.9rem + 2.4vw, 1.75rem);
  --section-heading: clamp(1.5rem, 0.9rem + 1.2vw, 2.25rem);
  --body-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  --small-size: 0.875rem;
  --label-size: 0.8125rem;

  --max: 1320px;
  --gutter: 22px;
  --radius: 8px;
  --control-h: 52px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);

  color-scheme: dark;
}

@media (min-width: 600px) {
  :root { --gutter: 32px; }
}
@media (min-width: 600px) {
  :root { --headline-size: min(clamp(3rem, 1.2rem + 3.9vw, 5.75rem), 11svh); }
}
@media (min-width: 900px) {
  :root { --selector-size: min(clamp(1.5rem, 0.6rem + 1.9vw, 2.625rem), 4.8svh); }
}
@media (min-width: 1000px) {
  :root { --gutter: clamp(48px, 6vw, 96px); }
}

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

html {
  background: var(--c-black);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 0;
}

body {
  margin: 0;
  background: var(--c-black);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--body-size);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

::selection { background: rgba(91, 228, 255, 0.85); color: var(--c-black); }

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

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

/* --------------------------------------------------------------------------
   Page frame
   -------------------------------------------------------------------------- */

.page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

main { flex: 1; }

.shell {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline:
    max(var(--gutter), env(safe-area-inset-left))
    max(var(--gutter), env(safe-area-inset-right));
}

/* --------------------------------------------------------------------------
   Backdrop: the light field (WebGL) over a CSS fallback
   -------------------------------------------------------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(160deg, var(--c-black) 40%, var(--c-navy) 100%);
}

.backdrop > * {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Before the shader's first frame and wherever WebGL is unavailable. */
.backdrop__fallback {
  background:
    radial-gradient(ellipse 55% 60% at 100% 75%, rgba(24, 59, 255, 0.55) 0%, rgba(24, 59, 255, 0.18) 55%, rgba(6, 17, 59, 0) 80%),
    radial-gradient(ellipse 40% 45% at 92% 100%, rgba(5, 139, 255, 0.35) 0%, rgba(5, 139, 255, 0) 70%),
    linear-gradient(118deg, var(--c-black) 0%, var(--c-black) 42%, var(--c-navy) 70%, #0a1f7a 100%);
}

.backdrop__canvas {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 240ms ease-out;
}

.field-ready .backdrop__canvas { opacity: 1; }

.backdrop__grain {
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Header and logo
   -------------------------------------------------------------------------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding-top: max(28px, env(safe-area-inset-top));
}

.brand { line-height: 0; }

.logo {
  display: block;
  height: auto;
  overflow: visible;
}

.logo--horizontal { width: clamp(300px, 26vw, 372px); }
.logo--stacked { display: none; width: min(224px, calc(100vw - 2 * var(--gutter) - 64px)); }

/* Below 900px the tagline goes under the wordmark so it stays readable. */
@media (max-width: 899px) {
  .logo--horizontal { display: none; }
  .logo--stacked { display: block; }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--text-support);
}

/* The decorative logo that travels during the entrance (built by main.js
   from the header logo itself, so its geometry is identical). */
.logo-intro {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
}

.logo-intro .logo { width: 100% !important; display: block !important; }


/* --------------------------------------------------------------------------
   Screens: two full-height sections with native scroll snapping
   -------------------------------------------------------------------------- */

.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* Snapping only where both sections fit a desktop viewport (main.js checks
   and picks mandatory or proximity); phones and zoomed pages scroll freely. */
@media (min-width: 900px) {
  html.snap-full { scroll-snap-type: y mandatory; }
  html.snap-relaxed { scroll-snap-type: y proximity; }
  .screen { scroll-snap-align: start; }
  .screen--intro { scroll-snap-stop: always; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  padding-top: clamp(36px, 7svh, 96px);
  padding-bottom: clamp(48px, 9svh, 112px);
}

.hero__content { max-width: 760px; }

.headline {
  font-size: var(--headline-size);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.022em;
}

.headline__line { display: block; }

.hero__description {
  max-width: 44ch;
  margin-top: clamp(18px, 2.6svh, 28px);
  font-size: var(--lead-size);
  line-height: 1.55;
  color: var(--text-support);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: clamp(24px, 3.4svh, 36px);
}

.hero__note {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 20px;
  font-size: var(--small-size);
  line-height: 1.5;
  color: var(--text-quiet);
}

/* Primary action: off-white, dark text, stable hit area. */
.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: var(--control-h);
  padding: 0 22px 0 24px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--button-ink);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, box-shadow 280ms var(--ease);
}

.button__arrow { flex: none; transition: transform 220ms var(--ease); }

@media (hover: hover) {
  .button:hover {
    background: #ffffff;
    /* A soft blue glow behind the button. */
    box-shadow:
      0 0 0 1px #ffffff,
      0 0 22px 0 rgba(5, 139, 255, 0.38),
      0 10px 44px -6px rgba(24, 59, 255, 0.5);
  }
  .button:hover .button__arrow { transform: translateX(3px); }
}

.button:active { background: #dfe5f0; box-shadow: none; }
.button:active .button__arrow { transform: translateX(1px); }
.button:focus-visible { outline: 2px solid var(--c-cyan); outline-offset: 3px; }

/* Secondary action and text links: a short underline reveal. */
.link-action,
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 calc(50% + 0.8em) / 0 1px no-repeat;
  transition: background-size 300ms var(--ease), color 200ms ease;
}

.link-action { font-size: 1rem; font-weight: 500; }
.text-link { color: var(--text-support); }

.link-action:hover,
.link-action:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  color: var(--text);
  background-size: 100% 1px;
}

/* --------------------------------------------------------------------------
   Services: titles on a shallow arc, a stationary statement beside them
   -------------------------------------------------------------------------- */

.services {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 40px;
  padding-block: clamp(48px, 8svh, 96px);
}

.services__statement { order: -1; }

.eyebrow {
  font-size: var(--label-size);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-quiet);
}

.section-heading {
  margin-top: 12px;
  font-size: clamp(1.75rem, 1rem + 2.2vw, 3.5rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.section-heading .headline__line { display: block; }

.arc { display: flex; flex-direction: column; }

.arc__title {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-support);
  font: inherit;
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: left;
  cursor: pointer;
  transition: color 200ms ease, translate 280ms var(--ease);
}

.arc__item.is-open .arc__title,
.arc__title:focus-visible { color: var(--text); translate: 4px 0; }

/* Short description: below the title on phones and tablets (tap to open). */
.arc__desc {
  display: none;
  max-width: 36ch;
  padding-bottom: 12px;
  font-size: var(--small-size);
  line-height: 1.5;
  color: var(--text-support);
}

.arc__item.is-open .arc__desc { display: block; }

@media (min-width: 900px) {
  .services {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    align-items: center;
    gap: clamp(32px, 5vw, 96px);
  }
  .services__statement { order: 0; }

  /* main.js places each item on a large circle centred off-screen left. */
  .arc {
    gap: 0;
    transition: translate 600ms var(--ease);
  }
  .arc__item { transform-origin: 0 50%; }
  .arc__title {
    min-height: 0;
    padding-block: clamp(2px, 0.55svh, 6px);
    font-size: min(clamp(1.375rem, 0.7rem + 1.5vw, 2.25rem), 4.2svh);
    color: var(--arc-color, var(--text-support));
  }
  .arc__item.is-open .arc__title,
  .arc__title:focus-visible { color: var(--text); translate: 8px 0; }

  /* On desktop the description sits beside the title, out of the flow, so
     the arc never moves. */
  .arc__item { position: relative; width: fit-content; }
  .arc__desc {
    display: block;
    position: absolute;
    left: calc(100% + 28px);
    top: 50%;
    width: max-content;
    max-width: 26ch;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-6px, -50%);
    transition: opacity 220ms ease, transform 320ms var(--ease), visibility 0s linear 220ms;
  }
  .arc__item.is-open .arc__desc {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
    transition: opacity 220ms ease, transform 320ms var(--ease), visibility 0s;
  }
  /* Keep the other titles quiet while one is described. */
  .arc:has(.is-open) .arc__item:not(.is-open) .arc__title { opacity: 0.55; }
  .arc__title { transition: color 200ms ease, translate 280ms var(--ease), opacity 220ms ease; }
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: clamp(56px, 10svh, 120px) clamp(32px, 6svh, 72px);
}

.contact__heading {
  margin-top: 14px;
  font-size: var(--headline-size);
  font-weight: 500;
  line-height: 1.03;
  letter-spacing: -0.022em;
}

.contact__text {
  max-width: 40ch;
  margin-top: clamp(18px, 2.6svh, 28px);
  font-size: var(--lead-size);
  color: var(--text-support);
}

.contact .button { margin-top: clamp(24px, 3.4svh, 36px); }
.contact__email { margin-top: 12px; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  font-size: var(--small-size);
  color: var(--text-quiet);
}

.site-footer .logo--horizontal { width: 220px; }
.site-footer .logo--stacked { width: 176px; }
@media (min-width: 900px) { .site-footer .logo--stacked { display: none; } }

/* Phones and tablets: logo centred, copyright underneath. */
@media (max-width: 899px) {
  .site-footer {
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    text-align: center;
  }
  .site-footer__logo { display: block; line-height: 0; }
  .site-footer p { margin: 0; }
}

/* --------------------------------------------------------------------------
   Sound toggle: fixed top right, in line with the header
   -------------------------------------------------------------------------- */

.status { margin-right: 60px; }

/* Phones and tablets: the logo and sound button share one centred row, with
   the status line tucked underneath. */
@media (max-width: 899px) {
  .site-header { gap: 12px 24px; }
  .status { margin-right: 0; }
}

.sound-toggle {
  position: fixed;
  z-index: 20;
  top: max(18px, env(safe-area-inset-top));
  right: max(var(--gutter), calc((100vw - var(--max)) / 2), env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(181, 193, 217, 0.18);
  border-radius: 50%;
  background: rgba(2, 4, 11, 0.35);
  color: var(--text-support);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: color 160ms ease, border-color 160ms ease, box-shadow 280ms var(--ease);
}
.sound-toggle[hidden] { display: none; }
.sound-toggle:hover {
  color: var(--text);
  border-color: rgba(181, 193, 217, 0.4);
  box-shadow: 0 0 18px -2px rgba(5, 139, 255, 0.35);
}
.sound-toggle:focus-visible { outline: 2px solid var(--c-cyan); outline-offset: 3px; }

.sound-toggle__bars { display: flex; align-items: center; gap: 2px; height: 14px; }
.sound-toggle__bars i {
  display: block;
  width: 2px;
  height: 3px;
  border-radius: 1px;
  background: currentColor;
  transition: height 240ms var(--ease);
}
/* Playing: the bars move gently. Muted or waiting: they lie flat. */
.sound-toggle.is-on .sound-toggle__bars i { animation: sound-bar 1.4s ease-in-out infinite alternate; }
.sound-toggle.is-on .sound-toggle__bars i:nth-child(2) { animation-delay: -0.5s; animation-duration: 1.1s; }
.sound-toggle.is-on .sound-toggle__bars i:nth-child(3) { animation-delay: -0.9s; animation-duration: 1.7s; }
.sound-toggle.is-on .sound-toggle__bars i:nth-child(4) { animation-delay: -0.2s; animation-duration: 1.25s; }
.sound-toggle[aria-pressed="false"] .sound-toggle__bars { opacity: 0.6; }
/* Sound is on but the browser is waiting for a first click: a soft pulse. */
.sound-toggle.is-waiting { animation: sound-wait 2.4s ease-in-out infinite; }
@keyframes sound-wait {
  50% { box-shadow: 0 0 16px 0 rgba(5, 139, 255, 0.45); border-color: rgba(181, 193, 217, 0.45); }
}
.sound-toggle.is-waiting::after { display: none; }
.sound-toggle[aria-pressed="false"]:not(.is-waiting)::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(-45deg);
}
@keyframes sound-bar {
  from { height: 3px; }
  to { height: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .sound-toggle.is-waiting { animation: none; }
  .sound-toggle.is-on .sound-toggle__bars i { height: 9px; }
  .sound-toggle.is-on .sound-toggle__bars i:nth-child(odd) { height: 5px; }
}

@media (max-width: 899px) {
  .sound-toggle { top: max(30px, env(safe-area-inset-top)); width: 40px; height: 40px; }
}

/* --------------------------------------------------------------------------
   Project enquiry form (native <dialog>)
   -------------------------------------------------------------------------- */

html.dialog-open { overflow: hidden; }

.enquiry {
  width: min(640px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(181, 193, 217, 0.16);
  border-radius: 14px;
  background: #050a1c;
  color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 0 60px -20px rgba(24, 59, 255, 0.35);
  overflow: auto;
  overscroll-behavior: contain;
}

.enquiry::backdrop {
  background: rgba(2, 4, 11, 0.72);
  backdrop-filter: blur(6px);
}

.enquiry[open] { animation: enquiry-in 320ms var(--ease); }
@keyframes enquiry-in {
  from { opacity: 0; transform: translateY(12px); }
}

.enquiry__panel { position: relative; padding: clamp(24px, 4vw, 40px); }

.enquiry__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-support);
  cursor: pointer;
}
.enquiry__close:hover { color: var(--text); background: rgba(181, 193, 217, 0.08); }
.enquiry__close:focus-visible { outline: 2px solid var(--c-cyan); outline-offset: 2px; }

.enquiry__title {
  padding-right: 40px;
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.enquiry__intro {
  margin-top: 8px;
  font-size: var(--small-size);
  color: var(--text-support);
}

.enquiry__form { display: grid; gap: 18px; }
.enquiry__form > .enquiry__intro { margin-top: -10px; }
.enquiry__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.field-row { display: grid; gap: 18px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label,
.field legend {
  padding: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-support);
}
.field legend { margin-bottom: 8px; }
.field__optional { font-weight: 400; color: var(--text-quiet); }

.field input,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid rgba(181, 193, 217, 0.22);
  border-radius: 8px;
  background: rgba(2, 4, 11, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field input:hover,
.field textarea:hover { border-color: rgba(181, 193, 217, 0.4); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--c-electric);
  box-shadow: 0 0 0 3px rgba(5, 139, 255, 0.25);
}
.field input:user-invalid,
.field textarea:user-invalid { border-color: #ff7a7a; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(181, 193, 217, 0.22);
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--text-support);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.chip:hover span { border-color: rgba(181, 193, 217, 0.45); color: var(--text); }
.chip input:checked + span {
  border-color: var(--c-electric);
  background: rgba(5, 139, 255, 0.16);
  color: var(--text);
}
.chip input:focus-visible + span { outline: 2px solid var(--c-cyan); outline-offset: 2px; }

.enquiry__status {
  font-size: var(--small-size);
  color: #ffb4b4;
}
.enquiry__status[hidden] { display: none; }

.enquiry__submit { justify-self: start; border: 0; cursor: pointer; font-family: inherit; }
.enquiry__submit:disabled { opacity: 0.7; cursor: progress; }

.enquiry__done {
  padding: 24px 40px 8px 0;
  font-size: var(--lead-size);
  line-height: 1.5;
  outline: none;
}
.enquiry__done[hidden] { display: none; }

/* --------------------------------------------------------------------------
   One shared background: a dim layer driven by scroll progress
   -------------------------------------------------------------------------- */

.backdrop__dim {
  background: radial-gradient(70% 60% at 85% 100%, rgba(2, 4, 11, 0.86), rgba(2, 4, 11, 0.96)), rgba(2, 4, 11, 0.2);
  opacity: var(--dim, 0);
}

/* --------------------------------------------------------------------------
   Entrance states. html.intro is set by the inline gate on every full load;
   main.js animates out of it, and a failsafe removes it.
   -------------------------------------------------------------------------- */

.intro [data-brand] .logo { visibility: hidden; }
.intro [data-reveal] { opacity: 0; }
.intro .backdrop__fallback { opacity: 0.35; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation: none !important;
  }
  .button__arrow { transform: none !important; }
  .arc__title, .arc { translate: none !important; }
  @media (min-width: 900px) { .arc__desc { transform: translate(0, -50%) !important; } }
}
