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

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
  }

  body,
  h1,
  h2,
  h3,
  p,
  ul {
    margin: 0;
  }

  body {
    min-width: 320px;
  }

  img {
    max-width: 100%;
  }

  a {
    color: inherit;
  }
}

@layer base {
  :root {
    --paper: #f7f4ee;
    --surface: #fffdf8;
    --ink: #171a18;
    --muted: #59605a;
    --line: #bfc4bc;
    --accent: #146b61;
    --accent-strong: #0a4942;
    --accent-two: #f2b84b;
    --signal: #edf7f2;
    --display: "Bodoni 72", Didot, "Baskerville", "Book Antiqua", Georgia, serif;
    --body: Aptos, "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
    --page-width: 1180px;
    --gutter: 28px;
  }

  html.theme-security {
    --paper: #f2f6f2;
    --surface: #fcfffb;
    --accent: #087f5b;
    --accent-strong: #03543d;
    --accent-two: #d7f04d;
    --signal: #e3f3e8;
  }

  html.theme-finance {
    --paper: #f6f4ec;
    --surface: #fffdf7;
    --accent: #236b68;
    --accent-strong: #12433f;
    --accent-two: #f1b94f;
    --signal: #e5f0ed;
  }

  html.theme-music {
    --paper: #f8f1ed;
    --surface: #fffaf7;
    --accent: #c63d32;
    --accent-strong: #7f211a;
    --accent-two: #31a8a0;
    --signal: #f9e1dc;
  }

  html.theme-education {
    --paper: #f3f5f8;
    --surface: #fff;
    --accent: #375eaa;
    --accent-strong: #263f72;
    --accent-two: #e7b94b;
    --signal: #e5ebf7;
  }

  html.theme-twice-exceptional {
    --paper: #fbf5f0;
    --surface: #fffdfb;
    --accent: #bf5d43;
    --accent-strong: #763827;
    --accent-two: #2e8d78;
    --signal: #e6f3ed;
  }

  html.theme-generic {
    --paper: #f4f4ef;
    --surface: #fffefa;
    --accent: #126b5e;
    --accent-strong: #0a453d;
    --accent-two: #eeac39;
    --signal: #e1f0eb;
  }

  body {
    color: var(--ink);
    background-color: var(--paper);
    background-image:
      linear-gradient(rgb(23 26 24 / 0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgb(23 26 24 / 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.65;
    letter-spacing: 0;
  }

  h1,
  h2,
  h3 {
    font-family: var(--display);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: 0;
    text-wrap: balance;
  }

  h1 {
    font-size: 72px;
  }

  h2 {
    font-size: 42px;
  }

  h3 {
    font-size: 25px;
  }

  a:focus-visible,
  button:focus-visible {
    outline: 3px solid var(--accent-two);
    outline-offset: 4px;
  }

  ::selection {
    color: var(--ink);
    background: var(--accent-two);
  }
}

@layer layout {
  .site-header,
  .site-footer,
  .hero,
  .principles-band,
  .content-band,
  .network-band,
  .definition-band,
  .notice-band,
  .availability-band,
  .sponsor-band,
  .ad-band {
    width: min(calc(100% - (var(--gutter) * 2)), var(--page-width));
    margin-inline: auto;
  }

  .site-header {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--line);
    background: rgb(247 244 238 / 0.92);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .site-header nav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 14px;
    font-weight: 700;
  }

  .site-header nav a {
    text-decoration: none;
    border-bottom: 2px solid transparent;
  }

  .site-header nav a:hover {
    border-color: var(--accent);
  }

  .wordmark {
    display: grid;
    gap: 0;
    text-decoration: none;
  }

  .wordmark-name {
    font-family: var(--display);
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
  }

  .wordmark-domain {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1;
  }

  .hero {
    min-height: min(650px, calc(100svh - 140px));
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.65fr);
    align-items: center;
    gap: 68px;
    padding-block: 72px 82px;
  }

  .hero-copy {
    max-width: 780px;
  }

  .hero-copy h1 {
    max-width: 15ch;
    margin-top: 18px;
  }

  .hero-summary {
    max-width: 65ch;
    margin-top: 26px;
    color: var(--muted);
    font-size: 20px;
  }

  .hero-signal {
    min-height: 250px;
    align-self: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 34px;
    border: 1px solid var(--accent-strong);
    border-top-width: 8px;
    border-radius: 4px;
    background: var(--signal);
    box-shadow: 10px 10px 0 var(--accent-two);
    overflow-wrap: anywhere;
  }

  .hero-signal strong {
    font-family: var(--display);
    font-size: 34px;
    line-height: 1.05;
  }

  .principles-band,
  .content-band,
  .network-band,
  .definition-band,
  .notice-band,
  .availability-band,
  .sponsor-band {
    padding-block: 88px;
    border-top: 1px solid var(--line);
  }

  .section-heading {
    display: grid;
    grid-template-columns: minmax(200px, 0.65fr) minmax(0, 1.35fr);
    column-gap: 60px;
    row-gap: 14px;
    margin-bottom: 48px;
  }

  .section-heading .eyebrow {
    grid-column: 1;
  }

  .section-heading h2 {
    grid-column: 2;
    grid-row: 1 / span 2;
    max-width: 18ch;
  }

  .section-heading > p:last-child {
    grid-column: 1;
    max-width: 48ch;
    color: var(--muted);
  }

  .principles-grid,
  .resource-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--ink);
  }

  .principle,
  .resource-card {
    min-width: 0;
    padding: 28px 28px 30px 0;
    border-bottom: 1px solid var(--ink);
  }

  .principle + .principle,
  .resource-card + .resource-card {
    padding-left: 28px;
    border-left: 1px solid var(--line);
  }

  .principle h3,
  .resource-card h3 {
    margin: 18px 0 12px;
  }

  .principle p,
  .resource-card p {
    color: var(--muted);
  }

  .definition-band {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(250px, 0.8fr);
    gap: 68px;
    border-top-color: var(--accent);
  }

  .definition-copy h2 {
    max-width: 17ch;
    margin: 16px 0 24px;
  }

  .definition-copy > p:last-child {
    max-width: 64ch;
    color: var(--muted);
    font-size: 19px;
  }

  .definition-list {
    display: grid;
    align-content: center;
    gap: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--ink);
  }

  .definition-list li {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--display);
    font-size: 24px;
  }

  .notice-band {
    background: var(--signal);
    border-top: 8px solid var(--accent);
    padding-inline: 36px;
  }

  .notice-band h2 {
    max-width: 19ch;
    margin: 12px 0 18px;
  }

  .notice-band > p:last-child {
    max-width: 75ch;
    color: var(--muted);
  }

  .resource-list,
  .network-list {
    border-top: 1px solid var(--ink);
  }

  .resource-row,
  .network-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding-block: 24px;
    border-bottom: 1px solid var(--line);
  }

  .resource-row p {
    max-width: 64ch;
    margin-top: 6px;
    color: var(--muted);
  }

  .network-link {
    text-decoration: none;
  }

  .network-link:hover strong {
    color: var(--accent);
  }

  .network-link > span:first-child {
    display: grid;
    gap: 3px;
  }

  .network-link strong {
    font-family: var(--display);
    font-size: 24px;
  }

  .network-link small {
    max-width: 70ch;
    color: var(--muted);
  }

  .network-domain {
    flex: 0 0 auto;
    font-weight: 700;
  }

  .availability-band,
  .sponsor-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    color: #fff;
    background: var(--ink);
    padding-inline: 42px;
    border: 0;
  }

  .availability-band h2,
  .sponsor-band h2 {
    margin: 10px 0 14px;
  }

  .availability-band > div,
  .sponsor-band > div {
    max-width: 720px;
  }

  .availability-status {
    max-width: 640px;
    font-family: var(--display);
    font-size: 28px;
    line-height: 1.25;
  }

  .contact-card {
    flex: 0 0 auto;
    display: grid;
    justify-items: start;
    gap: 14px;
  }

  .contact-prompt,
  .contact-note {
    color: #d8ddd8;
    font-size: 15px;
  }

  .contact-address {
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    text-underline-offset: 4px;
    overflow-wrap: anywhere;
  }

  .availability-band .eyebrow,
  .sponsor-band .eyebrow {
    color: var(--accent-two);
  }

  .affiliate-band {
    border-top-color: var(--accent-two);
  }

  .ad-band {
    display: grid;
    place-items: center;
    min-height: 120px;
    margin-block: 32px;
    padding: 24px;
    border: 1px dashed var(--line);
    background: var(--surface);
  }

  .ad-label {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
  }

  .site-footer {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding-block: 34px 54px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
  }

  .error-page {
    width: min(calc(100% - 48px), 760px);
    min-height: 100svh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
  }
}

