/* ============================================
   gradiant.lab — Main Stylesheet
   ============================================ */

/* 1. Google Fonts Import
   Poppins is loaded via <link> in views/layouts/main.ejs (faster — @import
   blocks and serialises the request). Kept here only for Material Symbols. */
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

/* 2. CSS Variables / Design Tokens
   Mirrors the Tailwind config in views/layouts/main.ejs — keep the two in sync. */
:root {
  /* Neutrals — warm greys carrying a faint violet cast so they sit under the
     brand gradient without reading as a second, cooler grey family. */
  --color-bg:                  #ffffff;
  --color-text:                #171320;
  --color-surface:             #ffffff;
  --color-surface-container-low: #F8F7FB;
  --color-surface-container:   #F3F1F9;
  --color-surface-container-high: #EDEAF6;
  --color-surface-container-highest: #E6E2F2;
  --color-surface-variant:     #EDEAF6;
  --color-border:              #E4E0EE;
  --color-outline:             #8B8496;
  --color-outline-variant:     #CFC8DD;
  --color-muted:               #5A5368;
  --color-primary:             #171320;
  --color-on-primary:          #ffffff;
  --color-on-surface:          #171320;
  --color-on-surface-variant:  #5A5368;
  --color-inverse-surface:     #171320;
  --color-error:               #ba1a1a;

  /* Brand — reserved for the logo, one emphasis word per headline, icon tiles
     and ambient washes. Not a general-purpose UI colour. */
  --brand-magenta: #E838C4;
  --brand-violet:  #8B5CF6;
  --brand-blue:    #3B82F6;
  --brand-gradient: linear-gradient(135deg, #E838C4 0%, #8B5CF6 55%, #3B82F6 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(232,56,196,.10) 0%, rgba(139,92,246,.10) 55%, rgba(59,130,246,.10) 100%);

  /* Typography */
  --font-headline: 'Poppins', system-ui, sans-serif;
  --font-body:     'Poppins', system-ui, sans-serif;
  --font-label:    'Poppins', system-ui, sans-serif;

  /* Spacing */
  --container-max: 1440px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Radius — the old system forced 0px everywhere; this is the reversal. */
  --radius-sm:   10px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --radius-xl:   32px;
  --radius-full: 9999px;

  /* Elevation — tinted toward the brand hue rather than neutral black. */
  --shadow-soft: 0 4px 24px -4px rgba(23,19,32,.06), 0 1px 2px rgba(23,19,32,.04);
  --shadow-lift: 0 18px 48px -12px rgba(139,92,246,.18), 0 2px 8px rgba(23,19,32,.04);

  /* Transitions */
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
  --duration: 400ms;
}

/* 3. Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

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

input, textarea, select {
  font-family: inherit;
}

::selection {
  background-color: var(--color-primary);
  color: white;
}

/* 4. Typography */
.syne, .font-headline {
  font-family: var(--font-headline);
  font-weight: 600;
}

.font-body {
  font-family: var(--font-body);
}

.font-label {
  font-family: var(--font-label);
}

/* Poppins is geometric and wider than Inter: large display type needs the
   tracking pulled in, or headlines drift apart at 4xl+. */
h1, h2, .text-6xl, .text-7xl, .text-8xl {
  letter-spacing: -0.02em;
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  vertical-align: middle;
}

/* 5. Layout Utilities */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

/* 6. Components */

/* --- Accessibility: skip to content --- */
.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 100;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: 0.875rem;
  transition: transform 200ms var(--ease-smooth);
}
.skip-link:focus {
  transform: translate(-50%, 0);
}

/* --- Brand lockup: mark | wordmark --- */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}
.brand-rule {
  width: 1px;
  height: 22px;
  background: var(--color-outline-variant);
}
.brand-rule--dark { background: rgba(255,255,255,.22); }
.brand-word {
  font-family: var(--font-headline);
  font-weight: 400;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--color-on-surface);
  white-space: nowrap;
}
.brand-word--light { color: #fff; font-size: 1.5rem; }
.brand-word .gradient-text { font-weight: 500; margin-left: 0.3em; }

/* --- Gradient text: one emphasis word per headline, never a whole phrase --- */
.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* painting a gradient onto glyphs clips descenders on some engines */
  padding-bottom: 0.04em;
}

