/* ==========================================================================
   "The Thermogenic Method" — 3-tab science card
   Markup: the <section class="section thermo" data-thermo> block in index.html
   Tabs: assets/js/thermo.js
   ========================================================================== */
.thermo {
  --t-fat: #e9b44c;
  --t-panel: #0b0d0e;
  --t-grid: rgba(255, 255, 255, .045);
  --t-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
.thermo .eyebrow { color: var(--ink); }
.thermo .t-sub { text-align: center; color: var(--ink-2); font-size: 17px; margin: -12px 0 24px; }
@media (max-width: 699px) { .thermo .h2 { white-space: nowrap; font-size: min(6.6vw, 30px); letter-spacing: -.02em; } }

/* ---------- Card ---------- */
.t-card {
  position: relative; border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  background: var(--card);
  box-shadow: 0 30px 60px -30px rgba(227, 59, 54, .35);
}

/* Tabs */
.t-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.t-tab {
  -webkit-appearance: none; appearance: none; cursor: pointer; position: relative;
  min-height: 60px; padding: 12px 8px; border: 0; background: transparent; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: var(--font-display); font-weight: 800; font-size: 14px; letter-spacing: .01em;
  transition: color .25s ease, background .25s ease;
}
.t-tab + .t-tab { border-left: 1px solid var(--line); }
.t-tab small { font-family: var(--t-mono); font-weight: 500; font-size: 10px; letter-spacing: .14em; color: var(--accent); opacity: .7; }
.t-tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent);
  transform: scaleX(0); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.t-tab[aria-selected="true"] { color: var(--ink); background: rgba(227, 59, 54, .06); }
.t-tab[aria-selected="true"] small { opacity: 1; }
.t-tab[aria-selected="true"]::after { transform: scaleX(1); }
.t-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Panels */
.t-panel { display: grid; }
.t-panel[hidden] { display: none; }
.t-panel.enter .t-visual svg { animation: tEnter .5s cubic-bezier(.2, .8, .2, 1) both; }
.t-panel.enter .t-copy > * { animation: tUp .5s cubic-bezier(.2, .8, .2, 1) both; }
.t-panel.enter .t-copy > *:nth-child(2) { animation-delay: .05s; }
.t-panel.enter .t-copy > *:nth-child(3) { animation-delay: .1s; }
.t-panel.enter .t-copy > *:nth-child(4) { animation-delay: .16s; }

/* Visual: lab-screen look */
.t-visual {
  --ink: #ffffff; --ink-2: rgba(255, 255, 255, .72); --ink-3: rgba(255, 255, 255, .5); color: var(--ink);
  position: relative; padding: 18px 16px 14px; background-color: var(--t-panel);
  background-image: linear-gradient(var(--t-grid) 1px, transparent 1px), linear-gradient(90deg, var(--t-grid) 1px, transparent 1px);
  background-size: 22px 22px;
  border-bottom: 1px solid var(--line);
}
.t-visual::before, .t-visual::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-color: rgba(227, 59, 54, .7); border-style: solid;
}
.t-visual::before { top: 10px; left: 10px; border-width: 1.5px 0 0 1.5px; }
.t-visual::after { right: 10px; bottom: 10px; border-width: 0 1.5px 1.5px 0; }
.t-visual svg { display: block; width: 100%; height: auto; max-width: 420px; margin: 0 auto; overflow: visible; }
.t-tag { position: absolute; top: 12px; right: 16px; font-family: var(--t-mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-3); }
.t-tag i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; animation: tBlink 1.4s steps(2) infinite; }

.t-lbl { font-family: var(--t-mono); font-size: 9px; letter-spacing: .14em; fill: var(--ink-3); }
.t-lbl.hot { fill: var(--accent); }
.t-lbl.fat { fill: var(--t-fat); }
.t-lead { stroke: var(--ink-3); stroke-width: .8; fill: none; }

/* Meter */
.t-meter { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-family: var(--t-mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-3); }
.t-bars { display: flex; gap: 3px; flex: 1; }
.t-bars i { flex: 1; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, .08); }
.t-bars i.on { background: var(--accent); box-shadow: 0 0 8px rgba(227, 59, 54, .55); }
.t-meter.idle .t-bars i.on { background: var(--t-fat); box-shadow: none; }
.t-meter b { font-weight: 600; color: var(--ink); min-width: 62px; text-align: right; }
.t-meter.idle b { color: var(--t-fat); }
.t-meter.live b { color: var(--accent); }
.t-panel:not([hidden]) .t-bars i.on { animation: tBar .5s ease both; }
.t-meter.live .t-bars i.on:last-child { animation: tBar .5s ease both, tPulse 1.2s ease-in-out .8s infinite; }

