/*
  GPS Area public website
  Signature visual idea: an open field-notebook layout with measured guide lines.
  Rules: Apple system fonts only; regular/medium/semibold weights only; mobile-first responsive structure.
*/

:root {
  color-scheme: light dark;
  --blue: #2563eb;
  --green: #0ea66b;
  --amber: #d97706;
  --red: #dc2626;
  --ink: #182033;
  --muted: #5b667a;
  --quiet: #7b8798;
  --paper: #fbfcff;
  --paper-soft: #f1f6ff;
  --line: rgba(24, 32, 51, 0.14);
  --line-soft: rgba(24, 32, 51, 0.08);
  --tint: rgba(37, 99, 235, 0.08);
  --green-tint: rgba(14, 166, 107, 0.10);
  --amber-tint: rgba(217, 119, 6, 0.12);
  --red-tint: rgba(220, 38, 38, 0.10);
  --shell: 1140px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(40px, 7vw, 88px);
  --radius: 22px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef4ff;
    --muted: #b3bed1;
    --quiet: #8e9bb0;
    --paper: #0b1020;
    --paper-soft: #111a2f;
    --line: rgba(238, 244, 255, 0.17);
    --line-soft: rgba(238, 244, 255, 0.10);
    --tint: rgba(96, 165, 250, 0.15);
    --green-tint: rgba(52, 211, 153, 0.13);
    --amber-tint: rgba(251, 191, 36, 0.15);
    --red-tint: rgba(248, 113, 113, 0.13);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, var(--tint), transparent 34rem),
    radial-gradient(circle at 100% 8%, var(--green-tint), transparent 30rem),
    linear-gradient(180deg, var(--paper), var(--paper-soft));
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: 0.006em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.58;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 78%);
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: var(--blue);
  font-weight: 500;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.24em;
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--green);
}

strong,
b {
  font-weight: 600;
}

p,
ul,
ol,
figure,
table {
  margin-top: 0;
}

p:last-child,
ul:last-child,
ol:last-child {
  margin-bottom: 0;
}

.shell {
  width: min(100% - (var(--gutter) * 2), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -56px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  font-weight: 500;
  transition: top 180ms ease;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
}

.brand {
  display: inline-grid;
  grid-template-columns: 48px minmax(0, auto);
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.004em;
  text-decoration: none;
}

.brand-mark,
.brand-logo,
.card-image-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
}

.brand span {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.brand small {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--muted);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  background: var(--tint);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
  padding-block: clamp(48px, 8vw, 100px) clamp(28px, 5vw, 56px);
}

.hero-copy {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  padding: 4px 0 6px;
  color: var(--blue);
  border-bottom: 1px solid currentColor;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.11em;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  max-width: 920px;
  font-size: clamp(2.4rem, 7vw, 4.85rem);
  line-height: 1.1;
  letter-spacing: 0.004em;
  word-spacing: 0.08em;
}

h2 {
  font-size: clamp(1.65rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: 0.002em;
  word-spacing: 0.045em;
}

h3 {
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  line-height: 1.28;
  letter-spacing: 0.004em;
}

.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.32rem);
  font-weight: 400;
  line-height: 1.68;
  word-spacing: 0.035em;
}

.updated {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--quiet);
  font-size: 0.95rem;
  font-weight: 400;
}

.badge-row,
.hero-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 500;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--green);
}

.panel,
.map-card,
.card,
.article-card,
.toc {
  min-width: 0;
  background: transparent;
  box-shadow: none;
}

.panel,
.map-card {
  position: relative;
  padding: clamp(20px, 4vw, 32px) 0 clamp(20px, 4vw, 32px) clamp(20px, 3vw, 32px);
  border-left: 2px solid var(--line);
}

.panel::before,
.map-card::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  width: 2px;
  height: 96px;
  background: linear-gradient(var(--blue), var(--green));
}

.coordinate-grid,
.status-stack {
  display: grid;
  gap: 0;
}

