@layer reset, tokens, base, layout, components, domains, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { min-inline-size: 320px; scroll-behavior: smooth; }
  body, h1, h2, h3, p, ul { margin: 0; }
  img { display: block; max-inline-size: 100%; block-size: auto; }
  a { color: inherit; }
}

@layer tokens {
  :root {
    --black: #08070a;
    --charcoal: #151219;
    --cream: #fff3dc;
    --cream-2: #f7e3bd;
    --white: #fffaf2;
    --chrome: #e8e8ee;
    --magenta: #ff2aa1;
    --magenta-deep: #8c0059;
    --rose: #bc2c79;
    --ink-soft: rgba(255, 250, 242, 0.78);
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
    --radius-lg: clamp(24px, 4vw, 54px);
    --radius-md: clamp(18px, 2.4vw, 32px);
    --space-page: clamp(18px, 5vw, 80px);
    --space-section: clamp(48px, 9vw, 132px);
    --max: 1180px;
    --ease: cubic-bezier(.2, .9, .2, 1);
  }

  [data-site="com"] {
    --page-bg: var(--black);
    --surface: rgba(255, 255, 255, 0.075);
    --surface-strong: rgba(255, 255, 255, 0.13);
    --text: var(--white);
    --text-muted: var(--ink-soft);
    --line: rgba(255, 255, 255, 0.18);
    --cta-bg: var(--cream);
    --cta-text: var(--black);
    --accent-text: #ff6fbd;
    --panel-bg: radial-gradient(circle at 78% 20%, rgba(255,42,161,.38), transparent 34%), linear-gradient(145deg, #17131c, #050407 72%);
  }

  [data-site="org"] {
    --page-bg: #fff2d9;
    --surface: rgba(8, 7, 10, 0.07);
    --surface-strong: rgba(8, 7, 10, 0.11);
    --text: #0c0a0d;
    --text-muted: rgba(12, 10, 13, 0.76);
    --line: rgba(12, 10, 13, 0.22);
    --cta-bg: #0c0a0d;
    --cta-text: var(--cream);
    --accent-text: var(--magenta-deep);
    --panel-bg: radial-gradient(circle at 24% 18%, rgba(255,42,161,.24), transparent 30%), linear-gradient(145deg, #fff8e8, #e9c98f 72%);
  }
}

@layer base {
  body {
    min-block-size: 100vh;
    overflow-x: clip;
    background: var(--page-bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .72;
    background:
      linear-gradient(120deg, transparent 0 26%, rgba(255, 42, 161, .12) 26% 27.5%, transparent 27.5% 100%),
      radial-gradient(circle at 12% 12%, rgba(255,255,255,.10), transparent 28%),
      radial-gradient(circle at 88% 76%, rgba(255,42,161,.10), transparent 26%);
    z-index: -1;
  }

  [data-site="org"] body::before {
    opacity: .55;
    background:
      linear-gradient(120deg, transparent 0 24%, rgba(140,0,89,.14) 24% 25.5%, transparent 25.5% 100%),
      radial-gradient(circle at 80% 8%, rgba(140,0,89,.12), transparent 28%),
      radial-gradient(circle at 16% 86%, rgba(8,7,10,.10), transparent 24%);
  }

  h1, h2 {
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
    font-weight: 850;
    letter-spacing: -0.06em;
    line-height: .88;
    overflow-wrap: break-word;
    overflow-wrap: normal;
    word-break: normal;
  }

  h1 { font-size: clamp(4.1rem, 9.5vw, 8.25rem); max-inline-size: 11ch; }
  h2 { font-size: clamp(2.3rem, 8vw, 6.3rem); max-inline-size: 11ch; }

  p, li { font-size: clamp(1rem, 1.45vw, 1.18rem); }

  :focus-visible {
    outline: 4px solid var(--magenta);
    outline-offset: 5px;
    border-radius: 10px;
  }

  ::selection { background: var(--magenta); color: var(--black); }
}

@layer layout {
  .skip-link {
    position: fixed;
    inset-block-start: 12px;
    inset-inline-start: 12px;
    z-index: 20;
    transform: translateY(-160%);
    background: var(--cta-bg);
    color: var(--cta-text);
    padding: .8rem 1rem;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
  }

  .skip-link:focus { transform: translateY(0); }

  .site-header,
  .hero,
  .section-stack,
  .site-footer {
    inline-size: min(calc(100% - (var(--space-page) * 2)), var(--max));
    margin-inline: auto;
  }

  .site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: clamp(20px, 4vw, 42px);
  }

  .brand-lockup,
  .header-meta,
  .cta-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(290px, .78fr);
    gap: clamp(24px, 5vw, 72px);
    align-items: center;
    min-block-size: min(760px, calc(100vh - 110px));
    padding-block: clamp(20px, 6vw, 70px) var(--space-section);
  }

  .hero-copy,
  .visual-panel,
  .statement-band,
  .fact-rail,
  .split-section,
  .checklist-section,
  .r4m-route {
    min-inline-size: 0;
  }

  .hero-copy,
  .section-stack,
  .statement-band,
  .fact-rail,
  .split-section,
  .checklist-section,
  .r4m-route {
    min-inline-size: 0;
  }

  .section-stack {
    display: grid;
    gap: clamp(28px, 5vw, 64px);
    padding-block-end: var(--space-section);
  }

  .site-footer {
    border-block-start: 1px solid var(--line);
    padding-block: clamp(28px, 6vw, 52px);
    color: var(--text-muted);
  }
}

@layer components {
  .brand-pip {
    inline-size: 28px;
    block-size: 28px;
    border-radius: 50%;
    background:
      linear-gradient(135deg, var(--cream) 0 42%, var(--magenta) 42% 58%, transparent 58%),
      var(--charcoal);
    box-shadow: 0 0 0 1px var(--line), 0 0 28px rgba(255,42,161,.36);
  }

  .brand-name {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 950;
    letter-spacing: -0.035em;
  }

  .domain-badge,
  .role-badge,
  .section-kicker,
  .eyebrow,
  .visual-caption,
  .support-note,
  .boundary-ribbon {
    color: var(--text-muted);
  }

  .domain-badge,
  .role-badge,
  .section-kicker {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .38rem .7rem;
    background: var(--surface);
    font-size: .85rem;
    font-weight: 800;
  }

  .section-kicker {
    display: inline-flex;
    margin-block-end: 1rem;
    color: var(--accent-text);
  }

  .header-link,
  .cta {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-block-size: 44px;
    border-radius: 999px;
    font-weight: 900;
    text-decoration: none;
    transition: transform .22s var(--ease), background .22s var(--ease), color .22s var(--ease), border-color .22s var(--ease);
  }

  .header-link {
    padding: .6rem .9rem;
    background: var(--surface-strong);
    border: 1px solid var(--line);
  }

  .cta {
    padding: .88rem 1.12rem;
    border: 1px solid var(--line);
  }

  .cta.primary { background: var(--cta-bg); color: var(--cta-text); border-color: transparent; }
  .cta.secondary { background: transparent; color: var(--text); }

  .header-link:hover,
  .cta:hover { transform: translateY(-2px); }

  .eyebrow {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    font-weight: 850;
    margin-block-end: 1.15rem;
  }

  .hero-body {
    max-inline-size: 660px;
    margin-block-start: 1.25rem;
    color: var(--text-muted);
    font-size: clamp(1.18rem, 2.2vw, 1.62rem);
  }

  .support-note,
  .boundary-ribbon {
    max-inline-size: 650px;
    margin-block-start: 1rem;
    border-inline-start: 4px solid var(--magenta);
    padding: .9rem 1rem;
    background: var(--surface);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
  }

  .boundary-ribbon strong { color: var(--text); }

  .cta-row { margin-block-start: 1.5rem; }

  .visual-panel {
    position: relative;
    min-block-size: 0;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel-bg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: 0;
  }

  .visual-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 52%, rgba(8, 7, 10, .78) 100%);
    pointer-events: none;
  }

  .visual-panel::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: calc(var(--radius-lg) - 12px);
    pointer-events: none;
    z-index: 3;
  }

  [data-site="org"] .visual-panel::before { border-color: rgba(8,7,10,.18); }

  .visual-picture,
  .hero-image {
    display: block;
    inline-size: 100%;
    block-size: 100%;
  }

  .visual-picture {
    position: absolute;
    inset: 0;
  }

  .hero-image {
    object-fit: cover;
    object-position: center;
  }

  .visual-accent {
    position: absolute;
    display: block;
    z-index: 2;
    inline-size: 48%;
    block-size: 8px;
    inset-inline-end: -8%;
    inset-block-start: 12%;
    transform: rotate(-12deg);
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--magenta), var(--cream));
    box-shadow: 0 0 28px rgba(255, 42, 161, .55);
  }

  .visual-caption {
    position: absolute;
    inset-inline: clamp(20px, 3vw, 32px);
    inset-block-end: clamp(18px, 3vw, 30px);
    max-inline-size: 30ch;
    font-size: .86rem;
    z-index: 4;
    color: #fffaf2;
    text-shadow: 0 2px 16px rgba(0,0,0,.8);
  }

  .statement-band,
  .fact-rail,
  .split-section,
  .checklist-section,
  .r4m-route {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 5vw, 62px);
  }

  .statement-band {
    display: grid;
    gap: clamp(18px, 4vw, 42px);
    grid-template-columns: minmax(0, .72fr) minmax(260px, 1fr);
    align-items: end;
  }

  .statement-band .section-kicker { grid-column: 1 / -1; justify-self: start; }
  .statement-band p { color: var(--text-muted); font-size: clamp(1.12rem, 2vw, 1.55rem); }

  .fact-rail {
    display: grid;
    grid-template-columns: minmax(0, .55fr) minmax(280px, 1fr);
    gap: clamp(22px, 5vw, 64px);
  }

  .fact-rail .section-kicker { grid-column: 1 / -1; justify-self: start; }

  .fact-list,
  .check-list {
    display: grid;
    gap: .9rem;
    padding: 0;
    list-style: none;
  }

  .fact-list li,
  .check-list li {
    position: relative;
    padding: 1rem 1rem 1rem 3.1rem;
    border-block-start: 1px solid var(--line);
    color: var(--text-muted);
  }

  .fact-list li::before,
  .check-list li::before {
    content: "";
    position: absolute;
    inset-inline-start: .35rem;
    inset-block-start: 1.25rem;
    inline-size: 1.15rem;
    block-size: 1.15rem;
    border-radius: 50%;
    background: var(--magenta);
    box-shadow: 0 0 0 7px rgba(255,42,161,.14);
  }

  .split-section {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: clamp(20px, 5vw, 70px);
    align-items: start;
  }

  .split-section .section-kicker { grid-column: 1 / -1; justify-self: start; }
  .split-section p { color: var(--text-muted); font-size: clamp(1.08rem, 2vw, 1.45rem); }

  .checklist-section p { color: var(--text-muted); margin-block: 1.1rem 1.4rem; }

  .r4m-route {
    background:
      linear-gradient(135deg, rgba(255,42,161,.18), transparent 46%),
      var(--surface-strong);
  }

  .r4m-route p { color: var(--text-muted); max-inline-size: 62ch; margin-block-start: 1rem; }
}

