:root {
  color-scheme: light dark;
  --brand-gradient: linear-gradient(
    112deg,
    #11895f 0%,
    #6a9f45 20%,
    #c5a136 38%,
    #e08233 55%,
    #d75a3a 72%,
    #b83a4c 100%
  );
  --canvas: #faf9f6;
  --canvas-soft: #f0eee8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #211f1c;
  --muted: #6b655d;
  --faint: rgba(33, 31, 28, 0.1);
  --ring: rgba(33, 31, 28, 0.08);
  --accent: #0e7c68;
  --accent-strong: #b83244;
  --accent-soft: rgba(14, 124, 104, 0.13);
  --accent-line: rgba(14, 124, 104, 0.08);
  --accent-ring: rgba(14, 124, 104, 0.26);
  --focus: #1f9f86;
  --icon-well: rgba(255, 255, 255, 0.78);
  --shadow: 0 24px 60px rgba(33, 31, 28, 0.08), 0 1px 2px rgba(33, 31, 28, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #11100e;
    --canvas-soft: #1a1815;
    --surface: rgba(27, 25, 22, 0.78);
    --surface-strong: #211f1c;
    --text: #f5f1e8;
    --muted: #bbb3a6;
    --faint: rgba(255, 255, 255, 0.1);
    --ring: rgba(255, 255, 255, 0.1);
    --accent: #46c8aa;
    --accent-strong: #ff7d8d;
    --accent-soft: rgba(70, 200, 170, 0.16);
    --accent-line: rgba(70, 200, 170, 0.1);
    --accent-ring: rgba(70, 200, 170, 0.24);
    --focus: #5ee4c8;
    --icon-well: rgba(255, 255, 255, 0.08);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.34), 0 1px 2px rgba(0, 0, 0, 0.28);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #faf9f6;
  --canvas-soft: #f0eee8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #211f1c;
  --muted: #6b655d;
  --faint: rgba(33, 31, 28, 0.1);
  --ring: rgba(33, 31, 28, 0.08);
  --accent: #0e7c68;
  --accent-strong: #b83244;
  --accent-soft: rgba(14, 124, 104, 0.13);
  --accent-line: rgba(14, 124, 104, 0.08);
  --accent-ring: rgba(14, 124, 104, 0.26);
  --focus: #1f9f86;
  --icon-well: rgba(255, 255, 255, 0.78);
  --shadow: 0 24px 60px rgba(33, 31, 28, 0.08), 0 1px 2px rgba(33, 31, 28, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #11100e;
  --canvas-soft: #1a1815;
  --surface: rgba(27, 25, 22, 0.78);
  --surface-strong: #211f1c;
  --text: #f5f1e8;
  --muted: #bbb3a6;
  --faint: rgba(255, 255, 255, 0.1);
  --ring: rgba(255, 255, 255, 0.1);
  --accent: #46c8aa;
  --accent-strong: #ff7d8d;
  --accent-soft: rgba(70, 200, 170, 0.16);
  --accent-line: rgba(70, 200, 170, 0.1);
  --accent-ring: rgba(70, 200, 170, 0.24);
  --focus: #5ee4c8;
  --icon-well: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34), 0 1px 2px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  background: linear-gradient(
      135deg,
      transparent 0 58%,
      var(--accent-line) 58% 59%,
      transparent 59%
    ),
    linear-gradient(180deg, var(--canvas) 0%, var(--canvas-soft) 100%);
  color: var(--text);
  font:
    1rem/1.7 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

img {
  display: block;
  max-width: 100%;
}

#doc {
  isolate: isolate;
  position: relative;
  width: min(100% - 32px, 1030px);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) 0 28px;
}