@layer components {
  .skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    transform: translateY(-160%);
    padding: 10px 14px;
    color: #fff;
    background: var(--ink);
  }

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

  .eyebrow {
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 34px;
    padding: 11px 18px;
    border: 1px solid var(--ink);
    border-radius: 3px;
    color: var(--surface);
    background: var(--ink);
    font-family: inherit;
    font-size: inherit;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
  }

  .button:hover {
    color: var(--ink);
    background: var(--accent-two);
  }

  .button--light {
    flex: 0 0 auto;
    margin-top: 0;
    color: var(--ink);
    background: #fff;
  }

  .signal-pulse {
    width: 11px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 7px rgb(8 127 91 / 0.14);
    animation: signal 2.4s ease-out infinite;
  }

  .principle-number,
  .resource-index {
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .text-link {
    flex: 0 0 auto;
    color: var(--accent-strong);
    font-weight: 800;
    text-underline-offset: 4px;
  }

  .affiliate-disclosure {
    color: var(--muted);
    font-size: 14px;
  }

  @keyframes signal {
    0% {
      box-shadow: 0 0 0 0 rgb(8 127 91 / 0.25);
    }
    70%,
    100% {
      box-shadow: 0 0 0 14px rgb(8 127 91 / 0);
    }
  }
}

