/* ==========================================================================
   base.css — Global reset, base element styles, and core utilities
   Import order matters: tokens first (so vars exist), then fonts.
   ========================================================================== */

@import url('./tokens.css');
@import url('./fonts.css');

/* ==========================================================================
   1. MODERN MINIMAL RESET
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

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

button {
  font: inherit;
}

:root {
  color-scheme: light;
}

/* ==========================================================================
   2. HTML
   ========================================================================== */
html {
  -webkit-text-size-adjust: 100%;
}

/* ==========================================================================
   3. BODY
   ========================================================================== */
body {
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ==========================================================================
   4. HEADINGS — display face, modular scale
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  color: var(--color-primary);
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
}

h3 {
  font-size: 1.35rem;
}

/* ==========================================================================
   5. CONTAINER
   ========================================================================== */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--pad-x-mobile);
}

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

/* ==========================================================================
   6. SECTION
   ========================================================================== */
.section {
  padding-block: var(--section-pad-y-mobile);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--section-pad-y);
  }
}

/* ==========================================================================
   7. HAIRLINE — 1px divider between sections (no shadows)
   ========================================================================== */
.hairline,
hr {
  height: var(--hairline);
  border: 0;
  background: var(--color-border);
  opacity: 0.5;
  margin: 0;
}

/* ==========================================================================
   8. EYEBROW — small-caps mono label
   ========================================================================== */
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-muted);
  display: inline-block;
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   9. NUM — tabular figures for ₹ amounts and dashboard numbers
   ========================================================================== */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ==========================================================================
   10. TEXT HELPERS
   ========================================================================== */
.text-muted {
  color: var(--color-muted);
}

/* ==========================================================================
   11. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 44px; /* mobile tap target */
  text-decoration: none;
  transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

/* Primary CTA — Bright Aqua is the ONLY CTA fill, paired with Ink text. */
.btn-primary {
  background: var(--color-cta);
  color: var(--color-ink);
  border-color: var(--color-cta);
}

.btn-primary:hover {
  /* Darken the aqua only — do NOT shift to a different hue. */
  filter: brightness(0.95);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Secondary — outlined, brand-violet text. */
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--color-primary) 6%, transparent);
}

/* Disabled state (both real disabled + aria-disabled). */
.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--color-border);
  color: var(--color-muted);
  border-color: var(--color-border);
  cursor: not-allowed;
  filter: none;
}

/* ==========================================================================
   12. LINKS — body-size link text uses the darker --color-accent-text
       (#0A6E6C, 5.38:1 on cream = AA pass); the lighter --color-accent is
       fine on hover. Underline is ALSO required so color is never the sole
       affordance.
   ========================================================================== */
a {
  color: var(--color-accent-text);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

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

/* ==========================================================================
   13. FOCUS RINGS — visible keyboard focus on all interactive elements
   ========================================================================== */
:where(a, button, .btn, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Remove the default outline only for mouse/touch focus (keeps keyboard ring). */
:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   14. REDUCED MOTION
   ========================================================================== */
@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;
  }
}
