/*
 * All Hatched design system
 * Shared tokens, type roles, layout primitives, and cross-page components.
 */

:root {
  /* Primitive palette. Components consume the semantic roles below. */
  --color-neutral-0: #ffffff;
  --color-neutral-50: #f5f7fa;
  --color-neutral-400: #aaaeb8;
  --color-neutral-700: #5e6470;
  --color-neutral-900: #111116;
  --color-neutral-950: #17171d;
  --color-neutral-1000: #07070a;
  --color-brand-pink: #ff006a;
  --color-brand-pink-accessible: #b90050;
  --color-brand-purple: #4147fb;
  --color-brand-blue: #008cff;
  --color-brand-coral: #ff3b2d;

  /* Semantic color roles */
  --bg-primary: var(--color-neutral-1000);
  --bg-secondary: var(--color-neutral-50);
  --surface-dark: var(--color-neutral-900);
  --surface-light: var(--color-neutral-0);
  --text-primary: var(--color-neutral-0);
  --text-inverse: var(--color-neutral-950);
  --text-secondary: var(--color-neutral-400);
  --text-muted: var(--color-neutral-700);
  --accent-pink: var(--color-brand-pink);
  --accent-pink-text: var(--color-brand-pink-accessible);
  --accent-purple: var(--color-brand-purple);
  --accent-blue: var(--color-brand-blue);
  --accent-coral: var(--color-brand-coral);
  --status-success: #2dba67;
  --status-success-surface: rgba(45, 186, 103, 0.12);
  --status-success-border: rgba(45, 186, 103, 0.5);
  --status-danger: #d92d20;
  --status-danger-surface: rgba(217, 45, 32, 0.12);
  --status-danger-border: rgba(217, 45, 32, 0.55);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-subtle-light: rgba(23, 23, 29, 0.08);
  --border-strong-light: rgba(23, 23, 29, 0.14);
  --gradient-brand: linear-gradient(135deg, var(--accent-coral) 0%, var(--accent-pink) 32%, var(--accent-purple) 68%, var(--accent-blue) 100%);

  /* Typography */
  --font-display: "Oswald", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --font-size-caption: 0.75rem;
  --font-size-body: clamp(1rem, 1.1vw, 1.125rem);
  --font-size-body-lg: clamp(1.1rem, 1.4vw, 1.25rem);
  --font-size-heading-md: clamp(1.35rem, 2vw, 2rem);
  --font-size-heading-lg: clamp(2rem, 3.5vw, 3rem);
  --font-size-heading-xl: clamp(2.75rem, 5vw, 4.5rem);
  --font-size-display-lg: clamp(3.5rem, 7vw, 6rem);
  --font-size-display-xl: clamp(4.5rem, 9vw, 8rem);
  --leading-display: 0.94;
  --leading-heading: 1.08;
  --leading-body: 1.58;
  --tracking-label: 0.14em;
  --tracking-action: 0.08em;

  /* Layout */
  --container-max: 1240px;
  --content-max: 820px;
  --content-narrow: 680px;
  --measure-display: 18ch;
  --measure-heading: 24ch;
  --measure-body: 68ch;
  --page-gutter: clamp(1rem, 3vw, 1.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --section-compact: clamp(3.5rem, 5vw, 5rem);
  --section-standard: clamp(4.5rem, 7vw, 7rem);
  --section-large: clamp(5.75rem, 8.5vw, 8.5rem);

  /* Shape and elevation */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 20px 56px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 28px 90px rgba(0, 0, 0, 0.46);

  /* Interaction */
  --motion-fast: 140ms;
  --motion-standard: 220ms;
  --motion-slow: 520ms;
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --z-header: 1000;
  --z-drawer: 1300;
  --z-overlay: 1200;
  --z-skip-link: 1400;
  --focus-ring-color: var(--accent-blue);
  --disabled-opacity: 0.58;
  --button-height: 50px;
  --button-height-compact: 44px;
  --button-padding-inline: 1.35rem;
  --control-height: 50px;
  --header-height: 76px;
  --header-height-mobile: 68px;

  /* Backward-compatible aliases used by approved page compositions */
  --color-bg-dark: var(--bg-primary);
  --color-bg-light: var(--bg-secondary);
  --color-surface-dark: var(--surface-dark);
  --color-surface-light: var(--surface-light);
  --color-text-dark: var(--text-inverse);
  --color-text-light: var(--text-primary);
  --color-muted-dark: var(--text-secondary);
  --color-muted-light: var(--text-muted);
  --brand-blue: var(--accent-blue);
  --brand-indigo: var(--accent-purple);
  --brand-pink: var(--accent-pink);
  --brand-coral: var(--accent-coral);
  --color-accent-pink: var(--accent-pink);
  --color-accent-pink-text: var(--accent-pink-text);
  --color-accent-purple: var(--accent-purple);
  --color-accent-blue: var(--accent-blue);
  --black: var(--bg-primary);
  --bg: var(--bg-primary);
  --paper: var(--bg-secondary);
  --panel: var(--surface-dark);
  --ink: var(--text-inverse);
  --white: var(--text-primary);
  --muted-dark: var(--text-secondary);
  --muted-light: var(--text-muted);
  --pink: var(--accent-pink);
  --indigo: var(--accent-purple);
  --blue: var(--accent-blue);
  --coral: var(--accent-coral);
  --gradient: var(--gradient-brand);
  --display: var(--font-display);
  --body: var(--font-body);
  --max: var(--container-max);
  --copy: 760px;
  --copy-wide: var(--content-max);
  --line: var(--border-strong);
  --soft-line: var(--border-subtle);
  --section-muted: var(--text-secondary);
  --space-section: var(--section-standard);
  --space-section-compact: var(--section-compact);
  --space-section-large: var(--section-large);
  --section-space: var(--section-standard);
  --section-space-large: var(--section-large);
  --shadow: var(--shadow-lg);

  /* Legacy redirect-shell aliases retained so noindex compatibility routes render cleanly. */
  --border-dark: 1px solid var(--border-strong);
  --header-logo-width: clamp(164px, 15vw, 190px);
  --text-primary-dark: var(--text-inverse);
  --text-muted-dark: var(--text-secondary);
  --text-muted-light: var(--text-muted);
}

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

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: var(--leading-body);
  margin: 0;
  overflow-x: hidden;
}

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

