/* =========================================================
   Miles — one-page site styles
   Everything you'd want to tweak lives in :root at the top.
   Change a color/size there and it updates everywhere it's used.
   The diagrams further down use their own inline SVG colors
   (blue/orange/green/red/teal/purple) that mirror the original
   slides — edit the fill="" / stroke="" attributes in index.html
   to change a diagram's colors.
   ========================================================= */

:root {
  /* Colors — sampled from the Miles deck (Google Slides default palette) */
  --color-bg: #ffffff;
  --color-bg-alt: #f6f5f3;      /* light section background, alternates with white */
  --color-text: #262524;
  --color-text-muted: #605d59;
  --color-primary: #990000;     /* Miles maroon — headings, buttons, accents */
  --color-primary-dark: #660000;
  --color-border: #e5e1dc;
  --color-success: #6aa84f;
  --color-failure: #cc0000;

  /* Type */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --font-mono: "Courier New", Courier, monospace;

  /* Layout */
  --max-width: 980px;
  --section-padding: 64px 0;
}

/* ---------- Reset-ish basics ---------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.2;
  margin: 0 0 16px;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.8rem; margin-bottom: 24px; }
h3 { font-size: 1.15rem; margin-bottom: 8px; color: var(--color-text); }

.sub-heading {
  margin-top: 40px;
}

p {
  margin: 0 0 16px;
  color: var(--color-text);
}

a {
  color: var(--color-primary);
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: 1.3rem;
  color: var(--color-primary);
}

.logo img {
  width:2rem;
}

.top-icon img {
  width:5rem;
}

.site-header nav a {
  margin-left: 24px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.95rem;
}

.site-header nav a:hover {
  color: var(--color-primary);
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 64px;
  text-align: center;
  background: var(--color-bg-alt);
}

.logo-mark-big {
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 16px;
}

.hero-sub {
  max-width: 620px;
  margin: 0 auto 32px;
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  background: var(--color-primary);
  color: #ffffff;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.95rem;
}

.button:hover {
  background: var(--color-primary-dark);
}

.button-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.button-secondary:hover {
  background: var(--color-primary);
  color: #ffffff;
}

/* ---------- Generic sections ---------- */
.section {
  padding: var(--section-padding);
}

.section.alt {
  background: var(--color-bg-alt);
}

.section p {
  max-width: 760px;
}

.summary-list {
  max-width: 760px;
  padding-left: 20px;
}

.summary-list li {
  margin-bottom: 10px;
}

/* ---------- Card grid (How it works) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 24px;
}

.card-number {
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: #ffffff;
  font-weight: bold;
  margin-bottom: 12px;
}

/* ---------- Diagrams (inline SVG) ---------- */
.diagram-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
  margin: 24px 0;
}

.diagram-box img {
  width:100%;
}

.diagram {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-label {
  font-family: var(--font-body);
  font-size: 13px;
  fill: var(--color-text);
}

.diagram-label-inv {
  font-family: var(--font-body);
  font-size: 12px;
  fill: #ffffff;
}

/* ---------- Trust chain example (two side-by-side diagrams) ---------- */
.chain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.chain-example {
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--color-border);
}

.chain-example img {
  width: 100%;
}

.chain-example.success {
  background: #f2f8ef;
}

.chain-example.failure {
  background: #fbeceb;
}

.chain-label {
  display: block;
  font-weight: bold;
  margin-bottom: 12px;
}

.chain-example.success .chain-label { color: var(--color-success); }
.chain-example.failure .chain-label { color: var(--color-failure); }

.chain-example .diagram {
  background: #ffffff;
  border-radius: 6px;
  margin-bottom: 12px;
}

/* ---------- HGC field / byte diagram ---------- */
.field-diagram {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  margin-top: 24px;
}

.field-diagram img {
  width:100%;
}

.field-group {
  border: 2px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.field-row, .field-group > .field-row {
  display: flex;
}

.field-group > .field {
  display: inline-block;
}

.field {
  background: #eeeeee;
  border-right: 1px solid var(--color-border);
  padding: 14px 16px;
  font-size: 0.9rem;
  text-align: center;
  white-space: nowrap;
}

.field:last-child {
  border-right: none;
}

.field-repeat {
  color: var(--color-text-muted);
  font-style: italic;
}

.field-repeat-header {
  background: #45818e;
  color: #ffffff;
  text-align: center;
  padding: 6px;
  font-size: 0.85rem;
}

.field-wide {
  flex: 1;
  white-space: normal;
}

/* first field-group is a plain row, not wrapped in field-row */
.field-diagram > .field-group:first-child {
  display: flex;
}

/* ---------- Screenshots (itch.io / Steam / LinkedIn) ---------- */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin: 24px 0;
  align-items: start;
}

.shot-grid img {
  width:100%;
}

.shot {
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-bg);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.shot figcaption {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.stat-shot {
  display: flex;
  flex-direction: column;
}

.stat-callout {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 16px;
  background: var(--color-bg-alt);
}

.stat-callout .badge {
  width: 40px;
  height: 40px;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: bold;
  color: var(--color-primary);
}

.stat-caption {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Content feed example: two phone screenshots with an arrow between */
.feed-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 260px));
  justify-content: center;
  align-items: center;
}

.feed-arrow {
  text-align: center;
  font-size: 2rem;
  color: var(--color-primary);
}

/* ---------- Code blocks (node / edge types) ---------- */
.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 18px;
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre;
}

/* ---------- Cost table ---------- */
.cost-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.95rem;
}

.cost-table th {
  background: var(--color-primary);
  color: #ffffff;
  text-align: left;
  padding: 10px 14px;
}

.cost-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
}

.cost-table tr:nth-child(even) td {
  background: var(--color-bg-alt);
}

/* ---------- CTA section ---------- */
.section.cta {
  text-align: center;
  background: var(--color-primary-dark);
  color: #ffffff;
}

.section.cta h2 {
  color: #ffffff;
}

.section.cta p {
  color: #f3d9d9;
  margin-left: auto;
  margin-right: auto;
}

.cta-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.section.cta .button-secondary {
  color: #ffffff;
  border-color: #ffffff;
}

.section.cta .button-secondary:hover {
  background: #ffffff;
  color: var(--color-primary-dark);
}

.fine-print {
  font-size: 0.85rem;
  color: #e8bcbc;
  max-width: 560px;
  margin: 0 auto;
}

.fine-print code {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 32px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    gap: 12px;
  }

  .site-header nav a {
    margin: 0 10px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .hero { padding: 56px 0 40px; }

  .field-diagram > .field-group:first-child {
    flex-wrap: wrap;
  }
}
