/* ============================================================
   Thought Pattern AI - Shared site chrome
   Reset, base, type primitives, buttons, nav, footer, CTA band.
   Consumes canonical tokens from colors_and_type.css.
   Loaded by every page; page-specific layout lives in <page>.css.
   ============================================================ */

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--tp-gradient-ground), var(--tp-bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--tp-yellow);
  color: var(--tp-action-fg);
  padding: var(--tp-space-2) var(--tp-space-4);
  z-index: 100;
}
.skip-link:focus { left: var(--tp-space-4); top: var(--tp-space-4); }

/* Keep email addresses on a single line (never break mid-address). */
a[href^="mailto:"] { white-space: nowrap; }

.eyebrow {
  font-family: var(--tp-font-mono);
  font-size: var(--tp-fs-xs);
  letter-spacing: var(--tp-ls-caps);
  text-transform: uppercase;
  color: var(--tp-yellow-deep);
  margin: 0 0 var(--tp-space-4);
}

.section-title {
  font-family: var(--tp-font-display);
  font-weight: var(--tp-fw-regular);
  letter-spacing: var(--tp-ls-display);
  font-size: var(--tp-fs-2xl);
  line-height: var(--tp-lh-snug);
  color: var(--tp-fg);
  margin: 0;
}

/* -------- Buttons ---------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--tp-font-mono);
  font-size: var(--tp-fs-sm);
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: var(--tp-radius-sm);
  border: 1px solid transparent;
  transition: background var(--tp-duration-base) var(--tp-ease-out),
              border-color var(--tp-duration-base) var(--tp-ease-out),
              color var(--tp-duration-base) var(--tp-ease-out);
}
.btn-primary {
  background: var(--tp-action);
  color: var(--tp-action-fg);
  font-weight: var(--tp-fw-medium);
}
.btn-primary:hover { background: var(--tp-action-hover); }
.btn-ghost {
  color: var(--tp-fg);
  border-color: var(--tp-border-strong);
}
.btn-ghost:hover { border-color: var(--tp-border-active); color: var(--tp-yellow); }
.btn-lg { padding: 15px 32px; font-size: var(--tp-fs-base); }

/* -------- Status dots ------------------------------------ */
.dot { width: 8px; height: 8px; border-radius: var(--tp-radius-pill); flex: none; }
.dot-success { background: var(--tp-success); box-shadow: 0 0 8px var(--tp-success-bg); }
.dot-running { background: var(--tp-running); box-shadow: 0 0 8px var(--tp-running-bg); }
.dot-warning { background: var(--tp-warning); box-shadow: 0 0 8px var(--tp-warning-bg); }

/* -------- Nav -------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tp-space-6);
  padding: var(--tp-space-4) var(--tp-space-8);
  background: rgba(26, 6, 26, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tp-border);
}
.brand { display: flex; align-items: center; gap: var(--tp-space-3); text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--tp-font-mono);
  font-size: var(--tp-fs-sm);
  letter-spacing: 0.22em;
  color: var(--tp-fg);
}
.brand-ai { color: var(--tp-yellow); }
.brand-sub {
  font-family: var(--tp-font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--tp-yellow-deep);
}
.nav-links { display: flex; gap: var(--tp-space-6); }
.nav-links a {
  font-family: var(--tp-font-mono);
  font-size: var(--tp-fs-sm);
  letter-spacing: 0.08em;
  color: var(--tp-fg-muted);
  text-decoration: none;
  transition: color var(--tp-duration-fast) var(--tp-ease-out);
}
.nav-links a:hover { color: var(--tp-yellow); }
.nav-links a[aria-current="page"] { color: var(--tp-yellow); }

/* Hamburger toggle - hidden on desktop, revealed in the mobile bar. */
.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: -6px 0;
  background: transparent;
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-sm);
  color: var(--tp-fg);
  cursor: pointer;
  transition: border-color var(--tp-duration-fast) var(--tp-ease-out),
              color var(--tp-duration-fast) var(--tp-ease-out);
}
.nav-toggle:hover { border-color: var(--tp-border-active); color: var(--tp-yellow); }
.nav-toggle:focus-visible { outline: 2px solid var(--tp-yellow); outline-offset: 2px; }
.nav-toggle-box {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 5px;
}
.nav-toggle-box span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--tp-duration-base) var(--tp-ease-out),
              opacity var(--tp-duration-fast) var(--tp-ease-out);
}
.nav.is-open .nav-toggle-box span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav-toggle-box span:nth-child(2) { opacity: 0; }
.nav.is-open .nav-toggle-box span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -------- CTA band --------------------------------------- */
.cta-band { max-width: 1200px; margin: 0 auto; padding: clamp(56px, 9vw, 120px) var(--tp-space-8); }
.cta-inner { text-align: center; max-width: 620px; margin: 0 auto; }
.cta-title {
  font-family: var(--tp-font-display);
  font-weight: var(--tp-fw-regular);
  letter-spacing: var(--tp-ls-display);
  font-size: clamp(2rem, 5vw, var(--tp-fs-3xl));
  color: var(--tp-fg);
  margin: 0 0 var(--tp-space-4);
}
.cta-sub {
  font-family: var(--tp-font-serif);
  font-size: var(--tp-fs-md);
  line-height: var(--tp-lh-body);
  color: var(--tp-fg-muted);
  margin: 0 0 var(--tp-space-8);
}

