/* ==========================================================================
   Defeat · site
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--red); color: #fff; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }

/* --- layout primitives ------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: var(--maxw-narrow); }
section { position: relative; }
.band { padding-block: clamp(72px, 10vw, 132px); }
.band--tight { padding-block: clamp(52px, 7vw, 88px); }
.rule { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

/* --- type -------------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); }
h3 { font-size: clamp(1.05rem, 1.7vw, 1.22rem); letter-spacing: -.015em; line-height: 1.25; }
p { margin: 0; }
.lede { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--ink-2); line-height: 1.62; }
.sub  { color: var(--dim); font-size: .975rem; line-height: 1.65; }
.mono { font-family: var(--mono); }

.eyebrow {
  font-family: var(--mono);
  font-size: .715rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dim-2);
  margin: 0 0 18px;
}
.eyebrow .dot { color: var(--red); }

.section-head { max-width: 640px; margin-bottom: clamp(38px, 5vw, 58px); }
.section-head p { margin-top: 16px; }
.section-head.center { margin-inline: auto; text-align: center; }

/* --- buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 20px;
  border-radius: var(--r-sm);
  font-size: .92rem; font-weight: 550; letter-spacing: -.005em;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-hot); }
.btn--ghost { color: var(--ink-2); background: var(--surface-2); }
.btn--ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn--bare { padding-inline: 0; color: var(--dim); height: auto; }
.btn--bare:hover { color: var(--ink); }
.btn--lg { height: 50px; padding: 0 26px; font-size: .97rem; }
.btn--icon { width: 36px; padding: 0; justify-content: center; background: var(--surface-2); color: var(--ink-2); }
.btn--icon:hover { background: var(--surface-3); color: var(--ink); }
.btn--icon svg { width: 15px; height: 15px; }
.btn .arr { transition: transform var(--t-fast) var(--ease); }
.btn:hover .arr { transform: translateX(3px); }

/* --- chips / pills ----------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 10px;
  border-radius: 999px;
  font-family: var(--mono); font-size: .672rem;
  letter-spacing: .09em; text-transform: uppercase;
}
.pill--verified { color: var(--verified); background: var(--verified-bg); }
.pill--unsigned { color: var(--unsigned); background: var(--unsigned-bg); }
.pill--blocked  { color: var(--blocked);  background: var(--blocked-bg); }
.pill .tick { width: 11px; height: 11px; }

.tag {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 13px 0 11px;
  border-radius: 999px;
  background: var(--surface-2);
  font-family: var(--mono); font-size: .69rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--dim);
}
.tag i { width: 6px; height: 6px; border-radius: 99px; background: var(--red); font-style: normal;
         animation: blip 2.6s var(--ease) infinite; }
@keyframes blip { 0%,100% { opacity: 1; } 50% { opacity: .28; } }

/* ==========================================================================
   Logo
   ========================================================================== */
