:root {
  color-scheme: dark;
  --graphite: #142623;
  --ivory: #f6f4e9;
  --phosphor: #92e5b6;
  --amber: #f9b76d;
  --muted: #b9c9bf;
  --line: #36524a;
  --panel: #1a302b;
  --sans: Roboto, "Segoe UI", sans-serif;
  --serif: "Liberation Serif", "Times New Roman", serif;
  --mono: "Liberation Mono", "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; background: var(--graphite); color: var(--ivory); font: 400 1rem/1.6 var(--sans); }
a { color: inherit; }
button { font: inherit; }
img { display: block; }
p, h1, h2, h3, h4, dl, dd, figure { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 5px; }
::selection { color: var(--graphite); background: var(--phosphor); }

.shell { width: min(100% - 2 * clamp(1.25rem, 5vw, 5rem), 82rem); margin-inline: auto; }
.skip-link { position: fixed; z-index: 10; inset: 1rem auto auto 1rem; padding: .65rem 1rem; color: var(--graphite); background: var(--ivory); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ivory); font: 500 1.16rem/1 "IBM Plex Sans", var(--sans); text-decoration: none; white-space: nowrap; }
.brand img { width: 2rem; height: 2rem; }
.site-header nav { display: flex; align-items: center; gap: clamp(1rem, 3.1vw, 3rem); }
.site-header nav a { font: .875rem/1 var(--mono); text-decoration: none; }
.site-header nav a:hover, .site-header nav a:focus-visible, .brand:hover { color: var(--phosphor); }
.site-header nav a[aria-current="page"] { color: var(--phosphor); text-decoration: underline; text-underline-offset: .35em; }
.nav-contact { padding: .75rem .9rem; border: 1px solid var(--line); }

.hero { padding-top: clamp(3.5rem, 5.6vw, 5.25rem); }
.hero-copy { position: relative; z-index: 1; width: fit-content; pointer-events: none; }
.hero-copy a { pointer-events: auto; }
.eyebrow, .technical { font: .875rem/1.45 var(--mono); letter-spacing: .065em; text-transform: uppercase; }
.eyebrow { color: var(--phosphor); margin-bottom: clamp(1.05rem, 2vw, 1.6rem); }
.hero h1 { font-size: clamp(3.35rem, 7.15vw, 7rem); font-weight: 300; line-height: .99; letter-spacing: -.065em; }
.hero h1 span { color: var(--phosphor); }
.hero-intro { margin-top: 1.65rem; max-width: 22rem; color: var(--muted); font-size: 1.125rem; line-height: 1.54; }
.button { display: inline-block; margin-top: 1.55rem; padding: .66rem 1rem; background: var(--phosphor); color: var(--graphite); font-weight: 500; text-decoration: none; }
.button:not(.button--trace):hover { background: var(--ivory); }
:is(.button--trace, .nav-contact) { position: relative; }

@media (any-hover: hover) {
  :is(.button--trace, .nav-contact):hover::before,
  :is(.button--trace, .nav-contact):hover::after {
    content: "";
    position: absolute;
    inset: -2px;
    border: 2px solid var(--amber);
    pointer-events: none;
    animation: trace-button-edge .55s linear;
  }

  /* When the animation ends, only the unclipped ::before border remains. */
  :is(.button--trace, .nav-contact):hover::after {
    clip-path: inset(50%);
    transform: rotate(180deg);
  }
}

/* The rotated copy traces the other half of the frame. */
@keyframes trace-button-edge {
  from { clip-path: polygon(50% 50%, 50% 0, 50% 0, 50% 0, 50% 0); }
  37% { clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 0, 100% 0); }
  63% { clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 100% 100%); }
  to { clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 50% 100%); }
}

@media (prefers-reduced-motion: reduce) {
  :is(.button--trace, .nav-contact):hover::before,
  :is(.button--trace, .nav-contact):hover::after { animation: none; }
}

