/* =========================================================================
   Phantom X 3.2 Benchmark — English
   Deepdub · stylesheet
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Tokens
   ------------------------------------------------------------------------- */
:root {
  /* Brand colors */
  --m: #FE338F;        /* magenta */
  --mh: #FF3390;       /* magenta hover */
  --v: #E25DFF;        /* violet */
  --r: #FF2123;        /* red */
  --b: #411AFA;        /* blue */

  /* Surfaces */
  --bg: #0A0A0A;
  --s1: #141414;
  --s2: #1A1A1A;
  --s3: #1F1F1F;

  /* Ink (text) */
  --ink400: #5A5A5A;
  --ink300: #8A8A8A;
  --ink200: #B5B5B5;
  --ink100: #E2E2E2;

  /* Gradients */
  --gp: linear-gradient(180deg, #FF2123 0%, #E25DFF 100%);
  --gm: linear-gradient(90deg,  #FE338F 0%, #E25DFF 100%);
  --gs: linear-gradient(135deg, #FF2123 0%, #FE338F 50%, #E25DFF 100%);
  --gh: linear-gradient(90deg,  #FE338F 0%, #E25DFF 100%);

  /* Layout */
  --container-max: 1180px;
  --container-pad: 32px;
}

/* -------------------------------------------------------------------------
   2. Reset + base
   ------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  background: var(--bg);
  color: #fff;
  font-family: "Onest", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

/* -------------------------------------------------------------------------
   3. Layout primitives
   ------------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .12), transparent);
  margin: 0;
  border: 0;
}

/* -------------------------------------------------------------------------
   4. Typography
   ------------------------------------------------------------------------- */
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--m);
}

.h1 {
  font-weight: 600;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 1.04;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.h2 {
  font-weight: 600;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.08;
  letter-spacing: -.018em;
  text-wrap: balance;
}

.lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink200);
  max-width: 62ch;
  text-wrap: pretty;
}

.body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink200);
  text-wrap: pretty;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-feature-settings: "tnum";
}

