/* ==========================================================================
   Territory Systems and AI — v2 stylesheet
   Dark navy theme drawn from the logo: deep navy, electric blue, gold.
   Every link colour is set explicitly so links never fall back to the
   default browser blue/purple on any platform (Android, iOS, desktop).
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --navy-950: #060d1f;
  --navy-900: #0a1428;
  --navy-850: #0c1830;
  --navy-800: #0e1c38;
  --navy-700: #13264a;
  --navy-600: #1a3260;

  --ink: #eaf1fb;          /* main text */
  --muted: #a8b8d4;        /* secondary text */
  --faint: #7e91b5;        /* tertiary text */

  --blue: #2f7bff;
  --blue-bright: #6ea8ff;
  --blue-soft: #9fc4ff;
  --orange: #f0a24a;
  --orange-bright: #f6b96e;

  --line: rgba(110, 168, 255, 0.16);
  --line-strong: rgba(110, 168, 255, 0.3);

  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px rgba(3, 8, 20, 0.45);

  --font-head: "Space Grotesk", "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;

  --container: 1120px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1000px 600px at 85% -100px, rgba(47, 123, 255, 0.12), transparent 60%),
    radial-gradient(800px 500px at -100px 40%, rgba(240, 162, 74, 0.05), transparent 55%),
    var(--navy-950);
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--ink);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin-bottom: 0.45em; }

/* ---------- Links: explicit colour on every state, every platform ----------
   This is what stops links rendering default blue / visited purple on
   mobile browsers. :visited matches the base colour on purpose. */
a {
  color: var(--blue-bright);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
a:visited { color: var(--blue-bright); }
a:hover, a:focus { color: var(--orange-bright); }
a:active { color: var(--orange); }

.text-link {
  color: var(--blue-bright);
  text-decoration: underline;
  text-decoration-color: rgba(110, 168, 255, 0.45);
  text-underline-offset: 3px;
}
.text-link:visited { color: var(--blue-bright); }
.text-link:hover, .text-link:focus { color: var(--orange-bright); text-decoration-color: var(--orange-bright); }

/* Phone / email links inside body copy */
a[href^="tel:"], a[href^="mailto:"] { color: var(--blue-bright); font-weight: 600; white-space: nowrap; }
a[href^="tel:"]:visited, a[href^="mailto:"]:visited { color: var(--blue-bright); }
a[href^="tel:"]:hover, a[href^="mailto:"]:hover { color: var(--orange-bright); }
a[href^="mailto:"] { white-space: normal; word-break: break-word; }

::selection { background: rgba(47, 123, 255, 0.4); color: #fff; }

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 200;
  background: var(--orange);
  color: var(--navy-950);
  padding: 0.6em 1.2em;
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus { left: 8px; color: var(--navy-950); }

/* ---------- Layout helpers ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 22px; }

.section { padding: 4.5rem 0; }
.section--alt { background: linear-gradient(180deg, var(--navy-900), var(--navy-850)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section--tight { padding: 3rem 0; }

.section-head { max-width: 720px; margin-bottom: 2.6rem; }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }

.kicker {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.9rem;
}
.lede { font-size: 1.15rem; color: var(--muted); }

.grid { display: grid; gap: 1.4rem; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}

.hl-blue { color: var(--blue-bright); }
.hl-orange { color: var(--orange); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  padding: 0.95em 1.7em;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn--primary { background: var(--orange); color: var(--navy-950); }
.btn--primary:visited { color: var(--navy-950); }
.btn--primary:hover, .btn--primary:focus { background: var(--orange-bright); color: var(--navy-950); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:visited { color: var(--ink); }
.btn--ghost:hover, .btn--ghost:focus { border-color: var(--blue-bright); color: var(--blue-bright); }

.btn--blue { background: var(--blue); color: #fff; }
.btn--blue:visited { color: #fff; }
.btn--blue:hover, .btn--blue:focus { background: var(--blue-bright); color: var(--navy-950); }

.btn--lg { font-size: 1.08rem; padding: 1.05em 2em; }
.btn--block { display: block; width: 100%; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 13, 31, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

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

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand:hover, .brand:focus { color: inherit; }
.brand__mark { width: 52px; height: 52px; flex: 0 0 auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__top {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: 0.16em;
  color: var(--orange);
}
.brand__sub { font-family: var(--font-head); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.22em; }
/* wordmark colours match the official logo: orange TERRITORY, blue subline */
.brand__sub .t-blue,
.brand__sub .t-white,
.brand__sub .t-orange { color: var(--blue-bright); }

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.nav__toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 4px 0;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav__menu { display: flex; align-items: center; gap: 1.6rem; }
.nav__links { display: flex; list-style: none; margin: 0; padding: 0; gap: 1.5rem; }
.nav__links li { margin: 0; }
.nav__links a {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--muted);
  padding: 0.4em 0;
}
.nav__links a:visited { color: var(--muted); }
.nav__links a:hover, .nav__links a:focus { color: var(--ink); }
.nav__links a[aria-current="page"] {
  color: var(--orange);
  border-bottom: 2px solid var(--orange);
}

@media (max-width: 980px) {
  .nav__toggle { display: block; }
  .nav__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--navy-900);
    border-bottom: 1px solid var(--line-strong);
    padding: 0.6rem 22px 1.4rem;
    box-shadow: var(--shadow);
  }
  .nav__menu.is-open { display: flex; }
  .nav__links { flex-direction: column; gap: 0; }
  .nav__links a { display: block; padding: 0.85em 0.2em; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav__links a[aria-current="page"] { border-bottom: 1px solid var(--orange); }
  .nav__cta { margin-top: 1.1rem; }
}

