/* ============================================================
   CapacityPod — base.css
   Variables, reset, typography, global utilities
   Spec v1 · Build 2026-04-08
   ============================================================ */

/* ----------------------------------------------------------
   1. Design Tokens
   ---------------------------------------------------------- */

:root {
  /* Brand Colors */
  --color-brand-primary:        #362256;
  --color-brand-primary-deep:   #23143A;
  --color-bg-base:              #FFFFFF;

  /* Purple Grey Scale */
  --color-purple-grey-light:    #BAB8C9;
  --color-purple-grey-mid:      #8E88A5;
  --color-purple-grey-dark:     #6A6184;

  /* Autumn Grey Scale */
  --color-autumn-grey-light:    #E5E5E5;
  --color-autumn-grey-mid:      #D3D1D1;
  --color-autumn-grey-dark:     #B9B5B4;

  /* Derived / UI Tokens */
  --color-bg-tint:              #E5E5E5; /* [BRAND MANUAL PLACEHOLDER — confirm neutral tint; interim: Autumn Grey Light] */
  --color-bg-subtle:            #D3D1D1;
  --color-text-primary:         #1D1D1B;
  --color-text-secondary:       #6A6184;
  --color-text-muted:           #8E88A5;
  --color-white:                #FFFFFF;
  --color-cta-bg:               #362256; /* [BRAND MANUAL PLACEHOLDER — confirm primary CTA colour; interim: Purple Deep] */
  --color-cta-text:             #FFFFFF;
  --color-cta-hover:            #23143A; /* [BRAND MANUAL PLACEHOLDER — confirm CTA hover; interim: Corporate Navy] */
  --color-error:                #E00613;
  --color-divider:              #EAEAEA;

  /* Spacing System (8px base) */
  --space-2:   16px;
  --space-3:   24px;
  --space-4:   32px;
  --space-5:   40px;
  --space-6:   48px;
  --space-8:   64px;
  --space-10:  80px;
  --space-12:  96px;
  --space-16:  128px;

  /* Border Radius */
  --radius-sm:   4px;  /* [BRAND MANUAL PLACEHOLDER — confirm; interim: 4px] */
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);

  /* Layout */
  --max-content-width: 1280px;
  --nav-height:        72px;

  /* Typography */
  --font-display: 'Alexandria', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-ui:      'Alexandria', system-ui, -apple-system, Segoe UI, sans-serif;

  /* Transitions */
  --transition-fast:   100ms ease;
  --transition-normal: 200ms ease;
  --transition-slow:   400ms ease-out;
}

/* ----------------------------------------------------------
   2. CSS Reset
   ---------------------------------------------------------- */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.65;
  color: var(--color-text-primary);
  background-color: var(--color-bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}

input,
textarea,
select {
  font: inherit;
}

/* ----------------------------------------------------------
   3. Typography
   ---------------------------------------------------------- */

/* Google Fonts import */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-text-primary);
}

/* H1 — Hero headline */
h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 3.5rem;      /* 56px */
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* H2 — Section headline */
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.5rem;      /* 40px */
  line-height: 1.15;
  letter-spacing: -0.015em;
}

/* H3 — Subsection / card title */
h3 {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 1.5rem;      /* 24px */
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* H4 — Label / eyebrow */
h4 {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.8125rem;   /* 13px */
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Lead / Subhead */
.subhead {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.25rem;     /* 20px */
  line-height: 1.45;
  letter-spacing: -0.005em;
}

/* Body */
p {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 1.0625rem;   /* 17px */
  line-height: 1.65;
}

/* Body small */
.body-small {
  font-size: 0.9375rem;   /* 15px */
  line-height: 1.6;
}

/* Caption */
.caption {
  font-size: 0.8125rem;   /* 13px */
  line-height: 1.5;
}

/* Eyebrow label */
.eyebrow {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.8125rem;   /* 13px */
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand-primary);
}

/* Text link */
.text-link {
  color: var(--color-brand-primary);
  text-decoration: none;
}
.text-link:hover {
  text-decoration: underline;
}

/* ----------------------------------------------------------
   4. Layout Utilities
   ---------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--max-content-width);
  margin-inline: auto;
  padding-inline: 80px;
}

@media (max-width: 1023px) {
  .container {
    padding-inline: 40px;
  }
}

@media (max-width: 767px) {
  .container {
    padding-inline: 20px;
  }
}

/* ----------------------------------------------------------
   5. Buttons
   ---------------------------------------------------------- */

/* Primary CTA */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.9375rem;   /* 15px */
  line-height: 1;
  letter-spacing: 0.01em;
  border-radius: var(--radius-full);
  padding: 0 24px;
  height: 44px;
  transition: background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
  white-space: nowrap;
  text-decoration: none;
}

