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

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  body, h1, h2, h3, p, ul { margin: 0; }
  ul { padding: 0; }
  img, svg { display: block; max-width: 100%; }
  button, input, textarea { font: inherit; }
}

@layer base {
  :root {
    --paper: #f7f6f2;
    --surface: #ffffff;
    --surface-soft: #efeee9;
    --ink: #242424;
    --muted: #686761;
    --line: #d8d6cf;
    --accent: #333333;
    --accent-soft: #e7e5df;
    --max: 1180px;
    --radius-sm: 14px;
    --radius-md: 22px;
    --radius-lg: 34px;
    --shadow: 0 18px 50px rgba(26, 26, 26, .07);
    --ease: cubic-bezier(.2,.8,.2,1);
  }

  body {
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
  }

  a { color: inherit; text-decoration-thickness: .07em; text-underline-offset: .18em; }
  a:focus-visible, button:focus-visible { outline: 3px solid #777; outline-offset: 4px; border-radius: 6px; }
  ::selection { background: #d9d7d0; color: #111; }
}

@layer layout {
  .container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
  .section { padding-block: clamp(72px, 8vw, 118px); }
  .section--compact { padding-block: clamp(52px, 6vw, 80px); }
  .grid { display: grid; gap: 24px; }
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  @media (max-width: 860px) {
    .container { width: min(calc(100% - 28px), var(--max)); }
    .grid--2, .grid--3 { grid-template-columns: 1fr; }
  }
}

@layer components {
  .skip-link {
    position: fixed; z-index: 999; left: 16px; top: 16px; transform: translateY(-180%);
    padding: 10px 14px; background: #111; color: #fff; border-radius: 10px;
  }
  .skip-link:focus { transform: translateY(0); }

  .site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  }
  .nav-shell { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
  .brand { display: inline-flex; align-items: center; flex: 0 0 auto; text-decoration: none; }
  .brand img { width: 118px; height: 72px; object-fit: cover; object-position: center 50%; }
  .site-nav { display: flex; align-items: center; gap: 28px; }
  .site-nav a {
    position: relative; padding-block: 9px; color: var(--muted); font-size: .93rem;
    text-decoration: none; letter-spacing: .01em;
  }
  .site-nav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 3px; height: 1px;
    background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .22s var(--ease);
  }
  .site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
  .site-nav a[aria-current="page"] { color: var(--ink); }
  .nav-toggle { display: none; border: 0; background: transparent; color: var(--ink); padding: 10px; cursor: pointer; }
  .nav-toggle-lines { display: grid; gap: 5px; width: 24px; }
  .nav-toggle-lines span { height: 1px; background: currentColor; display: block; }

  .hero { padding-block: clamp(76px, 9vw, 136px) clamp(82px, 10vw, 148px); overflow: hidden; }
  .hero-inner { position: relative; isolation: isolate; }
  .hero-inner::before {
    content: ""; position: absolute; z-index: -1; width: min(62vw, 720px); aspect-ratio: 1; right: -18%; top: -48%;
    border: 1px solid #dedcd5; border-radius: 50%; opacity: .9;
  }
  .hero-kicker { color: var(--muted); font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .18em; margin-bottom: 22px; }
  .hero h1 {
    max-width: 910px; font-family: Georgia, "Times New Roman", serif; font-weight: 400;
    font-size: clamp(3.1rem, 8vw, 7.7rem); line-height: .94; letter-spacing: -.048em;
  }
  .hero-subtitle {
    max-width: 760px; margin-top: 24px; color: var(--ink);
    font-size: clamp(1.35rem, 2.25vw, 2.05rem); font-weight: 500; line-height: 1.3; letter-spacing: -.018em;
  }
  .hero-copy { max-width: 720px; margin-top: 18px; color: var(--muted); font-size: clamp(1.03rem, 1.5vw, 1.25rem); }
  .hero-meta { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 34px; color: var(--muted); font-size: .9rem; }
  .hero-meta span { display: inline-flex; align-items: center; gap: 9px; }
  .hero-meta span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #66645f; }

  .section-head { display: grid; grid-template-columns: .72fr 1.28fr; gap: 28px; align-items: end; padding-bottom: 34px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
  .eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-weight: 650; font-size: .76rem; }
  .section-head h2, .page-title h1 {
    font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.035em; line-height: 1.04;
  }
  .section-head h2 { font-size: clamp(2.2rem, 4.6vw, 4.5rem); }

  .card {
    min-height: 220px; padding: 30px; background: var(--surface); border: 1px solid #e5e3dc; border-radius: var(--radius-md);
    box-shadow: 0 1px 0 rgba(20,20,20,.02); transition: transform .22s var(--ease), box-shadow .22s var(--ease);
  }
  .card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
  .card-index { color: var(--muted); font-size: .76rem; letter-spacing: .1em; margin-bottom: 42px; }
  .card h3 { font-size: 1.08rem; line-height: 1.35; margin-bottom: 12px; font-weight: 650; }
  .card p { color: var(--muted); font-size: .95rem; }

  .statement {
    border-radius: var(--radius-lg); background: #2c2c2b; color: #f7f6f2; padding: clamp(36px, 6vw, 76px);
    display: grid; grid-template-columns: .72fr 1.28fr; gap: 38px;
  }
  .statement .eyebrow { color: #bdbbb5; }
  .statement p { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 3.4vw, 3.3rem); line-height: 1.15; letter-spacing: -.025em; }

  .page-hero { padding-block: clamp(66px, 8vw, 108px) clamp(44px, 5vw, 70px); }
  .page-title { max-width: 840px; }
  .page-title h1 { font-size: clamp(3rem, 6.5vw, 6.2rem); }
  .page-title p { margin-top: 26px; max-width: 680px; color: var(--muted); font-size: 1.08rem; }

  .fact-list { list-style: none; border-top: 1px solid var(--line); }
  .fact-list li { display: grid; grid-template-columns: minmax(140px, .55fr) 1.45fr; gap: 24px; padding-block: 18px; border-bottom: 1px solid var(--line); }
  .fact-list strong { font-size: .86rem; font-weight: 600; color: var(--muted); }
  .fact-list span { color: var(--ink); }

  .prose { max-width: 760px; }
  .prose h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 400; letter-spacing: -.025em; line-height: 1.1; margin-bottom: 22px; }
  .prose p + p { margin-top: 18px; }
  .prose p { color: var(--muted); }

  .resource-list { list-style: none; border-top: 1px solid var(--line); }
  .resource-list li { border-bottom: 1px solid var(--line); }
  .resource-list a { display: flex; justify-content: space-between; gap: 24px; padding-block: 20px; text-decoration: none; }
  .resource-list a span:first-child { font-weight: 600; }
  .resource-list a span:last-child { color: var(--muted); font-size: .9rem; }
  .resource-list a:hover span:first-child { text-decoration: underline; text-underline-offset: .22em; }

  .contact-panel {
    display: grid; grid-template-columns: .7fr 1.3fr; gap: 30px; padding: clamp(30px, 5vw, 58px);
    background: var(--surface); border: 1px solid #e4e2db; border-radius: var(--radius-lg);
  }
  .contact-mail { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 3vw, 2.6rem); line-height: 1.25; overflow-wrap: anywhere; }
  .contact-note { color: var(--muted); max-width: 630px; }

  .site-footer { padding-block: 34px 42px; border-top: 1px solid var(--line); }
  .footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: end; }
  .footer-brand { font-size: .9rem; }
  .footer-note { margin-top: 6px; max-width: 650px; color: var(--muted); font-size: .78rem; }
  .footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px; font-size: .82rem; color: var(--muted); }
  .footer-links a { text-decoration: none; }
  .footer-links a:hover { text-decoration: underline; }

  .legal-note { margin-top: 20px; color: var(--muted); font-size: .82rem; }

  @media (max-width: 860px) {
    .nav-shell { min-height: 80px; }
    .brand img { width: 102px; height: 62px; }
    .nav-toggle { display: block; }
    .site-nav {
      position: absolute; top: calc(100% + 1px); left: 0; right: 0; display: none; align-items: stretch;
      background: var(--paper); border-bottom: 1px solid var(--line); padding: 16px 20px 22px; box-shadow: 0 18px 30px rgba(0,0,0,.05);
    }
    .site-nav[data-open="true"] { display: grid; gap: 2px; }
    .site-nav a { padding: 12px 4px; font-size: 1rem; }
    .site-nav a::after { display: none; }
    .section-head, .statement, .contact-panel { grid-template-columns: 1fr; }
    .section-head { align-items: start; }
    .fact-list li { grid-template-columns: 1fr; gap: 4px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-links { justify-content: flex-start; }
  }

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

@layer utilities {
  .muted { color: var(--muted); }
  .sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
}

/* Enterprise motion layer -------------------------------------------------- */
@layer components {
  :root {
    --motion-fast: 220ms;
    --motion-base: 620ms;
    --motion-slow: 900ms;
    --motion-enter: cubic-bezier(.16, 1, .3, 1);
  }

  body { overflow-x: hidden; }

  .site-header {
    transition: min-height var(--motion-fast) var(--ease),
                background-color var(--motion-fast) var(--ease),
                box-shadow var(--motion-fast) var(--ease),
                border-color var(--motion-fast) var(--ease);
  }
  .site-header.is-scrolled {
    background: color-mix(in srgb, var(--paper) 96%, transparent);
    border-bottom-color: color-mix(in srgb, var(--line) 90%, transparent);
    box-shadow: 0 12px 34px rgba(20, 20, 20, .055);
  }
  .nav-shell { transition: min-height var(--motion-fast) var(--ease); }
  .site-header.is-scrolled .nav-shell { min-height: 78px; }
  .brand img { transition: transform 420ms var(--motion-enter), opacity 220ms ease; }
  .brand:hover img { transform: scale(1.025); }

  .site-nav a {
    transition: color var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
  }
  .site-nav a:hover { color: var(--ink); transform: translateY(-1px); }

  .nav-toggle {
    transition: background-color var(--motion-fast) ease, transform var(--motion-fast) var(--motion-enter);
    border-radius: 12px;
  }
  .nav-toggle:hover { background: var(--accent-soft); transform: scale(1.04); }
  .nav-toggle:active { transform: scale(.96); }
  .nav-toggle-lines span {
    transform-origin: center;
    transition: transform 280ms var(--motion-enter), opacity 180ms ease;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-lines span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-lines span:nth-child(2) { opacity: 0; transform: scaleX(.3); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-lines span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .hero-inner::before {
    animation: hero-orbit 16s ease-in-out infinite alternate;
    will-change: transform;
  }
  @keyframes hero-orbit {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(-22px, 20px, 0) scale(1.035); }
  }

  .hero-meta a,
  .contact-mail,
  .resource-list a {
    transition: color var(--motion-fast) ease, opacity var(--motion-fast) ease;
  }
  .hero-meta a:hover, .contact-mail:hover { opacity: .62; }

  .card {
    position: relative;
    overflow: hidden;
    transition: transform 420ms var(--motion-enter), box-shadow 420ms var(--motion-enter), border-color 300ms ease;
  }
  .card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,.62) 48%, transparent 76%);
    transform: translateX(-125%);
    transition: transform 760ms var(--motion-enter);
  }
  .card:hover {
    transform: translateY(-8px) scale(1.008);
    box-shadow: 0 24px 60px rgba(26, 26, 26, .10);
    border-color: #d8d5cd;
  }
  .card:hover::before { transform: translateX(125%); }
  .card:active { transform: translateY(-3px) scale(.998); }

  .statement {
    position: relative;
    overflow: hidden;
    transition: transform 500ms var(--motion-enter), box-shadow 500ms var(--motion-enter);
  }
  .statement::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    right: -120px;
    top: -120px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.12);
    transition: transform 900ms var(--motion-enter);
  }
  .statement:hover { transform: translateY(-4px); box-shadow: 0 28px 70px rgba(20,20,20,.14); }
  .statement:hover::after { transform: scale(1.35) translate(-12px, 12px); }

  .fact-list li,
  .resource-list li {
    transition: background-color 240ms ease, padding-left 320ms var(--motion-enter), border-color 240ms ease;
  }
  .fact-list li:hover,
  .resource-list li:hover { background: rgba(255,255,255,.42); padding-left: 12px; }
  .resource-list a span:last-child { transition: transform 300ms var(--motion-enter), color 220ms ease; }
  .resource-list a:hover span:last-child { transform: translateX(4px); color: var(--ink); }

  .contact-panel {
    transition: transform 500ms var(--motion-enter), box-shadow 500ms var(--motion-enter), border-color 300ms ease;
  }
  .contact-panel:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: #d8d5cd;
  }

  .site-footer { overflow: hidden; }
  .footer-simple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
  .footer-brand { font-size: .9rem; font-weight: 550; }
  .footer-rights { color: var(--muted); font-size: .78rem; }

  /* IntersectionObserver reveal system. JS only adds .motion-item. */
  .js .motion-item {
    opacity: 0;
    transform: translate3d(0, 28px, 0) scale(.992);
    filter: blur(4px);
    transition: opacity var(--motion-base) var(--motion-enter),
                transform var(--motion-base) var(--motion-enter),
                filter var(--motion-base) var(--motion-enter);
    transition-delay: var(--motion-delay, 0ms);
    will-change: opacity, transform, filter;
  }
  .js .motion-item.motion-from-left { transform: translate3d(-34px, 0, 0) scale(.995); }
  .js .motion-item.motion-from-right { transform: translate3d(34px, 0, 0) scale(.995); }
  .js .motion-item.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }

  /* Hero arrives immediately, then page sections reveal while scrolling. */
  .js .hero .hero-kicker,
  .js .hero h1,
  .js .hero-subtitle,
  .js .hero-copy,
  .js .hero-meta,
  .js .page-hero .eyebrow,
  .js .page-hero h1,
  .js .page-hero .page-title > p {
    opacity: 0;
    transform: translateY(24px);
    animation: hero-enter 760ms var(--motion-enter) forwards;
  }
  .js .hero h1, .js .page-hero h1 { animation-delay: 90ms; }
  .js .hero-subtitle { animation-delay: 165ms; }
  .js .hero-copy, .js .page-hero .page-title > p { animation-delay: 240ms; }
  .js .hero-meta { animation-delay: 320ms; }
  @keyframes hero-enter { to { opacity: 1; transform: translateY(0); } }

  @media (max-width: 860px) {
    .site-header.is-scrolled .nav-shell { min-height: 70px; }
    .site-nav[data-open="true"] { animation: mobile-menu-in 300ms var(--motion-enter) both; }
    @keyframes mobile-menu-in {
      from { opacity: 0; transform: translateY(-8px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .footer-simple { align-items: flex-start; flex-direction: column; gap: 5px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .hero-inner::before { animation: none !important; }
    .js .motion-item,
    .js .hero .hero-kicker,
    .js .hero h1,
    .js .hero-subtitle,
    .js .hero-copy,
    .js .hero-meta,
    .js .page-hero .eyebrow,
    .js .page-hero h1,
    .js .page-hero .page-title > p {
      opacity: 1 !important;
      transform: none !important;
      filter: none !important;
      animation: none !important;
      transition: none !important;
    }
  }
}
