/* teamd.co.uk — the marketing page. Tokens, type, motion and layout follow docs/brand.md and
   docs/design/v4/spec.md (§2 checklist, §4 tokens, §6 type, §11 motion, §12 page). Dark only:
   the page sits on the brand's night ground. */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap;
  src: url(assets/fonts/Inter-Regular.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap;
  src: url(assets/fonts/Inter-Medium.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap;
  src: url(assets/fonts/Inter-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Inter Display"; font-weight: 500; font-style: normal; font-display: swap;
  src: url(assets/fonts/InterDisplay-Medium.woff2) format("woff2"); }
@font-face { font-family: "Inter Display"; font-weight: 600; font-style: normal; font-display: swap;
  src: url(assets/fonts/InterDisplay-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Space Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url(assets/fonts/SpaceMono-Regular.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  /* brand.md, app tokens, dark column */
  --bg: #070A18; --surface: #101526; --elevated: #1A1F34; --fill: #21273F;
  --sep: #272D42; --sep2: #3A415B;
  --text: #F2F4FC; --text2: #ADB7D2; --text3: #7B85A2;
  --accent: #B0C2F8; --on-accent: #10163F; --accent-pressed: #9AAEF0;
  --accent-soft: #202955; --on-accent-soft: #C6D3F9;
  /* the logo ramp, for the night sky and the small flat marks only */
  --lapis: #3043AC; --frost: #DBE4FC; --ink: #0E1434; --fleck: #D4AB4F;
  /* two shadow levels; dark triples the alpha in black (brand.md, Materials) */
  --sh-low: 0 1px 2px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.15);
  --sh-mid: 0 4px 12px rgba(0,0,0,.24), 0 12px 32px rgba(0,0,0,.24);
  --font-text: "Inter", -apple-system, "SF Pro Text", system-ui, sans-serif;
  --font-display: "Inter Display", "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* spec §11.1, verbatim */
  --spring: linear(0, 0.048, 0.155, 0.282, 0.407, 0.521, 0.619, 0.701, 0.768, 0.821, 0.863, 0.896, 0.921, 0.941, 0.956, 0.967, 0.975, 0.982, 0.986, 0.99, 0.993, 0.995, 1);
  --spring-pop: linear(0, 0.045, 0.153, 0.292, 0.439, 0.58, 0.704, 0.808, 0.89, 0.951, 0.994, 1.022, 1.038, 1.045, 1.046, 1.042, 1.037, 1.03, 1.023, 1.017, 1.012, 1.007, 1);
  --spring-soft: linear(0, 0.047, 0.158, 0.299, 0.445, 0.582, 0.701, 0.799, 0.876, 0.934, 0.974, 1.001, 1.017, 1.025, 1.028, 1.028, 1.025, 1.021, 1.017, 1.013, 1.009, 1.006, 1);
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --ease-exit: cubic-bezier(.4,0,1,1);
  --ease-calm: cubic-bezier(.45,0,.55,1);
  --gap: 96px; --inset: 24px;
  --orbit: min(66vh, 680px, 100vw - 32px);
}
@supports not (transition-timing-function: linear(0, 1)) {
  :root { --spring: cubic-bezier(.25,.9,.3,1); --spring-pop: cubic-bezier(.25,.9,.3,1); --spring-soft: cubic-bezier(.25,.9,.3,1); }
}
@media (max-width: 719px) { :root { --gap: 64px; --inset: 16px; } }
@media (max-width: 899px) { :root { --orbit: min(100vw - 32px, 58vh, 440px); } }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/23px var(--font-text); letter-spacing: -0.011em; font-optical-sizing: auto;
  font-variant-numeric: tabular-nums; min-height: 100vh; overflow-x: hidden;
}
body.is-modal { overflow: hidden; }
img, svg { display: block; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--on-accent-soft); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--inset); }
.mono { font-family: var(--font-mono); font-size: 11px; line-height: 14px; letter-spacing: .10em; text-transform: uppercase; color: var(--text2); font-weight: 400; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the ground: the mark tiled faintly over the night, drifting, and a soft lift of
   the ramp's deep blue behind the orbit so the mark sits in light ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(58% 46% at 50% 44%, rgba(30, 42, 107, .38), rgba(30, 42, 107, 0) 72%); }
.bg-tile { position: absolute; left: 0; top: 0; width: calc(100% + 96px); height: calc(100% + 96px); animation: drift 120s linear infinite; }
@keyframes drift { to { transform: translate3d(-96px, -96px, 0); } }
main, footer { position: relative; z-index: 1; }
.is-paused .bg-tile { animation-play-state: paused; }

/* ---------- hero: one centred composition ---------- */
.hero { padding: 48px 0 var(--gap); text-align: center; }
@media (max-width: 719px) { .hero { padding-top: 40px; } }
.wordmark { margin: 0 auto; width: min(100%, 440px); color: var(--text); }
.wordmark .wipe {
  display: block;
  -webkit-mask-image: linear-gradient(112deg, #000 45%, transparent 55%); mask-image: linear-gradient(112deg, #000 45%, transparent 55%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 0% 0; mask-position: 0% 0;
  animation: wipe-in .42s var(--ease-out) .1s both;
}
.wordmark svg { display: block; width: 100%; height: auto; }
@keyframes wipe-in { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; transform: translateY(8px); } to { -webkit-mask-position: 0% 0; mask-position: 0% 0; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tag { margin: 16px auto 0; max-width: 24ch; font-family: var(--font-display); font-weight: 600; font-size: 32px; line-height: 36px; letter-spacing: -0.03em; text-wrap: balance; animation: rise .3s var(--ease-out) .35s both; }
@media (max-width: 719px) { .tag { margin-top: 16px; font-size: 26px; line-height: 31px; } }

/* the orbit: the mark in the middle, the numbers on the inner ring, the sports on the outer ring */
.orbit { position: relative; width: var(--orbit); aspect-ratio: 1; margin: 24px auto 0; }
.stage { position: absolute; left: 50%; top: 50%; width: 44%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.stage > img, .stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage > img { object-fit: contain; transition-property: opacity; transition-duration: .15s; transition-timing-function: var(--ease-exit); }
.stage > img.is-hidden { opacity: 0; }
.stage > canvas { opacity: 0; pointer-events: none; touch-action: pan-y pinch-zoom; cursor: grab; transition-property: opacity; transition-duration: .3s; transition-timing-function: var(--ease-out); }
.stage > canvas.is-live { opacity: 1; pointer-events: auto; }
.stage > canvas.is-dragging { cursor: grabbing; }
.rings { position: absolute; inset: 0; animation: rings-in .61s var(--spring) .45s both; }
@keyframes rings-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.ring { position: absolute; inset: 0; pointer-events: none; }
.ring .slot { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a))); }
.ring .slot > * { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); pointer-events: auto; }
.ring-stats .slot { --r: calc(var(--orbit) * 0.3); }
.ring-stats .slot:nth-child(1) { --a: -90deg; } .ring-stats .slot:nth-child(2) { --a: 0deg; }
.ring-stats .slot:nth-child(3) { --a: 90deg; } .ring-stats .slot:nth-child(4) { --a: 180deg; }
.ring-stats { animation: ring-spin 140s linear infinite; }
.ring-stats .stat { animation: ring-unspin 140s linear infinite; }
/* the sports: three rings of small uppercase text around the mark, turning like a dial */
.tring { position: absolute; inset: -5%; width: 110%; height: 110%; pointer-events: none; transform-origin: 50% 50%; }
.tring text { font-family: var(--font-mono); font-size: 15.6px; letter-spacing: .12em; text-transform: uppercase; fill: var(--text2); }
.tring:nth-of-type(1) { animation: ring-spin 150s linear infinite; }
.tring:nth-of-type(2) { animation: ring-spin 190s linear infinite reverse; }
.tring:nth-of-type(3) { animation: ring-spin 240s linear infinite; }
.tring:nth-of-type(3) text { fill: var(--text3); }
@keyframes ring-spin { to { transform: rotate(360deg); } }
@keyframes ring-unspin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(-360deg); } }
.stat { display: flex; flex-direction: column; align-items: center; width: 96px; white-space: nowrap; }
.stat .mono { font-size: 10px; line-height: 13px; letter-spacing: .12em; }
.stat .val { margin-top: 2px; font-family: var(--font-display); font-weight: 500; font-size: 28px; line-height: 30px; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 899px) {
  .stage { width: 50%; }
  .tring { display: none; }
  .ring-stats .slot { --r: calc(var(--orbit) * 0.36); }
  .stat { width: 72px; }
  .stat .val { font-size: 22px; line-height: 26px; }
}

