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

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; overflow-x: clip; }
  body { min-width: 320px; margin: 0; }
  img { display: block; max-width: 100%; }
  h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; }
  a { color: inherit; }
  button, input { font: inherit; }
  :focus-visible { outline: 3px solid var(--signal); outline-offset: 4px; }
}

@layer base {
  :root {
    --paper: oklch(92% .03 190);
    --paper-2: oklch(96% .016 92);
    --ink: oklch(20% .04 238);
    --muted: oklch(43% .03 230);
    --line: oklch(72% .04 205);
    --accent: oklch(49% .12 164);
    --accent-dark: oklch(31% .08 164);
    --signal: oklch(52% .19 28);
    --white: oklch(97% .012 92);
    --display: "Jura", sans-serif;
    --body: "Commissioner", sans-serif;
    --shell: min(1460px, calc(100vw - 32px));
  }
  body { background: var(--paper); color: var(--ink); font-family: var(--body); line-height: 1.58; text-rendering: optimizeLegibility; }
  .shell { width: var(--shell); margin-inline: auto; }
  h1, h2, h3, .brand, .article-facts dd, .hero-facts dd { font-family: var(--display); }
  h1 { font-size: clamp(3.5rem, 7vw, 8rem); font-weight: 600; letter-spacing: -.075em; line-height: .86; }
  h2 { font-size: clamp(2.6rem, 5.2vw, 6rem); font-weight: 600; letter-spacing: -.065em; line-height: .92; }
  h3 { font-size: clamp(1.35rem, 2vw, 2rem); line-height: 1.12; }
  .eyebrow, .section-label { color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
  .skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 12px 16px; background: var(--signal); color: var(--white); transform: translateY(-160%); }
  .skip-link:focus { transform: none; }
}

