/* =========================================================
   AppSpring Tech – Design System
   common.css: tokens → reset → base → layout → components
   ========================================================= */

/* ── 1. DESIGN TOKENS ────────────────────────────────────── */

:root {
  /* -- Fonts -- */
  --font-brand: "Gilroy", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  /* -- Brand palette (matches DESIGN.md) -- */
  --color-purple:        #4F2EDE;  /* Primary */
  --color-purple-vibrant:#5732FA;  /* purple-soft-1 */
  --color-purple-deep:   #38219F;  /* purple-soft-2 */
  --color-purple-darkest:#2D1A7F;  /* purple-soft-3 */

  --color-mint:          #7CFAC3;
  --color-mint-soft:     #B7F9D9;
  --color-yellow:        #FAE019;
  --color-yellow-soft:   #F9EB9D;
  --color-coral:         #FA654B;
  --color-coral-soft:    #F9BBB2;

  --color-gray-900:      #333333;  /* text-primary */
  --color-gray-700:      #424242;  /* text-secondary */
  --color-gray-500:      #AFAFAF;  /* border */
  --color-gray-200:      #E5E5E5;  /* light separator */

  --color-white:         #FFFFFF;
  --color-white-soft:    #F6F6F6;

  /* -- Semantic aliases -- */
  --color-text:          var(--color-gray-900);
  --color-text-muted:    var(--color-gray-700);
  --color-text-soft:     var(--color-gray-500);
  --color-border:        var(--color-gray-500);
  --color-link:          var(--color-purple);
  --color-error:         var(--color-coral);
  --color-success:       var(--color-mint);
  --color-warning:       var(--color-yellow);

  /* -- Surfaces -- */
  --surface:             var(--color-white);
  --surface-alt:         var(--color-white-soft);
  --surface-soft:        #F5F1FF;  /* tinted purple */
  --surface-mint:        #EAFDF4;
  --surface-salmon:      #FFF0ED;
  --surface-yellow:      #FFF9D9;

  /* -- Shadows (intentionally subtle per DESIGN.md) -- */
  --shadow:              0 18px 45px rgba(45, 26, 127, 0.12);
  --shadow-soft:         0 10px 30px rgba(45, 26, 127, 0.08);

  /* -- Border radii (DESIGN.md rounded scale) -- */
  --radius-none: 0px;
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   10px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  /* Legacy alias — prefer named tokens above */
  --radius: var(--radius-md);

  /* -- Spacing (DESIGN.md spacing scale) -- */
  --space-xs:      6px;
  --space-sm:      16px;
  --space-md:      30px;
  --space-lg:      50px;
  --space-xl:      94px;
  --space-gutter:  40px;
  --space-section: 94px;

  /* -- Layout -- */
  --max-width:    1200px;
  --header-height: 73px;

  /* -- Gradients -- */
  --gradient-brand-primary: linear-gradient(135deg, var(--color-purple) 0%, var(--color-purple-vibrant) 100%);
  --gradient-brand-deep:    linear-gradient(135deg, var(--color-purple-darkest) 0%, var(--color-purple-deep) 100%);
  --gradient-brand-vivid:   linear-gradient(135deg, var(--color-purple-vibrant) 0%, var(--color-coral) 100%);

  /* -- Home-page dark theme local tokens (used by home.css) -- */
  --home-bg:     #000;
  --home-text:   #fff;
  --home-violet: var(--color-purple-vibrant);
  --home-mint:   var(--color-mint);
  --home-yellow: var(--color-yellow);
  --home-coral:  var(--color-coral);
}

/* ── 2. FONT FACES ───────────────────────────────────────── */

@font-face {
  font-family: "Gilroy";
  src: url("/assets/fonts/Gilroy-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gilroy";
  src: url("/assets/fonts/Gilroy-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ── 3. RESET & BASE ─────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-brand);
  color: var(--color-text);
  line-height: 1.6;
  background: var(--surface-alt);
}

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

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-coral);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5em;
  color: var(--color-gray-900);
  letter-spacing: -0.03em;
}

p {
  margin-bottom: 1em;
}

ul, ol {
  list-style: none;
}

/* ── 4. TYPOGRAPHY SCALE ─────────────────────────────────── */
/* Maps DESIGN.md typographic tokens to utility classes.     */