.theme-toggle {
  position: fixed;
  z-index: 10;
  top: 22px;
  right: 22px;
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px var(--ring),
    0 12px 32px rgba(33, 31, 28, 0.12),
    0 1px 2px rgba(33, 31, 28, 0.08);
  color: var(--text);
  cursor: pointer;
  transition-property: transform, box-shadow, background-color;
  transition-duration: 180ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.theme-toggle:hover {
  background: var(--surface-strong);
  box-shadow:
    inset 0 0 0 1px var(--accent-ring),
    0 16px 38px rgba(33, 31, 28, 0.14),
    0 1px 2px rgba(33, 31, 28, 0.08);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.theme-toggle__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.theme-toggle__icon {
  grid-area: 1 / 1;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
  opacity: 0;
  filter: blur(4px);
  transform: scale(0.25);
  transition-property: transform, opacity, filter;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.theme-toggle__icon--sun {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

:root[data-active-theme="dark"] .theme-toggle__icon--sun {
  opacity: 0;
  filter: blur(4px);
  transform: scale(0.25);
}

:root[data-active-theme="dark"] .theme-toggle__icon--moon {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.site-header {
  display: grid;
  gap: 14px;
  padding: clamp(28px, 6vw, 68px) 0 clamp(30px, 5vw, 58px);
}

#doc:not(.home) .site-header {
  padding: clamp(20px, 4vw, 38px) 0 18px;
}

.eyebrow {
  width: fit-content;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 9px 12px;
}

h1,
h2,
h3 {
  font-weight: 650;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(4.5rem, 17vw, 12.5rem);
  line-height: 0.95;
  max-width: 8ch;
}

#doc:not(.home) h1 {
  max-width: none;
  font-size: clamp(3.2rem, 10vw, 7rem);
  line-height: 1;
}

h1 a {
  display: inline-block;
  padding-bottom: 0.06em;
}

.lede {
  max-width: 34ch;
  color: var(--muted);
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  line-height: 1.25;
  text-wrap: pretty;
}

.rainbow,
.rainbow--footer,
.rainbow--title {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.rainbow--title,
.rainbow--footer {
  background-image: var(--brand-gradient);
}

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

.section-heading h2 {
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
}

.applist ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
}

.applist li {
  min-height: 176px;
  height: 100%;
  border-radius: 24px;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px var(--ring),
    var(--shadow);
  padding: 18px;
  transition-property: transform, box-shadow, background-color;
  transition-duration: 180ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.applist li:hover {
  background: var(--surface-strong);
  box-shadow:
    inset 0 0 0 1px var(--accent-ring),
    0 28px 70px rgba(33, 31, 28, 0.12),
    0 1px 2px rgba(33, 31, 28, 0.08);
  transform: translateY(-3px);
}

.applist li:active {
  transform: scale(0.96);
}

.applist a {
  display: grid;
  height: 100%;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
}

.icon {
  width: 70px;
  border-radius: 22px;
  padding: 4px;
  background: var(--icon-well);
  box-shadow: inset 0 0 0 1px var(--faint);
}

.icon img {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
}

.title {
  align-self: end;
  display: grid;
  gap: 6px;
}

.app-name {
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  font-weight: 680;
  line-height: 1.05;
  text-wrap: balance;
}

.app-meta {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 520;
  line-height: 1.3;
}

.app-action {
  display: inline-grid;
  width: 40px;
  height: 40px;
  align-items: center;
  align-self: end;
  justify-self: end;
  justify-items: end;
  border-radius: 999px;
  color: var(--accent);
}

.app-action__icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  transition-property: transform;
  transition-duration: 180ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.applist li:hover .app-action__icon {
  transform: translateX(3px);
}

main:not(.applist) {
  max-width: 720px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px var(--ring),
    var(--shadow);
  padding: clamp(24px, 5vw, 48px);
}

main:not(.applist) h2 {
  margin-bottom: 22px;
  font-size: clamp(2rem, 7vw, 4.5rem);
  line-height: 0.95;
}

main:not(.applist) h3 {
  margin-top: 30px;
  color: var(--accent-strong);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
}

main:not(.applist) p {
  margin-top: 14px;
  color: var(--text);
  font-size: 1.05rem;
  text-wrap: pretty;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: clamp(34px, 6vw, 68px);
  padding-top: 24px;
  color: var(--muted);
  font-size: 0.95rem;
}

footer p {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}

footer a,
footer span {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
}

footer a {
  transition-property: color, transform;
  transition-duration: 160ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

footer a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

footer br {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .icon img {
    outline-color: rgba(255, 255, 255, 0.1);
  }

  .applist li:hover {
    box-shadow:
      inset 0 0 0 1px var(--accent-ring),
      0 28px 70px rgba(0, 0, 0, 0.42),
      0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] .icon img {
  outline-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .applist li:hover,
:root[data-theme="dark"] .theme-toggle:hover {
  box-shadow:
    inset 0 0 0 1px var(--accent-ring),
    0 28px 70px rgba(0, 0, 0, 0.42),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

@media (max-width: 820px) {
  .applist ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  #doc {
    width: min(100% - 24px, 1030px);
    padding-top: 24px;
  }

  .theme-toggle {
    top: 12px;
    right: 12px;
  }

  .site-header {
    padding-bottom: 34px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .section-heading p {
    max-width: 34ch;
    text-align: left;
  }

  .applist ul {
    grid-template-columns: 1fr;
  }

  .applist li {
    min-height: 132px;
    border-radius: 20px;
    padding: 14px;
  }

  .applist a {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr;
    align-items: center;
    gap: 16px;
  }

  .title {
    align-self: center;
  }

  .app-name {
    font-size: 1.25rem;
  }

  .app-action {
    align-self: center;
    justify-content: end;
  }

  main:not(.applist) {
    border-radius: 20px;
    padding: 22px;
  }

  footer {
    margin-top: 34px;
  }

  footer p {
    gap: 4px 14px;
  }
}