/* ---------- Hero ---------- */
.hero { padding: 4.5rem 0 4rem; position: relative; overflow: hidden; }
.hero__inner {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 3rem;
  align-items: center;
}
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { max-width: 340px; margin: 0 auto; }
}
.hero h1 { margin-bottom: 0.5em; }
.hero .lede { font-size: 1.2rem; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 1.8rem 0 1.6rem; }
.hero__facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  padding: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.hero__facts li { margin: 0; }
.hero__art img { filter: drop-shadow(0 18px 40px rgba(3, 8, 20, 0.6)); border-radius: var(--radius-lg); }

/* Page hero (interior pages) */
.page-hero { padding: 3.6rem 0 3rem; border-bottom: 1px solid var(--line); }
.page-hero .lede { max-width: 760px; }
.breadcrumb { font-size: 0.88rem; color: var(--faint); margin-bottom: 1rem; }
.breadcrumb a { color: var(--faint); }
.breadcrumb a:visited { color: var(--faint); }
.breadcrumb a:hover { color: var(--blue-bright); }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(165deg, var(--navy-800), var(--navy-850));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0.2rem; }
.card--link { display: block; color: var(--ink); transition: border-color 0.2s ease, transform 0.2s ease; }
.card--link:visited { color: var(--ink); }
.card--link:hover, .card--link:focus { color: var(--ink); border-color: var(--blue-bright); transform: translateY(-3px); }
.card--link .card__more { color: var(--orange); font-weight: 700; font-family: var(--font-head); font-size: 0.95rem; }
.card--link:hover .card__more { color: var(--orange-bright); }
.card__icon { font-size: 1.9rem; line-height: 1; margin-bottom: 0.9rem; }
.card p { color: var(--muted); }
.card p:last-child { margin-bottom: 0; }

.card ul { color: var(--muted); }

/* number chips for process steps */
.step__no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(47, 123, 255, 0.15);
  border: 1px solid var(--line-strong);
  color: var(--blue-bright);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  background: rgba(240, 162, 74, 0.12);
  border: 1px solid rgba(240, 162, 74, 0.4);
  color: var(--orange-bright);
  border-radius: 999px;
  padding: 0.45em 1.1em;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.88rem;
}
.badge__dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 0 rgba(240, 162, 74, 0.6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(240, 162, 74, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(240, 162, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 162, 74, 0); }
}

.tp-badge { display: flex; align-items: center; gap: 1.2rem; }
.tp-badge img { width: 116px; height: 116px; flex: 0 0 auto; }
.tp-badge__text { font-size: 0.95rem; color: var(--muted); max-width: 300px; }

/* ---------- Feature / tick lists ---------- */
.ticklist { list-style: none; padding: 0; }
.ticklist li {
  padding-left: 1.7em;
  position: relative;
  margin-bottom: 0.6em;
  color: var(--muted);
}
.ticklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--orange);
  font-weight: 700;
}