/* Headline display — Gilroy ExtraBold, ~61px */
.text-display {
  font-size: clamp(2.8rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1;
}

/* Headline large — Gilroy ExtraBold, ~46px */
.text-headline-lg {
  font-size: clamp(2rem, 4.5vw, 2.875rem);
  font-weight: 800;
  line-height: 1.2;
}

/* Headline medium — ~35px */
.text-headline-md {
  font-size: clamp(1.75rem, 3.5vw, 2.2rem);
  font-weight: 500;
  line-height: 1.2;
}

/* Headline small — ~26px */
.text-headline-sm {
  font-size: clamp(1.4rem, 2.5vw, 1.625rem);
  font-weight: 500;
  line-height: 1.2;
}

/* Body large — 20px */
.text-body-lg  { font-size: 1.25rem;   line-height: 1.5; }

/* Body medium (default UI) — 16px */
.text-body-md  { font-size: 1rem;      line-height: 1.5; }

/* Body small — 14px */
.text-body-sm  { font-size: 0.875rem;  line-height: 1.43; }

/* Label large — 16px medium */
.text-label-lg { font-size: 1rem;      font-weight: 500; line-height: 1.25; }

/* Label medium — 14px medium */
.text-label-md { font-size: 0.875rem;  font-weight: 500; line-height: 1.286; }

/* Label small — 12px medium */
.text-label-sm { font-size: 0.75rem;   font-weight: 500; line-height: 1.333; }

/* -- Legacy scale kept for backward compat -- */
.text-xs  { font-size: 0.75rem; }
.text-sm  { font-size: 0.875rem; }
.text-base{ font-size: 1rem; }
.text-lg  { font-size: 1.125rem; }
.text-xl  { font-size: 1.25rem; }
.text-2xl { font-size: clamp(1.5rem, 3vw, 2.2rem); }
.text-3xl { font-size: clamp(2rem, 5vw, 3.5rem); }

/* ── 5. COLOUR UTILITIES ─────────────────────────────────── */

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-muted        { color: var(--color-text-muted); }
.text-soft         { color: var(--color-text-soft); }
.text-brand        { color: var(--color-purple); }
.text-brand-vivid  { color: var(--color-purple-vibrant); }
.text-brand-deep   { color: var(--color-purple-darkest); }
.text-mint         { color: var(--color-mint); }
.text-coral        { color: var(--color-coral); }
.text-yellow       { color: var(--color-yellow); }

/* Text on dark surface */
.text-on-dark,
.text-on-dark h1,
.text-on-dark h2,
.text-on-dark h3,
.text-on-dark h4,
.text-on-dark h5,
.text-on-dark h6 {
  color: var(--surface);
}

/* Background utilities */
.bg-surface        { background: var(--surface); }
.bg-surface-alt    { background: var(--surface-alt); }
.bg-surface-soft   { background: var(--surface-soft); }
.bg-surface-mint   { background: var(--surface-mint); }
.bg-surface-yellow { background: var(--surface-yellow); }
.bg-surface-salmon { background: var(--surface-salmon); }
.bg-brand          { background: var(--color-purple); }
.bg-brand-deep     { background: var(--color-purple-darkest); }
.bg-brand-mint     { background: var(--color-mint); }
.bg-brand-yellow   { background: var(--color-yellow); }
.bg-brand-coral    { background: var(--color-coral); }

/* Gradient utilities */
.gradient-brand-primary { background: var(--gradient-brand-primary); }
.gradient-brand-deep    { background: var(--gradient-brand-deep); }
.gradient-brand-vivid   { background: var(--gradient-brand-vivid); }

/* Eyebrow / label pattern */
.eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-purple);
}

/* ── 6. SPACING UTILITIES ────────────────────────────────── */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.py-2 { padding-top: 1rem;  padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.max-w-560 { max-width: 560px; }
.max-w-580 { max-width: 580px; }
.max-w-680 { max-width: 680px; }
.max-w-700 { max-width: 700px; }
.max-w-720 { max-width: 720px; }

.fw-bold { font-weight: 700; }

.justify-center { justify-content: center; }

/* ── 7. LAYOUT ───────────────────────────────────────────── */

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Section wrapper */
.section     { padding: var(--space-section) 0; }
.section-alt { background: var(--surface-alt); }

/* Section header block */
.section-header             { text-align: center; margin-bottom: 2.5rem; }
.section-header h2          { font-size: clamp(1.8rem, 4vw, 2.5rem); color: var(--color-gray-900); }
.section-header p           { color: var(--color-text-muted); max-width: 600px; margin: 0.5rem auto 0; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem;   }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* Split layout (content + visual) */
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 2rem;
  align-items: center;
}
@media (max-width: 900px) {
  .split-layout { grid-template-columns: 1fr; }
}

/* ── 8. COMPONENTS ───────────────────────────────────────── */

/* === Buttons ===
   DESIGN.md: primary (#4F2EDE), secondary (outline), tertiary (text-only)
   Shape: rounded-lg (10px) for standard; pill for hero CTAs            */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 51px;            /* DESIGN.md button height */
  padding: 5px 40px 5px 11px; /* DESIGN.md button padding */
  min-width: 143px;            /* DESIGN.md button min-width */
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;            /* label-lg weight */
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