.coordinate-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
}

.coordinate-chip,
.status-chip {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
}

.coordinate-chip strong,
.status-chip strong {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.coordinate-chip span,
.status-chip span {
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.status-stack {
  margin-top: 18px;
}

.status-chip {
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
}

.status-dot {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--green);
}

.status-dot.amber {
  background: var(--amber);
}

.status-dot.blue {
  background: var(--blue);
}

.section {
  padding-block: var(--section);
  border-top: 1px solid var(--line);
}

.section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.58fr);
  gap: clamp(18px, 4vw, 48px);
  align-items: end;
  margin-bottom: clamp(22px, 4vw, 40px);
}

.section-header p {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 clamp(22px, 3.4vw, 40px);
}

.card-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.article-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding-block: clamp(20px, 3vw, 32px);
  border-top: 1px solid var(--line);
}

.card:first-child,
.article-card:first-child {
  border-top-color: var(--line);
}

.card p,
.article-card p,
.article-card li,
.fine-print {
  color: var(--muted);
  font-weight: 400;
}

.card-icon,
.card-image-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 2px;
  color: var(--blue);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1;
}

.card-image-icon {
  padding: 0;
  border: 0;
}

.card:nth-child(2) .card-icon,
.card-icon.green {
  color: var(--green);
}

.card:nth-child(3) .card-icon,
.card-icon.amber {
  color: var(--amber);
}

.card:nth-child(4) .card-icon,
.card-icon.red {
  color: var(--red);
}

.card a.stretched {
  align-self: end;
  margin-top: 6px;
  font-weight: 500;
  text-decoration: none;
}

