/* Aimlink TARGET on a tablet: the screens of apps/target/index.html, HTML in the app's own look (the tablet scene on the
   start page, assets/devices.css, is the model; the colours are the GO app's, Figma "Aimlink GO AI Design System").
   They are stand-ins built from what aimlink.ai says TARGET does until real screens exist: live shot-by-shot tracking from a
   Wi-Fi camera, shot patterns and groups, auto-calibration, and results sent to GO. Demo data: Sofie Krag's air pistol
   series, the same 75.0 / 9.38 as in GO and on the start page.
   The tablet's screen is 100cqw wide and 69.7cqw tall. Parts switch on at a point in their clip with data-at (app-page.js
   runs the clock and adds .is-on); .t-in, .t-fade and .t-pop (app-page-wide.css) and .t-step say how. Without the clock every screen shows its end state. */

@layer sections {
  .ts {
    --app-bg: var(--color-night); --app-card: var(--color-line-dark); --app-tile: var(--color-grey-2); --app-line: var(--color-grey-2); --app-text: var(--color-snow); --app-muted: var(--color-snow-2); --app-lime: var(--color-lime);
    position: absolute; inset: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden;
    font: 400 2cqw/1.3 var(--font-text); color: var(--app-text);
    background: radial-gradient(110% 90% at 28% 45%, var(--color-dusk) 0%, var(--app-bg) 70%);
  }
  .ts .ui-ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .ts .ic { width: 2.1em; height: 2.1em; flex: none; margin: -0.5em; }
  .ts-top { display: flex; justify-content: space-between; padding: 1.2cqw 2.8cqw 0; font-size: 1.8cqw; font-weight: 600; }
  .ts-top-r { display: flex; align-items: center; gap: 0.4em; }
  .ts-bar { display: flex; align-items: center; justify-content: space-between; gap: 2cqw; padding: 1.3cqw 2.8cqw 1.2cqw; }
  .ts-logo { display: flex; align-items: center; gap: 0.4em; font: 500 4.6cqw/1 var(--font-numeric); letter-spacing: 0.02em; }
  .ts-logo img { width: 1.2em; height: 1.2em; flex: none; margin-top: -0.2em; }
  .ts-lane { color: var(--app-muted); }
  .ts-pill { display: inline-flex; align-items: center; gap: 0.5em; padding: 0.55em 1em; border-radius: 999px; background: var(--app-card); font-weight: 600; white-space: nowrap; }
  .ts-pill i { width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--app-lime); box-shadow: 0 0 0 0.25em color-mix(in srgb, var(--app-lime) 22%, transparent); }
  .ts-main { display: grid; min-height: 0; padding: 0.4cqw 2.8cqw 2.4cqw; gap: 3cqw; }
  .ts-k { font-size: 1.7cqw; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--app-muted); }
  .ts-card { display: grid; place-items: center; align-self: center; aspect-ratio: 1; padding: 1.6cqw; border-radius: 2.4cqw; background: var(--app-card); }
  .ts-card .target { width: 100%; height: 100%; }
  .ts-total { font: 500 11cqw/0.8 var(--font-numeric); font-variant-numeric: tabular-nums; }
  .ts-total small, .ts-stat b small, .ts-chips small { font-size: 55%; }
  .ts-stat span { display: block; margin-bottom: 0.3em; font-size: 1.7cqw; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--app-muted); }
  .ts-stat b { font: 500 5cqw/0.9 var(--font-numeric); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .ts-stat b i { margin-left: 0.2em; font-style: normal; font-size: 55%; color: var(--app-muted); }
  .ts-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1cqw; }
  .ts-chips li { padding: 0.85cqw 0 0.5cqw; border-radius: 1.2cqw; background: var(--app-card); text-align: center; font: 500 3.2cqw/1 var(--font-numeric); font-variant-numeric: tabular-nums; color: var(--app-text); }
  .ts-chips li.is-last { box-shadow: inset 0 0 0 0.22cqw var(--app-lime); }
  .ts-saved { display: inline-flex; align-items: center; gap: 0.45em; font-weight: 600; color: var(--app-lime); }

  /* 1 · Point a camera: the camera's view and the set-up */
  .ts-main-cam { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .ts-feed { position: relative; overflow: hidden; border-radius: 2.4cqw; background: var(--color-night); box-shadow: inset 0 0 0 1px var(--app-line); }
  .ts-view { display: block; width: 100%; height: 100%; }
  .ts-feed .ts-view .floor { fill: rgb(255 255 255 / 0.04); }
  .ts-feed .ts-view .rail { fill: none; stroke: rgb(160 224 32 / 0.5); stroke-width: 0.5; }
  .ts-feed .ts-view .rail-dim { stroke: rgb(255 255 255 / 0.12); }
  .ts-feed .ts-view .brk { fill: none; stroke: var(--app-lime); stroke-width: 0.9; stroke-linecap: round; stroke-linejoin: round; transform-box: fill-box; transform-origin: center; }
  .ts-feed .ts-view .t-paper { fill: #e9edf1; stroke: none; }
  .ts-feed .ts-view .t-line { stroke: var(--color-dusk); stroke-width: 0.35; }
  .ts-feed .ts-view .t-black { fill: var(--color-dusk); }
  .ts-feed .ts-view .t-line-dark { stroke: rgb(255 255 255 / 0.35); stroke-width: 0.3; }
  .ts-chip { position: absolute; display: inline-flex; align-items: center; gap: 0.45em; padding: 0.5em 0.95em 0.45em; border-radius: 999px; background: rgb(16 21 27 / 0.82); font-weight: 600; font-size: 1.8cqw; white-space: nowrap; backdrop-filter: blur(4px); }
  .ts-chip-tl { left: 2cqw; top: 2cqw; }
  .ts-chip-bl { left: 2cqw; bottom: 2cqw; color: var(--app-lime); }
  .ts-steps { display: grid; align-content: center; gap: 1.2cqw; }
  .ts-steps ul { display: grid; gap: 1.2cqw; }
  .ts-steps li { display: flex; align-items: center; gap: 1.2cqw; padding: 1.3cqw 1.6cqw; border-radius: 1.6cqw; background: var(--app-card); font-weight: 500; }
  .ts-ck { display: grid; place-items: center; width: 3cqw; height: 3cqw; flex: none; border-radius: 50%; background: var(--app-lime); color: var(--color-moss); }
  .ts-ck .ui-ic { width: 2cqw; height: 2cqw; stroke-width: 2.6; }
  .ts-start { display: grid; place-items: center; margin-top: 0.4cqw; padding: 1.5cqw 0 1.2cqw; border-radius: 999px; background: var(--app-lime); color: var(--color-moss); font: 600 2.3cqw/1 var(--font-numeric); letter-spacing: 0.08em; text-transform: uppercase; }

  /* 2 · Score live: the target, the shot list and the running total */
  .ts-main-live { grid-template-columns: auto minmax(0, 1fr); }
  .ts-main-live .ts-card { width: 50cqw; }
  .ts-side { display: flex; flex-direction: column; justify-content: center; gap: 2cqw; min-width: 0; }
  .ts-side .ts-stats { display: flex; gap: 4cqw; }

  /* 3 · See the pattern: where the shots sit as a group */
  .ts-main-pattern { grid-template-columns: auto minmax(0, 1fr); }
  .ts-main-pattern .ts-card { width: 50cqw; }
  .ts-group { fill: color-mix(in srgb, var(--color-lime) 12%, transparent); stroke: var(--color-lime); stroke-width: 0.7; }
  .ts-avgring { fill: none; stroke: var(--color-lime); stroke-width: 0.55; stroke-dasharray: 1.6 1.4; }
  .ts-cross { fill: none; stroke: var(--color-lime); stroke-width: 0.9; stroke-linecap: round; }
  .ts-plist { display: grid; gap: 1.5cqw; }
  .ts-plist > div { padding: 1.5cqw 2cqw 1.3cqw; border-radius: 1.8cqw; background: var(--app-card); }
  .ts-note { color: var(--app-muted); }

  /* 4 · Straight to GO: the series leaves the tablet and lands in the shooter's profile */
  .ts-main-sync { grid-template-columns: minmax(0, 1fr) 11cqw minmax(0, 1fr); align-items: center; }
  .ts-sync-card { display: grid; grid-template-columns: 17cqw minmax(0, 1fr); gap: 2cqw; align-items: center; padding: 2.2cqw; border-radius: 2.4cqw; background: var(--app-card); }
  .ts-sync-card .target { width: 100%; height: auto; }
  .ts-sync-card .ts-total { font-size: 9cqw; margin: 0.8cqw 0 1.2cqw; }
  .ts-wire { align-self: center; width: 100%; height: 4cqw; overflow: visible; }
  .ts-wire .w-line { fill: none; stroke: rgb(255 255 255 / 0.22); stroke-width: 1; stroke-dasharray: 2.4 2.4; stroke-linecap: round; }
  .ts-wire .w-pulse { fill: var(--app-lime); }
  .ts-go { display: grid; justify-items: start; gap: 1.2cqw; padding: 2.2cqw; border-radius: 2.4cqw; background: var(--color-paper); color: var(--app-bg); }
  .ts-go-head { display: flex; align-items: center; gap: 1.2cqw; font: 500 4cqw/1 var(--font-numeric); letter-spacing: 0.01em; }
  .ts-go-head img { width: 5.6cqw; height: 5.6cqw; }
  .ts-go-card { display: grid; gap: 0.5cqw; width: 100%; padding: 1.6cqw 1.8cqw; border-radius: 1.8cqw; background: #e4e8ec; }
  .ts-go-card span { font-size: 1.7cqw; color: #5B636B; }
  .ts-go-card b { font: 500 6.4cqw/0.9 var(--font-numeric); font-variant-numeric: tabular-nums; }
  .ts-go-card b small { font-size: 55%; }
  .ts-go .ts-saved { color: var(--color-fern); }
  .ts-synced { grid-column: 1 / -1; justify-self: center; }

  /* ── The clock, TARGET's own parts (the shared .t-in, .t-fade and .t-pop are in app-page-wide.css) ── */
  .is-timed .t-step[data-at] .ts-ck { background: var(--app-tile); color: transparent; transition: background-color 240ms var(--ease-out), color 240ms var(--ease-out); }
  .is-timed .t-step[data-at].is-on .ts-ck { background: var(--app-lime); color: var(--color-moss); }
  .is-timed .brk[data-at] { transform: scale(1.35); opacity: 0; transition: opacity 260ms var(--ease-out), transform 420ms var(--ease-out); }
  .is-timed .brk[data-at].is-on { transform: none; opacity: 1; }
  .is-timed .w-pulse[data-at] { opacity: 0; transition: opacity 200ms linear; }
  .is-timed .w-pulse[data-at].is-on { opacity: 1; }
  /* a shot's ring spreads once when it lands */
  @keyframes ts-impact { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(3.2); } }
  .ts .target .impact { opacity: 0; transform-box: fill-box; transform-origin: center; }
  .is-timed .t-pop[data-at].is-on .impact { animation: ts-impact 700ms var(--ease-out) both; }
  .ts .target .shot { transform-box: fill-box; transform-origin: center; }
  /* "Saved": the check gives one ring when the line switches on (the same ring as a landing shot; transform and opacity only) */
  .ts-saved[data-at] { position: relative; }
  .ts-saved[data-at]::before { content: ""; position: absolute; left: 0; top: 50%; width: 1.25em; height: 1.25em; margin-top: -0.625em; border-radius: 50%; border: 1px solid currentColor; opacity: 0; pointer-events: none; }
  .is-timed .ts-saved[data-at].is-on::before { animation: ts-impact 700ms var(--ease-out) both; }
}

/* TARGET tablet: recorded screens fill the glass. */
.club-screen-video, .target-screen-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #091219; }

@layer sections {
  .tab.target-go-demo {
    border-radius: calc(var(--tl) * 0.043);
    background: linear-gradient(152deg, #bfc4cb, #717780 18%, #343943 49%, #676e78 78%, #a3aab4);
    box-shadow:
      0 2.4cqw 5cqw rgb(12 20 28 / 0.25),
      0 0.5cqw 1.2cqw rgb(12 20 28 / 0.24),
      inset 0 0 0 max(1px, 0.15cqw) rgb(255 255 255 / 0.27);
  }
  .target-go-demo::before {
    right: 8%;
    width: 4.5%;
    background: linear-gradient(#9299a3, #484e58);
    box-shadow: -4.8cqw 0 #5a606a;
  }
  .target-go-demo .tab-bezel {
    border-radius: calc(var(--tl) * 0.037);
    background: #08090b;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1);
  }
  .target-go-demo .tab-cam {
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08);
  }
  .target-go-demo .tab-screen {
    border-radius: calc(var(--tl) * 0.013);
  }
}

/* Hero: lime light that lives round the tablet (the lane stays dark behind it). Rings ripple out from the target's
   centre like shots landing, a sweep turns round it, and a few sparks drift up. Over the lane video, under the copy's
   night gradient. The centre (--cx, --cy) is where the tablet rests; with reduced motion it is a still glow. */
@layer sections {
  .tg-fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; --cx: 79%; --cy: 62%; mix-blend-mode: screen; }
  .tg-glow { position: absolute; left: var(--cx); top: var(--cy); width: min(110vw, 1300px); aspect-ratio: 1; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgb(160 224 32 / 0.55), rgb(160 224 32 / 0.18) 42%, transparent 72%); animation: tg-glow 4.6s ease-in-out infinite; }
  .tg-sweep { position: absolute; left: var(--cx); top: var(--cy); width: min(120vw, 1500px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg 250deg, rgb(160 224 32 / 0.1) 280deg, rgb(160 224 32 / 0.5) 358deg, transparent 360deg);
    -webkit-mask-image: radial-gradient(closest-side, transparent 8%, #000 26%, #000 60%, transparent 98%); mask-image: radial-gradient(closest-side, transparent 8%, #000 26%, #000 60%, transparent 98%);
    animation: tg-turn 8s linear infinite; }
  .tg-cross { position: absolute; left: var(--cx); top: var(--cy); width: min(120vw, 1500px); aspect-ratio: 1; transform: translate(-50%, -50%);
    background: linear-gradient(90deg, transparent, rgb(160 224 32 / 0.4) 50%, transparent) center / 100% 1px no-repeat, linear-gradient(180deg, transparent, rgb(160 224 32 / 0.4) 50%, transparent) center / 1px 100% no-repeat;
    -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent 78%); mask-image: radial-gradient(closest-side, #000 30%, transparent 78%); animation: tg-glow 4.6s ease-in-out infinite reverse; }
  .tg-rings { position: absolute; left: var(--cx); top: var(--cy); width: 0; height: 0; }
  .tg-rings i { position: absolute; left: 0; top: 0; width: min(120vw, 1500px); aspect-ratio: 1; margin: calc(min(120vw, 1500px) / -2 + 0px); border-radius: 50%; border: 3px solid rgb(190 248 60 / 0.95);
    box-shadow: 0 0 40px 4px rgb(160 224 32 / 0.6), inset 0 0 60px rgb(160 224 32 / 0.3); opacity: 0; transform: scale(0.06);
    animation: tg-ring 6s cubic-bezier(0.18, 0.62, 0.3, 1) infinite; animation-delay: calc(var(--i) * -1s); }
  .tg-dots b { position: absolute; scale: 1.5; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 50%; background: rgb(205 250 90); box-shadow: 0 0 16px 4px rgb(160 224 32 / 0.9); opacity: 0;
    animation: tg-spark var(--t) ease-in-out infinite; animation-delay: var(--dl); }
  @keyframes tg-ring { 0% { transform: scale(0.06); opacity: 0; } 8% { opacity: 0.95; } 62% { opacity: 0.35; } 100% { transform: scale(1); opacity: 0; } }
  @keyframes tg-turn { to { transform: translate(-50%, -50%) rotate(360deg); } }
  @keyframes tg-glow { 0%, 100% { opacity: 0.62; } 50% { opacity: 1; } }
  @keyframes tg-spark { 0% { opacity: 0; transform: translate(0, 10px) scale(0.5); } 35% { opacity: 0.95; } 100% { opacity: 0; transform: translate(var(--dx), -90px) scale(1.15); } }
  @media (max-width: 899.98px) { .tg-fx { --cx: 50%; --cy: 74%; } .tg-glow, .tg-sweep, .tg-cross, .tg-rings i { width: 150vw; } .tg-rings i { margin: -75vw; } .tg-dots b:nth-child(n+12) { display: none; } }
  @media (prefers-reduced-motion: reduce) {
    .tg-sweep, .tg-dots { display: none; }
    .tg-glow, .tg-cross { animation: none; opacity: 0.7; }
    .tg-rings i { animation: none; transform: scale(calc(0.3 + var(--i) * 0.14)); opacity: calc(0.4 - var(--i) * 0.05); }
  }
}
