/* =====================================================================
   Aegis — Discord protection suite
   Sober, Apple-inspired showcase + documentation
   ===================================================================== */

/* ----- Design tokens ------------------------------------------------ */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --bg-dark: #101012;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --accent: #0071e3;
  --accent-press: #0058b3;
  --card: #ffffff;
  --green: #1a8f4c;
  --red: #d33a3a;
  --amber: #b25e09;

  --radius: 18px;
  --radius-lg: 28px;
  --radius-sm: 12px;

  --maxw: 1024px;
  --maxw-wide: 1220px;
  --nav-h: 52px;

  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.12);
}

/* ----- Reset -------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -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: none; cursor: pointer; }
ul { list-style: none; }
code, kbd { font-family: var(--mono); }

::selection { background: rgba(0, 113, 227, 0.18); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ----- Layout ------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}

.wrap--wide { max-width: var(--maxw-wide); }

.section {
  padding-block: clamp(72px, 11vw, 140px);
}

.section--alt { background: var(--bg-alt); }

.section--flush { padding-block: clamp(48px, 7vw, 96px); }

/* ----- Typography --------------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.06;
}

.t-hero {
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.t-display {
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.08;
}

.t-section {
  font-size: clamp(1.8rem, 4.2vw, 2.9rem);
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--accent);
  margin-bottom: 14px;
}

.lead {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.4;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.014em;
}

.muted { color: var(--text-2); }

.intro {
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  line-height: 1.5;
  color: var(--text-2);
  font-weight: 400;
}

.center { text-align: center; }

.section-head {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-head .intro { margin-top: 18px; }

/* ----- Buttons & links --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 1.0rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 11px 22px;
  border-radius: 980px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease);
  white-space: nowrap;
}

.btn svg { width: 17px; height: 17px; }

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

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: rgba(0, 0, 0, 0.04); border-color: var(--text-3); }

.btn-lg { padding: 14px 28px; font-size: 1.08rem; }

.link-cta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 400;
  transition: opacity 0.2s;
}
.link-cta::after {
  content: "›";
  font-size: 1.2em;
  line-height: 1;
  transition: transform 0.25s var(--ease);
}
.link-cta:hover { text-decoration: underline; }
.link-cta:hover::after { transform: translateX(3px); }

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  align-items: center;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* ----- Header / nav ------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.nav.is-scrolled { border-bottom-color: var(--line-soft); }

.nav-inner {
  height: 100%;
  max-width: var(--maxw-wide);
  margin-inline: auto;
  padding-inline: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand svg { width: 20px; height: 20px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline: auto;
}
.nav-links a {
  padding: 7px 13px;
  border-radius: 980px;
  font-size: 0.93rem;
  font-weight: 400;
  color: var(--text-2);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.current { color: var(--text); font-weight: 500; }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.nav-cta {
  font-size: 0.92rem;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  padding: 7px 16px;
  border-radius: 980px;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--accent-press); }

/* Language segmented toggle */
.lang {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 980px;
  background: rgba(0, 0, 0, 0.05);
}
.lang button {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
  padding: 5px 11px;
  border-radius: 980px;
  transition: color 0.2s, background 0.2s;
}
.lang button.active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* ----- Hero -------------------------------------------------------- */
.hero {
  text-align: center;
  padding-top: clamp(64px, 10vw, 120px);
  padding-bottom: clamp(40px, 6vw, 72px);
}
.hero .eyebrow { font-size: 1rem; }
.hero h1 { margin-bottom: 20px; }
.hero .lead { max-width: 720px; margin: 0 auto 30px; color: var(--text-2); font-weight: 400; }
.hero .link-row { justify-content: center; }

/* ----- Discord product mock --------------------------------------- */
.mock {
  max-width: 560px;
  margin: clamp(48px, 7vw, 80px) auto 0;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px 24px;
  text-align: start;
}

