/* ===========================================================
   AIdTech — design tokens
   =========================================================== */
:root {
  --ink: #12161b;
  --ink-soft: #333c41;
  --paper: #f5f3ec;
  --paper-raised: #ece8db;
  --teal: #1f9c7f;
  --teal-deep: #146354;
  --amber: #dd8a3d;
  --indigo: #5b5fe0;
  --line: #ddd9cb;
  --line-strong: #b3ad9b;
  --muted: #666f6a;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 62ch;
  --rail: 96px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(18, 22, 27, 0.05);
  --shadow-md: 0 10px 30px -12px rgba(18, 22, 27, 0.18);
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  margin: 0 0 0.5em;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 460; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.3rem; font-weight: 560; }

p { margin: 0 0 1.1em; max-width: var(--measure); color: var(--ink-soft); }
a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

button { font-family: var(--sans); cursor: pointer; }

/* ---------- layout shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 780px) {
  .shell { grid-template-columns: 40px minmax(0, 1fr); padding: 0 18px; }
}

/* coordinate rail — functional section markers, not decoration */
.rail {
  position: relative;
  border-right: 1px solid var(--line);
}
.rail-tick {
  position: absolute;
  left: -1px;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(-50%);
}
.rail-tick .bar { width: 14px; height: 1px; background: var(--line-strong); }
.rail-tick .lbl {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  display: none;
}
@media (min-width: 1040px) {
  .rail-tick .lbl { display: inline; }
}

.col { min-width: 0; padding: 0 0 0 28px; }
@media (max-width: 780px) { .col { padding-left: 18px; } }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(238, 240, 236, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 560;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.navlinks { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.navlinks a {
  font-size: 0.94rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.navlinks a:hover, .navlinks a.active {
  color: var(--ink);
  border-bottom-color: var(--teal);
}
.navtoggle { display: none; background: none; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 8px 10px; }
@media (max-width: 780px) {
  .navlinks { position: fixed; inset: 61px 0 auto 0; background: var(--paper); flex-direction: column; gap: 0; border-bottom: 1px solid var(--line); padding: 8px 18px 16px; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: transform .18s ease, opacity .18s ease; }
  .navlinks.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .navlinks a { padding: 12px 0; border-bottom: 1px solid var(--line); width: 100%; }
  .navtoggle { display: inline-flex; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.96rem;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
}
.btn-primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--teal-deep); color: var(--paper); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: var(--paper-raised); }

/* ---------- sections ---------- */
section { padding: 84px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }
.eyebrow-plain { font-size: 0.9rem; color: var(--muted); margin-bottom: 10px; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 46ch; }

/* ---------- hero ---------- */
.hero { padding-top: 56px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 28px; } }
.hero-art { width: 100%; height: auto; }
.hero-art path.contour {
  fill: none;
  stroke: var(--teal-deep);
  stroke-width: 1.1;
  opacity: 0.55;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 2.1s ease forwards;
}
.hero-art path.contour:nth-of-type(2) { stroke: var(--amber); opacity: 0.5; animation-delay: .12s; }
.hero-art path.contour:nth-of-type(3) { stroke: var(--indigo); opacity: 0.4; animation-delay: .24s; }
.hero-art path.contour:nth-of-type(4) { stroke: var(--amber); opacity: 0.35; animation-delay: .36s; }
.hero-art path.contour:nth-of-type(5) { animation-delay: .48s; }
.hero-art circle.node { fill: var(--indigo); opacity: 0; animation: fadein .5s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 0.85; } }
.hero-cta { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 48px; flex-wrap: wrap; }
.hero-stat b { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 500; }
.hero-stat span { font-size: 0.86rem; color: var(--muted); }

/* ---------- grids / cards ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--paper-raised);
  padding: 32px 28px;
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card.flagship {
  background: linear-gradient(145deg, var(--ink) 0%, var(--teal-deep) 145%);
  color: var(--paper);
  border-color: transparent;
}
.card.flagship h3, .card.flagship p { color: var(--paper); }
.card.flagship .tag { color: var(--amber); }
.tag { font-size: 0.78rem; color: var(--teal-deep); margin-bottom: 10px; display: block; }
.card ul { margin: 14px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 0.94rem; }
.card.flagship ul { color: var(--paper); opacity: 0.88; }
.card li { margin-bottom: 6px; }

/* process (real sequence — numbering is meaningful here) */
.process { display: grid; gap: 0; border-top: 1px solid var(--line); }
.process-step { display: grid; grid-template-columns: 48px 1fr; gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--line); align-items: start; }
.process-step .num {
  font-family: var(--serif); font-size: 1rem; font-weight: 560; color: var(--indigo);
  width: 40px; height: 40px; border-radius: 50%; background: var(--paper-raised);
  display: flex; align-items: center; justify-content: center;
}
.process-step h3 { margin-bottom: 6px; }
.process-step p { margin-bottom: 0; font-size: 0.98rem; }

/* case studies */
.case { padding: 30px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 2fr; gap: 28px; }
@media (max-width: 780px) { .case { grid-template-columns: 1fr; gap: 10px; } }
.case h3 { margin-bottom: 8px; }
.case .industry { font-size: 0.86rem; color: var(--muted); }
.case .stack { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.case .stack span { font-size: 0.78rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 3px 9px; color: var(--ink-soft); }

/* about */
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 28px; } }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.86rem; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; font-family: var(--sans); font-size: 1rem; padding: 11px 12px;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink);
  transition: border-color .15s ease;
}
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--ink-soft); }
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.86rem; color: var(--muted); margin-top: 10px; }
.form-success { border: 1px solid var(--teal); background: rgba(31,156,127,0.1); padding: 16px; border-radius: var(--radius); }

/* footer */
footer { padding: 40px 0 60px; }
.foot-row { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.foot-row small { color: var(--muted); }
.foot-links { display: flex; gap: 20px; list-style: none; padding: 0; margin: 0; }
.foot-links a { color: var(--muted); font-size: 0.9rem; text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

.page-head { padding-top: 56px; padding-bottom: 40px; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper);
  padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }
