/* Hastain Consulting — design tokens and layout.
   All colour literals live in the :root token block below. Everywhere else
   uses var(), so there are no one-off colours to drift. */

:root {
  /* Ground and panels (dark) */
  --forest: #121214;
  --panel: #1F1F24;

  /* Light surfaces */
  --light: #FFFFFF;
  --tint-1: #F4F4F2;
  --tint-2: #E8E8E4;

  /* Text */
  --ink: #121214;
  --muted-on-dark: #A3A3AB;
  --text-on-dark: #FFFFFF;

  /* Accent — fills and marks. 3.64:1 on white, so NEVER small text on a
     light surface; --accent-deep is the text-safe variant (5.04:1). */
  --accent: #E8552D;
  --accent-deep: #C4431F;
  --muted-on-light: #6E7076;

  /* Form chrome */
  --form-border: #8C8C88;

  /* Radii */
  --r-node: 14px;
  --r-panel: 20px;
  --r-pill: 999px;

  /* Type */
  --font-display: "Familjen Grotesk", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* Spacing */
  --gutter: 16px;
  --measure: 1140px;
}

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

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

body {
  margin: 0;
  background: var(--forest);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.125rem, 7vw, 3.5rem);
}

h2 {
  font-size: clamp(1.625rem, 4.5vw, 2.375rem);
}

h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 1rem;
}

a {
  color: inherit;
}

/* ---------- Focus ---------- */

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

.section-light :focus-visible,
.section-contact :focus-visible {
  outline-color: var(--ink);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--ink);
  padding: 12px 20px;
  border-radius: 0 0 var(--r-node) 0;
  font-weight: 600;
  text-decoration: none;
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 26px;
  border: 0;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.btn-sm {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 0.9375rem;
}

.btn-accent {
  background: var(--accent);
  color: var(--ink);
}

.btn-dark {
  background: var(--forest);
  color: var(--text-on-dark);
}

@media (hover: hover) {
  .btn:hover {
    filter: brightness(1.08);
  }

  .btn-dark:hover {
    filter: brightness(1.35);
  }
}

/* ---------- Nav ---------- */

.nav-bar {
  background: var(--forest);
  padding: 18px 0;
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  justify-content: space-between;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text-on-dark);
  padding: 8px 0;
}

/* The orbit mark inherits the wordmark's colour, so the orbits and the
   figure flip with the surface; only the AI sparkle stays accent. */
.wordmark-mark {
  flex: none;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px 22px;
  flex-wrap: wrap;
}

.nav-links > a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted-on-dark);
  font-weight: 500;
  text-decoration: none;
}

@media (hover: hover) {
  .nav-links > a:not(.btn):hover {
    color: var(--text-on-dark);
  }
}

/* ---------- Hero ---------- */

.hero {
  background: var(--forest);
  padding: 40px 0 72px;
}

.hero-grid {
  display: grid;
  gap: 40px;
  align-items: start;
}

@media (min-width: 900px) {
  .hero {
    padding: 72px 0 104px;
  }

  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
  }
}

.lede {
  max-width: 34ch;
  font-size: 1.1875rem;
  color: var(--muted-on-dark);
}

@media (min-width: 900px) {
  .lede {
    max-width: 44ch;
    font-size: 1.25rem;
  }
}

.hero-cta {
  margin: 28px 0 0;
}

/* ---------- Hero flow diagram ---------- */

.flow-panel {
  margin: 0;
  padding: 26px 22px 22px;
  background: var(--panel);
  border-radius: var(--r-panel);
}

.panel-title {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted-on-dark);
}

.flow-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.flow-node {
  padding: 16px 18px;
  background: var(--forest);
  border-radius: var(--r-node);
  color: var(--text-on-dark);
  font-weight: 500;
}

.flow-node-accent {
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
}

.flow-arrow {
  display: flex;
  justify-content: center;
  padding: 6px 0;
  color: var(--muted-on-dark);
}

.panel-caption {
  margin: 22px 0 0;
  color: var(--muted-on-dark);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* ---------- Light / dark sections ---------- */

.section-light {
  background: var(--light);
  color: var(--ink);
  padding: 64px 0;
}

.section-dark {
  background: var(--forest);
  color: var(--text-on-dark);
  padding: 64px 0;
}

@media (min-width: 900px) {
  .section-light,
  .section-dark {
    padding: 88px 0;
  }
}

.section-light h2,
.section-dark h2 {
  max-width: 26ch;
  margin-bottom: 36px;
}

/* ---------- Approach ---------- */

.approach-grid {
  display: grid;
  gap: 18px;
}

@media (min-width: 860px) {
  .approach-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }
}

.card {
  padding: 28px 24px;
  background: var(--tint-1);
  border-radius: var(--r-panel);
  color: var(--ink);
}

.card p {
  margin: 0;
}

.card h3 {
  margin-bottom: 12px;
}

.card-dark {
  background: var(--panel);
  color: var(--text-on-dark);
}

.card-dark p {
  color: var(--muted-on-dark);
}

/* ---------- What we build ---------- */

.build-grid {
  display: grid;
  gap: 18px;
}

