@layer reset, tokens, base, layout, parts, util, print;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, figure, ul, ol, dl, dd { margin: 0; }
  button, input, textarea { font: inherit; }
  button, a, summary, input { -webkit-tap-highlight-color: transparent; }
  img { max-width: 100%; display: block; }
  [hidden] { display: none !important; }
}

@layer tokens {
  :root {
    color-scheme: light;
    --bg: #f6f9f8;
    --grey: #737574;
    --ink: #606562;
    --deep: #454c48;
    --line: #c6ceca;
    --paper: #fcfdfc;
    --wash: #e9efec;
    --head: "Lora", Georgia, serif;
    --body: "Source Serif 4", Georgia, serif;
    --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
    --gap: clamp(4rem, 8vw, 8rem);
    --r: .75rem;
  }
}

@layer base {
  html { scroll-padding-top: 1.5rem; }
  body { background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--body); }
  h1, h2, h3 { font-family: var(--head); color: var(--grey); font-weight: 700; }
  h1 { font-size: 2.25rem; line-height: 1.12; letter-spacing: -.03em; text-wrap: balance; }
  h2 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -.025em; text-wrap: balance; }
  h3 { color: var(--deep); font-size: 1.0625rem; line-height: 1.4; }
  p { max-width: 68ch; }
  a { color: var(--deep); text-decoration-thickness: 1px; text-underline-offset: .22em; }
  a:hover { text-decoration-thickness: 2px; }
  button, summary { cursor: pointer; }
  :focus-visible { outline: 2px solid var(--deep); outline-offset: 4px; }
  button { color: var(--deep); }
  ::selection { color: var(--deep); background: #dce7e1; }
}

@layer layout {
  .w { width: min(100%, 1280px); margin-inline: auto; padding-inline: 1.5rem; }
  .mast { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; border-bottom: 1px solid var(--line); }
  .hero { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 4rem; padding-block: 4.5rem var(--gap); align-items: center; }
  .hero h1 { font-size: clamp(2.5rem, 5vw, 4rem); line-height: .9; max-width: 13ch; margin-block: 1.5rem 2rem; }
  .hc { padding-block: 1.5rem; }
  .ha { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
  .body { padding-block: 0 var(--gap); }
  .ch { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.6fr); gap: 4rem; padding-top: 2rem; margin-bottom: var(--gap); border-top: 1px solid var(--line); }
  .chh { max-width: 28ch; }
  .chh .k { margin-bottom: 1rem; }
  .prose { min-width: 0; max-width: 68ch; }
  .prose > * + * { margin-top: 1.5rem; }
  .ch.rev { grid-template-columns: minmax(0, 1.6fr) minmax(0, .85fr); }
  .ch.rev .chh { grid-column: 2; grid-row: 1; }
  .ch.rev .prose { grid-column: 1; grid-row: 1; }
  .op { padding-block: 2rem var(--gap); }
  .og { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, .8fr); gap: 5rem; padding-top: 3rem; align-items: start; }
  .og h1 { margin-block: 1.25rem 1.5rem; max-width: 21ch; }
  .on { border-left: 1px solid var(--line); padding: 2rem; margin-top: 1rem; }
  .on p + p { margin-top: 1rem; font-size: 1.125rem; }
  .g { display: grid; gap: 1rem; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot { background: var(--wash); border-top: 1px solid var(--line); padding-block: 4rem 2rem; }
  .fh { position: relative; padding-right: 12rem; margin-bottom: 3rem; }
  .fh h2 { font-size: 2.25rem; margin-top: 1rem; }
  .fg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem; }
  .fg h3 { min-height: 3rem; margin-bottom: 1rem; }
  .fb { display: flex; justify-content: space-between; gap: 3rem; border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 2rem; }
  .fb p { max-width: 60ch; }
}

