:root {
  color-scheme: dark;
  --bg: #000000;
  --ink: #f2f2f2;
  --muted: #a3a3a3;
  --accent: #ededed;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; color: var(--ink); background: var(--bg); isolation: isolate; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.wrap { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
main { padding-top: clamp(24px, 6vh, 64px); }
.home-page { display: flex; flex-direction: column; min-height: 100svh; }
.home-page main { padding-bottom: clamp(36px, 7vh, 96px); }
.home-page .feedback { margin-top: auto; }
.hero {
  min-height: 485px; position: relative; display: grid; place-items: center;
  padding: 68px 30px 83px;
}
.page-background {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}
.page-background::before {
  content: ""; position: absolute; inset: -8%;
  background:
    radial-gradient(ellipse at 16% 76%, #141414 0%, transparent 36%),
    radial-gradient(ellipse at 87% 20%, #121212 0%, transparent 38%);
  animation: background-glow 20s ease-in-out infinite alternate;
}
.page-wave {
  position: absolute; inset: -36px -24px;
  width: calc(100% + 48px); height: calc(100% + 72px);
  opacity: .88; animation: wave-drift 17s ease-in-out infinite;
}
.wave-sheen { opacity: .7; filter: brightness(1.85); }
.wave-sheen-band { animation: wave-sheen 15s linear -4s infinite; }
@keyframes background-glow {
  from { transform: translate(-2%, 1%); opacity: .72; }
  to { transform: translate(3%, -2%) scale(1.07); opacity: 1; }
}
@keyframes wave-drift {
  0%, 100% { transform: translate(-8px, 16px); opacity: .86; }
  35% { transform: translate(13px, -24px); opacity: 1; }
  68% { transform: translate(18px, 7px); opacity: .91; }
}
@keyframes wave-sheen {
  0% { transform: translateX(0); }
  65%, 100% { transform: translateX(2040px); }
}
.hero-copy { text-align: center; }
.page-stars { position: absolute; inset: 0; }
.page-stars span {
  position: absolute; left: var(--x); top: var(--y);
  width: 6px; height: 6px; background: #dedede;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: .45;
  animation: star-drift var(--duration) var(--delay) ease-in-out infinite alternate,
             star-twinkle var(--twinkle, 6s) var(--delay) ease-in-out infinite alternate;
}
.page-stars span:nth-child(3n) { width: 9px; height: 9px; --twinkle: 4.6s; }
.page-stars span:nth-child(even) { animation-direction: alternate-reverse, alternate; }
.page-stars span:nth-child(5n) { --twinkle: 8s; }
@keyframes star-drift {
  0% { transform: translate(-14px, 9px); }
  52% { transform: translate(6px, -12px); }
  100% { transform: translate(19px, 1px); }
}
@keyframes star-twinkle {
  from { opacity: .24; }
  to { opacity: .84; }
}
h1 { margin: 23px 0 19px; font-size: clamp(47px, 7.45vw, 100px); font-weight: 750; line-height: .98; letter-spacing: -.075em; }
h1 span { display: block; color: #c5c5c5; }
.description { max-width: 410px; margin: 0 auto; color: #a3a3a3; font-size: 16px; line-height: 1.55; text-wrap: balance; }
.section-nav {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2.5vw, 36px); max-width: 1120px;
  margin: clamp(18px, 5vh, 56px) auto 0;
}
.section-link {
  display: grid; place-items: center; position: relative;
  min-height: 78px; padding: 12px 37px;
  color: var(--ink); background: #0b0b0bbd;
  border: 1px solid #383838; border-radius: 13px;
  font: inherit; font-size: clamp(15px, 2vw, 21px); font-weight: 650;
  text-align: center; transition: background .2s, border-color .2s;
}
.section-link::after {
  content: ""; position: absolute; right: 20px;
  width: 7px; height: 7px; border-top: 1px solid #a3a3a3; border-right: 1px solid #a3a3a3;
  transform: rotate(45deg);
}
.section-link:hover { background: #171717e8; border-color: #696969; }
.feedback .credits { margin-top: 22px; font-size: 13px; }
.credits strong { color: var(--ink); font-weight: 600; }
.project-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 13px; }
.project-links a { color: var(--accent); text-underline-offset: 3px; }
.project-links a:hover { text-decoration: underline; }
.feedback {
  padding: 28px 12px 40px; border-top: 1px solid #222222;
  text-align: center; line-height: 1.55;
}
.feedback p { margin: 0; text-wrap: balance; }
.feedback p + p { margin-top: 6px; color: var(--muted); }
.feedback a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.tools {
  border-top: 1px solid #222222;
  margin-top: clamp(45px, 10vh, 112px);
  padding: clamp(30px, 4vw, 52px) 0 clamp(64px, 10vw, 128px);
}
.tools h2 { margin: 0; text-align: center; font-size: clamp(38px, 6vw, 72px); line-height: 1; letter-spacing: -.06em; }
.programs-page .tools { margin-top: 24px; }
.back-link { min-height: 40px; }
.tools-note { max-width: 640px; margin: 16px auto 0; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.55; text-wrap: balance; }
.tool-search { max-width: 480px; margin: 24px auto 0; }
.tool-search label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.tool-search input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid #383838; border-radius: 9px; background: #101010;
  color: var(--ink); font: inherit;
}
.tool-search input::placeholder { color: var(--muted); }
.tool-search-result { margin: 0; color: var(--muted); text-align: center; }
.tool-search-result:not(:empty) { margin-top: 20px; }
.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(calc((100% - 32px) / 3), 1fr)); gap: 16px;
  padding: 0; margin: 32px 0 0; list-style: none;
}
.tool-grid + .tool-grid { margin-top: 16px; }
.tool-grid[hidden], .tool-card[hidden] { display: none; }
.tool-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 24px; min-height: 190px; background: #0b0b0bd9;
  border: 1px solid #282828; border-radius: 14px;
}
.tool-card:hover, .tool-card:focus-within { border-color: #484848; }
.tool-card h3 { margin: 0; font-size: 19px; }
.tool-card p { margin: 0 0 4px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.tool-download {
  display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding: 8px 12px;
  border-radius: 7px; border: 1px solid #383838; color: var(--accent); background: #141414;
  font: inherit; font-size: 13px;
}
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.tool-actions .tool-download { margin-top: 0; }
a.tool-download:hover { background: #242424; }
.tool-download svg { width: 16px; height: 16px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .fade-item { transition: opacity .65s ease; }
  .fade-item:not(.in-view):not(:focus-within) { opacity: 0; }
}
dialog {
  width: min(440px, calc(100% - 32px)); color: var(--ink); background: #101010;
  border: 1px solid #333333; border-radius: 15px; padding: 30px;
  box-shadow: 0 24px 100px #000a;
}
dialog[open] { animation: enter .24s ease-out both; }
dialog::backdrop { background: #000000cf; backdrop-filter: blur(5px); }
dialog h2 { font-size: 25px; line-height: 1.14; margin: 16px 0 12px; }
dialog p { color: var(--muted); line-height: 1.55; margin: 0 0 23px; }
.close { min-height: 42px; padding: 0 16px; border-radius: 7px; border: 1px solid #3a3a3a; background: #1c1c1c; color: var(--ink); }
.close:hover { border-color: var(--accent); }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .hero { min-height: clamp(250px, 46svh, 385px); padding: 42px 10px; }
  h1 { font-size: clamp(33px, 9vw, 65px); }
  .description { font-size: 15px; }
  .tool-grid { grid-template-columns: repeat(auto-fit, minmax(calc((100% - 16px) / 2), 1fr)); }
  .tool-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .section-nav { grid-template-columns: 1fr; gap: 10px; }
  .section-link { min-height: 52px; }
}
@media (max-width: 470px) {
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 155px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .wave-sheen { display: none; }
}