/* phones: the sports run past under the mark instead of orbiting it */
.marquee { display: none; margin-top: 24px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
@media (max-width: 899px) { .marquee { display: block; } }
.marquee .row { margin: 0; width: max-content; white-space: nowrap; font-family: var(--font-mono); font-size: 11px; line-height: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--text2); animation: slide 60s linear infinite; }
.marquee .row + .row { margin-top: 10px; animation-direction: reverse; animation-duration: 75s; }
.marquee .row:nth-child(3) { animation-direction: normal; animation-duration: 90s; color: var(--text3); }
@keyframes slide { to { transform: translateX(-50%); } }

.cta { margin-top: 32px; animation: rise .3s var(--ease-out) .7s both; }
.ticker { position: relative; height: 27px; margin: 24px auto 0; animation: rise .3s var(--ease-out) .85s both; }
.ticker .line { position: absolute; left: 0; right: 0; top: 0; opacity: 0; font-weight: 600; font-size: 22px; line-height: 27px; letter-spacing: -0.02em; color: var(--text2); }
.ticker .line.is-on { opacity: 1; }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 132px; height: 50px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 17px; line-height: 22px; letter-spacing: -0.012em;
  transition-property: background-color, color, transform, opacity; transition-duration: .15s; transition-timing-function: var(--ease-out);
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-pressed); }
.btn-primary:active { background: var(--accent-pressed); transform: scale(.97); transition-duration: 90ms; }
.btn-primary[aria-disabled="true"] { cursor: default; }
.btn-primary.is-done { background: var(--accent-soft); color: var(--on-accent-soft); }
.btn .lbl { transition-property: opacity, filter; transition-duration: .12s; transition-timing-function: var(--ease-out); }
.btn .ld { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition-property: opacity; transition-duration: .12s; }
.btn .ld svg { width: 22px; height: 22px; overflow: visible; }
.btn .ld path { transform-box: view-box; }
.btn.is-busy .lbl { opacity: 0; filter: blur(4px); }
.btn.is-busy .ld { opacity: 1; }
/* Stride loader (spec §11.2 #12): the halves alternate between stride and aligned */
.btn.is-busy .ld .f { animation: ld-f 1.1s var(--ease-calm) infinite alternate; }
.btn.is-busy .ld .r { animation: ld-r 1.1s var(--ease-calm) infinite alternate; }
@keyframes ld-f { from { transform: translate(0, 0); } to { transform: translate(-32.5px, 80.4px); } }
@keyframes ld-r { from { transform: translate(0, 0); } to { transform: translate(32.5px, -80.4px); } }
.btn-text { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; border-radius: 8px; color: var(--accent); font-weight: 600; font-size: 15px; line-height: 21px; }
.btn-text:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- footer: the contact line only ---------- */
.foot { padding: 24px 0 44px; }
.contact { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: 8px; font-size: 13px; line-height: 18px; letter-spacing: -0.003em; color: var(--text2); text-align: center; }
.contact a { display: inline-flex; align-items: center; min-height: 44px; }
.contact .dot { color: var(--text3); }
.contact a, .consent a, .nojs a { text-decoration: underline; text-underline-offset: 3px; }
.motion { display: inline-flex; align-items: center; min-height: 44px; color: var(--text2); text-decoration: underline; text-underline-offset: 3px; }
.motion:hover { color: var(--text); }
.nojs { margin-top: 16px; font-size: 13px; line-height: 18px; color: var(--text2); }