@layer components {
  .site-header { min-height: 82px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(24px, 4vw, 70px); border-bottom: 1px solid var(--line); }
  .brand { width: max-content; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
  .brand__mark { display: grid; width: 38px; height: 38px; place-items: center; background: var(--accent); color: var(--white); font-size: .92rem; }
  .brand__name { font-size: 1.3rem; letter-spacing: -.05em; }
  .brand__name span { color: var(--accent); }
  .site-nav { display: flex; justify-content: flex-end; gap: clamp(20px, 3vw, 48px); }
  .site-nav a { min-height: 44px; display: inline-flex; align-items: center; font-size: .8rem; font-weight: 700; text-decoration: none; }
  .site-nav a[aria-current="page"] { color: var(--accent); }
  .header-cta, .button { min-height: 54px; display: inline-flex; align-items: center; justify-content: space-between; gap: 26px; padding: 0 22px; border: 1px solid transparent; background: var(--accent); color: var(--white); font-weight: 700; text-decoration: none; }
  .header-cta span, .button span { font-size: 1.1em; }
  .hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
  .text-link { min-height: 48px; display: inline-flex; align-items: center; border-bottom: 1px solid currentColor; font-size: .88rem; font-weight: 700; text-decoration: none; }
  .cta-band { min-height: 390px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 60px; padding: clamp(40px, 7vw, 100px); background: var(--ink); color: var(--white); overflow: hidden; position: relative; }
  .cta-band::after { position: absolute; right: -80px; bottom: -190px; content: "74"; color: color-mix(in oklch, var(--accent) 24%, transparent); font-family: var(--display); font-size: 28rem; font-weight: 700; line-height: 1; pointer-events: none; }
  .cta-band > * { position: relative; z-index: 1; }
  .cta-band > div { display: grid; gap: 20px; }
  .cta-band h2 { max-width: 900px; }
  .cta-band p:not(.section-label) { max-width: 58ch; color: color-mix(in oklch, var(--white) 70%, transparent); }
  .cta-band .section-label { color: var(--white); }
  .cta-band .button { background: var(--signal); }
  .site-footer { min-height: 190px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 70px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
  .site-footer p { max-width: 70ch; }
  .site-footer nav { display: flex; gap: 28px; }
  .site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; text-decoration: none; }
}

@layer pages {
  .home-hero { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; padding-top: 28px; overflow: hidden; }
  .home-hero::before, .article-hero::before { position: absolute; z-index: -1; left: -120px; top: 40px; width: 420px; height: 420px; border: 1px solid color-mix(in oklch, var(--accent) 28%, transparent); border-radius: 50%; box-shadow: 0 0 0 88px color-mix(in oklch, var(--accent) 7%, transparent), 0 0 0 176px color-mix(in oklch, var(--accent) 5%, transparent); content: ""; }
  .home-hero__copy { min-height: 650px; display: flex; flex-direction: column; justify-content: center; gap: 30px; padding: 56px 54px 60px 28px; }
  .home-hero h1 span { color: var(--signal); }
  .hero-lead { max-width: 660px; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.24rem); line-height: 1.62; }
  .home-hero__media { min-height: 650px; overflow: hidden; clip-path: polygon(10% 0,100% 0,100% 100%,0 100%,0 13%); position: relative; }
  .home-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 65% center; }
  .home-hero__media figcaption { position: absolute; right: 0; bottom: 0; padding: 13px 18px; background: var(--ink); color: var(--white); font-size: .7rem; }
  .hero-code { position: absolute; z-index: 2; right: 34px; top: 50px; display: flex; align-items: center; gap: 12px; color: var(--white); font-family: var(--display); }
  .hero-code b { font-size: 3.6rem; line-height: 1; }
  .hero-code span { font-size: .7rem; font-weight: 700; letter-spacing: .18em; }
  .hero-facts { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.35fr .7fr; background: var(--ink); color: var(--white); }
  .hero-facts div { min-height: 136px; display: grid; align-content: center; gap: 9px; padding: 26px 30px; border-right: 1px solid color-mix(in oklch, var(--white) 18%, transparent); }
  .hero-facts dt { color: color-mix(in oklch, var(--white) 65%, transparent); font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
  .hero-facts dd { font-size: clamp(1.5rem, 2.8vw, 3.2rem); font-weight: 700; line-height: 1; }
  .hero-note { grid-column: 1 / -1; display: flex; gap: 40px; padding: 22px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
  .hero-note span { color: var(--signal); font-weight: 700; }

  .first-check, .route, .directory, .sources, .related { padding-block: clamp(90px, 10vw, 160px); }
  .first-check > header, .route > header, .directory > header, .related > header { display: grid; gap: 22px; }
  .first-check > header { max-width: 1040px; }
  .check-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 70px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .check-grid article { min-height: 310px; display: flex; flex-direction: column; gap: 22px; padding: 32px; }
  .check-grid article + article { border-left: 1px solid var(--line); }
  .check-grid article > span { color: var(--signal); font-family: var(--display); font-weight: 700; }
  .check-grid article p { color: var(--muted); }
  .check-grid article a { min-height: 44px; margin-top: auto; width: max-content; display: inline-flex; align-items: center; font-size: .82rem; font-weight: 700; text-decoration: none; }
  .route { background: var(--paper-2); padding-inline: clamp(24px, 5vw, 80px); }
  .route header { max-width: 900px; }
  .route header > p:last-child { max-width: 60ch; color: var(--muted); }
  .route ol { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 70px; padding: 0; border-block: 1px solid var(--line); list-style: none; }
  .route li { min-height: 180px; display: flex; flex-direction: column; justify-content: space-between; padding: 26px 22px; }
  .route li + li { border-left: 1px solid var(--line); }
  .route b { color: var(--signal); font-family: var(--display); font-size: 1.35rem; }
  .route span { font-weight: 700; }
  .directory { display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(50px, 8vw, 120px); }
  .directory nav, .related nav { border-top: 1px solid var(--line); }
  .directory nav a, .related nav a { min-height: 90px; display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 22px; border-bottom: 1px solid var(--line); text-decoration: none; }
  .directory nav span, .related nav span { color: var(--signal); font-family: var(--display); font-size: .74rem; font-weight: 700; }
  .directory nav strong, .related nav strong { font-family: var(--display); font-size: clamp(1.1rem, 1.8vw, 1.75rem); }
  .directory nav i, .related nav i { color: var(--accent); font-style: normal; }
  .sources { display: grid; grid-template-columns: .8fr 1.2fr; gap: 80px; border-top: 1px solid var(--line); }
  .sources > div { display: grid; align-content: start; gap: 24px; }
  .sources nav { border-top: 1px solid var(--line); }
  .sources nav a { min-height: 110px; display: grid; gap: 4px; align-content: center; border-bottom: 1px solid var(--line); text-decoration: none; }
  .sources nav strong { font-family: var(--display); font-size: 1.35rem; }
  .sources nav span { color: var(--muted); font-size: .84rem; }

  .article-hero { position: relative; min-height: 680px; display: grid; grid-template-columns: 1fr 280px; align-items: center; gap: 80px; padding: clamp(70px, 9vw, 130px) clamp(18px, 5vw, 70px); border-bottom: 1px solid var(--line); overflow: hidden; }
  .article-hero > div:first-child { display: grid; gap: 30px; }
  .article-hero h1 { max-width: 1060px; font-size: clamp(3.4rem, 6.8vw, 7.5rem); }
  .article-hero__mark { width: 240px; height: 240px; display: grid; place-content: center; background: var(--ink); color: var(--white); clip-path: polygon(18% 0,100% 0,100% 82%,82% 100%,0 100%,0 18%); text-align: center; }
  .article-hero__mark b { font-family: var(--display); font-size: 6rem; line-height: .9; }
  .article-hero__mark span { color: var(--white); font-size: .72rem; font-weight: 700; letter-spacing: .2em; }
  .article-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
  .article-facts div { min-height: 100px; display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 14px; padding: 20px; }
  .article-facts div + div { border-left: 1px solid var(--line); }
  .article-facts dt { color: var(--signal); font-weight: 700; }
  .article-facts dd { font-size: clamp(1rem, 1.6vw, 1.45rem); font-weight: 700; line-height: 1.15; }
  .article-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(60px, 8vw, 120px); padding-block: 110px; }
  .toc { position: sticky; top: 30px; height: max-content; }
  .toc > p { margin-bottom: 20px; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
  .toc nav { border-top: 1px solid var(--line); }
  .toc a { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .78rem; line-height: 1.35; text-decoration: none; }
  .toc a span { color: var(--signal); font-family: var(--display); font-weight: 700; }
  .article-body { min-width: 0; }
  .content-section { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 28px; padding: 0 0 86px; scroll-margin-top: 24px; }
  .content-section + .content-section { padding-top: 72px; border-top: 1px solid var(--line); }
  .content-index { padding-top: 12px; color: var(--signal); font-family: var(--display); font-weight: 700; }
  .content-section > div { display: grid; gap: 24px; }
  .content-section h2 { max-width: 1050px; font-size: clamp(2.8rem, 4.7vw, 5.3rem); }
  .content-section p { max-width: 72ch; color: var(--muted); font-size: clamp(1rem, 1.25vw, 1.14rem); line-height: 1.72; }
  .content-section ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin-top: 12px; padding: 0; border-top: 1px solid var(--line); list-style: none; }
  .content-section li { min-height: 64px; display: flex; align-items: center; padding: 14px 18px 14px 24px; border-bottom: 1px solid var(--line); position: relative; }
  .content-section li::before { position: absolute; left: 4px; color: var(--signal); content: "■"; font-size: .48rem; }
  .content-section li:nth-child(even) { border-left: 1px solid var(--line); }
  .article-body > .cta-band { width: 100%; min-height: 330px; margin: 20px 0 90px; grid-template-columns: 1fr; padding: 54px; }
  .article-body > .cta-band h2 { font-size: clamp(2.4rem, 4vw, 4.6rem); }
  .article-body > .cta-band .button { width: max-content; }
  .faq { padding-top: 60px; scroll-margin-top: 24px; }
  .faq header { display: grid; gap: 20px; margin-bottom: 48px; }
  .faq details { border-top: 1px solid var(--line); }
  .faq details:last-child { border-bottom: 1px solid var(--line); }
  .faq summary { min-height: 86px; display: grid; grid-template-columns: 1fr 34px; align-items: center; gap: 20px; padding: 18px 0; cursor: pointer; font-weight: 700; list-style: none; }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary i { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); font-style: normal; }
  .faq summary i::before { content: "+"; }
  .faq details[open] summary i::before { content: "−"; }
  .faq details p { max-width: 72ch; padding: 0 50px 28px 0; color: var(--muted); line-height: 1.7; }
  .article-sources { display: grid; gap: 30px; padding-block: 64px 88px; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
  .article-sources h2 { font-size: clamp(2.5rem, 4.2vw, 4.8rem); }
  .article-sources nav { border-top: 1px solid var(--line); }
  .article-sources a { min-height: 92px; display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 4px 24px; border-bottom: 1px solid var(--line); text-decoration: none; }
  .article-sources strong { font-family: var(--display); font-size: clamp(1.05rem, 1.5vw, 1.3rem); }
  .article-sources span { color: var(--muted); font-size: .86rem; }
  .article-sources i { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--accent); font-style: normal; }
  .related { display: grid; grid-template-columns: .65fr 1.35fr; gap: 80px; background: var(--paper-2); padding-inline: clamp(24px, 5vw, 80px); }
}