/* Copy */
.t-copy { padding: 22px 22px 24px; }
.t-k { margin: 0; font-family: var(--t-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.t-h { margin: 8px 0 10px; font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; }
.t-p { margin: 0 0 18px; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.t-fact {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: center;
  padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(227, 59, 54, .28); background: rgba(227, 59, 54, .06);
}
.t-fact-l { grid-column: 1 / -1; font-family: var(--t-mono); font-size: 10px; letter-spacing: .18em; color: var(--accent); }
.t-stat { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; color: var(--ink); white-space: nowrap; }
.t-fact p { margin: 0; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.t-src { grid-column: 1 / -1; font-family: var(--t-mono); font-size: 9px; letter-spacing: .1em; color: var(--ink-3); margin-top: 4px; }

/* Scannable copy */
.t-copy .t-p { margin: 0 0 10px; }
.t-copy strong { color: var(--ink); font-weight: 700; }
.t-copy em { color: var(--ink); font-style: italic; }
.t-list { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 12px; }
.t-list li { position: relative; padding-left: 26px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.t-list li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.t-list li strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: 17px; margin-bottom: 1px; }
.t-bottom {
  margin: 16px 0 0; padding: 12px 16px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
  background: rgba(227, 59, 54, .07); font-family: var(--font-display); font-weight: 800; font-size: 17px; line-height: 1.35; color: var(--ink);
}
.t-panel.enter .t-copy > *:nth-child(5) { animation-delay: .2s; }
.t-panel.enter .t-copy > *:nth-child(6) { animation-delay: .24s; }
@media (min-width: 900px) { .t-list li { font-size: 17px; } .t-bottom { font-size: 19px; } }

/* SVG animation helpers */
.t-pulse { transform-box: fill-box; transform-origin: center; animation: tBlob 3.2s ease-in-out infinite; }
.t-ring { transform-box: fill-box; transform-origin: center; animation: tRing 2.4s ease-out infinite; }
.t-ring.d2 { animation-delay: .8s; }
.t-ring.d3 { animation-delay: 1.6s; }

@keyframes tEnter { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes tUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tBar { from { opacity: 0; transform: scaleY(.3); } to { opacity: 1; transform: none; } }
@keyframes tPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes tBlink { 50% { opacity: .2; } }
@keyframes tBlob { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes tRing { from { opacity: .7; transform: scale(.4); } to { opacity: 0; transform: scale(1.6); } }


/* ---------- Tab 1: B&W clip + energy donut ---------- */
.t-v1 { overflow: hidden; min-height: 320px; display: flex; flex-direction: column; justify-content: center; background-color: #08121a; }
.t-bgvid {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
  filter: grayscale(1) contrast(1.15) brightness(.5); opacity: .9;
}
.t-v1 { background-image: none; }
.t-v1 > .t-tag, .t-v1 > .t-pie { position: relative; z-index: 2; }
.t-v1 > .t-tag { position: absolute; }
.t-v1::before, .t-v1::after { z-index: 3; }
.t-v1 .t-pie { margin: 26px auto 4px; }
.t-v1 > .t-pie::before {
  content: ""; position: absolute; inset: -30px -40px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(5, 8, 10, .82), rgba(5, 8, 10, 0));
}
.t-pie { display: flex; flex-direction: column; align-items: center; width: 100%; }
.t-pie svg { width: 100%; max-width: 480px; overflow: visible; }
.t-v1 > .t-pie::before { inset: -10px -20px; background: radial-gradient(closest-side, rgba(5, 8, 10, .55), rgba(5, 8, 10, 0)); }
.t-backdrop { fill: rgba(6, 9, 11, .5); stroke: rgba(255, 255, 255, .08); }
.t-track { fill: none; stroke: rgba(255, 255, 255, .06); stroke-width: 48; }
.t-seg { fill: none; stroke-width: 48; transform: rotate(-90deg); transform-origin: 240px 150px; stroke-dasharray: 0 100; opacity: .9; }
.s-rmr { stroke: #e33b36; filter: drop-shadow(0 0 10px rgba(227, 59, 54, .55)); }
.s-ex  { stroke: #f27a2e; }
.s-dig { stroke: #f5c244; }
.s-rmr { stroke-dasharray: 69.5 30.5; stroke-dashoffset: 0; }
.s-ex  { stroke-dasharray: 19.5 80.5; stroke-dashoffset: -70; }
.s-dig { stroke-dasharray: 9.5 90.5; stroke-dashoffset: -90; }
.t-panel.enter .s-rmr { animation: tRmr 1.1s cubic-bezier(.3, .7, .2, 1) .2s both; }
.t-panel.enter .s-ex  { animation: tEx .6s ease 1.25s both; }
.t-panel.enter .s-dig { animation: tDig .5s ease 1.8s both; }
@keyframes tRmr { from { stroke-dasharray: 0 100; } to { stroke-dasharray: 69.5 30.5; } }
@keyframes tEx  { from { stroke-dasharray: 0 100; } to { stroke-dasharray: 19.5 80.5; } }
@keyframes tDig { from { stroke-dasharray: 0 100; } to { stroke-dasharray: 9.5 90.5; } }
.t-pie-c { font-family: var(--t-mono); font-size: 10px; letter-spacing: .16em; fill: var(--ink-2); }

/* callouts */
.t-co-line { fill: none; stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 0; }
.t-co-dot { stroke: #0b0d0e; stroke-width: 1.5; }
.t-co-n { font-family: var(--font-display); font-weight: 800; font-size: 30px; fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, .55); stroke-width: 4px; }
.t-co-l { font-family: var(--t-mono); font-weight: 600; font-size: 13px; letter-spacing: .14em; paint-order: stroke; stroke: rgba(0, 0, 0, .7); stroke-width: 3px; }
.co-rmr .t-co-line { stroke: #e33b36; } .co-rmr .t-co-dot { fill: #e33b36; } .co-rmr .t-co-l { fill: #ff6b63; }
.co-ex  .t-co-line { stroke: #f27a2e; } .co-ex  .t-co-dot { fill: #f27a2e; } .co-ex  .t-co-l { fill: #f6955a; }
.co-dig .t-co-line { stroke: #f5c244; } .co-dig .t-co-dot { fill: #f5c244; } .co-dig .t-co-l { fill: #f5c244; }
.co-rmr .t-co-n { font-size: 38px; }
.t-panel.enter .t-co-line { animation: tLine .45s ease both; }
.t-panel.enter .t-co-dot, .t-panel.enter .t-co text { animation: tFadeIn .4s ease both; }
.t-panel.enter .co-rmr .t-co-line, .t-panel.enter .co-rmr .t-co-dot { animation-delay: 1.05s; }
.t-panel.enter .co-rmr text { animation-delay: 1.25s; }
.t-panel.enter .co-ex .t-co-line, .t-panel.enter .co-ex .t-co-dot { animation-delay: 1.75s; }
.t-panel.enter .co-ex text { animation-delay: 1.95s; }
.t-panel.enter .co-dig .t-co-line, .t-panel.enter .co-dig .t-co-dot { animation-delay: 2.2s; }
.t-panel.enter .co-dig text { animation-delay: 2.4s; }
@keyframes tLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes tFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Tabs 2 + 3: body scans ---------- */
.t-body { background-color: #08121a; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.t-fig { position: relative; height: min(300px, 74vw); aspect-ratio: 480 / 534; margin: 8px auto 0; }
.t-fig img { -webkit-mask-image: radial-gradient(75% 70% at 50% 48%, #000 62%, transparent 100%);
                     mask-image: radial-gradient(75% 70% at 50% 48%, #000 62%, transparent 100%); }
.t-fig img, .t-fig > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.t-fig > svg { overflow: visible; max-width: none; }
.t-body .t-meter { width: 100%; }

/* visceral fat */
.t-vf-zone { fill: rgba(233, 132, 44, .14); stroke: #e9b44c; stroke-width: 1.5; stroke-dasharray: 4 6; animation: tDash 6s linear infinite; }
.t-vf { fill: url(#t-vfg); mix-blend-mode: screen; transform-box: fill-box; transform-origin: center; animation: tBlob 2.6s ease-in-out infinite; }
.t-scan { fill: #e9b44c; opacity: .7; filter: drop-shadow(0 0 6px #e9b44c); animation: tScan 3.2s ease-in-out infinite; }
.t-lead2 { fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 1.5; }
.t-call { position: absolute; display: flex; flex-direction: column; gap: 2px; font-family: var(--t-mono); font-size: 9px; letter-spacing: .12em; color: var(--ink-2); text-transform: uppercase; white-space: nowrap; }
.t-call b { font-weight: 600; color: #e9b44c; font-size: 10px; }
.t-call-r { right: -6%; top: 46%; transform: translateX(60%); }
.t-call-l { left: 2%; bottom: 3%; transform: translateX(-40%); }
.t-call-l b { color: var(--ink); }
@keyframes tDash { to { stroke-dashoffset: -100; } }
@keyframes tScan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(250px); } }

/* engine */
.t-heat { fill: rgba(227, 59, 54, .28); filter: blur(18px); mix-blend-mode: screen; animation: tHeat 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.t-rim { fill: rgba(227, 59, 54, .08); stroke: #ff5a4f; stroke-width: 3; filter: drop-shadow(0 0 8px rgba(227, 59, 54, .8)); }
.t-rim-ticks circle { fill: none; stroke: rgba(255, 120, 100, .55); stroke-width: 6; stroke-dasharray: 2 6; }
.t-rim-ticks { animation: tSpin 6s linear infinite reverse; }
.t-turbine { fill: rgba(255, 80, 66, .55); stroke: #ff8a7a; stroke-width: 1.2; filter: drop-shadow(0 0 6px rgba(227, 59, 54, .9)); mix-blend-mode: screen; animation: tSpin 1.1s linear infinite; }
.t-hub { fill: #e33b36; filter: drop-shadow(0 0 6px #e33b36); }
.t-ring2 { fill: none; stroke: #e33b36; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: tRing 2s ease-out infinite; }
.t-ring2.d2 { animation-delay: 1s; }
.t-tach { position: absolute; right: -30%; bottom: 4%; width: 40%; min-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 8px 6px; border-radius: 12px; background: rgba(8, 12, 14, .82); border: 1px solid rgba(227, 59, 54, .35); }
.t-tach svg { width: 100%; height: auto; display: block; }
.t-tach span { font-family: var(--t-mono); font-size: 9px; letter-spacing: .12em; color: var(--accent); white-space: normal; text-align: center; line-height: 1.3; }   /* label can wrap ("PERFORMANCE / ENGINE") */
.t-tach-arc { fill: none; stroke: rgba(255, 255, 255, .18); stroke-width: 3; }
.t-tach-red { fill: none; stroke: var(--accent); stroke-width: 3; }
.t-tach-ticks line { stroke: rgba(255, 255, 255, .5); stroke-width: 1.5; }
.t-tach-ticks line.red { stroke: var(--accent); }
.t-tach text { font-family: var(--t-mono); font-size: 7px; letter-spacing: .1em; fill: var(--ink-3); }
.t-needle line { stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.t-needle { transform-box: view-box; transform-origin: 60px 60px; transform: rotate(-120deg); }
.t-panel.enter .t-needle { animation: tRev 1.4s cubic-bezier(.3, .7, .2, 1) .2s both, tIdle .18s ease-in-out 1.6s infinite alternate; }
@keyframes tRev { 0% { transform: rotate(-120deg); } 60% { transform: rotate(78deg); } 100% { transform: rotate(62deg); } }
@keyframes tIdle { from { transform: rotate(60deg); } to { transform: rotate(68deg); } }
@keyframes tSpin { to { transform: rotate(360deg); } }
@keyframes tHeat { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }

@media (min-width: 900px) {
  .t-fig { height: 360px; }
  .t-v1 { min-height: 440px; }
}
@media (max-width: 699px) {
  .t-call-r { top: 14%; right: -26px; transform: none; align-items: flex-end; text-align: right; text-shadow: 0 1px 6px #000; }
  .t-lead-r { display: none; }
  .t-call-l { transform: none; left: -6px; text-shadow: 0 1px 6px #000; }
}
@media (max-width: 420px) {
  .t-call-r { right: -2px; }
  .t-tach { right: -8%; }
}

/* ---------- Desktop: visual left, copy right ---------- */
@media (min-width: 900px) {
  .thermo .wrap { max-width: 1040px; }
  .t-panel { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .t-visual { border-bottom: 0; border-right: 1px solid var(--line); padding: 28px 24px 20px; display: flex; flex-direction: column; justify-content: center; }
  .t-copy { padding: 34px 34px 32px; display: flex; flex-direction: column; justify-content: center; }
  .t-h { font-size: 32px; }
  .t-p { font-size: 17px; }
  .t-tab { min-height: 64px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .thermo *, .thermo *::before, .thermo *::after { animation: none !important; }
}