@layer parts {
  .brand { display: flex; flex-direction: column; justify-content: center; min-height: 56px; text-decoration: none; }
  .brand span:first-child { font: 700 1.5rem/1.2 var(--head); letter-spacing: -.03em; color: var(--deep); }
  .brand span:last-child { font-size: 1rem; }
  .dir { display: flex; min-height: 48px; align-items: center; gap: 1rem; font-weight: 500; white-space: nowrap; }
  .k { font-size: 1rem; font-weight: 500; line-height: 1.5; color: var(--ink); }
  .lede { max-width: 64ch; font-size: 1.125rem; line-height: 1.65; }
  .btn { min-height: 48px; display: inline-flex; justify-content: space-between; align-items: center; gap: 1.25rem; border: 1px solid var(--line); border-radius: var(--r); padding: .75rem 1.25rem; text-decoration: none; background: var(--paper); font-weight: 500; transition: background-color 200ms; }
  .btn:hover { background: var(--wash); }
  .solid { background: var(--deep); color: var(--bg); border-color: var(--deep); }
  .solid:hover { background: var(--ink); }
  .crumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
  .crumb li { display: flex; align-items: center; min-width: 0; }
  .crumb li + li::before { content: "/"; padding-inline: .25rem .75rem; color: var(--ink); }
  .crumb a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: .25rem; }
  .crumb span { font-size: 1rem; }
  .card { display: flex; flex-direction: column; min-height: 240px; padding: 1.5rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; box-shadow: 0 2px 12px rgb(69 76 72 / 4%); transition: background-color 200ms, border-color 200ms; }
  .card:hover { background: var(--wash); border-color: var(--grey); }
  .card p { font-size: 1rem; color: var(--ink); margin-top: 1rem; }
  .card .go { padding-top: 1.5rem; margin-top: auto; color: var(--deep); font-size: 1.25rem; }
  .ls { padding-left: 1.5rem; }
  .ls li { padding-left: .5rem; }
  .ls li + li { margin-top: 1rem; }
  .ls li::marker { color: var(--grey); }
  .cost { border-block: 1px solid var(--line); }
  .cl { display: grid; grid-template-columns: minmax(0, .6fr) minmax(0, 1.4fr); gap: 2rem; padding-block: 1.5rem; }
  .cl + .cl { border-top: 1px solid var(--line); }
  .cl dt { font-weight: 700; font-family: var(--head); color: var(--deep); }
  .cl dd { max-width: 45ch; }
  .rec { max-width: 880px; margin: 0 auto 3rem; border: 1px solid var(--line); background: var(--paper); border-radius: var(--r); padding: 2rem 2.5rem; box-shadow: 0 2px 12px rgb(69 76 72 / 4%); }
  .rec h2 { margin-block: .75rem 1.5rem; }
  .rec p { max-width: 68ch; }
  .src { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); max-width: 880px; margin: 1.5rem auto; }
  .src summary { min-height: 64px; display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; font-weight: 500; color: var(--deep); list-style: none; }
  .src summary::-webkit-details-marker { display: none; }
  .src[open] summary { border-bottom: 1px solid var(--line); }
  .plus { font: 400 1.5rem/1 var(--body); transition: transform 200ms; }
  .src[open] .plus { transform: rotate(45deg); }
  .sd { padding: .5rem 1.5rem 1rem; }
  .sl, .fg ul { list-style: none; padding: 0; }
  .sl li + li { border-top: 1px solid var(--line); }
  .sl a { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 48px; padding-block: .75rem; }
  .next { display: flex; max-width: 880px; margin: 3rem auto 0; min-height: 100px; border-block: 1px solid var(--line); align-items: center; justify-content: space-between; gap: 2rem; padding: 1.5rem 0; text-decoration: none; }
  .next .k { display: block; margin-bottom: .5rem; }
  .nl { font: 700 1.5rem/1.4 var(--head); }
  .next > span:last-child { font-size: 1.75rem; }
  .next:hover .nl { text-decoration: underline; text-underline-offset: .25em; }
  .fg a { display: flex; align-items: center; min-height: 44px; padding-block: .5rem; font-size: 1rem; }
  .fg a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 2px; }
  .top { position: absolute; top: 1.5rem; right: 0; display: inline-flex; align-items: center; min-height: 44px; gap: 1rem; }
  .sig { overflow-wrap: anywhere; font-size: 1rem; }
  .v { font: 400 1rem/1.6 var(--mono); color: var(--deep); }
  .art { position: relative; isolation: isolate; margin: 0 auto var(--gap); max-width: 960px; border: 1px solid var(--line); border-radius: var(--r); background: #e9eeeb; overflow: hidden; }
  .art img { position: relative; width: 100%; height: auto; color: transparent; font-size: 0; aspect-ratio: 5 / 4; object-fit: cover; }
  .art.tall { margin: 0; align-self: stretch; display: flex; flex-direction: column; }
  .art.tall img { aspect-ratio: 15 / 16; flex: 1; object-fit: cover; }
  .art figcaption { position: relative; padding: 1rem 1.5rem; border-top: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 1rem; }
  .paper { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
  .paper span { position: absolute; background: #f5f7f4; box-shadow: 0 3px 18px rgb(69 76 72 / 8%); border-radius: .4rem; }
  .paper span:nth-child(1) { width: 62%; height: 50%; top: 18%; left: 19%; transform: rotate(-10deg); }
  .paper span:nth-child(2) { width: 78%; height: 35%; bottom: 14%; left: -8%; transform: rotate(14deg); background: #b9c3bd; }
  .paper span:nth-child(3) { width: 50%; height: 40%; top: 35%; right: -10%; transform: rotate(-24deg); background: #d4ddd7; }
  .skip { position: absolute; left: 1.5rem; top: -100px; z-index: 10; background: var(--deep); color: var(--bg); padding: .75rem 1.25rem; min-height: 48px; border-radius: var(--r); }
  .skip:focus { top: 1rem; }
}

@layer util {
  @media (max-width: 1050px) {
    .hero { gap: 2.5rem; }
    .ch, .og { gap: 2.5rem; }
    .cards { grid-template-columns: 1fr; }
    .card { min-height: 0; }
    .fg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fg h3 { min-height: 0; }
  }
  @media (max-width: 700px) {
    .mast { min-height: 96px; gap: 1rem; }
    .brand span:first-child { font-size: 1.25rem; }
    .dir { gap: .5rem; white-space: normal; max-width: 9rem; }
    .hero, .og, .ch, .ch.rev { grid-template-columns: 1fr; }
    .hero { padding-top: 2.5rem; gap: 2rem; }
    .hc { padding: 0; }
    .hero h1 { max-width: 13ch; margin-block: 1.5rem; }
    .hero .lede { font-size: 1rem; }
    .hero .ha { gap: .75rem; }
    .art.tall { max-width: 420px; width: 100%; }
    .art.tall img { aspect-ratio: 5 / 4; flex: none; }
    .paper span:nth-child(2) { width: 62%; height: 28%; bottom: 20%; left: 6%; }
    .paper span:nth-child(3) { width: 40%; height: 30%; top: 35%; right: 8%; }
    .op { padding-top: 1.5rem; }
    .og { padding-top: 2rem; gap: 2rem; }
    .on { margin-top: 0; padding: 1.25rem; }
    .og h1 { font-size: 2.25rem; }
    .ch { gap: 1.75rem; padding-top: 1.75rem; }
    .ch.rev .chh, .ch.rev .prose { grid-column: auto; grid-row: auto; }
    .chh { max-width: 32ch; }
    .chh .k { margin-bottom: .75rem; }
    .cl { grid-template-columns: 1fr; gap: .75rem; }
    .rec { padding: 1.5rem; }
    .src summary { padding-inline: 1rem; }
    .sd { padding-inline: 1rem; }
    .fh { padding-right: 0; margin-bottom: 2rem; }
    .fh h2 { font-size: 1.75rem; }
    .top { position: static; margin-top: 1rem; }
    .fg { grid-template-columns: 1fr; gap: 2rem; }
    .fb { flex-direction: column; gap: 1.5rem; }
    .foot { padding-top: 3rem; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  }
}

@layer print {
  @media print {
    body { background: white; color: #222; }
    .mast, .foot, .art, .next, .skip, .on, .crumb { display: none; }
    .w { width: 100%; padding: 0; }
    .op { padding-block: 0 2rem; }
    .og, .ch, .ch.rev { display: block; }
    .ch { margin-bottom: 2rem; padding-top: 1rem; break-inside: avoid; }
    .chh { margin-bottom: 1rem; max-width: none; }
    .rec { box-shadow: none; break-inside: avoid; }
    .src { display: none; }
  }
}