.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo svg { width: 26px; height: 26px; color: var(--ink); overflow: visible; }
.logo .wm {
  font-family: var(--display); font-weight: 700; font-size: 1.16rem;
  letter-spacing: -.035em; color: var(--ink);
}
.logo .wm .tld { color: var(--dim-2); font-weight: 600; }
.logo:hover .finial { fill: var(--red); }
.logo .finial { transition: fill var(--t) var(--ease); }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  height: 66px;
  display: flex; align-items: center;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), height var(--t) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  height: 58px;
  background: rgba(12, 13, 16, .78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line-soft);
}
.nav .wrap { display: flex; align-items: center; gap: 30px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-links a {
  padding: 7px 12px; border-radius: 7px;
  font-size: .9rem; color: var(--dim);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-right .btn { height: 36px; font-size: .87rem; padding-inline: 15px; }
.nav-right .btn--icon { padding-inline: 0; width: 36px; flex: none; }
.nav-toggle { display: none; width: 38px; height: 38px; border-radius: 8px; align-items: center; justify-content: center; }
.nav-toggle:hover { background: var(--surface-2); }
.nav-toggle span { display: block; width: 17px; height: 1.5px; background: var(--ink); position: relative; transition: transform var(--t) var(--ease); }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 17px; height: 1.5px; background: var(--ink);
  transition: transform var(--t) var(--ease), opacity var(--t-fast) var(--ease);
}
.nav-toggle span::before { top: -5.5px; } .nav-toggle span::after { top: 5.5px; }
body.menu-open .nav-toggle span { transform: rotate(45deg); }
body.menu-open .nav-toggle span::before { transform: translateY(5.5px) rotate(-90deg); }
body.menu-open .nav-toggle span::after { opacity: 0; }

.drawer {
  position: fixed; inset: 66px 0 auto 0; z-index: 89;
  background: var(--page); border-bottom: 1px solid var(--line);
  padding: 14px var(--gutter) 24px;
  display: none; flex-direction: column; gap: 2px;
}
.drawer a { padding: 13px 4px; font-size: 1.02rem; color: var(--ink-2); border-bottom: 1px solid var(--line-soft); }
.drawer .drawer-x { display: flex; align-items: center; gap: 11px; }
.drawer .drawer-x svg { width: 15px; height: 15px; color: var(--ink); }
.drawer .btn { margin-top: 16px; justify-content: center; }
body.menu-open .drawer { display: flex; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-right .btn--ghost { display: none; }
  .nav-toggle { display: flex; }
}

/* ==========================================================================
   Reveal
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding-top: clamp(112px, 15vw, 164px); padding-bottom: clamp(56px, 8vw, 96px); overflow: hidden; }
.hero .wrap { position: relative; z-index: 2; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 70px); align-items: center;
}
.hero h1 { margin: 0; }
.hero h1 .accent { color: var(--red); }
.hero .lede { margin-top: 22px; max-width: 42ch; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 22px; display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .76rem; color: var(--dim-2); }
.hero-note code { color: var(--ink-2); }

/* ambient hero layer: hairline grid plus a slow red wash, no glow */
.hero-field { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-field::before {
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 150%;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(112% 74% at 50% 6%, #000 0%, transparent 72%);
          mask-image: radial-gradient(112% 74% at 50% 6%, #000 0%, transparent 72%);
  opacity: .62;
}
.hero-field::after {
  content: ""; position: absolute; top: -28vh; left: 50%; width: 92vw; height: 62vh;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(224, 36, 47, .16), transparent 68%);
  animation: drift 22s var(--ease) infinite alternate;
}
@keyframes drift { from { transform: translateX(-58%) scale(1); } to { transform: translateX(-42%) scale(1.14); } }

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero .lede { max-width: none; }
}

/* ==========================================================================
   Inbox card
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-bar {
  display: flex; align-items: center; gap: 12px;
  height: 46px; padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.card-bar .addr {
  font-family: var(--mono); font-size: .76rem; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-bar .addr b { color: var(--ink); font-weight: 500; }
.card-bar .count { margin-left: auto; font-family: var(--mono); font-size: .68rem; color: var(--dim-2); white-space: nowrap; }
.dots { display: flex; gap: 6px; flex: none; }
.dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--line-strong); }
.dots i:first-child { background: #3a3f47; }

.msg {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--t-fast) var(--ease);
}
.msg:last-child { border-bottom: 0; }
.flagchip {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-2);
  font-family: var(--mono); font-size: .66rem; font-weight: 600; letter-spacing: .02em;
}
.flagchip svg { width: 15px; height: 15px; }
.flagchip--grad { background: var(--flag-gradient); color: #6a1a16; }
.msg .who { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.msg .who b { font-size: .87rem; font-weight: 550; color: var(--ink); white-space: nowrap; }
.msg .who span { font-family: var(--mono); font-size: .69rem; color: var(--dim-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg .subj { font-size: .84rem; color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* streaming animation in the hero */
.stream .msg { opacity: 0; transform: translateY(10px); animation: land 620ms var(--ease-out) forwards; }
@keyframes land { to { opacity: 1; transform: none; } }
.stream .msg:nth-child(1) { animation-delay: .25s; }
.stream .msg:nth-child(2) { animation-delay: .55s; }
.stream .msg:nth-child(3) { animation-delay: .85s; }
.stream .msg:nth-child(4) { animation-delay: 1.15s; }
.stream .msg:nth-child(5) { animation-delay: 1.45s; }
.stream .msg .pill { opacity: 0; animation: land 420ms var(--ease-out) forwards; }
.stream .msg:nth-child(1) .pill { animation-delay: .85s; }
.stream .msg:nth-child(2) .pill { animation-delay: 1.15s; }
.stream .msg:nth-child(3) .pill { animation-delay: 1.45s; }
.stream .msg:nth-child(4) .pill { animation-delay: 1.75s; }
.stream .msg:nth-child(5) .pill { animation-delay: 2.05s; }

.card-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 15px; background: var(--surface-2);
  font-family: var(--mono); font-size: .69rem; color: var(--dim-2);
}
.card-foot .live { width: 6px; height: 6px; border-radius: 99px; background: var(--verified); animation: blip 2s var(--ease) infinite; }

/* ==========================================================================
   Marquee
   ========================================================================== */
.marquee { border-block: 1px solid var(--line-soft); overflow: hidden; padding-block: 20px; }
.marquee-track { display: flex; width: max-content; animation: slide 46s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  display: flex; align-items: center; gap: 30px;
  padding-right: 30px;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim-2); white-space: nowrap;
}
.marquee-track span::after { content: ""; width: 4px; height: 4px; border-radius: 99px; background: var(--red); opacity: .55; flex: none; }
.marquee-track i { width: 4px; height: 4px; border-radius: 99px; background: var(--red); opacity: .55; flex: none; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ==========================================================================
   Problem cards
   ========================================================================== */
.tri {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden;
}
.tri > article { background: var(--page-2); padding: clamp(26px, 3.2vw, 38px) clamp(22px, 2.6vw, 32px); }
.tri .num { font-family: var(--mono); font-size: .7rem; letter-spacing: .18em; color: var(--red); }
.tri h3 { margin: 16px 0 10px; }
.tri .glyph { height: 78px; margin-bottom: 20px; color: var(--line-strong); }
.tri .glyph svg { height: 100%; width: auto; overflow: visible; }
@media (max-width: 860px) { .tri { grid-template-columns: 1fr; } }

/* ==========================================================================
   Flow diagram
   ========================================================================== */
.flow svg { width: 100%; height: auto; overflow: visible; }
.flow .wire { stroke: var(--line-strong); stroke-width: 1.4; fill: none; }
.flow .wire--live { stroke: var(--red); stroke-dasharray: 5 9; animation: crawl 1.15s linear infinite; opacity: .95; }
@keyframes crawl { to { stroke-dashoffset: -14; } }
.flow .node { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.flow .node--core { fill: var(--surface-2); stroke: var(--line-strong); }
.flow .lbl { font-family: var(--mono); font-size: 9.6px; letter-spacing: .1em; text-transform: uppercase; fill: var(--dim); }
.flow .lbl--ink { fill: var(--ink); font-size: 11.6px; letter-spacing: -.01em; text-transform: none; font-family: var(--display); font-weight: 600; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); margin-top: clamp(38px, 5vw, 60px); }
.steps .num {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink);
  font-family: var(--mono); font-size: .72rem; margin-bottom: 15px;
}
.steps h3 { margin-bottom: 9px; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; gap: 28px; } }
