:root {
  color-scheme: light dark;
  --ink: #121212; /* TDS ink900 */
  --paper: #edf2e2; /* TDS paper / primaryLight */
  --paper-accent: #eef1dd; /* TDS elevated */
  --grid-color: rgba(33, 33, 33, 0.08); /* TDS textPrimary with alpha */
  --grid-spacing: 8px;
  --shadow-strong: rgba(18, 18, 18, 0.85); /* TDS ink900 */
  --shadow-solid: #121212;
  --corner-radius: 0;
  --font-stack: "IBM Plex Mono", "Courier New", monospace;
  background-color: var(--paper);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-stack);
  background: repeating-linear-gradient(
    135deg,
    var(--grid-color),
    var(--grid-color) 2px,
    transparent 2px,
    transparent var(--grid-spacing)
  );
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 64px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

header {
  text-transform: uppercase;
  border: 4px solid var(--ink);
  padding: 32px;
  background: var(--paper);
  box-shadow: 8px 8px 0 var(--shadow-solid);
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: 0.1em;
}

p {
  margin: 0 0 16px;
  line-height: 1.5;
}

a {
  color: #222a3d; /* TDS primaryDark */
  text-decoration: underline;
  text-decoration-color: rgba(34, 42, 61, 0.3);
}

a:hover,
a:focus-visible {
  text-decoration-color: rgba(34, 42, 61, 1);
}

.tagline {
  font-weight: 600;
}

/* Downloads section */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.download-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 6px 6px 0 var(--shadow-strong);
}

.platform-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.platform-icon {
  color: var(--ink);
  display: flex;
  flex-shrink: 0;
}

.platform-title {
  margin: 0;
  font-size: 1.6rem;
}

.platform-copy {
  margin: 0 0 4px;
}

.cta-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  border: 3px solid var(--ink);
  padding: 14px 16px;
  background: var(--paper-accent);
  font-weight: 700;
}

.btn-cta .icon {
  display: inline-flex;
}

.btn-cta:is(:hover, :focus-visible) {
  outline: none;
  box-shadow: 4px 4px 0 var(--shadow-solid);
}

.btn-cta.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  background: #f2f2f2;
}

.btn-cta.is-disabled:is(:hover, :focus-visible) {
  box-shadow: none;
}

/* Utility classes for responsive visibility */
.hide-card {
  display: none;
}

.hide-cta {
  display: none;
}

section {
  border: 3px solid var(--ink);
  padding: 32px;
  background: rgba(237, 242, 226, 0.95);
  box-shadow: 6px 6px 0 var(--shadow-strong);
}

section h2 {
  margin: 0 0 16px;
  font-size: 1.75rem;
  letter-spacing: 0.08em;
}

.doctrine-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.doctrine-item {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: center;
}

.doctrine-item::before {
  display: none;
}


.doctrine-item:nth-child(even) .doctrine-figure {
  order: 2;
}

.doctrine-item:nth-child(even) .doctrine-copy {
  order: 1;
}

.doctrine-figure {
  display: flex;
  justify-content: center;
}

.doctrine-figure img {
  height: 320px;
  width: auto;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--shadow-solid);
  object-fit: contain;
}

/* Mobile screenshots (portrait, smaller) - items 1, 3, 5 */
.doctrine-item:nth-child(odd) .doctrine-figure img {
  aspect-ratio: 9 / 16;
  object-fit: cover;
  width: 180px;
}

/* Desktop screenshots (landscape, larger) - items 2, 4 */
.doctrine-item:nth-child(even) .doctrine-figure img {
  aspect-ratio: 1824 / 1480;
}

.doctrine-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doctrine-title {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doctrine-copy p {
  margin: 0;
}

footer {
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.6;
}

footer strong {
  text-transform: uppercase;
}

@media (max-width: 600px) {
  main {
    padding: 48px 16px 80px;
  }

  header {
    padding: 24px;
  }

  .doctrine-item {
    grid-template-columns: 1fr;
  }

  .doctrine-item:nth-child(even) .doctrine-figure,
  .doctrine-item:nth-child(even) .doctrine-copy {
    order: unset;
  }

  .doctrine-figure img {
    max-width: 100%;
    height: auto;
    width: 100%;
  }

  /* Mobile screenshots stay smaller */
  .doctrine-item:nth-child(odd) .doctrine-figure img {
    width: min(180px, 100%);
  }

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