/* TSN Apex: Start Here (v5.5.0). The engine start button and its choices.
   Everything is scoped under .tsn-start or .tsn-start-band. The glow color
   arrives as --ts-glow and --ts-glow-rgb from the Start Here tab. */

/* ── Band under the hero ── */
.tsn-start-band {
  background:
    radial-gradient(120% 140% at 12% 50%, #2a2e35 0%, #16181c 46%, #0c0d10 100%);
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.6);
  --ts-fg-rgb: 255,255,255;
}
.tsn-start-band-inner { max-width: 1400px; margin: 0 auto; padding: 44px 48px; }

/* ── Layout ── */
.tsn-start {
  --ts-size: 148px;
  display: grid;
  grid-template-columns: var(--ts-size) minmax(0, 1fr);
  column-gap: 40px; row-gap: 20px;
  align-items: center;
  color: rgb(var(--ts-fg-rgb));
}
.tsn-start-btn     { grid-column: 1; grid-row: 1 / span 2; }
.tsn-start-copy    { grid-column: 2; grid-row: 1; align-self: end; }
.tsn-start-choices { grid-column: 2; grid-row: 2; align-self: start; }
/* Before the press the copy sits level with the middle of the button. */
.tsn-start.is-js:not(.is-on) .tsn-start-copy { grid-row: 1 / span 2; align-self: center; }
.tsn-start.is-js:not(.is-on) .tsn-start-choices { display: none; }