img { height: auto; }

a { color: inherit; }

button,
input,
textarea,
select { font: inherit; }

:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 4px;
}

.skip-link {
  background: var(--surface-light);
  color: var(--text-inverse);
  left: var(--space-4);
  padding: var(--space-3) var(--space-4);
  position: fixed;
  top: var(--space-3);
  transform: translateY(-160%);
  transition: transform var(--motion-fast) var(--ease-standard);
  z-index: var(--z-skip-link);
}

.skip-link:focus { transform: translateY(0); }

.sr-only {
  clip: rect(0, 0, 0, 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Typography roles */
.display-xl,
.display-lg {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
  line-height: var(--leading-display);
  text-wrap: balance;
}

.display-xl { font-size: var(--font-size-display-xl); }
.display-lg { font-size: var(--font-size-display-lg); }

.heading-xl,
.heading-lg,
.heading-md {
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: 0;
  line-height: var(--leading-heading);
  text-wrap: balance;
}

.heading-xl { font-size: var(--font-size-heading-xl); }
.heading-lg { font-size: var(--font-size-heading-lg); }
.heading-md { font-size: var(--font-size-heading-md); }
.body-lg { font-size: var(--font-size-body-lg); line-height: 1.55; }
.body { font-size: var(--font-size-body); line-height: var(--leading-body); }

.eyebrow,
.meta,
.caption {
  font-family: var(--font-body);
  font-weight: var(--font-weight-bold);
}

.eyebrow {
  font-size: clamp(0.7rem, 0.8vw, 0.75rem);
  letter-spacing: var(--tracking-label);
  line-height: 1.35;
  text-transform: uppercase;
}

.meta { font-size: var(--font-size-caption); letter-spacing: 0.06em; }
.caption { font-size: var(--font-size-caption); line-height: 1.5; }

/* Layout primitives */
.container,
.container--wide,
.section-inner,
.nav-shell,
.footer-grid,
.case-header__inner,
.case-footer__inner,
.ce-shell,
.pl-shell {
  margin-inline: auto;
  width: min(calc(100% - (var(--page-gutter) * 2)), var(--container-max));
}

.container--text { margin-inline: auto; max-width: var(--content-max); }
.container--narrow { margin-inline: auto; max-width: var(--content-narrow); }
.section { padding-block: var(--section-standard); }
.section--compact { padding-block: var(--section-compact); }
.section--large { padding-block: var(--section-large); }

/* Surface roles let components inherit readable text and borders. */
.surface-dark {
  --surface-background: var(--bg-primary);
  --surface-foreground: var(--text-primary);
  --surface-muted: var(--text-secondary);
  --surface-border: var(--border-strong);
  background: var(--surface-background);
  color: var(--surface-foreground);
}

.surface-light {
  --surface-background: var(--bg-secondary);
  --surface-foreground: var(--text-inverse);
  --surface-muted: var(--text-muted);
  --surface-border: var(--border-strong-light);
  background: var(--surface-background);
  color: var(--surface-foreground);
}

.stack { display: flex; flex-direction: column; gap: var(--stack-space, var(--space-5)); }
.cluster { align-items: center; display: flex; flex-wrap: wrap; gap: var(--cluster-space, var(--space-4)); }
.split { align-items: var(--split-align, center); display: grid; gap: var(--split-gap, clamp(2rem, 6vw, 6rem)); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2 { display: grid; gap: var(--grid-gap, var(--space-6)); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: var(--grid-gap, var(--space-6)); grid-template-columns: repeat(3, minmax(0, 1fr)); }

.media-frame {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 0;
  overflow: hidden;
}

.media-frame img { width: 100%; }

/* Predictable section-intro rhythm */
.section-heading > .eyebrow,
.price-group__header > .eyebrow,
.testimonials__header > .eyebrow { margin-bottom: var(--space-4); }

.section-heading > :is(h1, h2, h3),
.price-group__header > :is(h1, h2, h3),
.testimonials__header > :is(h1, h2, h3) { margin-bottom: var(--space-5); }

.section-heading > :is(h1, h2, h3):last-child,
.price-group__header > :is(h1, h2, h3):last-child,
.testimonials__header > :is(h1, h2, h3):last-child { margin-bottom: 0; }

.section-heading { max-width: var(--content-max); }
.section-heading > p:not(.eyebrow) { max-width: var(--measure-body); }

/* Shared button system */
.button,
.button--primary,
.button--secondary,
.button--text,
.text-link,
.nav-cta,
.case-nav__cta,
.project-cta,
.enterprise-case__copy .text-link,
.case-nav__link {
  align-items: center;
  display: inline-flex;
  font-family: var(--font-body);
  gap: var(--space-2);
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.button,
.button--primary,
.button--secondary,
.button--light {
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.77rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-action);
  min-height: var(--button-height);
  padding: 0.9rem var(--button-padding-inline);
  text-transform: uppercase;
  transition: background-color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}

.button--primary { background: var(--gradient-brand); color: #fff; }

.button--primary:visited,
.button--primary:hover,
.button--primary:focus-visible { color: #fff; }

.button--secondary { background: transparent; border-color: var(--border-strong); color: var(--text-primary); }

.button--light {
  background: var(--surface-light);
  border-color: var(--surface-light);
  color: var(--text-inverse);
}

.button--light:visited,
.button--light:hover,
.button--light:focus-visible { color: var(--text-inverse); }

.button--text,
.text-link { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

.nav-cta,
.case-nav__cta {
  background: var(--gradient-brand);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 0.7rem;
  font-weight: var(--font-weight-extrabold);
  letter-spacing: var(--tracking-action);
  min-height: var(--button-height-compact);
  padding: 0.7rem var(--space-4);
  text-transform: uppercase;
  transition: background-color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}

.button:active,
.button--primary:active,
.button--secondary:active,
.button--light:active { transform: translateY(0); }

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: var(--disabled-opacity);
  pointer-events: none;
}

@media (hover: hover) {
  .button:hover,
  .button--primary:hover,
  .button--secondary:hover,
  .button--light:hover,
  .case-nav__cta:hover { transform: translateY(-2px); }
}

/* Shared cards */
.testimonial-card,
.price-card,
.enterprise-case {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
}

.card { border-radius: var(--radius-lg); }
.card--feature { background: transparent; border: 0; padding: 0; }
.card--testimonial,
.testimonial-card { background: rgba(255, 255, 255, 0.025); }
.card--pricing,
.price-card { background: transparent; border-color: inherit; }
.card--enterprise,
.enterprise-case { background: var(--surface-dark); overflow: hidden; }
.card--decision { background: transparent; }

/* Shared header and footer dimensions */
.site-header,
.case-header { z-index: var(--z-header); }

.nav-shell,
.case-header__inner {
  align-items: center;
  display: flex;
  gap: var(--space-6);
  justify-content: space-between;
  min-height: var(--header-height);
}

.brand-mark,
.case-brand img {
  height: auto;
  object-fit: contain;
  object-position: left center;
  width: clamp(164px, 15vw, 190px);
}

.site-footer,
.case-footer { background: var(--bg-primary); border-top: 1px solid var(--border-subtle); color: var(--text-primary); }

/* Service composition shared by service pages and founder guides */
.service-page { background: var(--bg-primary); color: var(--text-primary); }
.service-page main { padding-top: 0; }
.service-hero {
  background: radial-gradient(circle at 84% 18%, rgba(65, 71, 251, 0.22), transparent 28%), radial-gradient(circle at 72% 60%, rgba(255, 0, 106, 0.12), transparent 30%), var(--bg-primary);
  padding: var(--space-7) 0 var(--space-8);
}
.service-hero__grid { align-items: end; display: grid; gap: clamp(2rem, 6vw, 6rem); grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr); }
.service-hero h1 { font-family: var(--font-display); font-size: clamp(4rem, 8vw, 7.5rem); font-weight: var(--font-weight-bold); line-height: 0.93; margin: 0.6rem 0 1.25rem; max-width: 10ch; text-transform: uppercase; }
.service-hero__lead { color: #d8dbe2; font-size: clamp(1.08rem, 1.7vw, 1.35rem); max-width: 720px; }
.service-hero__side { border-left: 1px solid var(--border-strong); padding-left: clamp(1.25rem, 3vw, 2.5rem); }
.service-hero__side strong { display: block; font-family: var(--font-display); font-size: 1.55rem; line-height: 1.05; margin-bottom: 0.7rem; }
.service-hero__side p { color: var(--text-secondary); margin: 0; }
.service-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: 1.7rem; }
.service-section { padding-block: var(--section-standard); }
.service-section--light { background: var(--bg-secondary); color: var(--text-inverse); }
.service-section--dark { background: var(--bg-primary); color: var(--text-primary); }
.service-section__head { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); margin-bottom: 2.5rem; }
.service-section h2 { font-family: var(--font-display); font-size: clamp(2.8rem, 5vw, 4.8rem); font-weight: var(--font-weight-bold); line-height: 0.95; margin: 0.3rem 0 0; text-transform: uppercase; }
.service-section__intro { font-size: clamp(1rem, 1.35vw, 1.18rem); max-width: var(--content-narrow); }
.service-section--light .service-section__intro { color: var(--text-muted); }
.service-section--dark .service-section__intro { color: var(--text-secondary); }
.service-grid { background: var(--border-strong-light); border: 1px solid var(--border-strong-light); display: grid; gap: 1px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.service-grid article { background: var(--surface-light); padding: clamp(1.5rem, 3vw, 2.25rem); }
.service-grid article span { color: var(--accent-pink-text); font-size: 0.72rem; font-weight: var(--font-weight-extrabold); letter-spacing: 0.12em; }
.service-grid h3 { font-size: 1.15rem; margin: 0.8rem 0 0.55rem; }
.service-grid p { color: var(--text-muted); margin: 0; }
.service-section--dark .service-grid { background: var(--border-strong); border-color: var(--border-strong); }
.service-section--dark .service-grid article { background: var(--surface-dark); }
.service-section--dark .service-grid p { color: var(--text-secondary); }
.service-list { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.service-list article { border: 1px solid var(--border-strong-light); padding: var(--space-5); }
.service-section--dark .service-list article { border-color: var(--border-strong); }
.service-list h3 { margin: 0 0 var(--space-2); }
.service-list p { color: var(--text-muted); margin: 0; }
.service-section--dark .service-list p { color: var(--text-secondary); }
.service-faq details { border-top: 1px solid var(--border-strong-light); padding: var(--space-4) 0; }
.service-faq details:last-child { border-bottom: 1px solid var(--border-strong-light); }
.service-faq summary { cursor: pointer; font-weight: var(--font-weight-extrabold); list-style: none; }
.service-faq summary::-webkit-details-marker { display: none; }
.service-faq summary::after { color: var(--accent-pink-text); content: "+"; float: right; }
.service-faq details[open] summary::after { content: "−"; }
.service-faq p { color: var(--text-muted); max-width: 760px; }
.service-cta { background: var(--gradient-brand); color: var(--text-primary); padding-block: clamp(4rem, 7vw, 6.5rem); text-align: center; }
.service-cta h2 { color: var(--text-primary); font-family: var(--font-display); font-size: clamp(3rem, 6vw, 5.5rem); font-weight: var(--font-weight-bold); line-height: var(--leading-display); margin: 0.45rem auto var(--space-4); max-width: 12ch; text-transform: uppercase; }
.service-cta p { margin-inline: auto; max-width: 650px; }

/* Shared service and guide shell */
.service-header {
  background: rgba(7, 7, 10, 0.96);
  border-bottom: 1px solid var(--border-subtle);
  inset: 0 0 auto;
  position: fixed;
  z-index: var(--z-header);
}

.service-header__inner,
.service-footer__inner {
  margin-inline: auto;
  width: min(calc(100% - (var(--page-gutter) * 2)), var(--container-max));
}

.service-header__inner {
  align-items: center;
  display: flex;
  gap: var(--space-4);
  justify-content: space-between;
  min-height: var(--header-height);
}

.service-header__logo img { width: clamp(165px, 18vw, 220px); }
.service-header__nav { align-items: center; display: flex; gap: var(--space-4); }
.service-header__nav a {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-action);
  text-decoration: none;
  text-transform: uppercase;
}
.service-header__nav a:hover { color: var(--text-primary); }
.service-header__nav .button--primary,
.service-header__nav .button--primary:hover,
.service-header__nav .button--primary:focus-visible { color: var(--text-primary); }

.service-footer {
  background: #050507;
  border-top: 1px solid var(--border-subtle);
  padding: 2.25rem 0;
}
.service-footer__inner { align-items: center; display: flex; gap: var(--space-5); justify-content: space-between; }
.service-footer__inner p { color: var(--text-secondary); font-size: 0.78rem; margin: 0; }
.service-footer__links { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.service-footer__links a { color: var(--text-secondary); font-size: 0.78rem; text-decoration: none; }
.service-footer__links a:hover { color: var(--text-primary); }

/* Responsive primitives */
@media (max-width: 1024px) {
  .split,
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .service-header__nav a:not(.button--primary) { display: none; }
  .service-footer__inner { align-items: flex-start; flex-direction: column; }
  .service-hero { padding: var(--space-6) 0 var(--space-7); }
  .service-hero__grid,
  .service-section__head { grid-template-columns: 1fr; }
  .service-hero__side { border-left: 0; border-top: 1px solid var(--border-strong); padding: 1.25rem 0 0; }
  .service-grid,
  .service-list { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --page-gutter: 1rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .service-header__inner { min-height: var(--header-height-mobile); }
}

@media (max-width: 480px) {
  .display-xl { font-size: clamp(3.25rem, 17vw, 4.5rem); }
  .display-lg { font-size: clamp(2.8rem, 14vw, 3.75rem); }
  .heading-xl { font-size: clamp(2.25rem, 11vw, 3rem); }
  .button,
  .button--primary,
  .button--secondary,
  .button--light { max-width: 100%; }
}

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

/* Production navigation behavior: fixed across every public page shell. */
html { scroll-padding-top: 92px; }
body { padding-top: var(--header-height); }
.site-header,
.case-header {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  z-index: var(--z-header);
}
section[id] { scroll-margin-top: 92px; }
@media (max-width: 767px) {
  body { padding-top: var(--header-height-mobile); }
  html { scroll-padding-top: 82px; }
  section[id] { scroll-margin-top: 82px; }
}
