@layer reset, base, layout, components, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { overflow-x: clip; scroll-behavior: smooth; }
  body { margin: 0; min-width: 320px; }
  img { display: block; max-width: 100%; }
  a { color: inherit; }
  button, input, textarea, select { font: inherit; }
  h1, h2, h3, p, dl, dd { margin: 0; }
  ul, ol { margin: 0; padding: 0; }
  :focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
}

@layer base {
  :root {
    --paper: oklch(94% .018 236);
    --surface: oklch(88% .025 236);
    --ink: oklch(25% .035 250);
    --muted: oklch(49% .026 250);
    --line: oklch(77% .025 236);
    --accent: oklch(59% .19 28);
    --accent-ink: oklch(96% .012 236);
    --dark: oklch(22% .04 250);
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
    --space-4xl: 64px;
    --space-5xl: 96px;
    --shell: min(1440px, calc(100vw - 32px));
    --display: "Alumni Sans", sans-serif;
    --body: "Golos Text", sans-serif;
  }

  body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    line-height: 1.56;
    text-rendering: optimizeLegibility;
  }

  h1, h2, h3 {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: -.045em;
  }

  h2 { font-size: clamp(3rem, 6.2vw, 7.4rem); line-height: .84; }
  .shell { width: var(--shell); margin-inline: auto; }
  .section-label, .eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
  .section-label { color: var(--accent); }
  .skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 12px 16px; background: var(--accent); color: var(--accent-ink); transform: translateY(-160%); }
  .skip-link:focus { transform: none; }
}

@layer layout {
  .site-header { position: relative; z-index: 20; border-bottom: 1px solid var(--line); }
  .site-header__inner { min-height: 84px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 48px; }
  .brand { display: inline-flex; width: max-content; align-items: center; gap: 10px; text-decoration: none; }
  .brand__mark { display: grid; width: 36px; height: 36px; place-items: center; background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-size: 1.25rem; font-weight: 800; line-height: 1; }
  .brand__name { font-family: var(--display); font-size: 1.48rem; font-weight: 700; letter-spacing: -.035em; line-height: 1; }
  .brand__name span { color: var(--accent); }
  .site-nav { display: flex; align-items: center; justify-content: flex-end; gap: clamp(20px, 3vw, 48px); }
  .site-nav > a:not(.header-cta) { font-size: .78rem; font-weight: 600; text-decoration: none; }
  .site-nav > a[aria-current="page"] { color: var(--accent); }
  .menu-toggle, .mobile-nav { display: none; }
  .content-flow { padding-top: clamp(32px, 5vw, 72px); }
  .mobile-cta { display: none; }
}

