/* Preston AI — shared stylesheet. Base is the original preston-ai.com design; subpage components added below. */
:root {
  --navy: #14203B;
  --ink: #0B1220;
  --cream: #F7F5EF;
  --paper: #EFEBE1;
  --gold: #C89B3C;
  --slate: #5B6472;
  --line: rgba(20, 32, 59, 0.12);
  --line-dark: rgba(247, 245, 239, 0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--navy);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--navy);
  text-wrap: balance;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 560px) { .wrap { padding: 0 20px; } }

/* ---------- Signature dot ---------- */
.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}
.dot.pulse { position: relative; }
.dot.pulse::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* ---------- Nav ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 245, 239, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 1.15rem;
}
.brand svg { width: 32px; height: 32px; }
.brand .ai { color: var(--gold); }
.navlinks { display: flex; gap: 28px; font-size: 0.9rem; font-weight: 500; }
.navlinks a { opacity: 0.75; transition: opacity 0.2s; white-space: nowrap; }
.navlinks a:hover, .navlinks a[aria-current="page"] { opacity: 1; }
.navlinks a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold); }
.navcta {
  background: var(--navy); color: var(--cream);
  padding: 9px 18px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 500; white-space: nowrap;
}
/* On phones the links move to a scrollable second row instead of disappearing */
@media (max-width: 900px) {
  nav { flex-wrap: wrap; row-gap: 10px; padding-bottom: 12px; }
  .navlinks { order: 3; flex-basis: 100%; overflow-x: auto; gap: 22px; padding-bottom: 4px; scrollbar-width: none; }
  .navlinks::-webkit-scrollbar { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: 120px 0 100px; position: relative; overflow: hidden; }
.hero-mark {
  position: absolute; right: -40px; top: 10px;
  width: 440px; height: 440px;
  opacity: 0.05; pointer-events: none;
}
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  color: var(--slate); margin-bottom: 28px;
}
h1.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02; max-width: 780px;
}
h1.hero-title .accent { color: var(--gold); }
.hero-sub { max-width: 600px; margin-top: 26px; font-size: 1.15rem; color: var(--slate); }
.hero-actions { margin-top: 40px; display: flex; gap: 16px; flex-wrap: wrap; }
.btn-primary {
  background: var(--navy); color: var(--cream);
  padding: 14px 26px; border-radius: 8px;
  font-weight: 500; font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--ink); transform: translateY(-1px); }
.btn-secondary {
  border: 1px solid var(--line);
  padding: 14px 26px; border-radius: 8px;
  font-weight: 500; font-size: 0.95rem; color: var(--navy);
  transition: border-color 0.2s, transform 0.15s ease;
  display: inline-block;
}
.btn-secondary:hover { border-color: var(--navy); transform: translateY(-1px); }
@media (max-width: 560px) { .hero { padding: 80px 0 72px; } .hero-mark { width: 300px; height: 300px; right: -90px; } }

/* ---------- Section shell ---------- */
section { padding: 90px 0; }
@media (max-width: 560px) { section { padding: 68px 0; } }
.section-head { margin-bottom: 52px; max-width: 640px; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-top: 14px; }
.section-head p { color: var(--slate); margin-top: 16px; font-size: 1.05rem; }
.section-head .eyebrow { margin-bottom: 0; }

/* ---------- Services ---------- */
.services { background: var(--navy); color: var(--cream); }
.services .eyebrow, .services .section-head p { color: rgba(247,245,239,0.6); }
.services .section-head h2 { color: var(--cream); }
.service-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line-dark);
  border: 1px solid var(--line-dark);
}
.service-card { background: var(--navy); padding: 40px 32px; }
.service-card .mono { color: var(--gold); }
.service-card h3 { color: var(--cream); font-size: 1.3rem; margin: 18px 0 14px; }
.service-card p { color: rgba(247,245,239,0.68); font-size: 0.98rem; }
a.service-card { transition: background 0.2s; }
a.service-card:hover { background: #1B2A4C; }
@media (max-width: 860px) { .service-grid { grid-template-columns: 1fr; } }

/* ---------- Where we start ---------- */
.start { background: var(--paper); }
.start-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line); border: 1px solid var(--line);
}
.start-item { background: var(--paper); padding: 32px 26px; }
.start-item .mono { color: var(--gold); }
.start-item h3 { font-size: 1.15rem; margin: 14px 0 10px; }
.start-item p { color: var(--slate); font-size: 0.95rem; }
@media (max-width: 960px) { .start-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .start-grid { grid-template-columns: 1fr; } }

