/* Defines the responsive visual system for the willi-server.com project portal. */
:root {
  color-scheme: dark;
  --page: #080b12;
  --surface: #101620;
  --surface-raised: #161e2b;
  --text: #f4f7fb;
  --muted: #aeb8c6;
  --line: #293445;
  --accent: #41ce16;
  --accent-deep: #16450f;
  --teal: #0eb9a5;
  --button: #49ba26;
  --radius: 20px;
  --shadow: 0 24px 70px rgb(0 0 0 / 35%);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--page);
  color: var(--text);
  scroll-behavior: smooth;
}

@property --portal-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 280px;
  margin: 0;
  background:
    radial-gradient(circle at 15% 8%, rgb(40 112 29 / 20%), transparent 31rem),
    radial-gradient(
      circle at 92% 24%,
      rgb(15 112 103 / 16%),
      transparent 28rem
    ),
    var(--page);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.page-loader {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background:
    linear-gradient(rgb(8 11 18 / 94%), rgb(8 11 18 / 98%)),
    radial-gradient(circle at center, rgb(14 185 165 / 12%), transparent 30rem),
    var(--page);
  color: var(--text);
  transition:
    opacity 220ms ease,
    visibility 220ms ease;
}

.page-loader.is-finished {
  opacity: 0;
  visibility: hidden;
}

.loader-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.loader-monogram {
  width: 46px;
  height: 46px;
  display: block;
  border-radius: 13px;
  box-shadow: 0 10px 32px rgb(65 206 22 / 18%);
}

.loader-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.loader-track {
  width: min(210px, calc(100vw - 48px));
  height: 3px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.loader-track i {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--accent));
  transform-origin: left;
  animation: loader-progress 900ms ease-in-out infinite alternate;
}

.loader-copy {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 9px 13px;
  border-radius: 8px;
  background: var(--text);
  color: var(--page);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  width: 100%;
  min-height: 76px;
  padding-inline: max(16px, calc((100% - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgb(255 255 255 / 9%);
  background: var(--page);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wordmark strong {
  font-weight: 600;
}

.wordmark span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #0a1a0f;
  font-size: 21px;
  font-weight: 700;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
}

.site-header nav a {
  position: relative;
  color: var(--muted);
  transition: color 180ms ease;
}

.site-header nav a::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  color: var(--text);
}

.site-header nav a:hover::after,
.site-header nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

main {
  overflow: clip;
}

.intro,
.project-section,
.about-section,
.upcoming-section {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.intro {
  position: relative;
  min-height: 500px;
  padding: clamp(44px, 6vw, 72px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  align-items: center;
  gap: clamp(30px, 5vw, 64px);
}

.intro::before,
.intro::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.intro::before {
  top: 18%;
  right: 8%;
  width: clamp(110px, 18vw, 230px);
  aspect-ratio: 1;
  border: 1px solid rgb(65 206 22 / 26%);
  background: radial-gradient(
    circle at 35% 35%,
    rgb(65 206 22 / 22%),
    transparent 65%
  );
}

.intro::after {
  top: 47%;
  right: 25%;
  width: clamp(36px, 6vw, 72px);
  aspect-ratio: 1;
  border: 1px solid rgb(14 185 165 / 38%);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.08;
}

h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(40px, 5.2vw, 68px);
  font-weight: 700;
  letter-spacing: -0.055em;
}

.intro-copy > p {
  max-width: 700px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: clamp(18px, 2.3vw, 23px);
}

.hero-visual {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 30px;
  background: #0c121c;
  box-shadow: var(--shadow);
}

.hero-visual img {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
}

.hero-visual figcaption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  padding: 10px 13px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 10px;
  background: rgb(8 11 18 / 75%);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  backdrop-filter: blur(12px);
}

.primary-action,
.card-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--button);
  background: var(--button);
  color: #0a1a0f;
  box-shadow: 0 0 0 rgb(73 186 38 / 0%);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.primary-action::after,
.card-primary::after {
  margin-left: 9px;
  content: "→";
  transition: transform 180ms ease;
}

.primary-action:hover,
.primary-action:focus-visible,
.card-primary:hover,
.card-primary:focus-visible {
  box-shadow: 0 12px 34px rgb(73 186 38 / 20%);
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.primary-action:hover::after,
.primary-action:focus-visible::after,
.card-primary:hover::after,
.card-primary:focus-visible::after {
  transform: translateX(4px);
}

.primary-action {
  min-height: 50px;
  padding: 12px 20px;
  border-radius: 12px;
}

.project-section {
  padding: 88px 0 112px;
  scroll-margin-top: 76px;
}

.section-heading {
  margin-bottom: 38px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.project-filter {
  min-width: 190px;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.project-filter select {
  min-height: 46px;
  padding: 0 38px 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  --pointer-x: 50%;
  --pointer-y: 50%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  padding: clamp(22px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgb(255 255 255 / 3%), transparent 60%), var(--surface);
  box-shadow: 0 1px 0 rgb(255 255 255 / 4%) inset;
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
  cursor: default;
}

.project-card[tabindex="0"],
.update-card[tabindex="0"] {
  cursor: pointer;
}

.project-card:focus-visible,
.update-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.project-card::before,
.update-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--pointer-x) var(--pointer-y),
    rgb(65 206 22 / 12%),
    transparent 13rem
  );
  opacity: 0;
  transition: opacity 220ms ease;
}

.project-card > *,
.update-card > * {
  position: relative;
  z-index: 1;
}

.project-card:hover::before,
.update-card:hover::before {
  opacity: 1;
}

.project-card:hover,
.project-card:focus-within,
.update-card:hover,
.update-card:focus-within {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  box-shadow:
    var(--shadow),
    0 1px 0 rgb(255 255 255 / 7%) inset;
  transform: translateY(-6px);
}

.project-card[hidden] {
  display: none;
}

.card-topline {
  min-height: 25px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--teal);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.card-topline i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgb(65 206 22 / 12%);
  animation: live-pulse 2.4s ease-out infinite;
}