/* --- Ambient brand wash: the iridescent corner bleed from the brand marks.
       Pure CSS radial gradients — no images, no build step. --- */
.brand-wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* Without this the container's overflow clip leaves a hard horizontal seam
     where the blur stops. Fade the wash out before it reaches the edge. */
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 45%, transparent 96%);
}
.brand-wash::before,
.brand-wash::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.brand-wash::before {
  width: 46vw; height: 46vw;
  min-width: 320px; min-height: 320px;
  top: -18vw; right: -12vw;
  background: radial-gradient(circle, rgba(232,56,196,.30), transparent 70%);
}
.brand-wash::after {
  width: 52vw; height: 52vw;
  min-width: 340px; min-height: 340px;
  bottom: -26vw; right: -6vw;
  background: radial-gradient(circle, rgba(59,130,246,.26), transparent 70%);
}
.brand-wash > * { position: relative; z-index: 1; }

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: transform 200ms var(--ease-smooth), box-shadow 200ms var(--ease-smooth), background-color 200ms var(--ease-smooth);
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: #2A2338;
    box-shadow: var(--shadow-lift);
    transform: translateY(-1px);
  }
}
.btn-primary:active { transform: translateY(0) scale(.985); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--color-border);
  color: var(--color-on-surface);
  padding: 0.75rem 2rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color 200ms var(--ease-smooth), background-color 200ms var(--ease-smooth), transform 200ms var(--ease-smooth);
}
@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover {
    border-color: var(--brand-violet);
    background: var(--color-surface-container-low);
    transform: translateY(-1px);
  }
}
.btn-ghost:active { transform: translateY(0) scale(.985); }

/* --- Icon tile: rounded square holding a gradient-tinted glyph --- */
.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-md);
  background: var(--brand-gradient-soft);
  border: 1px solid var(--color-border);
}
.icon-tile .material-symbols-outlined {
  font-size: 1.625rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Pull-quote with gradient rule, per the brand marks --- */
.quote-accent {
  border-left: 3px solid transparent;
  border-image: var(--brand-gradient) 1;
  padding-left: 1.5rem;
}

/* --- Soft callout box --- */
.callout-box {
  background: var(--brand-gradient-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

/* --- Focus visibility (was absent site-wide) --- */
:focus-visible {
  outline: 2px solid var(--brand-violet);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- CTA panel: replaces the old full-bleed black slab, which read as a
       copy-paste accident once the palette went light. --- */
.cta-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  background: var(--color-surface-container-low);
  padding: 4rem 2rem;
  box-shadow: var(--shadow-soft);
}
@media (min-width: 768px) {
  .cta-panel { padding: 6rem 4rem; }
}

/* --- Service card --- */
.service-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-soft);
  transition: transform var(--duration) var(--ease-smooth),
              box-shadow var(--duration) var(--ease-smooth),
              border-color var(--duration) var(--ease-smooth);
}
@media (hover: hover) and (pointer: fine) {
  .service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
    border-color: var(--color-outline-variant);
  }
}
.service-card__num {
  position: absolute;
  top: 1rem;
  right: 1.75rem;
  font-family: var(--font-headline);
  font-size: 5rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  /* Solid tint, not the brand gradient. The gradient is reserved for the logo,
     one emphasis word per headline, and icon tiles; spending it on a decorative
     watermark dilutes it, and at these opacities it reads as a flat tint anyway. */
  color: var(--brand-violet);
  opacity: 0.12;
  transition: opacity var(--duration) var(--ease-smooth);
  pointer-events: none;
}
.service-card:hover .service-card__num { opacity: 0.2; }
.service-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-on-surface);
  transition: gap var(--duration) var(--ease-smooth), color var(--duration) var(--ease-smooth);
}
.service-card:hover .service-card__link { gap: 0.7rem; color: var(--brand-violet); }
.service-card--lg { padding: 3rem; }
.service-card--lg .service-card__num { font-size: 7rem; }
@media (max-width: 767px) {
  .service-card, .service-card--lg { padding: 1.75rem; }
  .service-card__num, .service-card--lg .service-card__num { font-size: 3.5rem; }
}