/* ---------- Approach ---------- */
.approach {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 48px 64px; padding-bottom: 70px;
  border-bottom: 1px solid var(--line);
}
.approach-item h3 { font-size: 1.5rem; }
.approach-item p { color: var(--slate); margin-top: 10px; font-size: 0.98rem; max-width: 460px; }
@media (max-width: 720px) { .approach { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- Story ---------- */
.story { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: center; }
.story-visual {
  background: var(--ink); border-radius: 20px; padding: 48px;
  aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.story-visual .pin-label {
  font-family: 'IBM Plex Mono', monospace;
  color: rgba(247,245,239,0.5);
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.story-visual .pin-row { display: flex; align-items: center; gap: 12px; }
.map-doodle { width: 100%; flex: 1; margin: 8px 0; }
.story h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin: 14px 0 22px; }
.story p { color: var(--slate); font-size: 1.05rem; margin-bottom: 16px; max-width: 520px; }
@media (max-width: 860px) { .story { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 560px) { .story-visual { padding: 28px; } }

/* ---------- Contact ---------- */
.contact { background: var(--ink); color: var(--cream); text-align: center; }
.contact h2 { color: var(--cream); font-size: clamp(2rem, 4vw, 3rem); }
.contact p { color: rgba(247,245,239,0.62); margin: 18px auto 36px; max-width: 500px; }
.contact .btn-primary { background: var(--gold); color: var(--ink); }
.contact .btn-primary:hover { background: #dcb355; }

/* ---------- Footer ---------- */
footer {
  padding-top: 32px; padding-bottom: 32px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.85rem; color: var(--slate);
  flex-wrap: wrap; gap: 12px;
}
footer .foot-left { display: flex; align-items: center; gap: 8px; }

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* =========================================================
   Subpage components (Toolbox, Engagements, Industries, etc.)
   ========================================================= */
.page-hero { padding: 96px 0 72px; }
h1.page-title { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; }
.page-hero .lede { max-width: 640px; margin-top: 24px; font-size: 1.12rem; color: var(--slate); }
main > section.alt { background: var(--paper); }
main > section.dark { background: var(--navy); }
.dark .section-head h2 { color: var(--cream); }
.dark .eyebrow, .dark .section-head p { color: rgba(247,245,239,0.6); }
p.lede a, .section-head p a, .cell p a, .note a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }

/* Cell grid: same 1px-gap grid as "Where we start" */
.cells {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line); border: 1px solid var(--line);
}
.cells.two { grid-template-columns: repeat(2, 1fr); }
.cell { background: var(--cream); padding: 32px 28px; min-width: 0; }
.alt .cell { background: var(--paper); }
.cell .mono { color: var(--gold); }
.cell h3 { font-size: 1.15rem; margin: 14px 0 10px; }
.cell p { color: var(--slate); font-size: 0.95rem; }
.cell p + p { margin-top: 12px; }
@media (max-width: 960px) { .cells { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cells, .cells.two { grid-template-columns: 1fr; } }

/* Traveler: routing-sheet card for engagements and examples */
.stack { display: grid; gap: 24px; }
.traveler { background: var(--cream); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.alt .traveler { background: var(--cream); }
.traveler-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 28px; background: var(--navy);
}
.traveler-head .op { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.traveler-head .dur { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(247,245,239,0.7); }
.traveler-body { padding: 26px 28px 8px; }
.traveler-body h3 { font-size: 1.45rem; }
.traveler-body p { color: var(--slate); margin-top: 10px; max-width: 640px; }
.fields { margin: 18px 0 0; border-top: 1px solid var(--line); }
.fields div { display: grid; grid-template-columns: 10em 1fr; gap: 16px; padding: 14px 28px; border-bottom: 1px solid var(--line); }
.fields div:last-child { border-bottom: 0; }
.fields dt { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); padding-top: 4px; }
.fields dd { min-width: 0; }
.traveler > .fields:first-child, .traveler-head + .fields { margin-top: 0; }
@media (max-width: 560px) { .fields div { grid-template-columns: 1fr; gap: 4px; padding: 14px 20px; } .traveler-body, .traveler-head { padding-left: 20px; padding-right: 20px; } }

ul.ticks { list-style: none; display: grid; gap: 14px; }
ul.ticks li { padding-left: 22px; position: relative; max-width: 640px; color: var(--navy); }
ul.ticks li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

.note { font-size: 0.95rem; color: var(--slate); border-left: 2px solid var(--gold); padding-left: 14px; margin-top: 32px; max-width: 640px; }

@media (prefers-reduced-motion: reduce) {
  .dot.pulse::after { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Travelers sitting inside a cell grid read as flat cells with a navy label strip */
.cells > .traveler { border: 0; border-radius: 0; background: var(--cream); }
.alt .cells > .traveler { background: var(--paper); }
.cells > .traveler .traveler-body { padding-bottom: 26px; }
.traveler-body p a { color: var(--navy); font-weight: 500; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
a.cell { transition: background 0.2s; }
a.cell:hover { background: #FBFAF6; }

/* Cards in a grid: label above sub-label so every header has the same height */
.cells > .traveler .traveler-head { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; min-height: 76px; }