.dc-msg { display: flex; gap: 14px; }
.dc-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-dark);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.dc-avatar svg { width: 22px; height: 22px; color: #fff; }
.dc-body { flex: 1; min-width: 0; }
.dc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dc-name { font-weight: 600; font-size: 0.98rem; }
.dc-tag {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.03em;
  background: var(--accent); color: #fff;
  padding: 1px 5px; border-radius: 4px; text-transform: uppercase;
}
.dc-time { font-size: 0.74rem; color: var(--text-3); }

.embed {
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--accent);
  background: #fbfbfd;
  padding: 14px 16px;
}
.embed--green { border-left-color: var(--green); }
.embed--red { border-left-color: var(--red); }
.embed--amber { border-left-color: var(--amber); }
.embed-title { font-weight: 600; font-size: 0.96rem; margin-bottom: 5px; display: flex; align-items: center; gap: 7px; }
.embed-title svg { width: 16px; height: 16px; }
.embed-desc { font-size: 0.88rem; color: var(--text-2); line-height: 1.45; }
.embed-fields { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-top: 12px; }
.embed-field-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); margin-bottom: 2px; }
.embed-field-value { font-size: 0.86rem; }
.embed-foot { margin-top: 12px; font-size: 0.72rem; color: var(--text-3); }
.embed code, .dc-body code {
  font-size: 0.84em; background: rgba(0,0,0,0.05); padding: 1px 6px; border-radius: 5px;
}

/* slash command pill */
.slash {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 0.82rem;
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
  padding: 4px 11px; border-radius: 7px;
  border: 1px solid rgba(0, 113, 227, 0.15);
}

/* ----- Feature / bento grid ---------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.tile {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--line-soft);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.section--alt .tile { background: #fff; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--bg-alt);
  margin-bottom: 18px;
}
.section--alt .tile-icon { background: var(--bg-alt); }
.tile-icon svg { width: 24px; height: 24px; color: var(--text); }
.tile h3 { font-size: 1.2rem; margin-bottom: 8px; letter-spacing: -0.018em; }
.tile p { color: var(--text-2); font-size: 0.98rem; }

/* ----- Split feature ----------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
}
.split--rev .split-visual { order: -1; }
.split h2 { margin-bottom: 18px; }
.split .intro { margin-bottom: 26px; }

.checks { display: grid; gap: 14px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; color: var(--text); font-size: 1.02rem; }
.checks svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }

/* ----- Steps ------------------------------------------------------- */
.steps { max-width: 820px; margin-inline: auto; display: grid; gap: 18px; }
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  align-items: start;
}
.section--alt .step { background: #fff; }
.step-n {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-weight: 600; font-size: 1.05rem;
}
.step h3 { font-size: 1.22rem; margin-bottom: 7px; letter-spacing: -0.018em; }
.step p { color: var(--text-2); margin-bottom: 14px; font-size: 1rem; }

/* ----- Callout ----------------------------------------------------- */
.callout {
  max-width: 820px; margin: 0 auto clamp(36px, 5vw, 52px);
  display: flex; gap: 15px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--line-soft);
}
.callout svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent); margin-top: 2px; }
.callout strong { display: block; margin-bottom: 4px; font-weight: 600; }
.callout p { color: var(--text-2); font-size: 0.96rem; }

/* ----- Commands ---------------------------------------------------- */
.tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab {
  padding: 9px 18px;
  border-radius: 980px;
  font-size: 0.95rem; font-weight: 500;
  color: var(--text-2);
  background: var(--bg-alt);
  transition: all 0.25s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--text); color: #fff; }

.legend {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px;
  margin-bottom: 36px; font-size: 0.8rem; color: var(--text-3);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot--all { background: var(--green); }
.dot--staff { background: var(--amber); }
.dot--admin { background: var(--red); }

.cmd-group { display: none; max-width: 860px; margin-inline: auto; }
.cmd-group.active { display: block; animation: fade 0.5s var(--ease); }
.cmd-list { display: grid; gap: 10px; }
.cmd {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}
.section--alt .cmd { background: #fff; }
.cmd:hover { border-color: var(--line); }
.cmd-name { font-family: var(--mono); font-size: 0.95rem; font-weight: 500; }
.cmd-name .opt { color: var(--text-3); }
.cmd-desc { margin-top: 4px; font-size: 0.9rem; color: var(--text-2); }
.cmd-access { flex-shrink: 0; }

/* ----- FAQ accordion ----------------------------------------------- */
.faq { max-width: 780px; margin-inline: auto; }
.faq-item { border-bottom: 1px solid var(--line-soft); }
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 26px 4px;
  text-align: start;
  font-size: 1.18rem; font-weight: 500; letter-spacing: -0.016em;
}
.faq-icon { position: relative; width: 18px; height: 18px; flex-shrink: 0; }
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1.5px;
  background: var(--accent); transition: transform 0.3s var(--ease);
}
.faq-icon::after { transform: rotate(90deg); }
.faq-item.open .faq-icon::after { transform: rotate(0); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s var(--ease); }
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; }
.faq-a p { padding: 0 4px 28px; color: var(--text-2); font-size: 1.02rem; line-height: 1.55; max-width: 680px; }