.card a.stretched::after,
.link-list a::after {
  content: "";
  display: inline-block;
  width: 0.65em;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(180px, 248px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
  padding-bottom: var(--section);
}

.article-stack {
  display: grid;
  gap: clamp(24px, 4vw, 42px);
}

.article-card {
  scroll-margin-top: 96px;
}

.toc {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 0;
  padding-top: 8px;
  border-top: 2px solid var(--blue);
}

.toc strong {
  display: block;
  padding-bottom: 12px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toc a {
  padding: 9px 0;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
}

.toc a:hover {
  color: var(--blue);
}

.callout {
  padding: 16px 0 16px 18px;
  border-left: 3px solid var(--blue);
  background: transparent;
}

.callout.green {
  border-left-color: var(--green);
}

.callout.amber {
  border-left-color: var(--amber);
}

.callout.red {
  border-left-color: var(--red);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 14px 15px 0;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
  line-height: 1.58;
}

th {
  color: var(--ink);
  font-weight: 600;
}

td {
  color: var(--muted);
  font-weight: 400;
}

tr:last-child td {
  border-bottom: 0;
}

.check-list,
.step-list,
.link-list {
  display: grid;
  gap: 12px;
  padding-left: 0;
  list-style: none;
}

.check-list li,
.step-list li,
.link-list li {
  position: relative;
  min-width: 0;
  padding-left: 34px;
}

.check-list li::before,
.step-list li::before,
.link-list li::before {
  position: absolute;
  left: 0;
  top: 0.12em;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--green);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

.check-list li::before {
  content: "✓";
}

.link-list li::before {
  content: "↗";
  color: var(--blue);
}

.step-list {
  counter-reset: steps;
}

.step-list li {
  counter-increment: steps;
}

.step-list li::before {
  content: counter(steps);
  color: var(--blue);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0 4px;
  color: var(--blue);
  border: 0;
  border-bottom: 2px solid currentColor;
  background: transparent;
  font-weight: 500;
  text-decoration: none;
}

.button.secondary {
  color: var(--muted);
}

.button.warning {
  color: var(--amber);
}

.button:hover,
.button.secondary:hover,
.button.warning:hover {
  color: var(--green);
}

.kbd {
  display: inline-block;
  padding: 0 0.4em;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.9em;
  font-weight: 500;
  white-space: nowrap;
}

.footer {
  padding-block: 36px 52px;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(160px, 0.6fr) minmax(190px, 0.75fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
}

.footer-note {
  max-width: 540px;
  margin-top: 14px;
}

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-links > strong {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer a {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.footer a:hover {
  color: var(--blue);
}

@media (max-width: 980px) {
  .nav {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding-block: 12px;
  }

  .brand {
    align-self: flex-start;
  }

  .nav-links {
    justify-content: flex-start;
    overflow-x: auto;
    width: calc(100vw - (var(--gutter) * 2));
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .hero,
  .section-header,
  .article-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-block-start: clamp(36px, 7vw, 64px);
  }

  .panel,
  .map-card {
    padding-left: 20px;
  }

  .toc {
    position: static;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .toc::-webkit-scrollbar {
    display: none;
  }

  .toc strong {
    flex: 0 0 auto;
    padding: 9px 14px 9px 0;
    border-right: 1px solid var(--line);
  }

  .toc a {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    white-space: nowrap;
  }

  .card-grid,
  .card-grid.two,
  .card-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 clamp(18px, 5vw, 32px);
  }
}

@media (max-width: 700px) {
  :root {
    --gutter: 16px;
    --section: 44px;
  }

  body {
    font-size: 15.5px;
    line-height: 1.66;
  }

  .brand {
    grid-template-columns: 42px minmax(0, auto);
    gap: 10px;
  }

  .brand-mark,
  .brand-logo,
  .card-image-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .brand small {
    font-size: 10px;
    letter-spacing: 0.1em;
  }

  .nav-links a {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 13.5px;
  }

  .hero {
    gap: 26px;
    padding-block: 34px 26px;
  }

  .hero-copy {
    gap: 16px;
  }

  h1 {
    font-size: clamp(2.05rem, 11vw, 3.25rem);
    line-height: 1.13;
    letter-spacing: 0.006em;
    word-spacing: 0.075em;
  }

  h2 {
    font-size: clamp(1.55rem, 8vw, 2.2rem);
    line-height: 1.18;
  }

  h3 {
    font-size: 1.14rem;
  }

  .lede {
    font-size: 1.02rem;
  }

  .updated,
  .badge-row {
    gap: 8px 10px;
  }

  .panel,
  .map-card {
    padding: 18px 0 18px 18px;
  }

  .coordinate-grid,
  .card-grid,
  .card-grid.two,
  .card-grid.three {
    grid-template-columns: 1fr;
  }

  .card,
  .article-card {
    padding-block: 22px;
  }

  .section-header {
    margin-bottom: 18px;
  }

  .toc {
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
  }

  .table-wrap {
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding-block: 13px;
    font-size: 0.9rem;
  }

  .footer {
    padding-block: 32px 44px;
  }
}

@media (max-width: 390px) {
  .brand span {
    font-size: 0.95rem;
  }

  .brand small {
    display: none;
  }

  h1 {
    font-size: 2rem;
  }

  .badge {
    font-size: 0.84rem;
  }

  .check-list li,
  .step-list li,
  .link-list li {
    padding-left: 30px;
  }
}

/* Mobile QA fixes: keep nav visible and separate status labels from body text. */
.coordinate-chip > strong,
.status-chip div > strong {
  display: block;
  margin-bottom: 4px;
}

.coordinate-chip > span,
.status-chip div > span {
  display: block;
}

@media (max-width: 980px) {
  .nav-links {
    flex-wrap: wrap;
    overflow-x: visible;
    width: 100%;
    gap: 6px;
    padding-bottom: 0;
  }

  .nav-links a {
    padding-inline: 10px;
  }
}

@media (max-width: 700px) {
  .nav-links {
    gap: 5px;
  }

  .nav-links a {
    padding-inline: 9px;
  }
}

@media (max-width: 390px) {
  .nav-links {
    gap: 4px;
  }

  .nav-links a {
    padding-inline: 8px;
  }
}
