*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --ink: #0B0A07;
  --paper: #F2E6C8;
  --paper-deep: #E3D1A4;
  --line: #0B0A07;
  --muted: #615943;
  --red: #D12D1F;
  --green: #1F7A3B;
  --blue: #2B63D9;
  --brass: #F0C243;
  --white: #FFF8E8;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(11, 10, 7, 0.055) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(rgba(11, 10, 7, 0.04) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

body::selection {
  background: var(--brass);
  color: var(--ink);
}

a {
  color: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  min-height: 68px;
  background: rgba(242, 230, 200, 0.94);
  border-bottom: 3px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand,
.top-nav a {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand {
  gap: 12px;
  padding: 0 22px;
  border-right: 3px solid var(--line);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--paper);
  background: var(--ink);
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
}

.top-nav {
  display: flex;
  margin-left: auto;
}

.top-nav a {
  padding: 0 18px;
  border-left: 3px solid var(--line);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 36px;
  min-height: calc(100vh - 68px);
  padding: 68px 0 44px;
  align-items: end;
}

.hero-copy {
  padding-bottom: 28px;
}

.eyebrow,
.section-code,
.meta {
  margin: 0;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--red);
}

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

h1 {
  max-width: 880px;
  margin-bottom: 22px;
  font-size: clamp(4rem, 11vw, 9.8rem);
  line-height: 0.86;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-lede {
  max-width: 680px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-actions,
.store-links,
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-primary,
.button-secondary,
.store-links a,
.legal-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 3px solid var(--line);
  color: var(--ink);
  background: var(--paper);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 130ms ease, background-color 130ms ease, color 130ms ease;
}

.button-primary,
.legal-links a:first-child {
  background: var(--red);
  color: var(--white);
}

.button-secondary {
  background: var(--green);
  color: var(--white);
}

.button-primary:hover,
.button-secondary:hover,
.store-links a:hover,
.legal-links a:hover {
  transform: translate(-3px, -3px);
  box-shadow: 3px 3px 0 var(--ink);
}

.signal-board {
  border: 3px solid var(--line);
  background: var(--ink);
  color: var(--paper);
}

.signal-row {
  display: grid;
  grid-template-columns: 116px 1fr;
  min-height: 78px;
  border-bottom: 3px solid var(--paper);
}

.signal-row:last-child {
  border-bottom: 0;
}

.signal-row span,
.signal-row strong {
  display: flex;
  align-items: center;
  padding: 16px;
}

.signal-row span {
  color: var(--brass);
  border-right: 3px solid var(--paper);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.signal-row strong {
  font-size: 1.15rem;
  line-height: 1.15;
}

.section-split,
.legal-strip {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: 34px;
  padding: 54px 0;
  border-top: 4px solid var(--line);
}

.section-split h2,
.legal-strip h2 {
  margin: 6px 0 14px;
  max-width: 9ch;
  font-size: clamp(2.1rem, 4vw, 3.8rem);
  line-height: 0.94;
  overflow-wrap: break-word;
  text-transform: uppercase;
}

.section-note {
  color: var(--muted);
  font-size: 0.98rem;
}

.project-ledger,
.app-stack {
  display: grid;
  gap: 14px;
}

.ledger-line {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: stretch;
  min-height: 110px;
  border: 3px solid var(--line);
  background: var(--paper-deep);
  color: var(--ink);
  text-decoration: none;
}

.featured-line {
  background:
    linear-gradient(135deg, rgba(31, 122, 59, 0.18), transparent 50%),
    var(--paper-deep);
}

.line-number,
.ledger-line em {
  display: flex;
  align-items: center;
  padding: 16px;
  font-family: "Courier New", monospace;
  font-style: normal;
  font-weight: 900;
}

.line-number {
  justify-content: center;
  border-right: 3px solid var(--line);
  background: var(--green);
  color: var(--white);
}

.ledger-line span:nth-child(2) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 0;
}

.ledger-line strong {
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.86;
}

.ledger-line small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 1rem;
}

.ledger-line em {
  border-left: 3px solid var(--line);
  background: var(--brass);
}

.app-entry {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
  border: 3px solid var(--line);
  background: var(--white);
}

.app-entry-wide {
  background:
    linear-gradient(90deg, rgba(209, 45, 31, 0.14), transparent 58%),
    var(--white);
}

.app-entry img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border: 3px solid var(--line);
}

.app-copy {
  min-width: 0;
  padding: 2px 0 0;
}

.app-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--line);
}

.app-head h3 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.5rem);
  line-height: 1;
  text-transform: uppercase;
}

.app-head span {
  padding-bottom: 7px;
  color: var(--red);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-copy p {
  max-width: 720px;
  margin-bottom: 14px;
  color: var(--muted);
}

.store-links a {
  min-height: 36px;
  padding: 0 12px;
  border-width: 2px;
  background: transparent;
}

.store-links a:hover {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.legal-strip {
  align-items: center;
  padding-bottom: 72px;
}

.site-footer {
  border-top: 3px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  padding: 18px 24px;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.legal-page main {
  width: min(860px, calc(100% - 32px));
}

.legal-main {
  padding: 64px 0 82px;
}

.legal-main h1 {
  margin-top: 10px;
  font-size: clamp(3rem, 9vw, 7.2rem);
}

.legal-main .meta {
  margin-bottom: 34px;
  color: var(--green);
}

.legal-main p,
.legal-main li {
  color: #2A2418;
  font-size: 1.03rem;
}

.legal-main h2 {
  margin: 34px 0 8px;
  padding-top: 14px;
  border-top: 3px solid var(--line);
  font-size: 1.25rem;
  text-transform: uppercase;
}

.legal-main ul {
  margin: 0 0 18px;
  padding-left: 22px;
}

.legal-main a {
  color: var(--blue);
  font-weight: 800;
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media (max-width: 860px) {
  .site-header {
    position: static;
    flex-direction: column;
  }

  .brand {
    min-height: 62px;
    border-right: 0;
    border-bottom: 3px solid var(--line);
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
  }

  .top-nav a {
    justify-content: center;
    min-height: 44px;
    padding: 0 8px;
    border-left: 0;
    border-right: 3px solid var(--line);
  }

  .top-nav a:last-child {
    border-right: 0;
  }

  .hero-grid,
  .section-split,
  .legal-strip {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: 0;
    padding-top: 42px;
  }

  .signal-board {
    max-width: 520px;
  }

  .section-split,
  .legal-strip {
    gap: 18px;
    padding: 42px 0;
  }

  .ledger-line {
    grid-template-columns: 64px 1fr;
  }

  .ledger-line em {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 3px solid var(--line);
  }
}

@media (max-width: 560px) {
  main,
  .legal-page main {
    width: min(100% - 20px, 1180px);
  }

  .hero-actions,
  .legal-links {
    flex-direction: column;
  }

  .button-primary,
  .button-secondary,
  .legal-links a {
    justify-content: center;
    width: 100%;
  }

  .app-entry {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
  }

  .app-entry img {
    width: 78px;
    height: 78px;
  }

  .app-head {
    display: block;
  }

  .app-head span {
    display: inline-block;
    padding: 6px 0 4px;
    white-space: normal;
  }

  .store-links {
    gap: 8px;
  }

  .store-links a {
    min-height: 34px;
  }

  .signal-row {
    grid-template-columns: 96px 1fr;
  }
}
