@layer reset, tokens, base, shell, components, responsive, access;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, h4, p, figure, ul { margin: 0; }
  button, textarea { font: inherit; }
  img { max-width: 100%; }
}

@layer tokens {
  :root {
    color-scheme: light;
    --pc-paper: #f3f5ed;
    --pc-ink: #172f37;
    --pc-muted: #485c60;
    --pc-night: #112932;
    --pc-night-deep: #0c2029;
    --pc-mint: #b5e6c7;
    --pc-lilac: #d3c4ec;
    --pc-green: #245d50;
    --pc-line: #bccac2;
    --pc-serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
    --pc-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --pc-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  }
}

@layer base {
  html { background: var(--pc-night); }
  body { color: var(--pc-ink); font-family: var(--pc-sans); font-size: 18px; line-height: 1.65; }
  a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
  button, textarea { font-size: 18px; }
  button { cursor: pointer; }
  h1, h2, h3, h4 { font-family: var(--pc-serif); font-weight: 400; }
  h1 { font-size: clamp(48px, 4.9vw, 72px); line-height: 1.04; letter-spacing: -.045em; }
  h2, .pc-heading--section { font-size: 32px; line-height: 1.2; letter-spacing: -.025em; }
  h3, .pc-heading--product { font-size: 25px; line-height: 1.3; letter-spacing: -.015em; }
  h1 em { font-weight: 400; }
  p + p { margin-top: 1em; }
  h2 + p, h3 + p, h4 + p { margin-top: .9em; }
  :focus-visible { outline: 3px solid #643a96; outline-offset: 5px; }
  [hidden] { display: none !important; }
}

@layer shell {
  .pc-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; max-width: 1920px; margin-inline: auto; }
  .pc-index { position: sticky; top: 0; height: 100svh; padding: 44px 28px 36px; background: var(--pc-night); color: var(--pc-paper); overflow: hidden; display: flex; flex-direction: column; }
  .pc-index__brand { display: flex; flex-direction: column; align-items: flex-start; min-height: 144px; text-decoration: none; line-height: 1.35; }
  .pc-index__symbol { display: flex; gap: 4px; width: 42px; height: 28px; margin-bottom: 18px; transform: rotate(-14deg); }
  .pc-index__symbol span { height: 5px; width: 10px; background: var(--pc-mint); border-radius: 7px; align-self: center; }
  .pc-index__symbol span:nth-child(2) { height: 22px; background: var(--pc-lilac); }
  .pc-index__symbol span:nth-child(3) { height: 14px; }
  .pc-index__place { font-family: var(--pc-serif); font-size: 28px; letter-spacing: -.02em; }
  .pc-index__subject { font-size: 18px; }
  .pc-index__guide { margin-top: 11px; color: var(--pc-mint); font-size: 16px; }
  .pc-index__nav { margin-top: 46px; }
  .pc-index__list { padding: 0; list-style: none; }
  .pc-index__item + .pc-index__item { margin-top: 14px; }
  .pc-index__link { position: relative; display: flex; flex-direction: column; padding: 12px 12px 12px 17px; border-left: 2px solid #48615f; text-decoration: none; line-height: 1.5; min-height: 76px; }
  .pc-index__link:hover { border-color: var(--pc-lilac); background: #1c3840; }
  .pc-index__link[aria-current="page"] { border-left: 4px solid var(--pc-mint); padding-left: 15px; background: #213c43; }
  .pc-index__name { font-size: 20px; }
  .pc-index__detail { color: #bdd0cd; font-size: 16px; }
  .pc-index__note { margin-top: auto; padding-top: 40px; color: #c4d4ce; font-family: var(--pc-serif); font-size: 20px; font-style: italic; line-height: 1.45; position: relative; z-index: 1; }
  .pc-index__horizon { position: absolute; bottom: -50px; right: -140px; width: 330px; height: 190px; border: 1px solid #45615c; border-radius: 50%; transform: rotate(-20deg); pointer-events: none; }
  .pc-index__horizon::before { content: ''; position: absolute; inset: 24px; border: 1px solid #3c5758; border-radius: inherit; }
  .pc-content { min-width: 0; background: var(--pc-paper); }
  .pc-main { padding: 58px clamp(32px, 4.5vw, 80px) 70px; }
  .pc-article { max-width: 1110px; margin-inline: auto; }
  .pc-reading { max-width: 68ch; }
  .pc-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px 40px; align-items: center; margin-inline: clamp(32px, 4.5vw, 80px); padding: 26px 0 40px; border-top: 1px solid var(--pc-line); font-size: 16px; color: var(--pc-muted); }
  .pc-footer p { max-width: 67ch; }
  .pc-footer__link { display: inline-flex; gap: 18px; align-items: center; min-height: 48px; padding-block: 6px; color: var(--pc-ink); font-size: 16px; }
}

@layer components {
  .pc-skip { position: fixed; z-index: 10; top: 16px; left: 16px; min-height: 48px; display: flex; align-items: center; padding: 10px 18px; background: var(--pc-mint); color: var(--pc-night-deep); font-size: 16px; transform: translateY(-200%); }
  .pc-skip:focus { transform: none; }
  .pc-kicker { font-family: var(--pc-mono); font-size: 16px; line-height: 1.5; color: var(--pc-green); margin-bottom: 28px; }
  .pc-hero { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 34px; align-items: center; padding-bottom: 54px; border-bottom: 1px solid var(--pc-line); margin-bottom: 54px; }
  .pc-hero__title { margin-bottom: 28px; }
  .pc-hero__title em { color: var(--pc-green); }
  .pc-hero__lead { max-width: 45ch; font-size: 19px; line-height: 1.6; }
  .pc-art { aspect-ratio: 704 / 512; position: relative; min-width: 0; align-self: center; border-radius: 48% 48% 4px 4px; overflow: hidden; background: var(--pc-night-deep); }
  .pc-art__image { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; color: transparent; text-indent: -9999px; }
  .pc-art__scene { position: absolute; inset: 0; overflow: hidden; background: #173f4a; }
  .pc-art__moon { position: absolute; top: 12%; right: 23%; width: 7%; aspect-ratio: 1; border-radius: 50%; background: #edf0d9; }
  .pc-art__ribbon { position: absolute; border-radius: 50%; transform: rotate(-34deg); }
  .pc-art__ribbon--green { left: 0; top: 9%; width: 100%; height: 21%; background: #a9e1c5; }
  .pc-art__ribbon--green::after { content: ''; position: absolute; inset: 30% -4% -40% 0; background: #173f4a; border-radius: 50%; }
  .pc-art__ribbon--lilac { left: 12%; top: 28%; width: 88%; height: 11%; background: #c0acd9; transform: rotate(-36deg); }
  .pc-art__ribbon--lilac::after { content: ''; position: absolute; inset: 36% -2% -50% 0; background: #173f4a; border-radius: 50%; }
  .pc-art__ridge { position: absolute; bottom: 30%; height: 30%; width: 100%; background: #315e61; clip-path: polygon(0 50%, 17% 40%, 30% 54%, 43% 12%, 64% 57%, 80% 32%, 100% 44%, 100% 100%, 0 100%); }
  .pc-art__lake { position: absolute; bottom: 0; height: 38%; width: 100%; background: #0c303d; }
  .pc-art__lake::before { content: ''; position: absolute; left: 28%; top: 24%; width: 52%; height: 3%; background: #8bbcb0; transform: skewX(-32deg); }
  .pc-art__lake::after { content: ''; position: absolute; left: 43%; top: 40%; width: 20%; height: 2%; background: #bca7d4; }
  .pc-art__shore { position: absolute; bottom: -1%; height: 18%; width: 100%; background: #0b232a; clip-path: polygon(0 20%, 19% 38%, 46% 75%, 80% 70%, 100% 46%, 100% 100%, 0 100%); }
  .pc-art__pine { position: absolute; background: #0b232a; clip-path: polygon(50% 0, 69% 24%, 60% 24%, 80% 45%, 68% 45%, 94% 76%, 58% 76%, 58% 100%, 42% 100%, 42% 76%, 6% 76%, 33% 45%, 20% 45%, 42% 24%, 31% 24%); }
  .pc-art__pine--near { bottom: 2%; left: -5%; height: 56%; width: 29%; }
  .pc-art__pine--far { bottom: 8%; right: 2%; height: 36%; width: 20%; }
  .pc-section { margin-bottom: 50px; }
  .pc-product { border-left: 3px solid var(--pc-green); padding-left: 25px; margin-top: 30px; }
  .pc-product--compounded { border-color: #766088; }
  .pc-product--research { border-color: #a07045; }
  .pc-product p { max-width: 64ch; }
  .pc-pagehead { max-width: 830px; padding-bottom: 45px; margin-bottom: 46px; border-bottom: 1px solid var(--pc-line); }
  .pc-pagehead h1 { font-size: clamp(46px, 4.6vw, 66px); max-width: 17ch; }
  .pc-pagehead__lead { max-width: 59ch; font-size: 20px; line-height: 1.6; margin-top: 26px; }
  .pc-pagehead--evidence h1 em { color: var(--pc-green); }
  .pc-next { position: relative; display: flex; flex-direction: column; gap: 5px; margin-top: 46px; padding: 22px 64px 22px 24px; background: var(--pc-night); color: var(--pc-paper); text-decoration: none; border-radius: 0 26px 0 0; min-height: 106px; }
  .pc-next:hover { background: #25454a; }
  .pc-next__label { color: var(--pc-mint); font-size: 16px; }
  .pc-next__text { font-family: var(--pc-serif); font-size: 24px; line-height: 1.3; }
  .pc-next__arrow { position: absolute; right: 24px; top: 30px; font-size: 28px; }
  .pc-next--back { margin-top: 36px; }
  .pc-source { margin-top: 44px; background: #e8eee4; border-top: 2px solid #718d7f; padding: 24px; }
  .pc-source__heading { display: flex; gap: 12px; align-items: center; margin-bottom: 15px; }
  .pc-source__heading h2 { font-family: var(--pc-sans); font-weight: 600; font-size: 20px; letter-spacing: 0; }
  .pc-source__mark { height: 14px; width: 14px; background: var(--pc-green); border-radius: 50% 50% 0 50%; }
  .pc-source__link { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 13px 0; min-height: 54px; border-bottom: 1px solid #becbc0; font-size: 16px; line-height: 1.55; text-decoration: none; }
  .pc-source__link:last-child { border-bottom: 0; }
  .pc-source__link:hover span:first-child { text-decoration: underline; text-underline-offset: .2em; }
  .pc-source__arrow { color: var(--pc-green); font-size: 22px; flex-shrink: 0; }
  .pc-caution { margin-bottom: 50px; border: 1px solid #b5aec5; background: #ebe6f0; padding: 28px; }
  .pc-caution__kicker { font-family: var(--pc-mono); font-size: 16px; line-height: 1.5; color: #574169; margin-bottom: 14px; }
  .pc-caution h2 { font-size: 30px; }
  .pc-notes { margin-top: 54px; padding: 32px; border: 1px solid #b5c9bd; background: #e1ebdf; }
  .pc-notes__kicker { color: var(--pc-green); font-family: var(--pc-mono); font-size: 16px; margin-bottom: 10px; }
  .pc-notes__label { display: block; margin-top: 27px; font-size: 18px; font-weight: 600; }
  .pc-notes__help { font-size: 16px; line-height: 1.6; color: #3c554c; margin-top: 8px; margin-bottom: 16px; }
  .pc-notes__text { display: block; width: 100%; padding: 16px; resize: vertical; min-height: 170px; line-height: 1.6; background: #fafcf7; color: var(--pc-ink); border: 1px solid #738f7e; border-radius: 3px; }
  .pc-notes__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
  .pc-button { min-height: 48px; padding: 11px 19px; color: var(--pc-paper); background: var(--pc-green); border: 1px solid var(--pc-green); border-radius: 3px; line-height: 1.4; font-size: 16px; }
  .pc-button:hover { background: #153f35; }
  .pc-button--quiet { background: transparent; color: var(--pc-green); }
  .pc-button--quiet:hover { background: #cfded0; }
  .pc-button:disabled { background: #dde6db; color: #465f51; border-color: #7f9587; cursor: default; }
  .pc-notes__status { min-height: 27px; margin-top: 16px; font-size: 16px; line-height: 1.6; color: #3c554c; }
}

@layer responsive {
  @media (min-width: 1600px) {
    .pc-main { padding-top: 78px; }
    .pc-hero { gap: 60px; }
    .pc-hero__title { font-size: 80px; }
  }
  @media (max-width: 1140px) and (min-width: 761px) {
    .pc-shell { grid-template-columns: 220px minmax(0, 1fr); }
    .pc-index { padding-inline: 24px; }
    .pc-hero { grid-template-columns: 1fr; }
    .pc-art { width: min(420px, 85%); }
    .pc-hero__lead { max-width: 58ch; }
    .pc-footer { grid-template-columns: 1fr; }
  }
  @media (max-width: 760px) {
    .pc-shell { display: block; }
    .pc-index { position: relative; height: auto; padding: 25px 24px 24px; overflow: visible; }
    .pc-index__brand { position: relative; min-height: 66px; padding-left: 56px; }
    .pc-index__symbol { position: absolute; top: 12px; left: 0; margin-bottom: 0; }
    .pc-index__place { font-size: 26px; }
    .pc-index__subject { font-size: 17px; }
    .pc-index__guide { position: absolute; right: 0; top: 6px; max-width: 84px; font-size: 16px; margin-top: 0; }
    .pc-index__nav { margin-top: 20px; }
    .pc-index__item + .pc-index__item { margin-top: 4px; }
    .pc-index__link { flex-direction: row; align-items: center; gap: 18px; min-height: 48px; padding: 9px 10px 9px 14px; }
    .pc-index__link[aria-current="page"] { padding-left: 12px; }
    .pc-index__name { font-size: 17px; flex: 0 0 87px; }
    .pc-index__detail { font-size: 16px; line-height: 1.4; }
    .pc-index__note, .pc-index__horizon { display: none; }
    .pc-main { padding: 34px 24px 48px; }
    .pc-kicker { margin-bottom: 23px; }
    .pc-hero { grid-template-columns: 1fr; gap: 28px; padding-bottom: 36px; margin-bottom: 38px; }
    .pc-hero__title { font-size: clamp(44px, 12vw, 58px); margin-bottom: 23px; }
    .pc-hero__lead { font-size: 18px; }
    .pc-art { width: min(100%, 430px); border-radius: 42% 42% 3px 3px; }
    .pc-pagehead { padding-bottom: 31px; margin-bottom: 35px; }
    .pc-pagehead h1 { font-size: 44px; }
    .pc-pagehead__lead { font-size: 18px; margin-top: 22px; }
    h2, .pc-heading--section { font-size: 29px; }
    h3, .pc-heading--product { font-size: 24px; }
    .pc-section { margin-bottom: 38px; }
    .pc-product { padding-left: 18px; margin-top: 28px; }
    .pc-next { padding: 20px 54px 20px 20px; margin-top: 36px; }
    .pc-next__text { font-size: 23px; }
    .pc-next__arrow { right: 20px; }
    .pc-source { padding: 21px 20px; margin-top: 34px; }
    .pc-caution { padding: 24px 21px; margin-bottom: 38px; }
    .pc-caution h2 { font-size: 28px; }
    .pc-notes { padding: 25px 20px; margin-top: 38px; }
    .pc-notes__actions { flex-direction: column; }
    .pc-button { width: 100%; min-height: 49px; }
    .pc-footer { grid-template-columns: 1fr; margin-inline: 24px; padding-block: 24px 32px; gap: 14px; }
    .pc-footer__link { justify-self: start; }
  }
  @media (max-width: 360px) {
    .pc-index__guide { position: static; max-width: none; margin-top: 5px; }
    .pc-index__name { flex-basis: 80px; }
    .pc-index__link { gap: 10px; }
    .pc-main, .pc-index { padding-inline: 20px; }
    .pc-footer { margin-inline: 20px; }
    .pc-hero__title, .pc-pagehead h1 { font-size: 40px; }
  }
}

@layer access {
  .pc-index a:focus-visible { outline-color: var(--pc-lilac); }
  .pc-next:focus-visible { outline-color: #643a96; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  }
  @media print {
    .pc-index, .pc-skip, .pc-art, .pc-notes__actions, .pc-footer__link { display: none; }
    .pc-shell { display: block; }
    .pc-content, html { background: white; }
    .pc-main { padding: 0; }
    .pc-reading { max-width: 100%; }
    .pc-footer { margin-inline: 0; }
    .pc-source, .pc-caution, .pc-notes { break-inside: avoid; }
    .pc-next { color: var(--pc-ink); background: white; border: 1px solid var(--pc-line); }
    .pc-next__label { color: var(--pc-green); }
  }
}