/* -------- Footer ----------------------------------------- */
.site-foot {
  border-top: 1px solid var(--tp-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--tp-space-12);
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--tp-space-16) var(--tp-space-8);
}
.foot-copy {
  font-family: var(--tp-font-mono);
  font-size: var(--tp-fs-xs);
  letter-spacing: 0.08em;
  color: var(--tp-fg-subtle);
  margin: var(--tp-space-5) 0 0;
}
.foot-social { display: flex; gap: var(--tp-space-4); margin: var(--tp-space-5) 0 0; }
.foot-social a {
  display: inline-flex;
  color: var(--tp-fg-muted);
  transition: color var(--tp-duration-fast) var(--tp-ease-out);
}
.foot-social a:hover { color: var(--tp-yellow); }
.foot-social svg { width: 19px; height: 19px; }
.foot-cols { display: flex; flex-wrap: wrap; gap: var(--tp-space-12); }
.foot-cols h2 {
  font-family: var(--tp-font-mono);
  font-size: var(--tp-fs-xs);
  font-weight: 700;
  line-height: normal;
  letter-spacing: var(--tp-ls-caps);
  text-transform: uppercase;
  color: var(--tp-fg-muted);
  margin: 0 0 var(--tp-space-4);
}
.foot-cols a {
  display: block;
  font-family: var(--tp-font-serif);
  font-size: var(--tp-fs-base);
  color: var(--tp-fg-body);
  text-decoration: none;
  margin-bottom: var(--tp-space-2);
}
.foot-cols a:hover { color: var(--tp-yellow); }

/* -------- Responsive (shared chrome) --------------------- */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }

  /* Primary nav collapses into a drawer that drops below the sticky bar. */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: var(--tp-space-2) var(--tp-space-8) var(--tp-space-4);
    background: rgba(26, 6, 26, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--tp-border);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.38);
  }
  .nav.is-open .nav-links { display: flex; }
  .nav-links a {
    padding: var(--tp-space-3) 0;
    font-size: var(--tp-fs-base);
    color: var(--tp-fg-body);
    border-bottom: 1px solid var(--tp-border);
  }
  .nav-links a:last-child { border-bottom: 0; }
}
@media (max-width: 560px) {
  .nav { padding: var(--tp-space-4) var(--tp-space-5); }
  .nav-links { padding-left: var(--tp-space-5); padding-right: var(--tp-space-5); }
  /* Yield bar width to the logo, CTA and toggle: drop the wordmark. */
  .brand-text { display: none; }
  .cta-band { padding-left: var(--tp-space-5); padding-right: var(--tp-space-5); }
  .site-foot { padding: var(--tp-space-12) var(--tp-space-5); gap: var(--tp-space-8); }
  .foot-cols { gap: var(--tp-space-8); }
}
