/* ==========================================================================
   Vibe Crafted Software — Design Tokens & Base Styles
   Swap the values under :root to apply a real brand kit later; the rest of
   this file (and every page) reads from these variables, so a rebrand is a
   one-file change.
   ========================================================================== */

:root {
  /* Grayscale palette — the whole theme reads from these. --gray-900 is the
     brand's exact "ink" value (#0C0C0C, per the logo/website style guide) —
     used for text, buttons, and the header lockup. The rest of the ramp is a
     softened black/white spread (not pure #000/#fff) supporting it for UI
     roles the brand kit doesn't itself define, like muted text and borders. */
  --gray-950: #050505;
  --gray-900: #0c0c0c;
  --gray-800: #262626;
  --gray-700: #404040;
  --gray-600: #525252;
  --gray-500: #6b6b6b;
  --gray-400: #a3a3a3;
  --gray-300: #d4d4d4;
  --gray-200: #e5e5e5;
  --gray-100: #f0f0f0;
  --gray-50: #f7f7f7;

  /* Brand colors — currently mapped onto the grayscale ramp. Kept as their
     own tokens (rather than using --gray-* directly everywhere) so a real
     accent color can be reintroduced later — e.g. for the planned hover
     highlight on product tiles — by changing only these two lines. */
  --color-primary: var(--gray-900);
  --color-primary-dark: var(--gray-950);
  --color-accent: var(--gray-600);
  --color-accent-dark: var(--gray-800);

  /* Reserved for a future hover/interaction accent (not used yet — see
     products.html tiles). Intentionally unused by any rule today. */
  --color-hover-accent: #4f46e5;
  --color-hover-accent-alt: #14b8a6;

  /* Neutrals */
  --color-bg: #ffffff;
  --color-bg-alt: var(--gray-50);
  --color-text: var(--gray-900);
  --color-text-muted: var(--gray-500);
  --color-border: var(--gray-200);

  /* Type */
  --font-heading: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --radius: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --container-width: 1160px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 var(--space-2);
}

ul {
  margin: 0 0 var(--space-2);
  padding-left: 1.2em;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.section {
  padding: var(--space-6) 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-header {
  max-width: 640px;
  margin: 0 auto var(--space-5);
  text-align: center;
}

.section-header p {
  color: var(--color-text-muted);
}

.grid {
  display: grid;
  gap: var(--space-3);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .section {
    padding: var(--space-5) 0;
  }
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.brand {
  display: flex;
  align-items: center;
}

.brand:hover {
  text-decoration: none;
}

/* Header lockup. The brand kit's own spec (28-36px tall) reads as
   too small in practice — the wordmark all but disappears at that size,
   so this runs well past the documented range for legibility. */
.brand-lockup {
  height: 80px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--color-text);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.nav-cta {
  background: var(--color-primary);
  color: #fff !important;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
}

.nav-cta:hover {
  background: var(--color-primary-dark);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.nav-toggle svg {
  width: 26px;
  height: 26px;
}

@media (max-width: 780px) {
  .nav-toggle {
    display: block;
  }
  .brand-lockup {
    height: 48px;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-2) var(--space-3) var(--space-3);
    display: none;
    gap: var(--space-2);
  }
  .nav-links.is-open {
    display: flex;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 1rem;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--gray-700) 0%, var(--gray-900) 55%, var(--gray-950) 100%);
  color: #fff;
  padding: var(--space-7) 0;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: center;
}

.hero h1,
.hero p {
  color: #fff;
}

.hero-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: var(--space-2);
}

.hero-lede {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

.hero-actions .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.hero-actions .btn-outline:hover {
  border-color: #fff;
  color: #fff;
}

.hero-art {
  width: 100%;
}

.page-hero {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-6) 0 var(--space-5);
}

.page-hero .section-header {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
  }
  .hero-art {
    max-width: 320px;
    margin: 0 auto;
  }
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-1);
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-700);
  width: fit-content;
}

/* Inverted (dark) chip — distinguishes a second tag on the same card by
   value, not color, e.g. a vertical tag next to an integration-mode tag. */
.tag-alt {
  background: var(--color-primary);
  color: #ffffff;
}

/* ---------- Team ---------- */
.team-card {
  text-align: center;
}

.team-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  margin: 0 auto var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.4rem;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: var(--space-2);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

input,
textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
}

input:focus,
textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin-top: var(--space-2);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  display: none;
}

.form-status.is-visible {
  display: block;
}

.form-status.is-success {
  background: var(--gray-100);
  color: var(--gray-800);
  border: 1px solid var(--gray-300);
}

/* Error keeps red rather than going grayscale — a functional/system signal
   (form validation, danger), not a brand color, so it's exempt from the
   monochrome palette on accessibility/convention grounds. */
.form-status.is-error {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

/* ---------- Blog ---------- */
.post-card .post-date {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article {
  max-width: 720px;
  margin: 0 auto;
}

.article-meta {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-3);
}

.article h2 {
  margin-top: var(--space-4);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.75);
  padding: var(--space-5) 0 var(--space-3);
  margin-top: var(--space-6);
}

.site-footer a {
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.footer-grid h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: var(--space-1);
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: var(--space-3);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Utilities ---------- */
.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

.not-found {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6) var(--space-3);
}