@layer responsive {
  @media (max-width: 900px) {
    h1 {
      font-size: 54px;
    }

    h2 {
      font-size: 36px;
    }

    .hero {
      grid-template-columns: 1fr;
      min-height: 0;
      gap: 44px;
      padding-block: 54px 70px;
    }

    .hero-copy h1 {
      max-width: 17ch;
    }

    .hero-signal {
      min-height: 0;
      width: min(100%, 620px);
      padding: 24px;
      box-shadow: 7px 7px 0 var(--accent-two);
    }

    .section-heading {
      grid-template-columns: 1fr;
    }

    .section-heading .eyebrow,
    .section-heading h2,
    .section-heading > p:last-child {
      grid-column: 1;
      grid-row: auto;
    }

    .principles-grid,
    .resource-grid {
      grid-template-columns: 1fr;
    }

    .principle,
    .resource-card,
    .principle + .principle,
    .resource-card + .resource-card {
      padding: 24px 0;
      border-left: 0;
    }

    .definition-band {
      grid-template-columns: 1fr;
    }

    .availability-band,
    .sponsor-band {
      align-items: flex-start;
      flex-direction: column;
    }
  }

  @media (max-width: 620px) {
    :root {
      --gutter: 18px;
    }

    body {
      font-size: 16px;
    }

    h1 {
      font-size: 40px;
    }

    h2 {
      font-size: 32px;
    }

    h3 {
      font-size: 23px;
    }

    .site-header {
      min-height: 74px;
      gap: 12px;
    }

    .site-header nav {
      gap: 12px;
      font-size: 12px;
    }

    .wordmark-name {
      max-width: 13ch;
      font-size: 20px;
      overflow-wrap: anywhere;
    }

    .wordmark-domain {
      max-width: 18ch;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .hero {
      padding-block: 44px 60px;
    }

    .hero-summary {
      font-size: 18px;
    }

    .principles-band,
    .content-band,
    .network-band,
    .definition-band,
    .notice-band,
    .availability-band,
    .sponsor-band {
      padding-block: 58px;
    }

    .notice-band,
    .availability-band,
    .sponsor-band {
      padding-inline: 24px;
    }

    .section-heading {
      gap: 14px;
      margin-bottom: 34px;
    }

    .resource-row,
    .network-link {
      align-items: flex-start;
      flex-direction: column;
      gap: 14px;
    }

    .network-domain {
      overflow-wrap: anywhere;
    }

    .site-footer {
      flex-direction: column;
      gap: 10px;
    }
  }

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

    .signal-pulse {
      animation: none;
    }
  }
}