.signal { margin-top: clamp(-14rem, 12.9rem - 30vw, -7.5rem); }
.signal-art { margin-left: 18%; }
.signal-controls { display: flex; justify-content: flex-end; align-items: center; min-height: 3.25rem; border-top: 1px solid var(--line); }
.wave-toggle { padding: .3rem 0 .3rem .45rem; border: 0; background: none; color: var(--muted); font: .8125rem/1.5 var(--mono); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.wave-toggle:hover { color: var(--ivory); }

.directory { padding-block: clamp(3.25rem, 6vw, 5rem) clamp(3.8rem, 7vw, 6rem); }
.directory h2 { margin-bottom: 1.25rem; font-size: calc(1.55rem * .6); font-weight: 400; letter-spacing: -.025em; }
.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.directory-link { display: grid; align-content: start; gap: .5rem; min-height: 9.35rem; padding: 1.4rem 1.5rem; text-decoration: none; }
.directory-grid > * + * { border-left: 1px solid var(--line); }
.directory-link:hover { background: var(--panel); }
.directory-link:hover .directory-title { color: var(--phosphor); text-decoration: underline; text-underline-offset: .18em; }
.directory-title { font: 1.52rem/1.17 var(--serif); }
.directory-description { color: var(--muted); }

.inner-page { flex: 1; padding-block: clamp(3rem, 6vw, 6rem); }
.inner-page > h1, .home-section > h2 { font-size: calc(clamp(3rem, 7vw, 6.5rem) * var(--heading-scale, 1)); font-weight: 300; line-height: 1.06; letter-spacing: -.055em; }
.inner-page > .standfirst { max-width: 48ch; margin-top: 1.5rem; }
.inner-page > :is(h1, h2) + .section { margin-top: clamp(1.75rem, 4vw, 3rem); }
.home-section { --heading-scale: .6; border-top: 1px solid var(--line); }
.home-section-link { text-decoration-color: var(--phosphor); text-decoration-thickness: .045em; text-underline-offset: .13em; }
.home-section-link:is(:hover, :focus-visible) { color: var(--phosphor); }
.home-section > .section:last-child { padding-bottom: 0; }
.section { display: grid; grid-template-columns: minmax(13rem, 1fr) minmax(0, 1.6fr); align-items: start; gap: 1.65rem clamp(2rem, 7vw, 7.5rem); padding-block: clamp(2rem, 5vw, 4rem); border-top: 1px solid var(--line); }
.section :is(h2, h3) { font-size: calc(clamp(2.4rem, 4.5vw, 4.5rem) * var(--heading-scale, 1)); font-weight: 300; line-height: 1.06; letter-spacing: -.045em; }
.article-header :is(h3, h4), .field-guide :is(h2, h3) { font: italic 400 calc(clamp(1.8rem, 3vw, 2.65rem) * var(--heading-scale, 1))/1.08 var(--serif); letter-spacing: -.025em; }
.section .technical { color: var(--phosphor); margin-bottom: .65rem; }
.standfirst { font: 400 clamp(1.3rem, 2.3vw, 1.7rem)/1.32 var(--serif); }
.section-lead .standfirst { margin-top: .95rem; }
.section-lead .text-link { display: inline-block; margin-top: 1.1rem; }
.text-link { color: var(--phosphor); text-underline-offset: .22em; }
.text-link:hover { color: var(--ivory); }

.glossary > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .25rem 1.35rem; padding-block: .8rem; }
.glossary > div + div { border-top: 1px solid var(--line); }
dt { font-weight: 500; }
dd, .article-header > p:last-child, .field-guide > p:not(.technical), .disclosure-body { color: var(--muted); }
.article-header > p:last-child, .field-guide > p:not(.technical) { margin-top: .75rem; }
.research details, .field-guide details { margin-top: 1.3rem; }
details { border-block: 1px solid var(--line); }
summary { padding: .8rem 0; color: var(--phosphor); cursor: pointer; }
summary:hover { color: var(--ivory); }
.disclosure-body { padding: 0 0 1rem 1.05rem; }
.disclosure-body ol { margin: 0 0 .5rem; padding-left: 1.15rem; }
.disclosure-body li + li { margin-top: .45rem; }

.glossary { border-block: 1px solid var(--line); }
.learn-topics details + details { border-top: 0; }
.field-guide { margin-top: 2.65rem; }
table { width: 100%; margin-top: 1.2rem; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: .48rem .35rem; border-bottom: 1px solid var(--line); }
th:first-child { padding-left: 0; }
thead th { color: var(--phosphor); font-weight: 500; }
tbody th { font-weight: 400; }
td { color: var(--muted); white-space: nowrap; }
.field-guide details { border-top: 0; margin-top: .15rem; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem; padding-block: 2rem 3.25rem; }
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-width: 38rem; margin-top: 1.75rem; }
.contact-form label { display: block; margin-bottom: .35rem; }
.contact-form input:not([type="hidden"]), .contact-form textarea { display: block; width: 100%; padding: .6rem .75rem; border: 1px solid color-mix(in srgb, var(--line) 60%, var(--muted)); border-radius: 0; background: var(--panel); color: var(--ivory); font: inherit; }
.contact-form textarea { resize: vertical; }
.contact-message, .contact-privacy { grid-column: 1 / -1; }
.contact-form button { margin-top: 0; border: 0; justify-self: start; cursor: pointer; }
.contact-privacy { color: var(--muted); font-size: .875rem; }
.contact-privacy a { color: var(--phosphor); text-underline-offset: .22em; }
.footer-inner > .text-link { font: .875rem/1.5 var(--mono); }

@media (max-width: 68rem) {
  .hero-intro { max-width: 19rem; }
  .signal { margin-top: -7.5rem; }
  .signal-art { margin-left: 25%; }
}

@media (max-width: 54rem) {
  .signal { margin-top: -1.8rem; }
  .signal-art { margin-left: 12%; }
  .directory-link { padding-inline: 1rem; }
}

@media (max-width: 44rem) {
  .header-inner { flex-wrap: wrap; gap: .75rem 1rem; padding-block: .9rem .75rem; }
  .site-header nav { flex-wrap: wrap; gap: .625rem 1.15rem; }
  .nav-contact { padding: .45rem 0; border: 0; }
  .hero { padding-top: 2.65rem; }
  .hero h1 { font-size: clamp(2.4rem, 8.8vw, 4.8rem); }
  .hero-intro { margin-top: 1.1rem; }
  .signal { margin-top: .65rem; }
  .signal-art { margin-inline: -.6rem; }
  .directory-grid, .section, .contact-form { grid-template-columns: minmax(0, 1fr); }
  .directory-grid { grid-auto-rows: 1fr; }
  .directory-link { min-height: 0; gap: .35rem; padding: 1rem; }
  .directory-grid > * + * { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 25rem) {
  .glossary > div { grid-template-columns: minmax(0, 1fr); }
}