.grad-text {
  background: var(--gs);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* -------------------------------------------------------------------------
   5. Buttons
   ------------------------------------------------------------------------- */
.btn {
  all: unset;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 200ms cubic-bezier(.2, .7, .2, 1);
}
.btn:active { transform: scale(.98); }

.btn.primary           { background: var(--m); color: #fff; }
.btn.primary:hover     { background: var(--v); }

.btn.gradient {
  background: var(--gp);
  color: #fff;
  box-shadow: 0 12px 40px rgba(254, 51, 143, .32);
}

.btn.ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
}

/* Gradient-stroke pill (white fill, gradient border + gradient text) */
.btn.pill-light {
  color: #FE338F;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 14px;
  border: 1.5px solid transparent;
  background-image: linear-gradient(#fff, #fff), var(--gs);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
.btn.pill-light.lg     { padding: 14px 28px; font-size: 15px; }
.btn.pill-light .label {
  background: var(--gs);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.btn.pill-light:hover  { box-shadow: 0 12px 40px rgba(254, 51, 143, .32); }

/* -------------------------------------------------------------------------
   6. Top nav
   ------------------------------------------------------------------------- */
nav.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, .72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
nav.top .row {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 20px;
}
nav.top .pill {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #1F1F1F;
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--ink100);
}
nav.top .actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}
nav.top .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
nav.top .brand img { height: 22px; width: auto; }

/* -------------------------------------------------------------------------
   7. Hero
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 96px;
}
.hero .pattern {
  position: absolute;
  inset: -10% -2% 0 -2%;
  pointer-events: none;
  opacity: .32;
  background-image: url("assets/patterns/half-circle-grid.png");
  background-size: 560px auto;
  background-position: center top;
  background-repeat: repeat;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 70%);
}
.hero .glow {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 900px;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(254, 51, 143, .18), transparent 70%);
  filter: blur(40px);
}
.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-start;
  max-width: 920px;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink300);
}

/* -------------------------------------------------------------------------
   8. Section scaffold
   ------------------------------------------------------------------------- */
section {
  padding: 96px 0;
  position: relative;
}
section .label-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
section .icon-tile {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: none;
}

.twocol {
  display: flex;
  flex-direction: row;
  gap: 64px;
  align-items: center;
}
.twocol > * { flex: 1 1 0; min-width: 0; }
.twocol > *:first-child { flex: 1.05 1 0; }
.twocol > *:last-child  { flex: .95 1 0; }
@media (max-width: 960px) {
  .twocol { flex-direction: column; gap: 32px; align-items: stretch; }
  .twocol > *, .twocol > *:first-child, .twocol > *:last-child { flex: 1 1 auto; }
}

/* -------------------------------------------------------------------------
   9. Result · stat card + ELO chart
   ------------------------------------------------------------------------- */
.result-grid {
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: stretch;
}
.result-grid > * { flex: 1 1 0; min-width: 0; }
.result-grid > *:last-child { flex: 1.5 1 0; }
@media (max-width: 960px) {
  .result-grid { flex-direction: column; }
  .result-grid > *, .result-grid > *:last-child { flex: 1 1 auto; }
}

.stat-card {
  padding: 28px;
  background: var(--s1);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stat-num {
  font-size: 80px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.stat-num .grad {
  background: var(--gs);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-sub { font-size: 14px; color: var(--ink200); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(254, 51, 143, .14);
  color: var(--m);
  font-weight: 600;
  border: 1px solid rgba(254, 51, 143, .25);
}

.chart {
  padding: 28px;
  background: var(--s1);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chart h3 { margin: 0; font-size: 15px; font-weight: 600; }
.chart .axis {
  font-size: 11px;
  color: var(--ink300);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  margin-top: 6px;
}

/* ELO rows */
.elo-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
}
.elo-row > .elo-name { flex: 0 0 148px; }
.elo-row > .elo-bar  { flex: 1 1 0; min-width: 0; }
.elo-name { font-size: 13px; line-height: 1.25; }
.elo-name .b { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.elo-name .s { font-size: 11px; color: var(--ink300); }

.elo-bar {
  position: relative;
  height: 34px;
  border-radius: 8px;
  background: #0F0F0F;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .04);
}
.elo-bar .fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  font-weight: 700;
  color: #fff;
  font-size: 13px;
}
.elo-bar .fill.us {
  background: var(--gh);
  box-shadow:
    0 0 0 1px rgba(254, 51, 143, .5),
    0 6px 28px rgba(254, 51, 143, .35);
}
.elo-bar .fill.them {
  background: #3A3A3A;
  color: var(--ink100);
}

.badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--ink100);
}
.badge.us {
  background: rgba(254, 51, 143, .18);
  color: var(--m);
  border: 1px solid rgba(254, 51, 143, .3);
}
.badge.first { background: rgba(255, 255, 255, .12); color: #fff; }

/* -------------------------------------------------------------------------
   10. Latency chart
   ------------------------------------------------------------------------- */
.lat-row {
  display: flex;
  flex-direction: row;
  gap: 14px;
  align-items: center;
}
.lat-row > .name { flex: 0 0 200px; }
.lat-row > .bar  { flex: 1 1 0; min-width: 0; }
.lat-row > .ms   { flex: 0 0 90px; }
.lat-row .name { font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.lat-row .name .b { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.lat-row .name .b .rank {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: #1F1F1F;
  color: var(--ink200);
  border: 1px solid rgba(255, 255, 255, .08);
}
.lat-row .name .b .rank.us {
  background: var(--m);
  color: #fff;
  border-color: transparent;
}
.lat-row .bar {
  position: relative;
  height: 30px;
  border-radius: 8px;
  background: #0F0F0F;
  border: 1px solid rgba(255, 255, 255, .04);
  overflow: hidden;
}
.lat-row .bar .fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 8px;
}
.lat-row .bar .fill.us {
  background: var(--gh);
  box-shadow:
    0 0 0 1px rgba(254, 51, 143, .5),
    0 6px 28px rgba(254, 51, 143, .3);
}
.lat-row .bar .fill.them { background: #3A3A3A; }

.lat-row .ms {
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}
.lat-row .ms.us { color: var(--m); }

/* -------------------------------------------------------------------------
   11. Win-percentage cards
   ------------------------------------------------------------------------- */
.win-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 18px;
}
.win-grid > .win-card {
  flex: 1 1 calc(50% - 9px);
  min-width: 0;
}
@media (max-width: 760px) {
  .win-grid > .win-card { flex: 1 1 100%; }
}

.win-card {
  background: var(--s1);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
}
.win-card > .side.us   { flex: 0 0 calc(var(--us, 50) * 1%); }
.win-card > .side.them { flex: 0 0 calc(var(--them, 50) * 1%); }
.win-card .side {
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: space-between;
  min-height: 148px;
}
.win-card .side.us {
  background: var(--gh);
  color: #fff;
  position: relative;
}
.win-card .side.us::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 0% 100%, rgba(255, 255, 255, .18), transparent 60%);
  pointer-events: none;
}
.win-card .side.them {
  background: #1A1A1A;
  text-align: right;
  align-items: flex-end;
}
.win-card .label {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: .95;
}
.win-card .label.them {
  color: var(--ink200);
  opacity: .95;
  white-space: pre-line;
  line-height: 1.3;
}
.win-card .pct {
  font-size: 46px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
}
.win-card .pct.them { color: var(--ink300); }

/* -------------------------------------------------------------------------
   12. Bullets
   ------------------------------------------------------------------------- */
.bullet {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 24px;
  background: var(--s1);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
}
.bullet:has(.ico) {
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
}
.bullet .ico {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex: none;
  margin-top: -2px;
}
.bullet .b-lead {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
  background: linear-gradient(180deg, #FE338F 0%, #E25DFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bullet .b-title {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  line-height: 1.35;
}
.bullet .b-body {
  font-size: 14px;
  color: var(--ink200);
  line-height: 1.5;
  margin-top: 4px;
}

/* -------------------------------------------------------------------------
   13. Quote
   ------------------------------------------------------------------------- */
.quote {
  padding: 48px;
  background: linear-gradient(180deg, rgba(254, 51, 143, .08), rgba(226, 93, 255, .04));
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}
.quote .mark {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}
.quote .text {
  font-weight: 300;
  font-style: italic;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.35;
  letter-spacing: -.01em;
  max-width: 32ch;
  text-wrap: balance;
  margin: 0;
}
.quote .who {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
.quote .who .nm   { font-size: 14px; font-weight: 600; }
.quote .who .role { font-size: 12px; color: var(--ink300); }

/* -------------------------------------------------------------------------
   14. Dialogue mock
   ------------------------------------------------------------------------- */
.dialogue {
  background: var(--s1);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.dialogue::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 100% 0%, rgba(254, 51, 143, .08), transparent 60%);
  pointer-events: none;
}
.msg { display: flex; gap: 10px; align-items: flex-start; position: relative; }
.msg .av { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.msg .av.user { background: #2A2A2A; }
.msg .av.ai   { background: var(--gp); }
.msg .b { flex: 1; }
.msg .who {
  font-size: 11px;
  color: var(--ink300);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.msg .bubble {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  background: #0F0F0F;
  border: 1px solid rgba(255, 255, 255, .06);
}
.msg .bubble.ai {
  background: rgba(254, 51, 143, .08);
  border-color: rgba(254, 51, 143, .25);
}

/* Inline emotion tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(226, 93, 255, .18);
  color: var(--v);
  margin: 0 3px;
  border: 1px solid rgba(226, 93, 255, .3);
}

/* Waveform strip */
.wave {
  height: 36px;
  display: flex;
  gap: 2px;
  align-items: center;
  margin-top: 10px;
  width: 100%;
}
.wave span {
  flex: 1;
  min-width: 1.5px;
  background: var(--m);
  border-radius: 999px;
  opacity: .92;
}

/* -------------------------------------------------------------------------
   15. Final CTA
   ------------------------------------------------------------------------- */
.final {
  padding: 96px 0 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.final .pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .25;
  background-image: url("assets/patterns/half-circle-grid.png");
  background-size: 480px auto;
  background-position: center;
  mask-image: radial-gradient(60% 60% at 50% 50%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(60% 60% at 50% 50%, #000, transparent 75%);
}
.final .glow {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(closest-side, rgba(226, 93, 255, .18), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}
.final-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* -------------------------------------------------------------------------
   16. Footer
   ------------------------------------------------------------------------- */
footer {
  padding: 32px 0 48px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
footer .row {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
}
footer .small { font-size: 12px; color: var(--ink400); }