/* ---------- dialog ---------- */
dialog.wl {
  width: min(100% - 32px, 480px); max-height: min(100% - 32px, 100vh); margin: auto; padding: 24px;
  border: 0; border-radius: 28px; background: var(--surface); color: var(--text); box-shadow: var(--sh-mid);
  overflow: auto; overscroll-behavior: contain;
}
dialog.wl::backdrop { background: rgba(7, 10, 24, .6); }
dialog.wl[open] { animation: dlg-in .22s var(--ease-out); }
dialog.wl[open]::backdrop { animation: fade-in .22s var(--ease-out); }
dialog.wl.is-closing { animation: dlg-out .15s var(--ease-exit) forwards; }
dialog.wl.is-closing::backdrop { animation: fade-out .15s var(--ease-exit) forwards; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes dlg-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
.wl .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.wl .eyebrow { display: flex; align-items: center; gap: 8px; }
.wl .close { flex: none; width: 44px; height: 44px; margin: -12px -12px 0 0; display: grid; place-items: center; border-radius: 999px; color: var(--text2); transition-property: background-color, color; transition-duration: .15s; }
.wl .close:hover { background: var(--fill); color: var(--text); }
.wl .close svg { width: 20px; height: 20px; }
.wl h2 { margin-top: 12px; font-weight: 600; font-size: 26px; line-height: 31px; letter-spacing: -0.02em; }
.wl .lead { margin-top: 8px; font-size: 15px; line-height: 21px; letter-spacing: -0.009em; color: var(--text2); }
.wl form { margin-top: 20px; }
.field + .field { margin-top: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; line-height: 18px; letter-spacing: -0.003em; margin-bottom: 6px; }
.field input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; background: var(--fill); border: 1px solid var(--sep2);
  font-size: 16px; line-height: 23px; letter-spacing: -0.011em; color: var(--text);
  border-color: var(--text3);
  transition-property: border-color, background-color; transition-duration: .15s;
}
.field input::placeholder { color: var(--text3); }
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field input[aria-invalid="true"] { border-color: var(--accent); background: var(--accent-soft); }
.field .hint, .field .err { margin-top: 6px; font-size: 13px; line-height: 18px; letter-spacing: -0.003em; }
.field .hint { color: var(--text3); }
.field .err { color: var(--text); }
.field .err:empty { display: none; }
.hp { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.consent { margin-top: 20px; font-size: 13px; line-height: 18px; letter-spacing: -0.003em; color: var(--text2); }
.wl .actions { margin-top: 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.wl .status { font-size: 13px; line-height: 18px; letter-spacing: -0.003em; color: var(--text); flex: 1 1 160px; }
.wl noscript p { margin-top: 16px; font-size: 13px; line-height: 18px; color: var(--text2); }

/* ---------- the TeamD! moment (spec §11.3): the one full-bleed brand surface ---------- */
dialog.wl.is-sky {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border-radius: 0; box-shadow: none; overflow: hidden;
  background: #3043AC url(assets/brand/night-sky.svg) center / cover no-repeat;
  animation: none;
}
dialog.wl.is-sky::backdrop { background: rgba(14, 20, 52, .4); }
dialog.wl.is-sky.is-closing { animation: dlg-out .15s var(--ease-exit) forwards; }
.sky { position: absolute; inset: 0; display: none; }
.is-sky .sky { display: block; }
.is-sky .card { display: none; }
.sky .scrim { position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(14,20,52,.55)); }
.sky .col { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 24px; }
.sky .markbox { margin-top: min(24vh, 120px); width: 148px; height: 139px; }
.sky .markbox svg { width: 100%; height: 100%; overflow: visible; }
.sky .markbox .s-rear, .sky .markbox .s-front, .sky .markbox .s-shadow { transform-box: view-box; }
.sky .wordbox { margin-top: 28px; }
.sky .word {
  font-family: var(--font-display); font-weight: 600; font-size: 64px; line-height: 58px; letter-spacing: -0.035em; color: #FFFFFF; padding: 0 8px;
  -webkit-mask-image: linear-gradient(112deg, #000 45%, transparent 55%); mask-image: linear-gradient(112deg, #000 45%, transparent 55%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 0% 0; mask-position: 0% 0;
}
.sky .sub { margin: 24px 0 0; font-weight: 600; font-size: 22px; line-height: 27px; letter-spacing: -0.02em; color: #FFFFFF; }
.sky .done { position: absolute; left: 50%; bottom: max(32px, env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%); background: #FFFFFF; color: var(--lapis); }
.sky .done:hover { background: var(--frost); }
.sky .fleck { position: absolute; width: 2px; height: 2px; border-radius: 1px; background: var(--fleck); opacity: .2; }
.sky .fleck:nth-child(1) { left: 18%; top: 22%; } .sky .fleck:nth-child(2) { left: 74%; top: 17%; }
.sky .fleck:nth-child(3) { left: 30%; top: 70%; } .sky .fleck:nth-child(4) { left: 82%; top: 62%; }
.is-sky .fleck { animation: twinkle 3.2s var(--ease-calm) 1.65s 2 both; }
.is-sky .fleck:nth-child(2) { animation-delay: 2.45s; } .is-sky .fleck:nth-child(3) { animation-delay: 3.25s; } .is-sky .fleck:nth-child(4) { animation-delay: 4.05s; }
@keyframes twinkle { 0% { opacity: .2; } 50% { opacity: .9; } 100% { opacity: .2; } }

/* ---------- the footer's Pause motion control: every ambient loop freezes ---------- */
.is-paused .ring-stats, .is-paused .tring, .is-paused .ring .stat, .is-paused .marquee .row { animation-play-state: paused; }

/* ---------- Reduce Motion: movement becomes a 150 ms crossfade; loops stop ---------- */
@media (prefers-reduced-motion: reduce) {
  .wordmark .wipe, .tag, .rings, .cta, .ticker { animation: none; }
  .ring-stats, .tring, .ring .stat, .marquee .row, .bg-tile { animation: none; }
  .ticker { height: auto; }
  .ticker .line { position: static; display: block; opacity: 1; }
  .ticker .line + .line { margin-top: 8px; }
  .stage > canvas, .stage > img, .btn, .btn .lbl, .btn .ld, .field input, .wl .close { transition-duration: .15s; transition-property: opacity; }
  .btn-primary:active { transform: none; }
  dialog.wl[open], dialog.wl[open]::backdrop { animation: fade-in .15s linear; }
  dialog.wl.is-closing, dialog.wl.is-closing::backdrop { animation: fade-out .15s linear forwards; }
  .btn.is-busy .ld .f, .btn.is-busy .ld .r { animation: none; }
  .btn.is-busy .ld { opacity: .6; }
  .is-sky .fleck { animation: none; opacity: .5; }
}