/* Primary */
.btn-primary {
  background: var(--color-purple);
  color: var(--color-white);
}
.btn-primary:hover {
  background: var(--color-purple-vibrant);
  color: var(--color-white);
}

/* Secondary (outline) */
.btn-secondary,
.btn-outline {
  background: transparent;
  border-color: var(--color-purple);
  color: var(--color-purple);
}
.btn-secondary:hover,
.btn-outline:hover {
  background: var(--color-purple);
  color: var(--color-white);
}

/* Surface (white background) */
.btn-surface {
  background: var(--surface);
  color: var(--color-purple);
}
.btn-surface:hover {
  background: var(--surface);
  color: var(--color-purple-vibrant);
}

/* Outline on a dark background */
.btn-outline-on-dark {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
  color: var(--surface);
}
.btn-outline-on-dark:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--surface);
}

/* Tertiary (text-only) */
.btn-tertiary {
  background: transparent;
  border-color: transparent;
  color: var(--color-gray-700);
  font-size: 0.875rem;
  min-height: auto;
  min-width: auto;
  padding: 0;
}

/* Size modifier */
.btn-sm {
  min-height: 40px;
  padding: 0.65rem 1.1rem;
  font-size: 0.85rem;
}

.btn-block { width: 100%; }

/* Disabled state */
.btn.disabled,
.btn-secondary.disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

/* === Card ===
   DESIGN.md: white/soft-white bg, gray border, 8px radius, 16px padding */

.card {
  background: var(--surface);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  padding: 1rem;                /* ~16px */
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

/* === Tag / Chip ===
   DESIGN.md: pill shape, compact, high contrast */

.tag {
  display: inline-block;
  background: var(--surface-soft);
  color: var(--color-purple);
  border-radius: var(--radius-full);
  padding: 6px 12px;           /* DESIGN.md chip padding */
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.tag-inverse {
  background: rgba(255, 255, 255, 0.14);
  color: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* === Breadcrumb === */

.breadcrumb {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.82);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--color-purple-vibrant);
}

.breadcrumb span {
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Breadcrumb bar (inside hero/dark sections) */
.breadcrumb-bar {
  background: rgba(0, 0, 0, 0.15);
  padding: 0.6rem 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.82);
}

.breadcrumb-bar a {
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.2s;
}

.breadcrumb-bar a:hover {
  color: var(--color-purple-vibrant);
}

.breadcrumb-bar span {
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0.4rem;
}

/* === Accent border helpers === */

.accent-border-left-purple { border-left: 4px solid var(--color-purple); }
.accent-border-left-violet { border-left: 4px solid var(--color-purple-vibrant); }
.accent-border-left-mint   { border-left: 4px solid var(--color-mint); }
.accent-border-left-coral  { border-left: 4px solid var(--color-coral); }

.accent-border-top-purple  { border-top: 3px solid var(--color-purple); }
.accent-border-top-violet  { border-top: 3px solid var(--color-purple-vibrant); }
.accent-border-top-mint    { border-top: 3px solid var(--color-mint); }
.accent-border-top-coral   { border-top: 3px solid var(--color-coral); }

/* ── 9. SHARED PAGE UTILITIES ────────────────────────────
   Reusable across interior pages (services, digital-consulting, etc.)
   ──────────────────────────────────────────────────────── */

/* Symmetric button — overrides the asymmetric DESIGN.md padding
   when no trailing icon is present                          */
.sv-btn {
  padding: 0.875rem 2rem;
  min-width: 0;
  justify-content: center;
  text-align: center;
}

/* Ghost button for dark hero surfaces */
.sv-btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--color-white);
}

.sv-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Section intro block (left-aligned default) */
.sv-section-intro {
  margin-bottom: 3rem;
}

.sv-section-intro .eyebrow {
  display: block;
  margin-bottom: 0.5rem;
}

.sv-section-intro h2 {
  margin-bottom: 0.5rem;
}

.sv-section-intro p {
  color: var(--color-text-muted);
  max-width: 540px;
  margin: 0;
}

/* Centred variant */
.sv-section-intro--center {
  text-align: center;
}

.sv-section-intro--center p {
  margin-left: auto;
  margin-right: auto;
}

/* Full-width gradient CTA strip */
.sv-cta-strip {
  background: var(--gradient-brand-primary);
  padding: 4.5rem 0;
}

.sv-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.sv-cta-copy h2 {
  color: var(--color-white);
  margin-bottom: 0.4rem;
}

.sv-cta-copy p {
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

@media (max-width: 640px) {
  .sv-cta-inner {
    flex-direction: column;
    text-align: center;
  }
}