.btn--primary {
  background-color: var(--color-cta-bg);
  color: var(--color-cta-text);
  border: 1.5px solid var(--color-cta-bg);
}
.btn--primary:hover {
  background-color: var(--color-cta-hover);
  border-color: var(--color-cta-hover);
}
.btn--primary:active {
  background-color: #1A1230;
  border-color: #1A1230;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.btn--primary:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
}

/* Primary large */
.btn--lg {
  height: 48px;
}

/* Primary compact */
.btn--sm {
  height: 40px;
}

/* Ghost / Secondary */
.btn--ghost {
  background-color: transparent;
  color: var(--color-brand-primary);
  border: 1.5px solid var(--color-brand-primary);
}
.btn--ghost:hover {
  background-color: var(--color-brand-primary);
  color: var(--color-white);
}
.btn--ghost:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
}

/* Ghost on dark background (white variant) */
.btn--ghost-white {
  background-color: transparent;
  color: var(--color-white);
  border: 1.5px solid var(--color-white);
}
.btn--ghost-white:hover {
  background-color: rgba(255,255,255,0.15);
}
.btn--ghost-white:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

/* Reverse CTA (white fill, brand label — for brand-purple backgrounds) */
.btn--reverse {
  background-color: var(--color-white);
  color: var(--color-brand-primary);
  border: 1.5px solid var(--color-white);
}
.btn--reverse:hover {
  background-color: rgba(255,255,255,0.90);
}
.btn--reverse:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

/* CTA row */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

/* ----------------------------------------------------------
   6. Cards
   ---------------------------------------------------------- */

.card {
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-divider);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal);
}
.card:hover {
  box-shadow: var(--shadow-md);
}

.card--dark {
  background-color: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: none;
  color: var(--color-white);
}

.card--large {
  padding: 40px;
}

/* ----------------------------------------------------------
   7. Section Patterns
   ---------------------------------------------------------- */

.section {
  padding-block: var(--space-12);
  position: relative;
  overflow: hidden;
}

.section--compact {
  padding-block: var(--space-8);
}

.section--hero-spacing {
  padding-top: var(--space-16);
  padding-bottom: var(--space-12);
}

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

.section--dark {
  background-color: var(--color-brand-primary-deep);
  color: var(--color-white);
}

.section--brand {
  background-color: var(--color-brand-primary);
  color: var(--color-white);
}

.section__header {
  margin-bottom: var(--space-6);
}

.section__header--centered {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-6);
}

.section__header .eyebrow {
  margin-bottom: 16px;
}

.section__header h2 {
  margin-bottom: 0;
}

/* On dark sections, eyebrow at 60% opacity */
.section--dark .eyebrow,
.section--brand .eyebrow {
  color: rgba(255,255,255,0.60);
}

.section--dark h2,
.section--brand h2,
.section--dark h3,
.section--brand h3,
.section--dark p,
.section--brand p {
  color: var(--color-white);
}

/* ----------------------------------------------------------
   8. Split Layouts
   ---------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: center;
}

.split--7-5 {
  grid-template-columns: 7fr 5fr;
}

.split--5-7 {
  grid-template-columns: 5fr 7fr;
}

.split--6-6 {
  grid-template-columns: 6fr 6fr;
}

.split__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  line-height: 0;
}

.split__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
}

@media (max-width: 767px) {
  .split,
  .split--7-5,
  .split--5-7,
  .split--6-6 {
    grid-template-columns: 1fr;
  }
  .split__image {
    order: -1; /* image above text on mobile */
  }
}

/* ----------------------------------------------------------
   9. Grid Layouts
   ---------------------------------------------------------- */

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

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
}

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

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

/* ----------------------------------------------------------
   10. Process Steps
   ---------------------------------------------------------- */

.process-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}

.process-step {
  padding: var(--space-4);
  position: relative;
}

.process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 32px;
  height: 1px;
  width: 1px;
  background-color: rgba(255,255,255,0.25);
}

.process-step__number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.5rem;  /* 40px */
  line-height: 1;
  color: rgba(255,255,255,0.20);
  margin-bottom: 12px;
  display: block;
}