.project-card h3 {
  margin-bottom: 13px;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 700;
}

.project-card > p,
.project-card details p,
.about-section > p:last-child {
  color: var(--muted);
}

.legal-page {
  width: min(1000px, calc(100% - 32px));
  margin-inline: auto;
  padding: clamp(52px, 8vw, 96px) 0 112px;
}

.legal-hero {
  max-width: 820px;
  margin-bottom: 42px;
}

.legal-hero h1 {
  margin-bottom: 18px;
}

.legal-hero > p:not(.legal-kicker, .legal-updated),
.legal-card > p {
  color: var(--muted);
}

.legal-kicker,
.legal-updated {
  color: var(--teal);
  font-weight: 600;
}

.legal-kicker {
  margin-bottom: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-updated {
  margin: 20px 0 0;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.legal-card {
  min-width: 0;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.legal-card-wide {
  grid-column: 1 / -1;
}

.legal-card h2 {
  margin-bottom: 18px;
  font-size: clamp(25px, 3vw, 34px);
}

.legal-card p:last-child {
  margin-bottom: 0;
}

.legal-card a,
.footer-links a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.legal-details {
  margin: 0 0 22px;
  display: grid;
  gap: 14px;
}

.legal-details div {
  min-width: 0;
}

.legal-details dt {
  color: var(--muted);
  font-size: 14px;
}

.legal-details dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.upcoming-section {
  padding: 0 0 112px;
  scroll-margin-top: 96px;
}

.upcoming-section h2 {
  max-width: 820px;
  margin-bottom: 32px;
}

.update-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.update-card {
  --pointer-x: 50%;
  --pointer-y: 50%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(24px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgb(255 255 255 / 4%) inset;
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
  cursor: default;
}

.update-card h3 {
  margin-bottom: 13px;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 700;
}

.update-card > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.update-card .card-actions {
  margin-top: 24px;
}

.update-identifier {
  margin-bottom: 20px;
  color: var(--teal);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.project-card > p {
  min-height: 52px;
  margin-bottom: 20px;
}

.project-card details {
  margin-bottom: 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-card summary {
  min-height: 48px;
  margin-inline: -10px;
  padding: 11px 10px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 120ms ease;
  cursor: pointer;
}

.project-card summary:hover,
.project-card summary:focus-visible {
  background: rgb(14 185 165 / 10%);
  color: var(--teal);
}

.project-card summary:active {
  transform: translateY(1px) scale(0.99);
}

.project-card details p {
  margin-bottom: 16px;
}

.project-card details[open] p {
  animation: details-enter 220ms ease both;
}

.download-counter {
  margin: -4px 0 24px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 14px;
  border: 1px solid color-mix(in srgb, var(--teal) 34%, var(--line));
  border-radius: 12px;
  background: rgb(14 185 165 / 7%);
}

.download-counter-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.download-counter strong {
  color: var(--text);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.download-counter[data-state="error"] strong {
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}

.card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.card-actions > a:not(.card-primary) {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.card-actions > a:not(.card-primary):hover,
.card-actions > a:not(.card-primary):focus-visible {
  color: var(--teal);
  transform: translateY(-2px);
}

.card-actions > a:not(.card-primary):active {
  transform: scale(0.96);
}

.card-actions a:not(.card-primary) {
  color: var(--muted);
}

.card-primary {
  min-height: 43px;
  padding: 9px 14px;
  border-radius: 10px;
}

.empty-filter {
  padding: 36px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.about-section {
  margin-bottom: 110px;
  padding: clamp(34px, 6vw, 70px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.enhanced [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
}

.enhanced [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 620ms ease,
    transform 620ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.enhanced .project-card:nth-child(2n).is-visible {
  transition-delay: 70ms;
}

.project-card.filter-enter {
  animation: filter-enter 320ms ease both;
}

@keyframes live-pulse {
  60%,
  100% {
    box-shadow: 0 0 0 13px rgb(65 206 22 / 0%);
  }
}

@keyframes loader-progress {
  from {
    opacity: 0.72;
    transform: scaleX(0.1);
  }

  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes details-enter {
  from {
    opacity: 0;
    transform: translateY(-7px);
  }
}

@keyframes filter-enter {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }
}

.about-section h2 {
  max-width: 820px;
  margin-bottom: 20px;
}

.about-section > p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  font-size: 18px;
}

footer {
  width: min(1180px, calc(100% - 32px));
  min-height: 90px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 22px;
}

@media (max-width: 900px) {
  .intro {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-visual {
    width: min(560px, 100%);
  }
}

@media (max-width: 720px) {
  .site-header nav {
    gap: 14px;
  }

  .site-header nav a:last-child {
    display: none;
  }

  .intro {
    min-height: auto;
    padding-top: 42px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .project-filter {
    width: 100%;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .update-grid {
    grid-template-columns: 1fr;
  }

  .legal-grid {
    grid-template-columns: 1fr;
  }

  .legal-card-wide {
    grid-column: auto;
  }

  .project-card > p {
    min-height: 0;
  }
}

@media (max-width: 380px) {
  .wordmark strong {
    display: none;
  }

  h1 {
    font-size: 41px;
  }

  footer {
    padding-block: 20px;
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .enhanced [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .loader-track i {
    width: 100%;
    animation: none !important;
    transform: none;
  }
}