/* --- ERP dashboard mock (hero product shot, pure CSS) --- */
.dash {
  display: grid;
  grid-template-columns: 146px 1fr;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  font-size: 11px;
  line-height: 1.4;
}
.dash__side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  background: var(--color-surface-container-low);
  border-right: 1px solid var(--color-border);
}
.dash__brand { padding: 0 6px 14px; }
.dash__navitem {
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash__navitem--on {
  background: var(--brand-gradient-soft);
  color: var(--color-on-surface);
  font-weight: 500;
}
.dash__main { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.dash__title { font-weight: 600; font-size: 13px; }
.dash__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dash__stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.dash__stat-label { color: var(--color-muted); font-size: 10px; }
.dash__stat-value { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.dash__stat-delta { color: #16a34a; font-size: 10px; }
.dash__chart {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 10px 6px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.dash__spark { width: 100%; flex: 1; min-height: 76px; margin-top: 4px; }
.dash__months {
  display: flex; justify-content: space-between;
  color: var(--color-muted); font-size: 9px; padding-top: 4px;
}

/* --- Slide Underline --- */
.slide-underline {
  position: relative;
}
.slide-underline::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -4px;
  left: 0;
  border-radius: 2px;
  background: var(--brand-gradient);
  /* scaleX rather than width: transform is composited, width relayouts every frame */
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--duration) var(--ease-smooth);
}
.slide-underline:hover::after,
.slide-underline.active::after {
  transform: scaleX(1);
}

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

/* --- Project Card Hover --- */
.project-card:hover .project-reveal {
  opacity: 1;
  transform: translateY(0);
}
.project-card:hover .project-image {
  transform: translateY(-10px);
}

/* --- Floating Label (Contact Form) --- */
.floating-label-group {
  position: relative;
  margin-bottom: 1.5rem;
}
.floating-label-group input,
.floating-label-group textarea,
.floating-label-group select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  width: 100%;
  padding: 16px 16px 14px;
  outline: none;
  transition: border-color var(--duration), box-shadow var(--duration);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
}
.floating-label-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B8496' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}
.floating-label-group input:focus,
.floating-label-group textarea:focus,
.floating-label-group select:focus {
  border-color: var(--brand-violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .14);
}
.floating-label-group label {
  position: absolute;
  left: 16px;
  top: 16px;
  color: var(--color-outline);
  pointer-events: none;
  transition: transform .25s var(--ease-smooth), font-size .25s var(--ease-smooth), color .25s var(--ease-smooth);
  font-family: var(--font-label);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  background: #fff;
  padding: 0 5px;
  border-radius: 4px;
}
.floating-label-group input:focus ~ label,
.floating-label-group input:not(:placeholder-shown) ~ label,
.floating-label-group textarea:focus ~ label,
.floating-label-group textarea:not(:placeholder-shown) ~ label {
  transform: translate(-4px, -26px);
  font-size: 0.75rem;
  color: var(--brand-violet);
}

/* --- Form Success/Error --- */
.form-success {
  padding: 2rem;
  text-align: center;
  font-size: 1.125rem;
  color: var(--color-text);
  font-family: var(--font-headline);
  font-weight: 600;
}
.form-error {
  color: var(--color-error);
  font-size: 0.875rem;
  margin-top: 1rem;
}

/* --- Mobile Navigation Overlay --- */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease-smooth);
}
.mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: all;
}
/* Links sit inside a <nav> for the landmark, so the column layout lives on
   that wrapper rather than the overlay itself. */
.mobile-nav-overlay nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.mobile-nav-overlay a.is-current {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mobile-nav-overlay a {
  font-family: var(--font-headline);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  transition: opacity 0.3s;
}
.mobile-nav-overlay a:hover {
  opacity: 0.5;
}

/* --- Hamburger Button --- */
.hamburger-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  cursor: pointer;
  z-index: 60;
  position: relative;
}
.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s ease;
}
.hamburger-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Blog Content Prose --- */
.prose-custom {
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}
.prose-custom img {
  max-width: 100%;
  height: auto;
  display: block;
}
.prose-custom table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}
.prose-custom pre,
.prose-custom code {
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 100%;
}
.prose-custom h2 {
  font-family: var(--font-headline);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 3rem;
  text-transform: uppercase;
  color: #0a0a0a;
}
.prose-custom p {
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.8;
  color: #525252;
  margin-bottom: 2rem;
}
.prose-custom ul {
  list-style: none;
  padding: 0;
}
.prose-custom ul li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.8;
  color: #525252;
  margin-bottom: 1.5rem;
}
.prose-custom ul li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #0a0a0a;
  margin-top: 0.625rem;
  flex-shrink: 0;
}