@layer components {
  .button, .header-cta {
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 0 22px;
    border: 1px solid transparent;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
  }
  .button--primary, .header-cta { background: var(--accent); color: var(--accent-ink); }
  .button--dark { background: var(--dark); color: var(--paper); }
  .text-link { display: inline-flex; min-height: 44px; align-items: center; border-bottom: 1px solid currentColor; font-size: .86rem; font-weight: 700; text-decoration: none; }
  .hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }

  .home-hero { position: relative; min-height: min(780px, calc(100vh - 84px)); overflow: hidden; isolation: isolate; }
  .home-hero__media, .home-hero__overlay { position: absolute; inset: 0; }
  .home-hero__media { z-index: -3; right: 0; left: 48%; background: url("/assets/home-hero-v2.webp") 72% center / auto 100% no-repeat; }
  .home-hero__overlay { z-index: -2; background: linear-gradient(90deg, var(--paper) 0 45%, color-mix(in oklch, var(--paper) 88%, transparent) 50%, transparent 59%); }
  .home-hero__content { display: grid; min-width: 0; min-height: inherit; max-width: none; align-content: center; gap: var(--space-xl); padding: var(--space-3xl) 52% 184px clamp(var(--space-xl), 4vw, var(--space-4xl)); }
  .home-hero h1 { max-width: none; font-size: clamp(5.25rem, 7vw, 7.25rem); line-height: .76; }
  .home-hero h1 span { display: block; width: max-content; max-width: 100%; margin-top: .1em; color: var(--accent); font-size: .72em; line-height: .84; white-space: nowrap; }
  .home-hero__lead { max-width: 55ch; color: var(--muted); font-size: clamp(1rem, 1.45vw, 1.28rem); }
  .home-hero__route { position: absolute; z-index: 1; top: 28px; right: 2vw; display: flex; align-items: center; gap: 14px; }
  .home-hero__route strong { font-family: var(--display); font-size: 3.3rem; line-height: 1; }
  .home-hero__route i { width: 56px; height: 1px; background: currentColor; }
  .home-hero__route span { font-size: .7rem; font-weight: 700; letter-spacing: .16em; }
  .hero-facts { position: absolute; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--dark); color: var(--paper); }
  .hero-facts div { display: grid; min-height: 148px; align-content: end; gap: 5px; padding: 22px 30px; border-right: 1px solid color-mix(in oklch, var(--paper) 17%, transparent); }
  .hero-facts div:last-child { border-right: 0; }
  .hero-facts small { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
  .hero-facts strong { font-family: var(--display); font-size: clamp(2rem, 3.4vw, 3.8rem); line-height: .9; }
  .intro-strip { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); font-size: .8rem; }
  .intro-strip > span { color: var(--accent); font-weight: 800; }
  .intro-strip p:nth-child(2) { max-width: 78ch; }
  .intro-strip p:last-child { color: var(--muted); }

  .internal-hero { position: relative; min-height: 610px; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--line); }
  .internal-hero__media, .internal-hero__overlay { position: absolute; inset: 0; }
  .internal-hero__media { z-index: -3; left: 58%; background: url("/assets/hero.webp") 60% 32% / cover no-repeat; filter: saturate(.7); }
  .internal-hero__overlay { z-index: -2; background: linear-gradient(90deg, var(--paper) 0 57%, color-mix(in oklch, var(--paper) 80%, transparent) 68%, transparent 86%); }
  .internal-hero__route { position: absolute; top: 24px; right: 20px; display: flex; align-items: center; gap: 12px; }
  .internal-hero__route strong { font-family: var(--display); font-size: 2.7rem; line-height: 1; }
  .internal-hero__route i { width: 42px; height: 1px; background: currentColor; }
  .internal-hero__route span { font-size: .65rem; font-weight: 700; letter-spacing: .16em; }
  .breadcrumbs { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 26px; color: var(--muted); font-size: .72rem; }
  .breadcrumbs a { text-decoration: none; }
  .internal-hero__copy { display: grid; min-width: 0; max-width: 920px; align-content: center; gap: 24px; padding: 88px 32% 80px 1vw; }
  .internal-hero h1 { max-width: 10ch; font-size: clamp(4.6rem, 8.6vw, 9.3rem); line-height: .78; }
  .internal-hero__copy > p:not(.eyebrow) { max-width: 58ch; color: var(--muted); font-size: clamp(1rem, 1.45vw, 1.25rem); }

  .content-section { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); padding-block: clamp(64px, 9vw, 132px); border-bottom: 1px solid var(--line); }
  .content-section__number { position: sticky; top: 28px; height: max-content; color: var(--accent); font-family: var(--display); font-size: clamp(4rem, 8vw, 8rem); font-weight: 700; line-height: .8; }
  .content-section__body { display: grid; min-width: 0; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .65fr); gap: 28px 64px; }
  .content-section__body > .section-label, .content-section__body > h2, .content-prose, .section-links { grid-column: 1; }
  .content-section__body h2 { max-width: 10ch; }
  .content-prose { display: grid; max-width: 70ch; gap: 20px; color: color-mix(in oklch, var(--ink) 82%, var(--paper)); font-size: clamp(1rem, 1.35vw, 1.16rem); }
  .check-list { grid-column: 2; grid-row: 2 / span 3; list-style: none; border-top: 1px solid var(--line); }
  .check-list li { position: relative; padding: 17px 8px 17px 28px; border-bottom: 1px solid var(--line); }
  .check-list li::before { position: absolute; top: 22px; left: 4px; width: 6px; height: 6px; background: var(--accent); content: ""; }
  .section-links { display: grid; margin-top: 12px; }
  .section-links a { display: flex; min-height: 56px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); font-weight: 700; text-decoration: none; }
  .section-links a:last-child { border-bottom: 1px solid var(--line); }
  .section-links i { color: var(--accent); font-style: normal; }

  .mid-cta { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 48px; padding: clamp(42px, 7vw, 84px); overflow: hidden; background: var(--accent); color: var(--accent-ink); }
  .mid-cta::after { position: absolute; right: -40px; bottom: -155px; color: color-mix(in oklch, var(--accent-ink) 17%, transparent); content: "54"; font-family: var(--display); font-size: 24rem; font-weight: 800; line-height: 1; pointer-events: none; }
  .mid-cta > * { position: relative; z-index: 1; }
  .mid-cta > div { display: grid; gap: 18px; }
  .mid-cta .section-label { color: var(--accent-ink); }
  .mid-cta h2 { max-width: 9ch; font-size: clamp(3rem, 5.5vw, 6.4rem); }
  .mid-cta p:last-child { max-width: 60ch; }

  .source-block { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(300px, .85fr) minmax(400px, 1.15fr); gap: var(--space-3xl); align-items: center; padding-block: clamp(72px, 10vw, 140px); border-bottom: 1px solid var(--line); }
  .source-block > * { min-width: 0; }
  .source-block__date { color: var(--accent); font-family: var(--display); font-size: clamp(7rem, 10vw, 9.5rem); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.055em; line-height: .72; white-space: nowrap; }
  .source-block__copy { display: grid; gap: 20px; }
  .source-block__copy h2 { font-size: clamp(3.5rem, 4.4vw, 5rem); }
  .source-block__copy p:last-child { max-width: 48ch; }
  .source-block nav { display: grid; }
  .source-block nav a { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; padding: 17px 0; border-top: 1px solid var(--line); text-decoration: none; }
  .source-block nav a:last-child { border-bottom: 1px solid var(--line); }
  .source-block nav span { color: var(--muted); font-size: .78rem; }
  .source-block nav i { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--accent); font-style: normal; }

  .faq-block { padding-block: clamp(72px, 10vw, 140px); border-bottom: 1px solid var(--line); }
  .faq-block header { display: grid; grid-template-columns: 180px 1fr; align-items: start; }
  .faq-block header h2 { max-width: 9ch; }
  .faq-list { margin: 64px 0 0 180px; }
  .faq-list details { border-top: 1px solid var(--line); }
  .faq-list details:last-child { border-bottom: 1px solid var(--line); }
  .faq-list summary { display: flex; min-height: 84px; align-items: center; justify-content: space-between; gap: 24px; cursor: pointer; font-size: clamp(1rem, 1.8vw, 1.3rem); font-weight: 700; list-style: none; }
  .faq-list summary::-webkit-details-marker { display: none; }
  .faq-list summary i { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); font-style: normal; }
  .faq-list details[open] summary i { background: var(--accent); color: var(--accent-ink); transform: rotate(45deg); }
  .faq-list details p { max-width: 70ch; padding: 0 64px 30px 0; }

  .related-block { padding-block: clamp(64px, 9vw, 120px); }
  .related-block h2 { margin-top: 10px; }
  .related-block nav { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 48px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .related-block a { display: flex; min-height: 112px; align-items: center; justify-content: space-between; gap: 18px; padding: 20px; border-right: 1px solid var(--line); font-weight: 700; text-decoration: none; }
  .related-block a:last-child { border-right: 0; }
  .related-block i { color: var(--accent); font-style: normal; }

  .final-cta { position: relative; display: grid; gap: 34px; padding: clamp(52px, 8vw, 110px); overflow: hidden; background: var(--accent); color: var(--accent-ink); }
  .final-cta::after { position: absolute; right: -38px; bottom: -190px; color: color-mix(in oklch, var(--accent-ink) 15%, transparent); content: "54"; font-family: var(--display); font-size: clamp(18rem, 36vw, 36rem); font-weight: 800; line-height: 1; pointer-events: none; }
  .final-cta > * { position: relative; z-index: 1; }
  .final-cta__meta { display: flex; justify-content: space-between; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
  .final-cta__copy { display: grid; gap: 22px; }
  .final-cta h2 { max-width: 10ch; }
  .final-cta__copy p { max-width: 62ch; }
  .final-cta .button { width: max-content; min-width: 245px; }

  .site-footer { margin-top: 16px; background: var(--dark); color: var(--paper); }
  .site-footer__grid { display: grid; grid-template-columns: 1fr .65fr 1fr; gap: clamp(32px, 6vw, 90px); padding-block: 64px 96px; }
  .site-footer__grid > div { display: grid; align-content: start; gap: 18px; }
  .site-footer__grid p { max-width: 48ch; color: color-mix(in oklch, var(--paper) 72%, var(--dark)); font-size: .82rem; }
  .site-footer__grid nav { display: grid; align-content: start; gap: 12px; }
  .site-footer__grid nav a { width: max-content; font-size: .85rem; font-weight: 600; text-decoration: none; }
  .site-footer__grid > div:last-child span { color: color-mix(in oklch, var(--paper) 58%, var(--dark)); font-size: .72rem; }
}

@layer responsive {
  @media (hover: hover) {
    .button, .header-cta, .section-links a, .related-block a, .source-block a { transition: transform 180ms ease-out, background 180ms ease-out, color 180ms ease-out; }
    .button:hover, .header-cta:hover { transform: translateY(-2px); }
    .section-links a:hover, .source-block a:hover { color: var(--accent); }
    .related-block a:hover { background: var(--dark); color: var(--paper); }
  }

  @media (max-width: 1180px) {
    .source-block { grid-template-columns: minmax(220px, .65fr) minmax(0, 1fr); }
    .source-block nav { grid-column: 1 / -1; }
  }

  @media (max-width: 980px) {
    :root { --shell: min(100% - 28px, 920px); }
    .site-header__inner { grid-template-columns: auto 1fr auto; min-height: 72px; }
    .site-nav { display: none; }
    .menu-toggle { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; font-size: 1.3rem; }
    .mobile-nav { border-top: 1px solid var(--line); }
    .site-header[data-open="true"] .mobile-nav { display: block; }
    .mobile-nav nav { display: grid; padding-block: 10px 18px; }
    .mobile-nav nav > a:not(.button) { min-height: 48px; display: flex; align-items: center; border-bottom: 1px solid var(--line); font-weight: 700; text-decoration: none; }
    .mobile-nav .button { margin-top: 12px; }
    .home-hero__content { padding-right: 52%; padding-left: var(--space-xl); }
    .home-hero h1 { font-size: clamp(4.4rem, 9vw, 5.5rem); }
    .home-hero h1 span { font-size: .64em; }
    .content-section__body { grid-template-columns: 1fr; }
    .check-list { grid-column: 1; grid-row: auto; }
    .source-block { grid-template-columns: minmax(220px, .65fr) minmax(0, 1fr); }
    .source-block nav { grid-column: 1 / -1; }
    .related-block nav { grid-template-columns: repeat(2, 1fr); }
    .related-block a:nth-child(2) { border-right: 0; }
    .related-block a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  }

  @media (max-width: 720px) {
    body { padding-bottom: max(68px, env(safe-area-inset-bottom)); }
    .brand__name { font-size: 1.2rem; }
    .home-hero { min-height: auto; }
    .home-hero__media { inset: 0 0 auto; height: 340px; background-position: 72% 25%; background-size: cover; }
    .home-hero__overlay { height: 340px; background: linear-gradient(0deg, var(--paper), transparent 66%); }
    .home-hero__route { display: none; }
    .home-hero__content { width: 100%; max-width: none; padding: 284px 0 40px; }
    .home-hero h1 { width: 100%; max-width: 100%; font-size: clamp(2.75rem, 12.5vw, 4.5rem); line-height: .79; }
    .home-hero h1 span { width: auto; margin-top: .08em; font-size: 1em; white-space: normal; }
    .home-hero__lead { font-size: .94rem; }
    .hero-actions { align-items: stretch; flex-direction: column; }
    .hero-actions .button, .hero-actions .text-link { width: 100%; }
    .hero-facts { position: relative; grid-template-columns: 1fr; }
    .hero-facts div { min-height: 104px; border-right: 0; border-bottom: 1px solid color-mix(in oklch, var(--paper) 17%, transparent); }
    .intro-strip { grid-template-columns: 38px 1fr; }
    .intro-strip p:last-child { grid-column: 2; }

    .internal-hero { min-height: auto; }
    .internal-hero__media { inset: 0 0 auto; height: 290px; background-position: 60% 22%; }
    .internal-hero__overlay { height: 290px; background: linear-gradient(0deg, var(--paper), transparent 67%); }
    .internal-hero__route { display: none; }
    .breadcrumbs { position: relative; z-index: 2; padding-top: 16px; color: var(--paper); text-shadow: 0 1px 4px color-mix(in oklch, var(--dark) 70%, transparent); }
    .internal-hero__copy { width: 100%; max-width: none; padding: 235px 0 42px; }
    .internal-hero h1 { max-width: 100%; font-size: clamp(2.75rem, 13vw, 5rem); }

    .content-section { min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-block: 68px; }
    .content-section__number { position: static; font-size: 3.4rem; }
    .content-section__body { width: 100%; max-width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .content-section__body > *, .content-prose, .check-list { min-width: 0; max-width: 100%; }
    .content-section__body h2, .content-prose, .check-list li { overflow-wrap: anywhere; }
    .content-section__body h2 { max-width: 100%; font-size: clamp(2.9rem, 15vw, 5rem); }
    .check-list li { padding-block: 14px; }
    .mid-cta { grid-template-columns: 1fr; align-items: start; padding: 40px 24px; }
    .mid-cta .button { width: 100%; }
    .mid-cta::after { font-size: 16rem; }

    .source-block { grid-template-columns: 1fr; padding-block: 76px; }
    .source-block__date { font-size: 5.5rem; }
    .source-block nav { grid-column: 1; }
    .faq-block { padding-block: 76px; }
    .faq-block header { grid-template-columns: 1fr; gap: 12px; }
    .faq-block header h2 { max-width: 100%; }
    .faq-list { margin: 42px 0 0; }
    .faq-list summary { min-height: 76px; font-size: .96rem; }
    .faq-list details p { padding-right: 0; }
    .related-block nav { grid-template-columns: 1fr; }
    .related-block a { min-height: 72px; border-right: 0; border-bottom: 1px solid var(--line); }
    .related-block a:last-child { border-bottom: 0; }
    .final-cta { padding: 44px 24px 52px; }
    .final-cta h2 { max-width: 100%; font-size: clamp(3rem, 15vw, 5rem); }
    .final-cta .button { width: 100%; min-width: 0; }
    .site-footer__grid { grid-template-columns: 1fr; padding-bottom: 48px; }
    .mobile-cta { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: flex; min-height: 62px; align-items: center; justify-content: space-between; padding: 0 20px max(0px, env(safe-area-inset-bottom)); background: var(--accent); color: var(--accent-ink); font-weight: 800; text-decoration: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  }
}
