/* ============================================================================
   getdecred.now — hand-written modern CSS (no framework, no build)
   Organised with @layer + native nesting. Design tokens reverse-engineered from
   the original site's :root. Self-hosted Inter (latin subset, variable).
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;          /* variable range */
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  /* latin subset (matches the file we vendored from Google Fonts) */
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@layer reset, base, components, utilities;

/* --------------------------------------------------------------------------
   reset / base elements
   -------------------------------------------------------------------------- */
@layer reset {
  *,
  *::before,
  *::after { box-sizing: border-box; }
  * { margin: 0; }

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

  body {
    font-family: var(--font);
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100dvh;
    overflow-x: hidden;
  }

  img, svg, picture { display: block; max-width: 100%; }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; color: inherit; cursor: pointer; }

  :focus-visible { outline: 2px solid var(--dcr-blue); outline-offset: 2px; border-radius: 4px; }
  ::selection { background: hsl(var(--primary) / 0.35); color: #fff; }

  /* Skip link (a11y) — hidden until focused */
  .skip-link {
    position: fixed;
    inset-block-start: 0.5rem;
    inset-inline-start: 0.5rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--dcr-blue);
    color: #000;
    font-weight: 600;
    border-radius: 0.5rem;
    transform: translateY(-150%);
    transition: transform 0.2s;

    &:focus { transform: translateY(0); }
  }
}

/* --------------------------------------------------------------------------
   tokens + layout primitives
   -------------------------------------------------------------------------- */
@layer base {
  :root {
    /* Core palette (HSL channels so we can vary alpha with hsl(var(--x) / a)) */
    --background: 0 0% 0%;
    --card: 0 0% 4%;
    --card-2: 0 0% 6%;
    --border: 0 0% 12%;
    --muted: 0 0% 8%;
    --foreground: 210 40% 98%;
    --muted-foreground: 210 15% 65%;
    --primary: 210 100% 55%;
    --primary-glow: 210 100% 65%;

    /* Convenience solid colors */
    --dcr-blue: #1a8cff;
    --dcr-blue-glow: #4da6ff;
    --green: #22c55e;
    --decred-green: #2ed6a1;
    --red: #ef4444;
    --yellow: #eab308;
    --orange: #f97316;

    --radius: 0.75rem;
    --shadow-card: 0 10px 30px -10px hsl(0 0% 0% / 0.8);
    --shadow-glow: 0 0 40px -10px hsl(var(--primary) / 0.5);
    --gradient-card: linear-gradient(180deg, hsl(var(--card)), hsl(var(--card-2)));
    --gradient-text: linear-gradient(135deg, #1a8cff, #4da6ff);

    --container: 72rem; /* ~1152px */
    --nav-h: 4rem;

    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
      Helvetica, Arial, sans-serif;

    /* CTA arrow glyphs, drawn via CSS mask (see .arrow) */
    --ico-arrow-up-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10'/%3E%3Cpath d='M7 17 17 7'/%3E%3C/svg%3E");
    --ico-arrow-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E");
  }

  /* Layout web components render their markup in light DOM; the custom-element
     wrappers themselves shouldn't create boxes. */
  site-nav,
  site-footer { display: contents; }

  .container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1.5rem;
  }

  .page {
    position: relative;
    z-index: 1;
    padding-top: calc(var(--nav-h) + 3.5rem);
    padding-bottom: 4rem;

    /* Ambient hero glow behind the top of every page */
    &::before {
      content: "";
      position: absolute;
      inset-block-start: 0;
      inset-inline: 0;
      height: 700px;
      background: radial-gradient(60% 50% at 50% 0%, hsl(var(--primary) / 0.12), transparent 70%);
      z-index: -1;
      pointer-events: none;
    }
  }

  .section {
    margin-top: 4rem;
    &:first-of-type { margin-top: 0; }
  }
}

/* --------------------------------------------------------------------------
   components
   -------------------------------------------------------------------------- */