/* --- Legal Drawer (Privacy / Terms) --- */
.legal-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease-smooth);
}
.legal-drawer-backdrop.open {
  opacity: 1;
  pointer-events: all;
}
.legal-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 101;
  background: #fff;
  max-height: 85vh;
  transform: translateY(100%);
  transition: transform var(--duration) var(--ease-smooth);
  overflow-y: auto;
}
.legal-drawer.open {
  transform: translateY(0);
}
.legal-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2.5rem;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.legal-drawer-header h2 {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}
.legal-drawer-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-text);
  cursor: pointer;
  transition: opacity 0.3s;
}
.legal-drawer-close:hover {
  opacity: 0.5;
}
.legal-drawer-body {
  padding: 2.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-on-surface-variant);
}
.legal-drawer-body p {
  margin-bottom: 1rem;
}
.legal-drawer-body .legal-date {
  font-size: 0.875rem;
  color: var(--color-outline);
  margin-bottom: 2rem;
}

/* 8. Animations */

/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in[data-delay="1"] { transition-delay: 0.1s; }
.fade-in[data-delay="2"] { transition-delay: 0.2s; }
.fade-in[data-delay="3"] { transition-delay: 0.3s; }
.fade-in[data-delay="4"] { transition-delay: 0.4s; }
.fade-in[data-delay="5"] { transition-delay: 0.5s; }

/* CTA Background Texture */
.cta-texture {
  background-image: repeating-linear-gradient(45deg, #fff 0, #fff 1px, transparent 0, transparent 50%);
  background-size: 10px 10px;
}

/* --- Filter pills --- */
.filter-btn {
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: #fff;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-on-surface-variant);
  transition: color .2s var(--ease-smooth), border-color .2s var(--ease-smooth),
              background-color .2s var(--ease-smooth), transform .2s var(--ease-smooth);
}
/* Hover only where a real pointer exists. On touch the :hover state sticks
   after a tap, so an unselected filter kept the violet ring and read as a
   second active button alongside the filled one. */
@media (hover: hover) and (pointer: fine) {
  .filter-btn:hover {
    color: var(--color-on-surface);
    border-color: var(--brand-violet);
    transform: translateY(-1px);
  }
}
.filter-btn:active { transform: scale(.97); }
.filter-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* --- Fact card (about page sidebar) --- */
.fact-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform var(--duration) var(--ease-smooth),
              box-shadow var(--duration) var(--ease-smooth);
}
@media (hover: hover) and (pointer: fine) {
  .fact-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
  }
}
.fact-card .icon-tile { flex-shrink: 0; width: 3rem; height: 3rem; }
.fact-card .icon-tile .material-symbols-outlined { font-size: 1.375rem; }

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 4.5rem 2rem;
  border: 1px dashed var(--color-outline-variant);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-low);
}

/* --- Active Nav Link --- */
.nav-link.active::after {
  width: 100%;
}
.nav-link.active {
  color: #0A0A0A;
  font-weight: 500;
}

/* 9. Responsive */