/* ---------- Key/value terms ---------- */
.terms { list-style: none; padding: 0; margin: 0; }
.terms li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8em 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.terms li:last-child { border-bottom: none; }
.terms__k { color: var(--faint); font-size: 0.95rem; }
.terms__v { color: var(--ink); font-weight: 600; text-align: right; }

/* ---------- Pricing ---------- */
.price-card { text-align: center; }
.price-card__rate { font-family: var(--font-head); font-size: 2.8rem; font-weight: 700; color: var(--ink); margin: 0.2em 0 0.1em; }
.price-card__rate .cur { font-size: 1.4rem; color: var(--orange); vertical-align: super; }
.price-card__rate .per { font-size: 1.05rem; color: var(--faint); font-weight: 500; }
.price-card__note { color: var(--muted); font-size: 0.95rem; margin-bottom: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--navy-700), var(--navy-800) 55%, #2a1f10);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 3.6rem 0;
  text-align: center;
}
.cta-band h2 { margin-bottom: 0.4em; }
.cta-band p { color: var(--muted); max-width: 640px; margin: 0 auto 1.6em; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }

/* ---------- FAQ (details/summary) ---------- */
.faq-item {
  background: linear-gradient(165deg, var(--navy-800), var(--navy-850));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.9rem;
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 3rem 1.1rem 1.4rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 1.3rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--orange);
  font-size: 1.5rem;
  font-weight: 400;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item__body { padding: 0 1.4rem 1.2rem; color: var(--muted); }
.faq-item__body p:last-child { margin-bottom: 0; }

/* ---------- Forms ---------- */
.form-card {
  background: linear-gradient(165deg, var(--navy-800), var(--navy-850));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.form-card label {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 1.1rem 0 0.4rem;
  color: var(--ink);
}
.form-card label:first-of-type { margin-top: 0; }
.form-card input,
.form-card select,
.form-card textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--navy-950);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0.8em 1em;
  transition: border-color 0.2s ease;
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
  outline: none;
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(47, 123, 255, 0.2);
}
.form-card select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--blue-bright) 50%), linear-gradient(135deg, var(--blue-bright) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
.form-card textarea { resize: vertical; min-height: 130px; }
.form-card ::placeholder { color: var(--faint); }
.form-hint { font-size: 0.88rem; color: var(--faint); }

/* ---------- Contact info blocks ---------- */
.contact-line {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
a.contact-line { color: var(--blue-bright); }
a.contact-line:visited { color: var(--blue-bright); }
a.contact-line:hover, a.contact-line:focus { color: var(--orange-bright); }

/* ---------- Articles ---------- */
.article-body { max-width: 760px; }
.article-body h2 { margin-top: 2.2rem; font-size: 1.55rem; }
.article-body h3 { margin-top: 1.8rem; }
.article-body p, .article-body li { color: #c6d3ea; }
.article-body strong { color: var(--ink); }
.article-meta { color: var(--faint); font-size: 0.9rem; margin-bottom: 2rem; }
.article-card__meta { color: var(--faint); font-size: 0.85rem; margin-bottom: 0.4rem; }

blockquote {
  margin: 1.6rem 0;
  padding: 1rem 1.4rem;
  border-left: 3px solid var(--orange);
  background: rgba(240, 162, 74, 0.07);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  border-top: 1px solid var(--line);
  padding: 3.4rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
  gap: 2.4rem;
  margin-bottom: 2.4rem;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

.site-footer h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-bottom: 1rem;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.55em; }
.footer-links a { color: var(--muted); font-size: 0.97rem; }
.footer-links a:visited { color: var(--muted); }
.footer-links a:hover, .footer-links a:focus { color: var(--orange-bright); }

.footer-brand p { color: var(--faint); font-size: 0.93rem; }
.footer-brand .brand { margin-bottom: 1rem; }
.footer-tp { width: 116px; height: 116px; margin-top: 1rem; }

.footer-legal {
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 2rem;
  justify-content: space-between;
  color: var(--faint);
  font-size: 0.88rem;
}
.footer-legal a { color: var(--faint); text-decoration: underline; text-underline-offset: 3px; }
.footer-legal a:visited { color: var(--faint); }
.footer-legal a:hover { color: var(--orange-bright); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .badge__dot { animation: none; }
  .btn { transition: none; }
}

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.max-720 { max-width: 720px; }
.muted { color: var(--muted); }
