/* Design of the site: the same as the app, which follows the display of the IndiaNavi. Only the 7 colors of the
   ACeP display, flat surfaces, black outlines, square corners and hard shadows. */
:root {
  --ink: #000000;
  --paper: #ffffff;
  --green: #00ff00;
  --blue: #0000ff;
  --red: #ff0000;
  --yellow: #ffff32;
  --orange: #ff7f00;
  --tint: #f4f4ef;

  --border: 2px;
  --shadow: 4px;
  --gutter: 16px;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { background: var(--yellow); color: var(--ink); }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0 4px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  white-space: nowrap;
}

h1, h2, h3 { font-family: var(--mono); line-height: 1.2; margin: 0; }
h3 { font-size: 16px; text-transform: uppercase; letter-spacing: 0.02em; }

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

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

/* Pixel font and icons, drawn by pixel.js */
[data-pixel] { display: inline-block; line-height: 0; }
[data-pixel] svg { height: 100%; width: auto; display: block; }
[data-icon] { display: inline-block; flex: none; width: 32px; height: 32px; }
[data-icon] svg { width: 100%; height: 100%; display: block; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: var(--border) solid var(--ink);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { background: none; }
.brand img { border: var(--border) solid var(--ink); image-rendering: pixelated; }
.brand [data-pixel] { height: 20px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
nav a {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 8px;
  border: var(--border) solid transparent;
}
nav a:hover { background: var(--green); border-color: var(--ink); }

/* Buttons, the same as in the app: they move into their shadow when pressed */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 16px;
  border: var(--border) solid var(--ink);
  box-shadow: var(--shadow) var(--shadow) 0 var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 60ms, box-shadow 60ms;
}
.button:hover { background: var(--yellow); color: var(--ink); }
.button:active { transform: translate(var(--shadow), var(--shadow)); box-shadow: none; }
.button [data-icon] { width: 32px; height: 32px; }
.button.primary { background: var(--green); }
.button.secondary { background: var(--orange); }
.button.paper, .button.plain { background: var(--paper); }
.button.compact { min-height: 40px; padding: 2px 12px; font-size: 14px; }
.button.compact [data-icon] { width: 24px; height: 24px; }
.button[aria-pressed="true"] { background: var(--yellow); }

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }

/* Hero */
.hero { background: var(--green); border-bottom: var(--border) solid var(--ink); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 56px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 4px 10px 4px 6px;
  background: var(--paper);
  border: var(--border) solid var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}
.kicker [data-icon] { width: 24px; height: 24px; }
.hero-title { display: block; height: clamp(44px, 7vw, 80px); margin: 0 0 24px; }
.hero-title svg { max-width: 100%; height: 100%; }
.lead { font-size: 20px; line-height: 1.5; margin: 0 0 14px; max-width: 34em; }
.lead-small { margin: 0; max-width: 34em; }

/* Device mock-up */
.device-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.device {
  position: relative;
  width: min(100%, 496px);
  padding: 22px 22px 54px;
  background: #222;
  border: var(--border) solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}
