/* ============================================================
   Brand landing — page-scoped styles
   Hero (cyber background + cover composition), principles, chapter
   grid, palette, marquee, motion-tile section. All other widget
   styling comes from ../shared/tokens.css + base.css + components.css.
   ============================================================ */
  /* Cover page-specific styles */
  .cover-hero { background: var(--rk-ink); color: var(--paper);
    padding: clamp(96px, 14vw, 200px) 0 clamp(64px, 9vw, 140px);
    position: relative; overflow: hidden; min-height: 100svh;
    display: flex; align-items: center; }
  .cover-hero::before { content:''; position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 40%, rgba(58,93,192,0.36), transparent 55%),
                radial-gradient(circle at 75% 70%, rgba(198,223,223,0.10), transparent 60%);
    pointer-events: none; z-index: 0; }
  .cover-hero::after { content:''; position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 72px 72px; mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
    pointer-events: none; z-index: 0; }
  .cover-hero__inner { position: relative; z-index: 2; width: 100%; }
  .cover-eyebrow { color: var(--mist-100); font-size: clamp(11px, 1.4vw, 13px);
    letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
    opacity: 0; animation: fadeIn 1s var(--ease-out) 200ms forwards;
    display: inline-flex; align-items: center; gap: 14px; }
  .cover-eyebrow::before { content:''; width: 32px; height: 1px; background: var(--mist-100); opacity: 0.6; }
  /* Logo block — width-capped so the inline SVG scales to fit any viewport */
  .cover-logo { width: clamp(220px, 56vw, 580px); max-width: 100%;
    margin: clamp(20px, 4vw, 36px) 0 clamp(18px, 3vw, 28px);
    opacity: 0; animation: fadeIn 1.2s var(--ease-out) 100ms forwards; }
  .cover-logo svg { width: 100% !important; height: auto !important; display: block; }
  .cover-title { font-family: var(--font-display);
    font-size: clamp(40px, 7vw, 96px); font-weight: 300;
    line-height: 1.02; letter-spacing: -0.035em;
    color: var(--paper); max-width: 920px;
    opacity: 0; animation: fadeIn 1s var(--ease-out) 700ms forwards;
    transform: translateY(20px);
    animation-fill-mode: forwards;
  }
  @keyframes coverTitleIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .cover-title { animation: coverTitleIn 1s var(--ease-out) 700ms forwards; }
  .cover-title em { font-style: italic; font-weight: 300; color: var(--mist-100); }
  .cover-sub { font-size: clamp(16px, 1.5vw, 22px); line-height: 1.55;
    color: rgba(243,248,248,0.72); max-width: 600px; margin-top: clamp(18px, 3vw, 28px);
    opacity: 0; animation: coverTitleIn 1s var(--ease-out) 900ms forwards; }
  .cover-actions { display: flex; gap: 12px; margin-top: clamp(24px, 4vw, 40px);
    flex-wrap: wrap;
    opacity: 0; animation: coverTitleIn 1s var(--ease-out) 1100ms forwards; }

  /* ================================================================
     Animated cyber-security backdrop
     Layered above the radial gradient + grid (.cover-hero::before/::after)
     but below the .cover-hero__inner content (z-index 2).
     ================================================================ */
  .cyber-bg { position: absolute; inset: 0; z-index: 1; pointer-events: none;
    overflow: hidden;
    opacity: 0; animation: cyber-fade-in 1.4s var(--ease-out) 350ms forwards; }
  @keyframes cyber-fade-in { to { opacity: 1; } }

  /* Constellation — static. One idea, told once. The radar + scan carry the motion. */
  .cyber-bg__net { position: absolute; inset: 0;
    width: 100%; height: 100%; overflow: visible; }
  .cyber-bg__edges line {
    stroke: var(--mist-100); stroke-width: 1;
    stroke-dasharray: 6 6; opacity: 0.18;
  }
  .cyber-bg__nodes circle {
    fill: var(--mist-100);
    filter: drop-shadow(0 0 6px rgba(58,93,192,0.65));
    opacity: 0.55;
  }

  /* Radar pulse — concentric circles expanding outward (slow & deliberate) */
  .cyber-bg__radar { position: absolute;
    right: clamp(-80px, -6vw, -40px); bottom: clamp(-80px, -6vw, -40px);
    width: clamp(240px, 36vw, 460px); aspect-ratio: 1; }
  .cyber-bg__ring { position: absolute; inset: 0;
    border: 1px solid var(--mist-100); border-radius: 50%;
    opacity: 0; animation: cyber-ring 8s ease-out infinite; }
  @keyframes cyber-ring {
    0%   { transform: scale(0.16); opacity: 0; }
    8%   { opacity: 0.40; }
    100% { transform: scale(1.25); opacity: 0; }
  }
  .cyber-bg__radar-core { position: absolute; top: 50%; left: 50%;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--mist-100); transform: translate(-50%, -50%);
    box-shadow: 0 0 24px 4px rgba(198,223,223,0.45); opacity: 0.55; }

  /* Thin glowing horizontal scan line — slower than before, no longer busy */
  .cyber-bg__scan { position: absolute; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(198,223,223,0.75), transparent);
    box-shadow: 0 0 24px 2px rgba(198,223,223,0.28);
    animation: cyber-scan 12s linear infinite; opacity: 0; }
  @keyframes cyber-scan {
    0%   { top: -4%; opacity: 0; }
    8%   { opacity: 0.45; }
    92%  { opacity: 0.45; }
    100% { top: 104%; opacity: 0; }
  }

  /* Mono code strings — static, label the scene rather than animate it */
  .cyber-bg__code { position: absolute; font-family: var(--font-mono);
    font-size: clamp(9.5px, 1.05vw, 11.5px); letter-spacing: 0.06em;
    color: rgba(198,223,223,0.45); display: flex; flex-direction: column;
    gap: 4px; line-height: 1.4; opacity: 1; }
  .cyber-bg__code--tl { top: clamp(80px, 13vh, 140px); left: clamp(20px, 4vw, 60px); }
  .cyber-bg__code--br { bottom: clamp(80px, 13vh, 140px); right: clamp(20px, 4vw, 60px); text-align: right; align-items: flex-end; }

  /* Reduced motion: still calm; only the two remaining loops need silencing */
  @media (prefers-reduced-motion: reduce) {
    .cyber-bg { opacity: 1; animation: none; }
    .cyber-bg__ring,
    .cyber-bg__scan { animation: none; opacity: 0.4; }
    .cyber-bg__scan { display: none; }
  }

  /* Mobile tweaks — dial back density so the hero doesn't feel busy */
  @media (max-width: 720px) {
    .cyber-bg__code--tl { top: 78px; }
    .cyber-bg__code--br { bottom: 78px; }
    .cyber-bg__code span:nth-child(3) { display: none; }
    .cyber-bg__radar { right: -50px; bottom: -50px; width: 240px; }
  }
  @media (max-width: 480px) {
    .cyber-bg__code { font-size: 9.5px; }
    .cyber-bg__code span:nth-child(2) { display: none; }
    .cover-hero { padding-top: 88px; }
  }

  /* Section anchors */
  .grid-section { padding: clamp(80px, 12vw, 160px) 0; background: var(--paper); }
  .grid-cards { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: var(--s-9); }
  @media (min-width: 560px) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
  @media (min-width: 920px) { .grid-cards { grid-template-columns: repeat(3, 1fr); } }
  .grid-card { padding: var(--s-6); background: var(--paper-2);
    border-radius: var(--r-2xl); box-shadow: var(--shadow-2);
    transition: box-shadow var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
    cursor: pointer; display: flex; flex-direction: column; gap: var(--s-3);
    min-height: 240px; position: relative; overflow: hidden; }
  @media (min-width: 560px) { .grid-card { padding: var(--s-8); min-height: 280px; } }
  .grid-card:hover { box-shadow: var(--shadow-4); transform: translateY(-4px); }
  .grid-card:hover .grid-card__arrow { transform: translate(4px, -4px); color: var(--blue-100); }
  .grid-card__num { font-family: var(--font-mono); font-size: 13px; color: var(--accent); font-weight: 500; letter-spacing: 0.04em; }
  .grid-card__title { font-family: var(--font-display); font-size: clamp(22px, 4.5vw, 28px); font-weight: 600; letter-spacing: -0.022em; margin-top: 6px; }
  .grid-card__desc { font-size: 15px; line-height: 1.55; color: var(--text-soft); flex: 1; }
  .grid-card__arrow { position: absolute; top: var(--s-5); right: var(--s-5);
    color: var(--text-mute);
    transition: transform var(--dur-3) var(--ease-out), color var(--dur-3) var(--ease-out); }
  @media (min-width: 560px) { .grid-card__arrow { top: var(--s-7); right: var(--s-7); } }
  .grid-card__preview { margin-top: var(--s-4); display: flex; gap: 6px; align-items: center; }

  /* Mini color preview swatches */
  .swatch { width: 28px; height: 28px; border-radius: 8px; box-shadow: var(--shadow-1); }

  /* Color preview section */
  .color-strip { display: grid; grid-template-columns: repeat(4, 1fr);
    border-radius: var(--r-2xl); overflow: hidden; box-shadow: var(--shadow-3); }
  .color-strip__cell { padding: var(--s-9) var(--s-7) var(--s-7);
    min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
    transition: filter var(--dur-3) var(--ease-out); }
  .color-strip__cell:hover { filter: brightness(1.04); }
  .color-strip__hex { font-family: var(--font-mono); font-size: 13px; opacity: 0.78; letter-spacing: 0.03em; }
  .color-strip__name { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }

  /* Pillars block */
  .pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); margin-top: var(--s-9); }
  @media (max-width: 720px) { .pillars { grid-template-columns: 1fr; } }
  .pillar { padding: var(--s-7); background: var(--paper-2); border-radius: var(--r-xl); box-shadow: var(--shadow-1); }
  .pillar__num { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.06em; }
  .pillar__h { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin: 8px 0 10px; }
  .pillar__d { font-size: 15px; line-height: 1.55; color: var(--text-soft); }

  /* Marquee section */
  .marquee { padding: 80px 0; background: var(--rk-ink); color: var(--paper); overflow: hidden; }
  .marquee__inner { display: flex; gap: 80px; white-space: nowrap;
    animation: marquee 32s linear infinite; }
  .marquee__item { font-family: var(--font-display); font-size: clamp(48px, 6vw, 88px);
    font-weight: 300; letter-spacing: -0.035em; opacity: 0.45; }
  .marquee__item .em-serif { font-style: italic; color: var(--mist-100); opacity: 1; }
  @keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

  /* Motion · Product cards & spinners ============================
     Compact display of every variant from the cards lab. The lab
     uses `.card-grid` with a 4-card showcase; here we constrain it
     to a single column so each variant gets its own tile. */
  .motion-section { padding: clamp(80px, 12vw, 160px) 0; background: var(--paper); }
  .motion-section + .motion-section { padding-top: 0; }
  .motion-group { margin-top: var(--s-9); }
  .motion-group + .motion-group { margin-top: var(--s-10); }
  .motion-group__h { display: flex; align-items: baseline; gap: var(--s-4); margin-bottom: var(--s-6);
    padding-bottom: var(--s-3); border-bottom: 1px solid var(--ink-8); flex-wrap: wrap; }
  @media (max-width: 720px) {
    .motion-group__h { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
    .motion-group__tag { flex: none; }
  }
  @media (hover: none) {
    .motion-group__count { display: none; }
  }
  .motion-group__eb { font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
  .motion-group__title { font-family: var(--font-display); font-size: clamp(18px, 3.5vw, 22px); font-weight: 600;
    letter-spacing: -0.018em; }
  .motion-group__tag { font-size: 14px; color: var(--text-soft); font-style: italic; flex: 1; }
  .motion-group__count { font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); letter-spacing: 0.08em; }

  /* Tile grid — one tile per variant, hover the card to see the motion */
  .motion-tiles { display: grid; grid-template-columns: 1fr; gap: 18px; }
  @media (min-width: 720px)  { .motion-tiles { grid-template-columns: repeat(2, 1fr); } }
  @media (min-width: 1100px) { .motion-tiles { grid-template-columns: repeat(3, 1fr); } }
  .motion-tile { background: var(--paper-2); border-radius: var(--r-xl);
    box-shadow: var(--shadow-1); padding: var(--s-5);
    display: flex; flex-direction: column; gap: var(--s-4); }
  .motion-tile__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
  .motion-tile__title { font-family: var(--font-display); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
  .motion-tile__id { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-mute); letter-spacing: 0.05em; }
  .motion-tile__note { font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); margin: -4px 0 0; }
  .motion-tile__hint { font-size: 11px; color: var(--text-mute); font-style: italic; }
  /* Force the lab's grid to single column inside our tile so we get
     one card per variant — the variant--* class on the same wrapper
     keeps the animation selectors matching. */
  .motion-tile .card-grid { grid-template-columns: 1fr; gap: 0; }
  .motion-tile .rk-card { min-height: 200px; }

  /* Spinner grid uses the lab's existing .spinner-grid / .spinner-cell;
     we just bound its containing section to the brand page width. */
  .motion-spinners { margin-top: var(--s-7); }
  /* Inline animations referenced above */
  @keyframes cardDot { 0% { left: 0; } 50% { left: calc(100% - 6px); } 100% { left: 0; } }