/* ─── Tablet ─────────────────────────────────── */
@media (max-width: 1024px) {
  .container { padding: 0 1.5rem; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid     { grid-template-columns: repeat(2, 1fr); }
  .about-grid    { grid-template-columns: repeat(2, 1fr); }
  .stats-grid    { grid-template-columns: repeat(2, 1fr); }
  .hero h1       { font-size: clamp(2.5rem, 5vw, 4rem); }
}

/* ─── Mobile ──────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger-btn { display: flex; }

  /* Container */
  .container { padding: 0 1rem; }

  /* Typography — element selectors (non-Tailwind elements) */
  h1 { font-size: clamp(1.8rem, 5vw, 4.5rem); }
  h2 { font-size: clamp(1.4rem, 4vw, 3rem); }
  h3 { font-size: clamp(1.1rem, 3vw, 1.8rem); }

  /* Override Tailwind large text classes on mobile */
  .text-7xl { font-size: 2.5rem !important; }
  .text-6xl { font-size: 2rem !important; }
  .text-5xl { font-size: 1.75rem !important; }
  .text-4xl { font-size: 1.5rem !important; }
  .text-3xl { font-size: 1.25rem !important; }
  .text-2xl { font-size: 1.1rem !important; }

  /* Navbar */
  .nav__links { display: none; flex-direction: column; position: fixed;
    inset: 0; background: #fff; justify-content: center;
    align-items: center; gap: 2rem; z-index: 999; }
  .nav__links.open { display: flex; }
  .nav__hamburger  { display: flex; }
  .nav__link--cta  { margin-top: 1rem; }

  /* Hero */
  .hero { min-height: auto; padding: 6rem 0 3rem; text-align: left; }
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-decoration { display: none; }
  .hero-buttons { flex-direction: column; gap: 0.75rem; }
  .hero-buttons .btn { width: 100%; text-align: center; }

  /* Grids → single column */
  .services-grid,
  .projects-grid,
  .blog-grid     { grid-template-columns: 1fr; gap: 1.25rem; }

  /* About / stats */
  .about-grid  { grid-template-columns: 1fr; gap: 2rem; }
  .stats-grid  { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .stat-number { font-size: 2.5rem; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }

  /* CTA banner */
  .cta-banner { padding: 3rem 1rem; text-align: center; }
  .cta-banner h2 { font-size: 1.8rem; }

  /* Cards */
  .project-card,
  .blog-card,
  .service-card { width: 100%; }

  /* Blog detail */
  .blog-cover { height: 220px; }
  .blog-content { font-size: 16px; }

  /* Project detail */
  .project-meta { flex-wrap: wrap; gap: 0.5rem; }
  .project-logo-box { padding: 1.5rem; }

  /* Footer */
  .footer__inner { flex-direction: column; gap: 2rem; text-align: center; }
  .footer__nav   { flex-direction: column; gap: 0.75rem; align-items: center; }
}

/* ─── Small mobile ────────────────────────────── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.9rem; }
  .btn { padding: 0.65rem 1.25rem; font-size: 0.9rem; }
}

/* ─── Small phones (320-400px) ─────────────────
   At 320px the desktop px-8 gutters cost 20% of the screen, the hero holds a
   92vh minimum it no longer needs once the dashboard mock is hidden, and the
   long Azerbaijani CTA labels wrap inside their pills. */
@media (max-width: 400px) {
  /* Reclaim the gutters. 20px keeps content off the edge without the 64px
     total that px-8 costs at this width. */
  .px-8 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }

  /* The hero's min-height was sized around the dashboard mock, which is
     hidden below lg — without this it renders as ~250px of empty wash. */
  header.min-h-\[92vh\] {
    min-height: auto !important;
    padding-top: 6.5rem;
    padding-bottom: 3rem;
  }

  /* Headline: 3rem eats three lines of a 320px screen. */
  .text-5xl  { font-size: 2rem !important;   line-height: 1.15 !important; }
  .text-6xl  { font-size: 2.1rem !important; line-height: 1.15 !important; }
  .text-7xl  { font-size: 2.1rem !important; line-height: 1.15 !important; }
  .text-8xl  { font-size: 2.4rem !important; line-height: 1.1  !important; }

  /* Full-width CTAs read better than pills whose labels wrap. */
  .btn-primary, .btn-ghost {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-align: center;
  }
  /* Nav "Əlaqə" is inside a flex row and must stay inline. */
  .navbar .btn-primary { width: auto; }

  .service-card, .service-card--lg { padding: 1.5rem; }
  .service-card__num,
  .service-card--lg .service-card__num { font-size: 3rem; top: .75rem; right: 1rem; }

  .cta-panel { padding: 2.5rem 1.25rem; border-radius: var(--radius-lg); }
  .empty-state { padding: 3rem 1.25rem; }
  .fact-card { padding: 1.15rem; gap: .9rem; }

  .filter-btn { padding: .55rem 1rem; font-size: 10px; letter-spacing: .1em; }

  /* Keep taps comfortably above the 44px minimum. */
  .mobile-nav-overlay a { font-size: 1.6rem; padding: .35rem 0; }
}

/* ─── Global image safety ─────────────────────── */
img { max-width: 100%; height: auto; }

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