.device::before {
  content: "WANDERNAVI";
  position: absolute;
  bottom: 18px;
  left: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #888;
}
.device-screen { border: var(--border) solid var(--ink); background: var(--paper); line-height: 0; }
.device-screen img { display: block; width: 100%; }
@media (min-resolution: 2dppx) { .device-screen img { image-rendering: pixelated; } }
.device-button {
  position: absolute;
  right: 22px;
  bottom: 14px;
  width: 26px;
  height: 26px;
  background: var(--orange);
  border: var(--border) solid var(--ink);
}
figcaption { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.caption-note { font-size: 13px; opacity: 0.75; max-width: 28em; }

/* Dithered divider, two display colors mixed like in the map tiles */
.dither {
  height: 16px;
  border-bottom: var(--border) solid var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(45deg, var(--ink) 25%, transparent 25%, transparent 75%, var(--ink) 75%),
    linear-gradient(45deg, var(--ink) 25%, transparent 25%, transparent 75%, var(--ink) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  image-rendering: pixelated;
}

/* Sections */
.section { padding: 72px 0; }
.section.tinted { background: var(--tint); border-top: var(--border) solid var(--ink); border-bottom: var(--border) solid var(--ink); }
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(22px, 3.2vw, 30px);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 20px;
}
.section-title .bar {
  flex: none;
  width: 14px;
  height: 28px;
  background: var(--orange);
  border: var(--border) solid var(--ink);
}
.section-lead { max-width: 44em; margin: 0 0 36px; font-size: 18px; }

/* Cards */
.card {
  background: var(--paper);
  border: var(--border) solid var(--ink);
  padding: 18px;
}
.card p { margin: 8px 0 0; font-size: 15.5px; }
.card .icon { width: 48px; height: 48px; margin-bottom: 12px; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.features .card:hover { box-shadow: var(--shadow) var(--shadow) 0 var(--ink); }

/* Palette */
.display-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.display-grid p { margin: 0 0 14px; max-width: 36em; }
.palette { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.palette li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
}
.palette b { width: 1.2em; text-align: right; opacity: 0.55; }
.swatch {
  display: flex;
  width: 120px;
  height: 32px;
  border: var(--border) solid var(--ink);
  background: linear-gradient(90deg, var(--pure) 50%, var(--panel) 50%);
}

/* Steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 8px 0;
  margin-bottom: 14px;
  background: var(--ink);
  color: var(--green);
}
.step-number svg { height: 100%; }
.segments {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-top: 28px;
  border: var(--border) solid var(--ink);
}
.segments span { flex: 1; height: 18px; border: 1px solid var(--ink); background: var(--green); }
.segments span:nth-child(n + 9) { background: var(--paper); }

/* App */
.app-grid { display: grid; grid-template-columns: 280px 1fr; gap: 56px; align-items: center; }
.app-grid p { max-width: 38em; margin: 0 0 14px; }
.app-icon img {
  display: block;
  width: 100%;
  border: var(--border) solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  image-rendering: pixelated;
}
.checklist { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 12px; }
.checklist [data-icon] { width: 32px; height: 32px; }

/* Specs */
.table-wrap { overflow-x: auto; }
.specs {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: var(--border) solid var(--ink);
}
.specs th, .specs td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--ink); }
.specs th {
  width: 30%;
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 14px;
  border-right: var(--border) solid var(--ink);
  background: var(--yellow);
}
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }

/* Repositories */
.repos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.repo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow) var(--shadow) 0 var(--ink);
  transition: transform 60ms, box-shadow 60ms;
}
.repo h3 { text-transform: none; word-break: break-word; }
.repo p { flex: 1; margin-bottom: 14px; }
.repo:hover { background: var(--paper); }
.repo:hover h3 { background: var(--yellow); }
.repo:active { transform: translate(var(--shadow), var(--shadow)); box-shadow: none; }
.badge {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 8px;
  border: 1.5px solid var(--ink);
}
.badge.green { background: var(--green); }
.badge.orange { background: var(--orange); }
.badge.yellow { background: var(--yellow); }

/* Name */
.name-grid { display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: center; }
.name-grid p { max-width: 38em; margin: 0; }
.indianavi { display: block; width: 100%; }

/* Footer */
.footer { background: var(--ink); color: var(--paper); padding: 28px 0; font-size: 14px; }
.footer a { color: var(--green); }
.footer a:hover { color: var(--ink); background: var(--green); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--green); }
.footer-brand [data-icon] { width: 32px; height: 32px; background: var(--green); border: var(--border) solid var(--green); }
.footer-brand [data-pixel] { height: 18px; }

/* Smaller screens */
@media (max-width: 900px) {
  .hero-grid, .display-grid, .app-grid { grid-template-columns: 1fr; gap: 36px; }
  .device-figure { justify-self: center; width: 100%; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .repos { grid-template-columns: 1fr; }
  .app-icon { max-width: 200px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .section { padding: 52px 0; }
  .hero-grid { padding-top: 36px; padding-bottom: 40px; }
  .lead { font-size: 18px; }
  nav { display: none; }
  .steps { grid-template-columns: 1fr; }
  .name-grid { grid-template-columns: 1fr; }
  .indianavi { max-width: 180px; }
  .specs th { width: 38%; padding: 10px; }
  .specs td { padding: 10px; }
  code { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .repo { transition: none; }
}