@media (min-width: 760px) {
  .build-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

.build-item {
  padding: 26px 24px;
  background: var(--panel);
  border-radius: var(--r-panel);
}

.build-item h3 {
  margin: 14px 0 10px;
}

.build-item p {
  margin: 0;
  color: var(--muted-on-dark);
}

.icon {
  display: block;
  color: var(--accent);
}

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  gap: 36px;
  align-items: start;
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 56px;
  }
}

.contact-intro h2 {
  margin-bottom: 18px;
}

.lede-light {
  max-width: 38ch;
  font-size: 1.125rem;
  color: var(--ink);
}

.contact-email {
  margin: 0;
  font-weight: 500;
}

.contact-email a {
  color: var(--ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.contact-form {
  display: grid;
  gap: 18px;
  padding: 28px 24px;
  background: var(--tint-1);
  border-radius: var(--r-panel);
}

.hp-wrap[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
}

.req {
  font-weight: 400;
  color: var(--ink);
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--form-border);
  border-radius: var(--r-node);
  background: var(--light);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
}

.field textarea {
  min-height: 132px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink);
  opacity: 0.6;
}

.contact-form .btn {
  justify-self: start;
}

/* ---------- Thanks page ---------- */

.thanks {
  min-height: 70vh;
  background: var(--light);
  color: var(--ink);
  display: flex;
  align-items: center;
  padding: 72px 0;
}

.thanks-card {
  max-width: 44rem;
  padding: 36px 28px;
  background: var(--tint-2);
  border-radius: var(--r-panel);
}

.thanks-card p {
  color: var(--ink);
}

.thanks-card p:last-of-type {
  margin-bottom: 0;
}

.thanks-actions {
  margin: 28px 0 0;
}

/* ---------- Footer ---------- */

.footer {
  background: var(--forest);
  color: var(--muted-on-dark);
  padding: 36px 0 44px;
  font-size: 0.9375rem;
}

.footer p {
  margin: 0;
}

/* ---------- Reduced motion ---------- */

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


/* ---------- Architecture stack ---------- */

.section-lede {
  max-width: 62ch;
  font-size: 1.125rem;
  color: var(--ink);
  margin: 0 0 40px;
}

.stack {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  max-width: 820px;
}

.stack-layer {
  background: var(--tint-1);
  border: 1px solid var(--tint-2);
  border-radius: var(--r-panel);
  padding: 22px 24px;
}

.stack-layer-accent {
  background: var(--forest);
  border-color: var(--forest);
}

.stack-layer-accent .stack-tag {
  color: var(--accent);
}

.stack-layer-accent .stack-name,
.stack-layer-accent .stack-note {
  color: var(--text-on-dark);
}

.stack-tag {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.stack-name {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.stack-note {
  margin: 0;
  max-width: 60ch;
  color: var(--ink);
}

.stack-join {
  display: flex;
  justify-content: center;
  color: var(--muted-on-light);
  padding: 2px 0;
}

.gate-card {
  max-width: 820px;
  background: var(--forest);
  border-radius: var(--r-panel);
  padding: 26px 28px;
  margin: 0 0 32px;
}

.gate-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--accent);
}

.gate-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px 28px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  color: var(--text-on-dark);
}

.gate-list li {
  position: relative;
  padding-left: 22px;
}

.gate-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.section-outro {
  max-width: 68ch;
  margin: 0;
  color: var(--ink);
}

@media (max-width: 640px) {
  .gate-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .wordmark {
    font-size: 1.25rem;
    gap: 10px;
  }
}

/* ---------- Why us ---------- */

.section-lede-dark {
  color: var(--muted-on-dark);
}

.why-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 980px;
}

.why-item {
  background: var(--panel);
  border-radius: var(--r-panel);
  padding: 24px 26px;
}

.why-item h3 {
  margin: 0 0 10px;
  font-size: 1.125rem;
  color: var(--text-on-dark);
}

.why-item p {
  margin: 0;
  color: var(--muted-on-dark);
}

@media (max-width: 760px) {
  .why-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* ---------- Wordmark lockup ---------- */

.wordmark-text {
  line-height: 1;
  letter-spacing: -0.035em;
}

/* The AI is the load-bearing part of the name. It matches the sparkle in the
   mark exactly, and only ever sits on the dark nav bar, where it is 5.14:1. */
.wordmark-ai {
  color: var(--accent);
}

/* ---------- Texture ----------
   A fine dot grid, not a gradient wash. It reads as a plan or a grid rather
   than decoration, and it is drawn with rgba() so no hex literal escapes the
   token block. Both layers are pure paint: nothing moves, nothing loads. */

.section-dark,
.hero {
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: 0 0;
}

.section-light {
  background-image:
    radial-gradient(rgba(18, 18, 20, 0.055) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: 0 0;
}

/* Panels and cards sit ON the grid, so they need their own solid ground or the
   dots show through and muddy the text. */
.flow-panel,
.build-item,
.why-item,
.stack-layer,
.gate-card,
.approach-card,
.contact-card {
  background-clip: padding-box;
}

/* ---------- Section eyebrow rule ---------- */

.section-dark h2,
.section-light h2 {
  position: relative;
  padding-top: 22px;
}

.section-dark h2::before,
.section-light h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

@media (max-width: 760px) {
  .wordmark {
    font-size: 1.5rem;
    gap: 10px;
  }
}
