/* ==========================================================================
   DESIGN SYSTEM — Arhant Solutions
   Mobile-first. All defaults target phones.
   Breakpoints add complexity upward via min-width queries.
   ========================================================================== */

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

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

body {
  min-height: 100dvh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

ul,
ol {
  list-style: none;
}

/* ---------- Custom Properties ---------- */
:root {
  /* — Colors — */
  --color-navy-950:  #050d1a;
  --color-navy-900:  #0a1628;
  --color-navy-800:  #0f2240;
  --color-navy-700:  #162d52;
  --color-navy-600:  #1e3a68;

  --color-blue-600:  #2563eb;
  --color-blue-500:  #3b82f6;
  --color-blue-400:  #60a5fa;
  --color-blue-100:  #dbeafe;
  --color-blue-50:   #eff6ff;

  --color-slate-900: #0f172a;
  --color-slate-700: #334155;
  --color-slate-500: #64748b;
  --color-slate-400: #94a3b8;
  --color-slate-300: #cbd5e1;
  --color-slate-200: #e2e8f0;
  --color-slate-100: #f1f5f9;
  --color-slate-50:  #f8fafc;

  --color-white:     #ffffff;
  --color-black:     #000000;

  --color-success:   #10b981;
  --color-error:     #ef4444;
  --color-warning:   #f59e0b;

  /* — Semantic tokens — */
  --bg-primary:      var(--color-navy-900);
  --bg-secondary:    var(--color-slate-50);
  --bg-surface:      var(--color-white);
  --bg-hero:         linear-gradient(135deg, var(--color-navy-950) 0%, var(--color-navy-800) 50%, var(--color-navy-700) 100%);

  --text-primary:    var(--color-slate-900);
  --text-secondary:  var(--color-slate-500);
  --text-inverse:    var(--color-white);
  --text-accent:     var(--color-blue-600);

  --border-default:  var(--color-slate-200);
  --border-focus:    var(--color-blue-500);

  /* — Typography — */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               Oxygen, Ubuntu, Cantarell, sans-serif;

  --text-xs:    clamp(0.75rem,  0.7rem  + 0.15vw, 0.8125rem);
  --text-sm:    clamp(0.8125rem, 0.78rem + 0.18vw, 0.9375rem);
  --text-base:  clamp(0.9375rem, 0.9rem  + 0.2vw,  1.0625rem);
  --text-lg:    clamp(1.0625rem, 1rem    + 0.3vw,  1.25rem);
  --text-xl:    clamp(1.25rem,   1.1rem  + 0.5vw,  1.5rem);
  --text-2xl:   clamp(1.5rem,    1.3rem  + 0.7vw,  1.875rem);
  --text-3xl:   clamp(1.875rem,  1.5rem  + 1vw,    2.25rem);
  --text-4xl:   clamp(2.25rem,   1.8rem  + 1.5vw,  3rem);
  --text-5xl:   clamp(2.75rem,   2rem    + 2vw,    3.75rem);

  --leading-tight:   1.2;
  --leading-snug:    1.35;
  --leading-normal:  1.6;
  --leading-relaxed: 1.75;

  --tracking-tight:  -0.025em;
  --tracking-normal: 0;
  --tracking-wide:   0.025em;

  /* — Spacing (8px base) — */
  --space-1:   0.25rem;   /*  4px */
  --space-2:   0.5rem;    /*  8px */
  --space-3:   0.75rem;   /* 12px */
  --space-4:   1rem;      /* 16px */
  --space-5:   1.25rem;   /* 20px */
  --space-6:   1.5rem;    /* 24px */
  --space-8:   2rem;      /* 32px */
  --space-10:  2.5rem;    /* 40px */
  --space-12:  3rem;      /* 48px */
  --space-16:  4rem;      /* 64px */
  --space-20:  5rem;      /* 80px */
  --space-24:  6rem;      /* 96px */

  /* — Sizing — */
  --max-width-content: 1200px;
  --max-width-narrow:  800px;
  --max-width-wide:    1400px;

  /* — Border radius — */
  --radius-sm:   0.375rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-full: 9999px;

  /* — Shadows — */
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md:    0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg:    0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
  --shadow-xl:    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  --shadow-glow:  0 0 20px rgba(37, 99, 235, 0.15);

  /* — Transitions — */
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --duration-fast:   150ms;
  --duration-normal: 250ms;
  --duration-slow:   400ms;

  /* — Z-index — */
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
}

/* ---------- Base Typography ---------- */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-surface);
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 700;
  color: var(--text-primary);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl);  }
h6 { font-size: var(--text-lg);  }

p {
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

p + p {
  margin-top: var(--space-4);
}

strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Layout Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--max-width-content);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.container--wide {
  max-width: var(--max-width-wide);
}

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

.section--sm {
  padding-block: var(--space-10);
}

.section--lg {
  padding-block: var(--space-24);
}

.section--dark {
  background: var(--bg-hero);
  color: var(--text-inverse);
}

.section--dark p {
  color: var(--color-slate-300);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--text-inverse);
}

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

/* Flex utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

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

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

.grid-4 {
  grid-template-columns: 1fr;
}

/* Text utilities */
.text-center { text-align: center; }
.text-left   { text-align: left;   }

.text-accent   { color: var(--text-accent); }
.text-inverse  { color: var(--text-inverse); }
.text-muted    { color: var(--text-secondary); }

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

.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* Spacing helpers */
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }

.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }

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

/* ---------- Breakpoints ---------- */

/* Tablet: 768px */
@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-8);
  }

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

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

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

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

/* Desktop: 1024px */
@media (min-width: 1024px) {
  .container {
    padding-inline: var(--space-10);
  }

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

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

/* Wide: 1280px */
@media (min-width: 1280px) {
  .container {
    padding-inline: var(--space-12);
  }
}