@layer responsive {
  @media (max-width: 1050px) {
    .site-nav { display: none; }
    .site-header { grid-template-columns: 1fr auto; }
    .home-hero { grid-template-columns: 1fr 1fr; }
    .home-hero__copy { padding-left: 18px; padding-right: 30px; }
    .directory, .sources, .related { grid-template-columns: 1fr; }
    .article-layout { grid-template-columns: 1fr; }
    .toc { position: static; }
    .toc nav { display: grid; grid-template-columns: repeat(2, 1fr); }
    .toc a:nth-child(even) { border-left: 1px solid var(--line); padding-left: 16px; }
  }
  @media (max-width: 760px) {
    :root { --shell: calc(100vw - 24px); }
    h1 { font-size: clamp(3.2rem, 16vw, 5rem); }
    h2 { font-size: clamp(2.4rem, 12vw, 4rem); overflow-wrap: anywhere; }
    .site-header { min-height: 70px; }
    .header-cta { min-height: 46px; padding-inline: 14px; font-size: .76rem; }
    .header-cta span { display: none; }
    .brand__mark { width: 34px; height: 34px; }
    .brand__name { font-size: 1.06rem; }
    .home-hero { display: flex; flex-direction: column; padding-top: 0; }
    .home-hero__copy { min-height: auto; padding: 72px 4px 48px; }
    .home-hero__media { min-height: 430px; }
    .hero-code { top: auto; right: 18px; bottom: 476px; }
    .hero-actions { align-items: stretch; }
    .hero-actions .button, .hero-actions .text-link { width: 100%; }
    .hero-facts { grid-template-columns: 1fr; }
    .hero-facts div { min-height: 104px; border-right: 0; border-bottom: 1px solid color-mix(in oklch, var(--white) 18%, transparent); }
    .hero-note { align-items: flex-start; gap: 18px; }
    .check-grid { grid-template-columns: 1fr; }
    .check-grid article { min-height: 230px; }
    .check-grid article + article { border-left: 0; border-top: 1px solid var(--line); }
    .cta-band { min-height: 500px; grid-template-columns: 1fr; align-content: center; gap: 34px; padding: 48px 24px 110px; }
    .cta-band > * { min-width: 0; }
    .cta-band::after { right: -50px; bottom: -130px; font-size: 20rem; }
    .cta-band .button { width: 100%; }
    .route { padding-inline: 24px; }
    .route ol { grid-template-columns: 1fr; }
    .route li { min-height: 112px; }
    .route li + li { border-left: 0; border-top: 1px solid var(--line); }
    .directory nav a, .related nav a { grid-template-columns: 40px 1fr auto; gap: 12px; }
    .sources { gap: 50px; }
    .site-footer { grid-template-columns: 1fr; gap: 18px; padding: 50px 0; }
    .site-footer nav { flex-wrap: wrap; }
    .article-hero { min-height: 0; grid-template-columns: 1fr; gap: 54px; padding: 76px 4px 44px; }
    .article-hero h1 { font-size: clamp(2.55rem, 10.5vw, 4rem); overflow-wrap: break-word; hyphens: auto; }
    .article-hero__mark { width: 150px; height: 150px; margin-left: auto; }
    .article-hero__mark b { font-size: 4rem; }
    .article-facts { grid-template-columns: 1fr; }
    .article-facts div + div { border-left: 0; border-top: 1px solid var(--line); }
    .article-layout { gap: 72px; padding-block: 80px; }
    .toc nav { grid-template-columns: 1fr; }
    .toc a:nth-child(even) { border-left: 0; padding-left: 0; }
    .content-section { grid-template-columns: 1fr; gap: 18px; padding-bottom: 70px; }
    .content-section + .content-section { padding-top: 60px; }
    .content-section h2 { font-size: clamp(2.45rem, 11vw, 3.8rem); }
    .content-section ul { grid-template-columns: 1fr; }
    .content-section li:nth-child(even) { border-left: 0; }
    .article-body > .cta-band { padding: 44px 22px 100px; }
    .article-body > .cta-band .button { width: 100%; }
    .faq summary { min-height: 74px; }
    .related { padding-inline: 24px; gap: 50px; }
  }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
}