.tsn-start-headline {
  font-size: clamp(1.35rem, 2.2vw, 1.9rem); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.15; margin: 0;
  color: rgb(var(--ts-fg-rgb));
}
.tsn-start-sub {
  font-size: 1rem; line-height: 1.6; margin: 8px 0 0; max-width: 56ch;
  color: rgba(var(--ts-fg-rgb), 0.74);
}
.tsn-start-prompt {
  font-size: 0.95rem; font-weight: 700; margin: 0 0 12px;
  color: rgba(var(--ts-fg-rgb), 0.9);
}
.tsn-start-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  max-width: 760px;
}
.tsn-start-pick {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 12px 18px;
  border: 1px solid rgba(var(--ts-fg-rgb), 0.22);
  border-radius: 8px;
  background: rgba(var(--ts-fg-rgb), 0.05);
  color: rgb(var(--ts-fg-rgb)); text-decoration: none;
  font-size: 0.98rem; font-weight: 600; line-height: 1.3;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.tsn-start-dot {
  flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%;
  background: rgba(var(--ts-fg-rgb), 0.3);
  transition: background-color .15s ease, box-shadow .15s ease;
}
.tsn-start-pick:hover, .tsn-start-pick:focus-visible {
  border-color: var(--ts-glow);
  background: rgba(var(--ts-glow-rgb), 0.1);
  box-shadow: 0 0 0 1px rgba(var(--ts-glow-rgb), 0.35), 0 0 22px rgba(var(--ts-glow-rgb), 0.22);
  color: rgb(var(--ts-fg-rgb));
}
.tsn-start-pick:hover .tsn-start-dot, .tsn-start-pick:focus-visible .tsn-start-dot {
  background: var(--ts-glow); box-shadow: 0 0 10px 2px rgba(var(--ts-glow-rgb), 0.8);
}
.tsn-start-pick:focus-visible { outline: 2px solid var(--ts-glow); outline-offset: 2px; }
.tsn-start-proof {
  margin: 16px 0 0; font-size: 0.85rem; color: rgba(var(--ts-fg-rgb), 0.55);
}

/* ── The button ──
   Three layers: a brushed-metal bezel (the button itself), a thin light
   ring (.tsn-start-ring) and the dark face with the lettering. */
.tsn-start-btn {
  position: relative; width: var(--ts-size); height: var(--ts-size);
  border: 0; padding: 0; border-radius: 50%; cursor: pointer;
  font-family: inherit; color: inherit;
  -webkit-tap-highlight-color: transparent;
  background:
    conic-gradient(from 210deg,
      #f4f5f7 0deg, #8d929b 38deg, #e9ebee 82deg, #6c7079 128deg,
      #dfe1e5 176deg, #7b808a 222deg, #f1f2f4 268deg, #858a93 314deg, #f4f5f7 360deg);
  box-shadow:
    0 14px 28px rgba(0,0,0,0.5),
    0 2px 4px rgba(0,0,0,0.5),
    inset 0 1px 1px rgba(255,255,255,0.9),
    inset 0 -2px 3px rgba(0,0,0,0.45);
  transition: transform .08s ease, box-shadow .08s ease;
}
.tsn-start-ring {
  position: absolute; inset: 9%; border-radius: 50%;
  background: #08090b;
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,0.34),
    inset 0 0 14px rgba(255,255,255,0.12),
    0 0 0 1px rgba(0,0,0,0.9);
  animation: tsn-start-idle 2.8s ease-in-out infinite;
}
.tsn-start-face {
  position: absolute; inset: 16%; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 28%, #3b3f47 0%, #1b1d21 52%, #0b0c0e 100%);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.16),
    inset 0 -6px 12px rgba(0,0,0,0.75),
    0 1px 2px rgba(0,0,0,0.8);
  line-height: 1;
}
.tsn-start-led {
  width: 22%; height: 4px; border-radius: 2px; margin-bottom: 9%;
  background: rgba(255,255,255,0.22);
  transition: background-color .12s ease, box-shadow .12s ease;
}
.tsn-start-top {
  font-size: calc(var(--ts-size) * 0.135); font-weight: 800; letter-spacing: 0.14em;
  margin-right: -0.14em; /* cancels the trailing letter space so the word centers */
  color: #e7e9ec; text-transform: uppercase;
  transition: color .12s ease, text-shadow .12s ease;
}
.tsn-start-bottom {
  margin-top: 7%;
  font-size: calc(var(--ts-size) * 0.082); font-weight: 700; letter-spacing: 0.3em;
  margin-right: -0.3em;
  color: rgba(231,233,236,0.62); text-transform: uppercase;
  transition: color .12s ease, text-shadow .12s ease;
}
@keyframes tsn-start-idle {
  0%, 100% { box-shadow: inset 0 0 0 3px rgba(255,255,255,0.26), inset 0 0 10px rgba(255,255,255,0.06), 0 0 0 1px rgba(0,0,0,0.9); }
  50%      { box-shadow: inset 0 0 0 3px rgba(255,255,255,0.62), inset 0 0 18px rgba(255,255,255,0.22), 0 0 0 1px rgba(0,0,0,0.9); }
}

.tsn-start-btn:hover .tsn-start-top { color: #ffffff; }
.tsn-start-btn:focus-visible { outline: 3px solid var(--ts-glow); outline-offset: 5px; }

/* Finger down: the whole button sinks. */
.tsn-start-btn:active {
  transform: translateY(2px) scale(0.975);
  box-shadow:
    0 6px 14px rgba(0,0,0,0.5),
    0 1px 2px rgba(0,0,0,0.5),
    inset 0 1px 1px rgba(255,255,255,0.9),
    inset 0 -2px 3px rgba(0,0,0,0.45);
}

/* Running: lit in the glow color, and it stays lit. */
.tsn-start.is-on .tsn-start-ring {
  animation: none;
  box-shadow:
    inset 0 0 0 3px var(--ts-glow),
    inset 0 0 22px rgba(var(--ts-glow-rgb), 0.7),
    0 0 0 1px rgba(0,0,0,0.9);
}
.tsn-start.is-on .tsn-start-btn {
  box-shadow:
    0 14px 28px rgba(0,0,0,0.5),
    0 0 34px 6px rgba(var(--ts-glow-rgb), 0.5),
    0 0 90px 18px rgba(var(--ts-glow-rgb), 0.22),
    inset 0 1px 1px rgba(255,255,255,0.9),
    inset 0 -2px 3px rgba(0,0,0,0.45);
}
.tsn-start.is-on .tsn-start-face {
  background: radial-gradient(circle at 50% 30%, rgba(var(--ts-glow-rgb), 0.3) 0%, #1b1d21 55%, #0b0c0e 100%);
}
.tsn-start.is-on .tsn-start-led {
  background: var(--ts-glow); box-shadow: 0 0 10px 2px rgba(var(--ts-glow-rgb), 0.9);
}
.tsn-start.is-on .tsn-start-top {
  color: var(--ts-glow); text-shadow: 0 0 12px rgba(var(--ts-glow-rgb), 0.85);
}
.tsn-start.is-on .tsn-start-bottom {
  color: rgba(var(--ts-glow-rgb), 0.9); text-shadow: 0 0 10px rgba(var(--ts-glow-rgb), 0.6);
}

/* ── v5.5.0: call or note step, the note form, the thank-you ── */
.tsn-start [hidden] { display: none !important; }
.tsn-start-dot.is-lit { background: var(--ts-glow); box-shadow: 0 0 10px 2px rgba(var(--ts-glow-rgb), 0.8); }
.tsn-start-picked {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 0 0 14px; font-size: 0.95rem; font-weight: 600;
  color: rgba(var(--ts-fg-rgb), 0.82);
}
.tsn-start-back {
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  font: inherit; font-weight: 600; color: rgba(var(--ts-fg-rgb), 0.6);
  text-decoration: underline; text-underline-offset: 3px;
}
.tsn-start-back:hover { color: rgb(var(--ts-fg-rgb)); }
.tsn-start-back:focus-visible { outline: 2px solid var(--ts-glow); outline-offset: 2px; }
.tsn-start-ways { display: flex; flex-wrap: wrap; gap: 10px; max-width: 760px; }
.tsn-start-way {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 12px 22px; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 0.98rem; font-weight: 700; line-height: 1.3;
  text-decoration: none; text-align: center;
  border: 1px solid rgba(var(--ts-fg-rgb), 0.3);
  background: rgba(var(--ts-fg-rgb), 0.05); color: rgb(var(--ts-fg-rgb));
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.tsn-start-way:hover, .tsn-start-way:focus-visible {
  border-color: var(--ts-glow); color: rgb(var(--ts-fg-rgb));
  box-shadow: 0 0 0 1px rgba(var(--ts-glow-rgb), 0.35), 0 0 22px rgba(var(--ts-glow-rgb), 0.22);
}
.tsn-start-way:focus-visible { outline: 2px solid var(--ts-glow); outline-offset: 2px; }
/* The call option is the lit one. Its text color arrives as --ts-on-glow,
   picked in PHP as whichever of dark or white reads better on the glow color. */
.tsn-start-way--call {
  background: var(--ts-glow); border-color: var(--ts-glow); color: var(--ts-on-glow, #14120f);
}
.tsn-start-way--call:hover, .tsn-start-way--call:focus-visible {
  color: var(--ts-on-glow, #14120f);
  box-shadow: 0 0 0 1px rgba(var(--ts-glow-rgb), 0.6), 0 0 26px rgba(var(--ts-glow-rgb), 0.5);
}
.tsn-start-way[disabled] { opacity: 0.6; cursor: default; box-shadow: none; }

.tsn-start-fields {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  max-width: 760px;
}
.tsn-start-field { margin: 0; }
.tsn-start-field--wide { grid-column: 1 / -1; }
.tsn-start-field label {
  display: block; margin-bottom: 5px;
  font-size: 0.82rem; font-weight: 600; color: rgba(var(--ts-fg-rgb), 0.74);
}
.tsn-start-field input, .tsn-start-field textarea {
  display: block; width: 100%; padding: 12px 14px; border-radius: 8px;
  border: 1px solid rgba(var(--ts-fg-rgb), 0.3);
  background: rgba(var(--ts-fg-rgb), 0.07); color: rgb(var(--ts-fg-rgb));
  font: inherit; font-size: 1rem; line-height: 1.4; /* 16px keeps iPhones from zooming in */
}
.tsn-start-field textarea { resize: vertical; min-height: 64px; }
.tsn-start-field input:focus, .tsn-start-field textarea:focus {
  outline: 2px solid var(--ts-glow); outline-offset: 1px; border-color: var(--ts-glow);
}
/* Honeypot: off screen for people, present for bots. */
.tsn-start-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tsn-start-error {
  margin: 12px 0 0; font-size: 0.92rem; font-weight: 600;
  color: rgb(var(--ts-fg-rgb)); padding: 8px 12px; border-radius: 6px; max-width: 760px;
  background: rgba(var(--ts-glow-rgb), 0.22); border: 1px solid rgba(var(--ts-glow-rgb), 0.6);
}
.tsn-start-actions { margin: 14px 0 0; }
.tsn-start-view--thanks:focus { outline: none; }
.tsn-start-thanks {
  display: flex; align-items: baseline; gap: 12px; margin: 0; max-width: 60ch;
  font-size: 1.08rem; font-weight: 700; line-height: 1.45; color: rgb(var(--ts-fg-rgb));
}
.tsn-start-thanks::before {
  content: ''; flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%;
  background: var(--ts-glow); box-shadow: 0 0 10px 2px rgba(var(--ts-glow-rgb), 0.8);
}

@media (max-width: 900px) {
  .tsn-start-fields { grid-template-columns: 1fr; }
  .tsn-start-ways { flex-direction: column; align-items: stretch; }
}

/* ── Compact copy inside the hero (phones only) ── */
.tsn-start--hero { display: none; --ts-fg-rgb: var(--tsn-hero-fg-rgb, 255,255,255); }

@media (max-width: 900px) {
  .tsn-start-band-inner { padding: 36px 24px; }
  .tsn-start { --ts-size: 120px; column-gap: 26px; }
  .tsn-start-list { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* The hero copy takes over, so the band steps aside. */
  .tsn-start-band--split { display: none; }
  .tsn-start--hero {
    display: grid; --ts-size: 92px;
    column-gap: 18px; row-gap: 16px;
    margin-top: 28px; text-align: left;
  }
  .tsn-start--hero .tsn-start-btn  { grid-row: 1; }
  .tsn-start--hero .tsn-start-copy { grid-row: 1; align-self: center; }
  .tsn-start--hero.is-js:not(.is-on) .tsn-start-copy { grid-row: 1; }
  .tsn-start--hero .tsn-start-choices { grid-column: 1 / -1; grid-row: 2; }
  .tsn-start--hero .tsn-start-headline { font-size: 1.1rem; }
  .tsn-start--hero .tsn-start-sub { font-size: 0.88rem; line-height: 1.45; margin-top: 4px; }
  /* A band that is not split (hero copy off, or hero hidden) on a phone. */
  .tsn-start--band { --ts-size: 96px; column-gap: 18px; }
  .tsn-start--band .tsn-start-btn  { grid-row: 1; }
  .tsn-start--band .tsn-start-copy { grid-row: 1; align-self: center; }
  .tsn-start--band.is-js:not(.is-on) .tsn-start-copy { grid-row: 1; }
  .tsn-start--band .tsn-start-choices { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .tsn-start-ring { animation: none; }
  .tsn-start-btn, .tsn-start-pick, .tsn-start-way, .tsn-start-dot, .tsn-start-led, .tsn-start-top, .tsn-start-bottom { transition: none; }
  .tsn-start-btn:active { transform: none; }
}

/* ── v5.5.4: Jumper cables style ──
   The button becomes a transparent frame around an SVG battery. Clamps
   start on the floor, clip onto the terminals, a spark jumps, and the
   charge meter fills with the glow color. */
.tsn-start--cables { --ts-size: 220px; }
.tsn-start--cables .tsn-start-btn {
  width: var(--ts-size); height: auto; aspect-ratio: 240 / 150;
  border-radius: 14px; background: none; box-shadow: none;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.tsn-start--cables .tsn-start-btn:active,
.tsn-start--cables.is-on .tsn-start-btn { transform: none; background: none; box-shadow: none; }
.tsn-start--cables .tsn-start-btn:focus-visible { outline: 2px solid var(--ts-glow); outline-offset: 6px; }
.tsn-cables { display: block; width: 100%; height: 100%; overflow: visible; }
.tsn-cable { fill: none; stroke-width: 5; stroke-linecap: round; }
.tsn-cable--pos { stroke: #d61f2c; }
.tsn-cable--neg { stroke: #2b2f36; }
.tsn-start-band .tsn-cable--neg, .tsn-start--hero .tsn-cable--neg { stroke: #5b6170; }
.tsn-bat-body {
  fill: #1c1f26; /* solid in the dark band, so the cables run behind the battery */
  stroke: rgba(var(--ts-fg-rgb), 0.55); stroke-width: 2.5;
  transition: stroke .3s ease, filter .3s ease;
}
.tsn-start--hero .tsn-bat-body { fill: rgba(var(--ts-fg-rgb), 0.06); }
.tsn-bat-term { fill: rgba(var(--ts-fg-rgb), 0.65); }
.tsn-bat-sign { fill: rgba(var(--ts-fg-rgb), 0.75); font: 700 13px/1 system-ui, sans-serif; }
.tsn-bat-label {
  fill: rgb(var(--ts-fg-rgb)); font: 800 11px/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.tsn-bat-track { fill: none; stroke: rgba(var(--ts-fg-rgb), 0.35); stroke-width: 1.5; }
.tsn-bat-fill {
  fill: rgba(var(--ts-fg-rgb), 0.35);
  transform-box: fill-box; transform-origin: left center; transform: scaleX(0.12);
  transition: transform 1s cubic-bezier(.2,.8,.2,1), fill .3s ease;
  animation: tsn-cables-low 1.6s ease-in-out infinite;
}
.tsn-clamp { cursor: grab; }
.tsn-clamp.is-dragging { cursor: grabbing; }
.tsn-clamp--pos .tsn-clamp-jaw, .tsn-clamp--pos .tsn-clamp-grip { fill: #e11d2e; }
.tsn-clamp--neg .tsn-clamp-jaw, .tsn-clamp--neg .tsn-clamp-grip { fill: #3a3f48; }
.tsn-clamp-jaw { stroke: rgba(0,0,0,0.35); stroke-width: 1; }
.tsn-spark path {
  fill: none; stroke: #fff7d6; stroke-width: 2.6; stroke-linecap: round;
  opacity: 0; filter: drop-shadow(0 0 3px var(--ts-glow)) drop-shadow(0 0 8px var(--ts-glow));
}
.tsn-spark.is-sparking path { animation: tsn-cables-spark .7s ease-out 2; }

.tsn-start--cables.is-on .tsn-bat-body { stroke: var(--ts-glow); filter: drop-shadow(0 0 10px rgba(var(--ts-glow-rgb), 0.65)); }
.tsn-start--cables.is-on .tsn-bat-fill { fill: var(--ts-glow); transform: scaleX(1); animation: none; }
.tsn-start--cables.is-on .tsn-bat-label { fill: var(--ts-glow); }

@keyframes tsn-cables-low { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes tsn-cables-spark {
  0% { opacity: 0; transform: scale(.4); }
  25% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.4); }
}
.tsn-spark path { transform-box: fill-box; transform-origin: center; }

@media (max-width: 900px) { .tsn-start--cables { --ts-size: 190px; } }
@media (max-width: 768px) {
  .tsn-start--hero.tsn-start--cables, .tsn-start--band.tsn-start--cables { --ts-size: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  .tsn-bat-fill { animation: none; transition: none; }
  .tsn-spark.is-sparking path { animation: none; opacity: 1; }
}