@layer components {
  /* inline text helpers */
  .gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .dcr { color: var(--dcr-blue); font-weight: 700; }
  .note { color: var(--yellow); font-weight: 600; }

  /* CTA arrow — single masked glyph, swappable via --arrow */
  .arrow {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    background: currentColor;
    -webkit-mask: var(--arrow, var(--ico-arrow-up-right)) center / contain no-repeat;
    mask: var(--arrow, var(--ico-arrow-up-right)) center / contain no-repeat;
    transition: transform 0.2s;
  }
  .arrow--right { --arrow: var(--ico-arrow-right); }

  /* ---- Top navigation ---- */
  .site-nav {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 50;
    height: var(--nav-h);
    background: hsl(var(--background) / 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid hsl(var(--border));
  }
  .site-nav__inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.15rem;
    flex-shrink: 0;

    & img { width: 32px; height: 32px; border-radius: 8px; }
  }

  .nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 1rem;
  }
  .nav-links {
    display: flex;
    align-items: center;
    gap: 1.35rem;
    margin-inline-start: 1rem;
    list-style: none;
    padding: 0;

    & a {
      color: hsl(var(--muted-foreground));
      font-weight: 500;
      font-size: 0.95rem;
      transition: color 0.2s;

      &:hover,
      &[aria-current="page"] { color: hsl(var(--foreground)); }
    }
  }

  .nav-actions {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
  }
  .lang-toggle {
    background: none;
    border: none;
    color: hsl(var(--muted-foreground));
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.3rem 0.25rem;
    transition: color 0.2s;

    &:hover { color: hsl(var(--foreground)); }
  }

  /* Mobile menu toggle (real <button>, JS-driven via [data-open]) */
  .nav-burger {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    background: hsl(var(--card));
    align-items: center;
    justify-content: center;

    & span,
    & span::before,
    & span::after {
      content: "";
      display: block;
      width: 18px;
      height: 2px;
      background: hsl(var(--foreground));
      position: relative;
      transition: transform 0.2s, opacity 0.2s;
    }
    & span::before { position: absolute; top: -6px; }
    & span::after { position: absolute; top: 6px; }
  }

  /* ---- Buttons ---- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1.1rem;
    border-radius: 0.6rem;
    border: 1px solid transparent;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s, border-color 0.2s;
    white-space: nowrap;

    /* arrow nudges on hover */
    &:hover .arrow { transform: translate(2px, -2px); }
  }
  .btn-primary {
    background: var(--dcr-blue);
    color: #000;
    &:hover { background: var(--dcr-blue-glow); box-shadow: var(--shadow-glow); }
  }
  .btn-block { width: 100%; }
  .btn-outline {
    background: hsl(var(--background));
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
    &:hover { border-color: hsl(var(--primary) / 0.5); background: hsl(var(--muted)); }
  }

  /* ---- Hero ---- */
  .hero {
    text-align: center;
    padding-block: 1rem 1.5rem;

    & h1 {
      font-weight: 800;
      font-size: clamp(2.75rem, 7vw, 4.5rem);
      line-height: 1.05;
      letter-spacing: -0.02em;
    }
    & p {
      margin-top: 1.25rem;
      color: hsl(var(--muted-foreground));
      font-size: clamp(1rem, 2.5vw, 1.25rem);
      max-width: 46rem;
      margin-inline: auto;
    }
  }

  /* ---- Section labels / headings ---- */
  .section-label {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
  }
  .section-head {
    text-align: center;
    margin-bottom: 2.5rem;

    & .eyebrow {
      display: inline-block;
      text-transform: uppercase;
      letter-spacing: 0.15em;
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--dcr-blue);
      margin-bottom: 0.75rem;
    }
    & h2 {
      font-size: clamp(1.9rem, 4vw, 2.6rem);
      font-weight: 800;
      letter-spacing: -0.01em;
    }
    & p {
      margin-top: 0.9rem;
      color: hsl(var(--muted-foreground));
      max-width: 44rem;
      margin-inline: auto;
    }
  }

  /* ---- Cards (shared) ---- */
  .card {
    background: var(--gradient-card);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;

    &:hover { border-color: hsl(var(--primary) / 0.4); }
  }

  /* Logo chip — contain on a black chip, matching the original */
  .logo {
    width: 64px;
    height: 64px;
    border-radius: 0.7rem;
    object-fit: contain;
    background: hsl(var(--background));
    flex-shrink: 0;
  }
  .logo--sm { width: 48px; height: 48px; }
  .logo--contain { object-fit: contain; }
  .logo--icon {
    display: grid;
    place-items: center;
    background: hsl(var(--muted));
    color: var(--dcr-blue);

    & svg { width: 30px; height: 30px; }
  }

  /* Badges */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
  }
  .badge-blue  { color: var(--dcr-blue); background: hsl(var(--primary) / 0.2); border-color: hsl(var(--primary) / 0.3); }
  .badge-green { color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
  .badge-soft  { color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); border-color: hsl(var(--border)); }
  .badge-purple{ color: #c084fc; background: hsl(270 95% 75% / 0.12); border-color: hsl(270 95% 75% / 0.3); }
  .badge-hw    { color: var(--dcr-blue); background: transparent; border-color: hsl(var(--border)); font-size: 0.7rem; padding: 0.1rem 0.45rem; }
  .badge-hw.green { color: var(--green); }

  /* category pill under a card title */
  .pill {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    padding: 0.15rem 0.6rem;
    border-radius: 0.4rem;
  }

  /* ---- Exchange cards (Primary) ---- */
  .primary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;

    @media (min-width: 768px) { grid-template-columns: 1fr 1fr; }
  }
  .xc {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
  }
  .xc__top { display: flex; align-items: flex-start; gap: 1rem; }
  .xc__titles { flex: 1; min-width: 0; }
  .xc__title { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
  .xc__pill { margin-top: 0.5rem; }
  .xc__desc { margin-top: 1rem; color: hsl(var(--muted-foreground)); }
  .xc__cta { margin-top: 1.5rem; }

  .features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    margin-top: 1.25rem;
  }
  .feat {
    position: relative;
    padding-inline-start: 1rem;
    font-size: 0.9rem;
    color: hsl(var(--foreground));

    &::before {
      content: "";
      position: absolute;
      inset-inline-start: 0;
      inset-block-start: 0.55em;
      width: 6px;
      height: 6px;
      border-radius: 999px;
      background: var(--dcr-blue);
    }
    &.red::before    { background: var(--red); }
    &.green::before  { background: var(--green); }
    &.yellow::before { background: var(--yellow); }
    &.orange::before { background: var(--orange); }
    &:empty { display: none; } /* hide localized-away features */
  }

  /* ---- Alternative exchanges grid ---- */
  .alt-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;

    @media (min-width: 768px) { grid-template-columns: 1fr 1fr; }
    @media (min-width: 1024px) { grid-template-columns: repeat(4, 1fr); }
  }
  .alt {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .alt__head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    & h3 { font-size: 1.2rem; font-weight: 700; }
  }
  .alt__desc { color: hsl(var(--muted-foreground)); font-size: 0.95rem; flex: 1; }

  /* ---- Instant swaps grid ---- */
  .swap-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;

    @media (min-width: 768px) { grid-template-columns: repeat(4, 1fr); }
  }
  .swap {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    text-align: center;
  }
  .swap__head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    & h3 { font-size: 1.05rem; font-weight: 700; }
  }

  /* ---- Notice / callout cards ---- */
  .notice {
    padding: 1.5rem 1.75rem;
    border-radius: var(--radius);

    & h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }
    & p { color: hsl(var(--muted-foreground)); }
  }
  .notice--info { border: 1px solid hsl(var(--primary) / 0.3); background: hsl(var(--primary) / 0.05); }
  .notice--warn { border: 1px solid hsl(45 90% 50% / 0.3); background: hsl(45 90% 50% / 0.05); }
  .notice--cake {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    border: 1px solid hsl(var(--border));
    background: var(--gradient-card);

    & img { width: 64px; height: 64px; border-radius: 0.6rem; }
  }

  /* ---- "Soon" + NEAR Intents ---- */
  .soon-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 30rem;
    opacity: 0.85;

    & img { width: 48px; height: 48px; border-radius: 0.5rem; }
    & h3 { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 0.6rem; }
    & p { color: hsl(var(--muted-foreground)); font-size: 0.95rem; margin-top: 0.25rem; }
  }

  /* ---- "Why choose" grid ---- */
  .why-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem 4rem;

    @media (min-width: 768px) { grid-template-columns: 1fr 1fr; }
  }
  .why {
    & h3 {
      font-size: 1.2rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
      display: flex;
      align-items: center;
      gap: 0.6rem;

      &::before {
        content: "";
        width: 0.4rem;
        height: 1.4rem;
        border-radius: 999px;
        background: var(--gradient-text);
      }
    }
    & p { color: hsl(var(--muted-foreground)); }
  }

  /* ---- Wallets page ---- */
  .wallet-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;

    @media (min-width: 768px) { grid-template-columns: repeat(3, 1fr); }
  }
  .wallet { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
  .wallet__head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    & h3 { font-size: 1.2rem; font-weight: 700; }
  }
  .wallet__badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
  .wallet__desc { color: hsl(var(--muted-foreground)); font-size: 0.95rem; flex: 1; }
  .platforms {
    font-size: 0.85rem;
    color: hsl(var(--muted-foreground));
  }
  .platforms__label { display: block; margin-bottom: 0.4rem; }
  .platforms__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
  .tag {
    font-size: 0.78rem;
    padding: 0.15rem 0.55rem;
    border-radius: 0.4rem;
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
  }

  /* ---- Community page ---- */
  .community-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;

    @media (min-width: 768px) { grid-template-columns: repeat(2, 1fr); }
    @media (min-width: 1024px) { grid-template-columns: repeat(3, 1fr); }
  }
  .comm { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
  .comm__head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    & h3 { font-size: 1.15rem; font-weight: 700; }
  }
  .comm__icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 0.7rem;
    background: hsl(var(--background));
    flex-shrink: 0;
    overflow: hidden;

    & img { width: 100%; height: 100%; object-fit: contain; }
    & svg { width: 20px; height: 20px; }
  }
  .comm__desc { color: hsl(var(--muted-foreground)); font-size: 0.95rem; flex: 1; }

  /* ---- About page — generic ---- */
  .about-section { margin-top: 5rem; }

  /* Bitcoin vs Decred comparison */
  .compare {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 768px;
    margin: 2.5rem auto 0;

    @media (min-width: 768px) { flex-direction: row; align-items: center; justify-content: center; }
  }
  .compare__col {
    padding: 2rem;
    @media (min-width: 768px) { flex: 1 1 0; max-width: 340px; }

    & h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.6rem; }
    & img { width: 32px; height: 32px; }
  }
  .compare__arrow {
    display: grid;
    place-items: center;
    color: var(--dcr-blue);
    flex: 0 0 auto;

    & svg { width: 1.75rem; height: 1.75rem; transform: rotate(90deg); }
    @media (min-width: 768px) { & svg { transform: none; } }
  }
  .compare__list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;

    & li {
      display: flex;
      align-items: flex-start;
      gap: 0.6rem;

      &::before {
        content: "";
        width: 1.25rem;
        height: 1.25rem;
        flex-shrink: 0;
        margin-top: 1px;
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a8cff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
      }
      &.x::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
      }
    }
  }
  .compare--btc h3 { color: #f7931a; }
  .compare--dcr h3 { color: var(--dcr-blue); }

  /* Innovation cards */
  .innov-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2.5rem;

    @media (min-width: 768px) { grid-template-columns: repeat(2, 1fr); }
    @media (min-width: 1024px) { grid-template-columns: repeat(4, 1fr); }
  }
  .innov {
    padding: 1.5rem;
    & h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
    & p { color: hsl(var(--muted-foreground)); font-size: 0.95rem; }
    & .ico { margin-bottom: 1rem; }
  }

  /* shared icon chip */
  .ico {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.7rem;
    display: grid;
    place-items: center;
    background: hsl(var(--primary) / 0.12);
    color: var(--dcr-blue);

    & svg { width: 1.45rem; height: 1.45rem; }
  }
  .ico--orange { background: hsl(24 94% 53% / 0.2); color: #fb923c; }
  .ico--green  { background: color-mix(in srgb, var(--green) 20%, transparent); color: #4ade80; }
  .flow__step .ico { margin: 0 auto 1rem; background: hsl(var(--primary) / 0.2); }
  .flow__step .ico.ico--orange { background: hsl(24 94% 53% / 0.2); }
  .flow__step .ico.ico--green { background: color-mix(in srgb, var(--green) 20%, transparent); }

  /* Quick stats */
  .stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2.5rem;

    @media (min-width: 768px) { grid-template-columns: repeat(3, 1fr); }
  }
  .stat { padding: 1.75rem; text-align: center; }
  .stat__value { font-size: 2.2rem; font-weight: 800; color: var(--dcr-blue); line-height: 1.1; }
  .stat__pct { color: hsl(var(--muted-foreground)); font-size: 0.9rem; margin-top: 0.25rem; }
  .stat__label { margin-top: 0.75rem; font-weight: 600; }
  .stat__sub { color: hsl(var(--muted-foreground)); font-size: 0.85rem; }

  /* big sovereignty / result panels */
  .panel {
    padding: 2rem;
    margin-top: 2.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background: linear-gradient(135deg, hsl(var(--primary) / 0.06), hsl(var(--card)));

    & h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.75rem; }
    & p { color: hsl(var(--muted-foreground)); }
  }

  /* Security architecture — merge diagram (PoW + PoS -> Finalized) */
  .sec-flow { margin: 2.5rem auto 0; max-width: 56rem; }
  .sec-flow__row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 1rem;

    @media (min-width: 768px) { flex-direction: row; align-items: center; }
  }
  .sec-card {
    padding: 1.5rem;
    border-color: hsl(var(--primary) / 0.3);

    @media (min-width: 768px) { flex: 1; }
    & p { color: hsl(var(--muted-foreground)); font-size: 0.92rem; }
  }
  .sec-card--green { border-color: color-mix(in srgb, var(--green) 30%, transparent); }
  .sec-card__head { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.85rem; }
  .sec-card__head .ico { flex-shrink: 0; }
  .sec-card__head h4 { font-size: 1.2rem; font-weight: 700; }
  .sec-card__label { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem; font-size: 0.9rem; font-weight: 500; }
  .sec-card__label::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 999px; flex-shrink: 0; }
  .sec-card__label.orange::before { background: #fb923c; }
  .sec-card__label.blue::before { background: var(--dcr-blue); }
  .sec-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0;

    @media (min-width: 768px) { flex-direction: row; padding: 0 1.25rem; }
  }
  .sec-divider__line { width: 1px; height: 1.75rem; }
  .sec-divider__line.orange { background: linear-gradient(to bottom, #fb923c, hsl(24 94% 53% / 0.4)); }
  .sec-divider__line.blue { background: linear-gradient(to top, var(--dcr-blue), hsl(210 100% 55% / 0.4)); }
  @media (min-width: 768px) {
    .sec-divider__line { width: 3.5rem; height: 1px; }
    .sec-divider__line.orange { background: linear-gradient(to right, #fb923c, hsl(24 94% 53% / 0.4)); }
    .sec-divider__line.blue { background: linear-gradient(to left, var(--dcr-blue), hsl(210 100% 55% / 0.4)); }
  }
  .sec-shield {
    margin: 0.5rem;
    padding: 0.7rem;
    border-radius: 999px;
    background: hsl(var(--primary) / 0.2);
    border: 1px solid hsl(var(--primary) / 0.4);
    color: var(--dcr-blue);
    display: grid;
    place-items: center;
    & svg { width: 1.4rem; height: 1.4rem; }
  }
  .sec-arrow {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
    color: #4ade80;
    & svg { width: 1.6rem; height: 1.6rem; }
  }
  .sec-finalized {
    display: flex;
    justify-content: center;
    & .sec-card { width: 100%; max-width: 28rem; }
  }
  .sec-result { max-width: 56rem; margin-inline: auto; }

  /* Pure PoW vs Hybrid */
  .versus {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem auto 0;
    max-width: 56rem;

    @media (min-width: 768px) { grid-template-columns: 1fr 1fr; }
  }
  .versus__col { padding: 1.75rem; }
  .versus__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    & h4 { font-weight: 700; font-size: 1.15rem; }
  }
  .versus__ico {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    & svg { width: 1.4rem; height: 1.4rem; }
  }
  .versus--bad {
    border: 1px solid hsl(0 84% 60% / 0.25);
    & .versus__ico { background: hsl(0 84% 60% / 0.2); color: #f87171; }
    & .versus__list li::before { content: "\2717"; color: var(--red); }
  }
  .versus--good {
    border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
    & .versus__ico { background: color-mix(in srgb, var(--green) 20%, transparent); color: #4ade80; }
    & .versus__list li::before { content: "\2713"; color: var(--green); }
  }
  .versus__list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    & li { display: flex; gap: 0.6rem; color: hsl(var(--muted-foreground)); }
    & li::before { font-weight: 700; flex-shrink: 0; }
  }

  /* StakeShuffle steps */
  .shuffle {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 2.5rem;

    @media (min-width: 768px) { grid-template-columns: repeat(5, 1fr); }
  }
  .shuffle__step {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    & h4 { font-weight: 700; margin-bottom: 0.6rem; }
    & .ico { margin: 0.25rem auto 0.75rem; }
    & p { color: hsl(var(--muted-foreground)); font-size: 0.85rem; margin-top: auto; padding-top: 0.75rem; }
  }
  .shuffle__step--green { border-color: color-mix(in srgb, var(--green) 30%, transparent); }
  .shuffle__num {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6rem;
    display: grid;
    place-items: center;
    background: hsl(var(--primary) / 0.15);
    color: var(--dcr-blue);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.85rem;
  }
  .shuffle__chip {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dcr-blue);
    margin-bottom: 0.25rem;
  }
  .shuffle__chip--green { color: #4ade80; }
  .shuffle__sub { color: hsl(var(--muted-foreground)); font-size: 0.78rem; }
  .nodes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin: 0.25rem 0 0.5rem;
  }
  .node {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.45rem;
    background: hsl(var(--primary) / 0.1);
    border: 1px solid hsl(var(--primary) / 0.2);
    font-size: 0.8rem;
    text-align: start;

    & .dot { color: var(--dcr-blue); font-weight: 700; }
    & .coin { width: 16px; height: 16px; border-radius: 999px; margin-inline-start: auto; }
  }
  .node--green { background: color-mix(in srgb, var(--green) 10%, transparent); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
  .node--green .dot { color: #4ade80; }

  /* Treasury distribution */
  .treasury-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2.5rem;
    align-items: center;

    @media (min-width: 768px) { grid-template-columns: 1fr 1fr; }
  }
  .donut {
    position: relative;
    width: min(18rem, 78vw);
    aspect-ratio: 1;
    margin-inline: auto;
  }
  .donut__svg { width: 100%; height: 100%; transform: rotate(-90deg); }
  .donut__svg circle { fill: none; stroke-width: 12; }
  .donut__track { stroke: hsl(var(--muted-foreground) / 0.15); }
  .donut__seg { stroke-linecap: round; }
  .donut__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .donut__center .big { font-size: 2.6rem; font-weight: 800; color: var(--dcr-blue); line-height: 1.1; }
  .donut__center > span:last-child { color: hsl(var(--muted-foreground)); font-size: 0.95rem; }
  .seg-miners { stroke: hsl(var(--muted-foreground) / 0.4); }
  .seg-voters { stroke: hsl(var(--primary) / 0.5); }
  .seg-treasury { stroke: #4ade80; }
  .legend {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    & li { display: flex; align-items: center; gap: 0.6rem; font-weight: 500; }
    & .sw { width: 0.85rem; height: 0.85rem; border-radius: 4px; flex-shrink: 0; }
    & .sw.miners { background: hsl(var(--muted-foreground) / 0.4); }
    & .sw.voters { background: hsl(var(--primary) / 0.5); }
    & .sw.treasury { background: #4ade80; }
  }
  .legend__title { font-weight: 700; margin-bottom: 0.25rem; }

  .treasury-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2.5rem;
  }
  .tstat {
    padding: 1.5rem;
    position: relative;

    & .l { color: hsl(var(--muted-foreground)); font-size: 0.9rem; }
    & .v { font-size: 1.9rem; font-weight: 800; color: var(--dcr-blue); margin-top: 0.25rem; }
    & .ico { position: absolute; inset-block-start: 1.25rem; inset-inline-end: 1.25rem; }
  }
  .tstat--wide { grid-column: 1 / -1; }
  .tstat--wide .v { font-size: 2.4rem; }

  /* How treasury spending works */
  .steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
    position: relative;

    @media (min-width: 768px) {
      grid-template-columns: repeat(5, 1fr);
      /* connecting line behind the treasury step icons */
      &::before {
        content: "";
        position: absolute;
        z-index: 0;
        inset-block-start: 1.75rem;
        inset-inline: 12%;
        height: 1px;
        background: hsl(var(--border));
      }
    }
  }
  .steps__item {
    text-align: center;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;

    & h4 { font-weight: 700; margin-bottom: 0.25rem; }
    & p { color: hsl(var(--muted-foreground)); font-size: 0.85rem; }
  }
  .steps__icon {
    position: relative;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.8rem;
    display: grid;
    place-items: center;
    background: hsl(var(--primary) / 0.12);
    color: var(--dcr-blue);
    margin-bottom: 0.85rem;

    & svg { width: 1.55rem; height: 1.55rem; }
    & .num {
      position: absolute;
      inset-block-start: -0.45rem;
      inset-inline-end: -0.45rem;
      width: 1.5rem;
      height: 1.5rem;
      border-radius: 999px;
      display: grid;
      place-items: center;
      font-size: 0.78rem;
      font-weight: 700;
      background: var(--dcr-blue);
      color: #000;
    }
  }

  /* ---- Footer ---- */
  .site-footer {
    border-top: 1px solid hsl(var(--border));
    margin-top: 5rem;
    padding-block: 2.5rem;

    & .container { display: flex; flex-direction: column; gap: 1.25rem; align-items: center; text-align: center; }
  }
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    list-style: none;
    padding: 0;

    & a { color: hsl(var(--muted-foreground)); font-size: 0.95rem; transition: color 0.2s; }
    & a:hover { color: var(--dcr-blue); }
  }
  .footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    & img { width: 28px; height: 28px; border-radius: 7px; }
  }
  .footer-copy { color: hsl(var(--muted-foreground)); font-size: 0.85rem; }

  /* Centre the nav links on desktop (brand stays left, actions right) */
  @media (min-width: 768px) {
    .site-nav__inner { position: relative; }
    .nav-links {
      position: absolute;
      inset-inline-start: 50%;
      inset-block-start: 50%;
      transform: translate(-50%, -50%);
      margin: 0;
    }
  }

  /* Mobile nav behaviour (JS-driven open state via [data-open]) */
  @media (max-width: 767px) {
    .nav-burger { display: inline-flex; margin-inline-start: auto; order: 3; }
    .nav-menu {
      position: fixed;
      inset-block-start: var(--nav-h);
      inset-inline: 0;
      flex-direction: column;
      align-items: stretch;
      gap: 0.25rem;
      padding: 0.75rem 1.5rem 1.25rem;
      background: hsl(var(--background) / 0.98);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid hsl(var(--border));
      transform: translateY(-135%);
      transition: transform 0.25s ease;
      visibility: hidden;
    }
    .nav-links {
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      margin: 0;

      & li { width: 100%; }
      & a { display: block; padding: 0.75rem 0; font-size: 1.05rem; }
    }
    .nav-actions {
      margin: 0.5rem 0 0;
      gap: 1.25rem;
      & .btn-primary { flex: 1; }
    }
    .site-nav[data-open] {
      & .nav-menu { transform: translateY(0); visibility: visible; }
      & .nav-burger span { background: transparent; }
      & .nav-burger span::before { transform: rotate(45deg); top: 0; }
      & .nav-burger span::after { transform: rotate(-45deg); top: 0; }
    }
  }
}

/* --------------------------------------------------------------------------
   utilities — no-JS fallback chrome (only rendered inside <noscript>)
   -------------------------------------------------------------------------- */
@layer utilities {
  .fallback-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    padding: 0.75rem 1.5rem;
    background: hsl(var(--background) / 0.95);
    border-bottom: 1px solid hsl(var(--border));
    backdrop-filter: blur(12px);

    & a { color: hsl(var(--muted-foreground)); font-weight: 500; font-size: 0.95rem; }
    & a:first-child { color: hsl(var(--foreground)); font-weight: 700; margin-inline-end: auto; }
  }
  .fallback-foot {
    border-top: 1px solid hsl(var(--border));
    margin-top: 5rem;
    padding: 2rem 1.5rem;
    text-align: center;
    color: hsl(var(--muted-foreground));
    font-size: 0.9rem;

    & a { color: hsl(var(--muted-foreground)); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
