/* ============================================================
   expatch — offensive cyber security
   Monochrome, near-black, techno. "h1 / HackerOne" aesthetic.
   ============================================================ */

:root {
  /* surfaces */
  --bg:        #090a0c;
  --bg-elev:   #101216;
  --bg-elev-2: #15181e;
  --line:      #21262e;
  --line-soft: #181b21;

  /* ink */
  --text:      #e9ebee;
  --text-dim:  #9aa1a9;
  --text-mute: #6a7078;
  --white:     #ffffff;

  /* severity (kept monochrome — differentiated by luminance) */
  --sev-crit:  #ffffff;
  --sev-high:  #cdd1d6;
  --sev-med:   #8b9199;
  --sev-low:   #5f656d;

  /* type */
  --font-display: 'Chakra Petch', 'Bahnschrift', 'Segoe UI', sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Consolas', monospace;

  /* scale */
  --container: 1140px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 9px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* subtle vignette so the page has depth without color */
  background-image:
    radial-gradient(1200px 600px at 50% -10%, #14171d 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #101319 0%, transparent 55%);
  background-attachment: fixed;
}

/* ---------- typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  color: var(--white);
}
h1 { font-size: clamp(2.6rem, 6.5vw, 5.1rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p  { margin: 0 0 1rem; color: var(--text-dim); }

a { color: var(--text); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--white); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin: 0 0 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--text-mute);
}

.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-dim); max-width: 56ch; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.divider { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

.row-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; margin-bottom: 2.5rem; flex-wrap: wrap;
}
.row-head h2 { margin: 0; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.nav__logo { display: flex; align-items: center; gap: .7rem; }
.nav__logo img { height: 30px; width: auto; display: block; }
.nav__logo--lockup {
  width: clamp(164px, 19vw, 232px);
  height: 42px;
  overflow: hidden;
  flex: 0 0 auto;
}
.brand-lockup {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nav__logo .brand-lockup {
  width: 100%;
  height: 100%;
}
.brand-lockup--nav { object-fit: contain; object-position: center; }
.nav__logo .wm {
  font-family: var(--font-display); font-weight: 700; font-size: 1.32rem;
  letter-spacing: .02em; color: var(--white);
}
.nav__links { display: flex; align-items: center; gap: 2rem; }
.nav__links a {
  font-size: .92rem; color: var(--text-dim); font-weight: 500;
  position: relative; padding-block: .4rem;
}
.nav__links a:hover { color: var(--white); }
.nav__links a.active { color: var(--white); }
.nav__links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--white);
}
.nav__burger { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: .4rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: .8rem 1.4rem; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; transition: all .22s var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--white); color: #0a0a0a; }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(255,255,255,.12); }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--text-mute); background: var(--bg-elev); }
.btn .arw { transition: transform .22s var(--ease); }
.btn:hover .arw { transform: translateX(3px); }

/* ---------- hero ---------- */
.hero { position: relative; padding-block: clamp(4.5rem, 11vw, 9rem) clamp(3.5rem, 8vw, 6rem); overflow: hidden; }
.hero__mark { display: block; margin: 0 auto clamp(1.8rem, 4vw, 3rem); }
.hero__mark img { height: clamp(96px, 16vw, 168px); width: auto; display: block; margin-inline: auto; }
.hero__brand {
  width: min(520px, 90vw);
  aspect-ratio: 582 / 331;
  margin: 0 auto clamp(1.4rem, 3.5vw, 2.5rem);
  overflow: hidden;
  opacity: .96;
}
.brand-lockup--hero { object-fit: contain; object-position: center; }
.hero__inner { text-align: center; max-width: 880px; margin-inline: auto; }
.hero h1 { margin-bottom: 1.2rem; }
.hero h1 .dim { color: var(--text-mute); }
.hero .lead { margin: 0 auto 2.2rem; }
.hero__cta { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }

/* a thin technical rule under the hero, echoing the logo's wing-line */
.wing-rule { display: flex; align-items: center; gap: 1rem; color: var(--line); margin-top: clamp(3rem,7vw,5rem); }
.wing-rule::before, .wing-rule::after { content: ""; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); flex: 1; }
.wing-rule span { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .25em; color: var(--text-mute); text-transform: uppercase; }

/* ---------- capabilities ---------- */
.caps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.cap { background: var(--bg); padding: 2rem 1.8rem; transition: background .25s var(--ease); }
.cap:hover { background: var(--bg-elev); }
.cap__n { font-family: var(--font-mono); font-size: .8rem; color: var(--text-mute); }
.cap h3 { margin: .8rem 0 .5rem; color: var(--white); }
.cap p { margin: 0; font-size: .95rem; }

/* ---------- cards / lists ---------- */
.grid { display: grid; gap: 1.1rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  display: flex; flex-direction: column; gap: .9rem;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.6rem 1.6rem 1.7rem;
  transition: border-color .25s var(--ease), transform .25s var(--ease), background .25s var(--ease);
}
.card:hover { border-color: var(--text-mute); transform: translateY(-3px); background: var(--bg-elev-2); }
.card__meta { display: flex; align-items: center; gap: .8rem; font-family: var(--font-mono); font-size: .76rem; color: var(--text-mute); letter-spacing: .04em; }
.card__meta time { color: var(--text-mute); }
.card h3 { margin: 0; font-size: 1.22rem; line-height: 1.2; }
.card p { margin: 0; font-size: .94rem; }
.card__tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: .4rem; }
.card__more { font-family: var(--font-mono); font-size: .8rem; color: var(--text); display: inline-flex; gap: .4rem; }

