:root {
  --bg: #f7f7f3;
  --paper: #fbfbf8;
  --text: #2b2823;
  --muted: #746d63;
  --border: rgba(43, 40, 35, 0.14);
  --surface: rgba(255, 255, 255, 0.18);
  --max-width: 1040px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #161714;
  --paper: #1d1f1b;
  --text: #f1efe8;
  --muted: #b3ada1;
  --border: rgba(241, 239, 232, 0.16);
  --surface: rgba(255, 255, 255, 0.05);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background: linear-gradient(
    180deg,
    var(--paper) 0%,
    var(--bg) 100%
  );
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--text) 8%, transparent),
    transparent 60%
  );
}

.site-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 1rem 0 3.5rem;
}

.site-header,
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
}

.site-header {
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.site-footer {
  justify-content: flex-start;
  align-items: center;
  border-top: 1px solid var(--border);
}

.wordmark,
.site-nav a,
.inline-link,
.footer-links a {
  color: var(--text);
  text-decoration: none;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
}

.wordmark,
.site-nav a,
.button,
.eyebrow,
.section-label,
.footer-links a,
.portrait-block figcaption {
  font-family: "Courier Prime", monospace;
}

.wordmark {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav,
.footer-links,
.app-header,
.button-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-nav,
.footer-links {
  align-items: center;
}

.app-header,
.button-group {
  align-items: baseline;
}

.site-nav a {
  padding: 0.15rem 0;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--text);
  border-color: var(--text);
}

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

.theme-toggle-label,
.theme-toggle-value {
  font-family: "Courier Prime", monospace;
  font-size: 0.78rem;
  line-height: 1;
}

.theme-toggle-label {
  color: var(--muted);
}

.theme-toggle-value {
  padding: 0.18rem 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

main {
  display: grid;
  gap: 1.5rem;
  padding: 0.75rem 0 0;
}

.hero {
  padding: 1rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(140px, 190px);
  gap: 2rem;
  align-items: start;
}

.hero-compact h1 {
  max-width: 14ch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.section-label {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1,
h2 {
  font-family: "Courier Prime", monospace;
  font-weight: 400;
}

h1 {
  max-width: 16ch;
  font-size: clamp(1.45rem, 2.6vw, 2.05rem);
  line-height: 1.22;
}

h2 {
  margin-bottom: 0.9rem;
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.4;
}

h3 {
  font-family: "Courier Prime", monospace;
  font-size: 0.94rem;
  font-weight: 400;
  line-height: 1.5;
}

.lede,
.panel :where(p:not(.section-label)),
.detail-list {
  max-width: 68ch;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.78;
}

.lede {
  margin: 1rem 0 0;
}

.panel > p:not(.section-label) {
  margin: 0;
}

.panel > p:not(.section-label) + p:not(.section-label),
.panel > p:not(.section-label) + .button {
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
}

.button-primary {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
}

.button-secondary {
  background: transparent;
}

.button-group {
  justify-content: flex-end;
}

.feature-columns,
.app-list {
  display: grid;
  gap: 1.25rem;
}

.feature-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto;
  row-gap: 1.5rem;
}

.feature-column {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
}

.panel {
  padding: 1.25rem 0 1.5rem;
  border-top: 1px solid var(--border);
}

.app-card-layout {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.app-copy {
  min-width: 0;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}

.detail-list {
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.tool-groups {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 1rem;
}

.tool-group-title {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.tool-group-wide {
  grid-column: 1 / -1;
}

.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
}

.tool-list li {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: "Courier Prime", monospace;
  font-size: 0.82rem;
  line-height: 1.2;
  background: var(--surface);
}

.app-icon-block {
  margin: 0.2rem 0 0;
}

.app-icon-mask {
  width: 92px;
  height: 92px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

.app-icon {
  display: block;
  width: 92px;
  height: 92px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

.app-icon-mask .app-icon {
  border: 0;
  border-radius: 0;
  background: transparent;
  transform: scale(1.045);
}

.portrait-block {
  margin: 0;
  justify-self: end;
}

.detail-list li {
  position: relative;
  margin-bottom: 0.7rem;
  padding-left: 1.15rem;
}

.detail-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78rem;
  width: 0.38rem;
  height: 0.38rem;
  background: var(--text);
}

.app-note {
  margin: 1rem 0 0;
  font-size: 0.88rem;
}

.inline-link {
  border-bottom: 1px solid color-mix(in srgb, var(--text) 45%, transparent);
}

.portrait {
  display: block;
  width: 100%;
  max-width: 165px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 50%;
  filter: grayscale(100%) contrast(0.94) brightness(1.03);
  background: var(--surface);
}

.portrait-block figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  width: 165px;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.site-footer {
  margin-top: 1.5rem;
}

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

.footer-links .section-label {
  margin: 0;
}

.footer-separator {
  margin: 0;
  position: relative;
  top: -0.03em;
  line-height: 1;
}

@media (max-width: 840px) {
  .hero-layout,
  .feature-columns {
    grid-template-columns: 1fr;
  }

  .feature-columns {
    row-gap: 1.25rem;
  }

  .feature-column {
    display: flex;
    flex-direction: column;
    grid-row: auto;
    gap: 1.5rem;
  }

  .site-header,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  h1 {
    max-width: 100%;
  }

  .portrait {
    max-width: 150px;
  }

  .portrait-block figcaption {
    width: 150px;
    font-size: 0.84rem;
    letter-spacing: 0.06em;
  }

  .portrait-block {
    justify-self: start;
  }

  .app-card-layout {
    grid-template-columns: 1fr;
  }

  .app-header {
    grid-template-columns: 1fr;
  }

  .button-group {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .tool-groups {
    grid-template-columns: 1fr;
  }

  .tool-group-wide {
    grid-column: auto;
  }
}

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

@media (max-width: 560px) {
  .site-shell {
    width: min(calc(100% - 1rem), var(--max-width));
  }

  .site-nav {
    width: 100%;
    gap: 0.75rem;
  }
}