.process-step__title {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 1rem;   /* 16px */
  color: var(--color-white);
  margin-bottom: 8px;
}

.process-step__desc {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 0.875rem; /* 14px */
  color: rgba(255,255,255,0.70);
  line-height: 1.5;
}

/* Light version (How It Works page) */
.process-steps--light .process-step__number {
  font-size: 3.5rem;   /* 56px */
  color: rgba(54, 34, 86, 0.15);
}
.process-steps--light .process-step__title {
  font-size: 1.25rem;
  color: var(--color-text-primary);
}
.process-steps--light .process-step__desc {
  color: var(--color-text-secondary);
  font-size: 1rem;
}
.process-steps--light .process-step:not(:last-child) {
  border-right: 1px solid var(--color-divider);
}

@media (max-width: 767px) {
  .process-steps,
  .process-steps--light {
    grid-template-columns: 1fr;
  }
  .process-step:not(:last-child)::after {
    display: none;
  }
  .process-steps--light .process-step:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid var(--color-divider);
    padding-bottom: var(--space-6);
    margin-bottom: var(--space-6);
  }
}

/* ----------------------------------------------------------
   11. Numbered mini-step (circles)
   ---------------------------------------------------------- */

.mini-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.mini-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
}

.mini-step__number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-brand-primary);
  color: var(--color-white);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.mini-step__content {}

.mini-step__title {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 1rem;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.mini-step__desc {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Dashed vertical connector */
.mini-steps .mini-step:not(:last-child) .mini-step__number::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: calc(var(--space-4) + 12px);
  border-left: 1px dashed var(--color-purple-grey-light);
}

/* ----------------------------------------------------------
   12. Callout Box
   ---------------------------------------------------------- */

.callout {
  border: 1px solid rgba(54, 34, 86, 0.30);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 1rem;
  color: var(--color-brand-primary);
  margin-top: var(--space-4);
}

/* ----------------------------------------------------------
   13. Form Elements
   ---------------------------------------------------------- */

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field + .form-field {
  margin-top: 24px;
}

.form-label {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.875rem;   /* 14px */
  color: var(--color-text-primary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid #D7D7D7;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 1rem;
  color: var(--color-text-primary);
  background-color: var(--color-white);
  transition: border-color 150ms ease;
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-muted);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--color-brand-primary);
}

.form-textarea {
  height: auto;
  min-height: 120px;
  padding: 12px 16px;
  resize: vertical;
  line-height: 1.65;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23362256' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
  cursor: pointer;
}

.form-error {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--color-error);
  margin-top: 4px;
  display: none;
}

.form-field--error .form-input,
.form-field--error .form-textarea,
.form-field--error .form-select {
  border-color: var(--color-error);
}

.form-field--error .form-error {
  display: block;
}

/* ----------------------------------------------------------
   14. Grafismo utility
   ---------------------------------------------------------- */

.grafismo {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.10;
}

.grafismo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ----------------------------------------------------------
   15. Scroll animation (fade-up)
   ---------------------------------------------------------- */

.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----------------------------------------------------------
   16. Utility classes
   ---------------------------------------------------------- */

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

.text-center { text-align: center; }
.text-white  { color: var(--color-white) !important; }

.mt-2  { margin-top: var(--space-2); }
.mt-3  { margin-top: var(--space-3); }
.mt-4  { margin-top: var(--space-4); }
.mt-5  { margin-top: var(--space-5); }
.mt-6  { margin-top: var(--space-6); }

/* ----------------------------------------------------------
   17. Mobile typography scale
   ---------------------------------------------------------- */

@media (max-width: 767px) {
  h1 {
    font-size: 2.25rem;   /* 36px */
  }
  h2 {
    font-size: 1.75rem;   /* 28px */
  }
  h3 {
    font-size: 1.25rem;   /* 20px */
  }
  .subhead {
    font-size: 1.0625rem; /* 17px */
  }
  p {
    font-size: 1rem;      /* 16px */
  }
}

/* ----------------------------------------------------------
   18. Placeholder image styling
   ---------------------------------------------------------- */

.placeholder-img {
  background-color: var(--color-bg-tint);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  padding: 16px;
  overflow: hidden;
  position: relative;
}

.placeholder-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(0,0,0,0.04) 8px,
    rgba(0,0,0,0.04) 9px
  );
}

.placeholder-img span {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.8);
  padding: 8px 12px;
  border-radius: 4px;
}