/* ----- Updates / changelog ----------------------------------------- */
.releases { max-width: 760px; margin-inline: auto; display: grid; gap: 22px; }
.release {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.section--alt .release { background: #fff; }
.release-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.release-tag {
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500;
  color: var(--accent); background: rgba(0, 113, 227, 0.08);
  padding: 3px 11px; border-radius: 980px;
}
.release h3 { font-size: 1.4rem; letter-spacing: -0.02em; }
.release-summary { color: var(--text-2); margin-bottom: 18px; }
.release-block { margin-top: 18px; }
.release-block h4 {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); margin-bottom: 10px;
}
.release-block ul { display: grid; gap: 8px; }
.release-block li { display: flex; gap: 10px; color: var(--text-2); font-size: 0.96rem; line-height: 1.5; }
.release-block li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 9px; flex-shrink: 0; }
.release code { font-size: 0.85em; background: rgba(0,0,0,0.05); padding: 1px 6px; border-radius: 5px; color: var(--text); }

/* ----- Language chips ---------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 760px; margin-inline: auto; }
.chip {
  padding: 9px 16px; border-radius: 980px;
  background: var(--card); border: 1px solid var(--line-soft);
  font-size: 0.92rem; color: var(--text-2);
}
.section--alt .chip { background: #fff; }

/* ----- CTA band (dark) --------------------------------------------- */
.cta {
  background: var(--bg-dark);
  color: #f5f5f7;
  text-align: center;
}
.cta h2 { color: #fff; margin-bottom: 18px; }
.cta .intro { color: #a1a1a6; max-width: 600px; margin: 0 auto 32px; }
.cta .btn-secondary { color: #fff; border-color: rgba(255,255,255,0.28); }
.cta .btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }
.cta .btn-row { justify-content: center; }

/* ----- Footer ------------------------------------------------------ */
.footer { background: var(--bg-alt); color: var(--text-2); font-size: 0.82rem; }
.footer-inner { max-width: var(--maxw-wide); margin-inline: auto; padding: 40px 22px; }
.footer-top {
  display: grid; grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line);
}
.footer-brand .brand { font-size: 1rem; margin-bottom: 10px; }
.footer-brand p { max-width: 280px; line-height: 1.5; }
.footer-col h4 { font-size: 0.82rem; color: var(--text); margin-bottom: 12px; font-weight: 600; }
.footer-col a { display: block; padding: 5px 0; color: var(--text-2); transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { padding-top: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ----- Reveal animations ------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }

@keyframes fade { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ----- Page hero (subpages) ---------------------------------------- */
.page-hero { text-align: center; padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(8px, 2vw, 24px); }
.page-hero .intro { max-width: 640px; margin: 18px auto 0; }

/* ----- Responsive -------------------------------------------------- */
@media (max-width: 940px) {
  .split { grid-template-columns: 1fr; }
  .split--rev .split-visual { order: 0; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line-soft);
    padding: 14px 22px 20px;
    transform: translateY(-130%);
    transition: transform 0.35s var(--ease);
    margin: 0;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 8px; font-size: 1rem; }
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .cmd { flex-direction: column; align-items: flex-start; gap: 10px; }
  .step { grid-template-columns: 1fr; gap: 14px; }
  .footer-top { grid-template-columns: 1fr; gap: 24px; }
}