.tag {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .03em;
  color: var(--text-dim); border: 1px solid var(--line);
  padding: .22rem .6rem; border-radius: 999px;
}

/* ---------- severity ---------- */
.sev { font-family: var(--font-mono); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 6px; border: 1px solid; display: inline-flex; align-items: center; gap: .4rem; }
.sev::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sev--critical { color: var(--sev-crit); border-color: color-mix(in srgb, var(--sev-crit) 45%, transparent); background: color-mix(in srgb, var(--sev-crit) 9%, transparent); }
.sev--high     { color: var(--sev-high); border-color: color-mix(in srgb, var(--sev-high) 40%, transparent); background: color-mix(in srgb, var(--sev-high) 7%, transparent); }
.sev--medium   { color: var(--sev-med);  border-color: color-mix(in srgb, var(--sev-med) 45%, transparent); }
.sev--low      { color: var(--sev-low);  border-color: color-mix(in srgb, var(--sev-low) 55%, transparent); }

/* ---------- advisory table ---------- */
.adv { width: 100%; border-collapse: collapse; font-size: .92rem; }
.adv thead th {
  text-align: left; font-family: var(--font-mono); font-weight: 500;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-mute); padding: 0 1rem .9rem; border-bottom: 1px solid var(--line);
}
.adv tbody tr { border-bottom: 1px solid var(--line-soft); transition: background .2s var(--ease); }
.adv tbody tr:hover { background: var(--bg-elev); }
.adv td { padding: 1.05rem 1rem; vertical-align: middle; }
.adv .cve { font-family: var(--font-mono); color: var(--white); white-space: nowrap; }
.adv .prod { color: var(--text); }
.adv .muted { color: var(--text-mute); font-family: var(--font-mono); font-size: .82rem; }
.adv .stat { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .06em; color: var(--text-dim); }

/* ---------- prose (write-up article) ---------- */
.prose { max-width: 760px; margin-inline: auto; }
.prose h2 { margin-top: 2.6rem; font-size: 1.7rem; }
.prose h3 { margin-top: 2rem; color: var(--white); }
.prose p, .prose li { color: var(--text-dim); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--white); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--text-mute); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .4rem; }
.prose code { font-family: var(--font-mono); font-size: .86em; background: var(--bg-elev-2); border: 1px solid var(--line); padding: .12em .4em; border-radius: 5px; color: var(--text); }
.prose pre {
  background: #0c0e12; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1.2rem 1.3rem; overflow-x: auto; margin: 1.6rem 0; line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: .84rem; color: #d6dae0; }
.prose blockquote { margin: 1.6rem 0; padding: .6rem 1.2rem; border-left: 2px solid var(--text-mute); color: var(--text-dim); font-style: italic; }
.callout { display: flex; gap: .9rem; background: var(--bg-elev); border: 1px solid var(--line); border-left: 2px solid var(--white); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 1.6rem 0; }
.callout .k { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); }
.callout p { margin: .2rem 0 0; color: var(--text-dim); font-size: .94rem; }

/* article header */
.article-head { max-width: 760px; margin: 0 auto clamp(2rem,5vw,3rem); }
.article-head .card__meta { margin-bottom: 1.2rem; }
.article-head h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }

/* ---------- page header (sub-pages) ---------- */
.page-head { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 1rem; }
.page-head .lead { margin: 0; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 3.5rem 2.5rem; margin-top: 2rem; }
.footer__grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.footer__brand { max-width: 320px; }
.nav__logo--footer {
  width: 214px;
  height: 34px;
  overflow: hidden;
}
.brand-lockup--footer { object-fit: contain; object-position: center; }
.footer__brand .wm { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--white); }
.footer__brand p { margin: .7rem 0 0; font-size: .9rem; color: var(--text-mute); }
.footer__cols { display: flex; gap: 4rem; flex-wrap: wrap; }
.footer__col h4 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-mute); font-weight: 500; margin: 0 0 1rem; }
.footer__col a { display: block; font-size: .9rem; color: var(--text-dim); margin-bottom: .6rem; }
.footer__col a:hover { color: var(--white); }
.footer__base { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line-soft); font-family: var(--font-mono); font-size: .76rem; color: var(--text-mute); }

/* ---------- reveal animation ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .grid--3 { grid-template-columns: 1fr 1fr; }
  .caps { grid-template-columns: 1fr; }
  .footer__grid { flex-direction: column; }
}
@media (max-width: 680px) {
  .nav__links { position: fixed; inset: 70px 0 auto 0; flex-direction: column; gap: 0; background: var(--bg-elev); border-bottom: 1px solid var(--line); padding: .5rem var(--gutter) 1.5rem; transform: translateY(calc(-100% - 80px)); visibility: hidden; transition: transform .3s var(--ease), visibility .3s var(--ease); }
  .nav__links.open { transform: none; visibility: visible; }
  .nav__links a { width: 100%; padding: .9rem 0; border-bottom: 1px solid var(--line-soft); }
  .nav__burger { display: block; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .adv thead { display: none; }
  .adv tbody tr { display: grid; grid-template-columns: 1fr auto; gap: .3rem .8rem; padding: 1rem 0; }
  .adv td { padding: .15rem 0; }
  .adv .cve { grid-column: 1; } .adv .sevcell { grid-column: 2; grid-row: 1; text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* footer (desktop >=681px): keep (c) left; "authorized testing" notice top-right,
   location ("Boston, MA") stacked on the line directly beneath it */
@media (min-width: 681px) {
  .footer__base span:nth-child(3) { order: 2; }
  .footer__base span:nth-child(2) { order: 3; flex-basis: 100%; text-align: right; margin-top: .5rem; }
}