@layer domains {
  [data-site="com"] .hero h1 {
    text-shadow: 0 0 42px rgba(255,42,161,.20);
  }

  [data-site="com"] .statement-band {
    background:
      linear-gradient(105deg, rgba(255,42,161,.18), transparent 42%),
      var(--surface);
  }

  [data-site="org"] .hero {
    grid-template-columns: minmax(290px, .82fr) minmax(0, 1fr);
  }

  [data-site="org"] .hero-copy { order: 2; }
  [data-site="org"] .visual-panel { order: 1; }

  [data-site="org"] h1,
  [data-site="org"] h2 { letter-spacing: -0.055em; }

  [data-site="org"] h1 {
    font-size: clamp(4rem, 9vw, 8rem);
    max-inline-size: 8ch;
  }

  [data-site="org"] .mission-standard,
  [data-site="org"] .checklist-section {
    background:
      radial-gradient(circle at 90% 10%, rgba(140,0,89,.13), transparent 34%),
      var(--surface);
  }
}

@layer responsive {
  @media (max-width: 900px) {
    .site-header { align-items: flex-start; flex-direction: column; }
    .hero,
    [data-site="org"] .hero {
      grid-template-columns: 1fr;
      min-block-size: auto;
      padding-block-start: 16px;
    }
    [data-site="org"] .hero-copy,
    [data-site="org"] .visual-panel { order: initial; }
    .visual-panel {
      min-block-size: 0;
      aspect-ratio: 16 / 9;
    }
    .statement-band,
    .fact-rail,
    .split-section { grid-template-columns: 1fr; }
    h1 { max-inline-size: 8.5ch; }
  }

  @media (max-width: 560px) {
    :root { --space-page: 16px; }
    .domain-badge,
    .role-badge { font-size: .78rem; }
    .header-link { inline-size: 100%; justify-content: center; }
    h1 { font-size: clamp(3.15rem, 15vw, 4rem); max-inline-size: 100%; }
    h2 { font-size: clamp(2.35rem, 12vw, 3.45rem); max-inline-size: 100%; }
    .hero-body { font-size: 1.08rem; }
    .cta-row { align-items: stretch; flex-direction: column; }
    .cta { justify-content: center; inline-size: 100%; }
    .visual-panel { border-radius: 28px; }
    h1,
    [data-site="org"] h1 {
      max-inline-size: 100%;
      font-size: clamp(3.25rem, 15.5vw, 4.1rem);
      letter-spacing: -0.05em;
    }
    h2 { max-inline-size: 100%; }
    .statement-band,
    .fact-rail,
    .split-section,
    .checklist-section,
    .r4m-route { border-radius: 28px; }
  }

  @media (prefers-reduced-motion: no-preference) {
    .visual-accent { animation: accent-shift 9s var(--ease) infinite alternate; }
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
      animation-duration: .001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: .001ms !important;
    }
  }

  @keyframes accent-shift {
    from { transform: rotate(-12deg) translateX(-5%); }
    to { transform: rotate(-8deg) translateX(8%); }
  }
}
