/* ============================================================
   File: css/global.css
   Purpose: Reset, variables, typography, utilities
   Brand: NameSliq – Domain Forensic Audit & Trading
   Light theme (green / light blue)
   ============================================================ */

/* -----------------------------
   Modern CSS Reset
----------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"],
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

body {
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

img,
picture {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* -----------------------------
   CSS Variables
----------------------------- */
:root {
  /* Brand colors */
  --color-sky: #0ea5e9;          /* primary light blue */
  --color-sky-soft: #e0f2fe;
  --color-purple: #8b5cf6;
  --color-purple-soft: #ede9fe;
  --color-success: #10b981;      /* green */
  --color-success-soft: #dcfce7;
  --color-warning: #f59e0b;
  --color-warning-soft: #fef3c7;
  --color-danger: #ef4444;
  --color-danger-soft: #fee2e2;

  /* Light neutrals */
  --color-bg: #f0fdf4;             /* main page background (light green) */
  --color-bg-alt: #ecfeff;         /* subtle blue/green alt background */
  --color-surface: #ffffff;        /* cards / surfaces */
  --color-surface-alt: #f1f5f9;    /* soft grey surface */
  --color-border-subtle: #e2e8f0;
  --color-border-strong: #cbd5f5;

  --color-text: #0f172a;           /* primary dark text */
  --color-text-muted: #4b5563;
  --color-text-soft: #6b7280;
  --color-heading: #020617;

  /* Typography - modern fonts */
  --font-display: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radii & shadows */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-pill: 999px;

  --shadow-soft: 0 16px 30px rgba(15, 23, 42, 0.08);
  --shadow-subtle: 0 10px 24px rgba(15, 23, 42, 0.06);
  --shadow-focus: 0 0 0 2px rgba(14, 165, 233, 0.65);

  /* Layout */
  --container-width: 72rem; /* 1152px */
  --header-height: 4.5rem;

  /* Z-index */
  --z-header: 40;
  --z-nav: 50;

  /* Breakpoints */
  --bp-xs: 320px;
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1440px;
}

/* -----------------------------
   Base Typography & Body
----------------------------- */
body {
  font-family: var(--font-body);
  font-size: var(--font-size-md);
  color: var(--color-text);
  background: radial-gradient(circle at top, #e0f2fe 0, #f0fdf4 45%, #ffffff 100%);
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-heading);
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.4rem, 3vw + 1rem, 3.2rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.9rem, 2.1vw + 1rem, 2.35rem);
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.4rem;
}

h4 {
  font-size: 1.2rem;
}

/* Paragraphs */
p {
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
}

strong {
  color: var(--color-heading);
}

/* Links */
a.link-inline {
  color: var(--color-sky);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a.link-inline:hover {
  color: var(--color-purple);
}

/* Code / data */
code,
pre,
.data-text {
  font-family: var(--font-mono);
}

/* -----------------------------
   Utilities
----------------------------- */

/* Spacing helpers */
.mt-0 {
  margin-top: 0 !important;
}
.mt-2 {
  margin-top: var(--space-2) !important;
}
.mt-4 {
  margin-top: var(--space-4) !important;
}
.mb-0 {
  margin-bottom: 0 !important;
}
.mb-2 {
  margin-bottom: var(--space-2) !important;
}
.mb-4 {
  margin-bottom: var(--space-4) !important;
}
.mb-8 {
  margin-bottom: var(--space-8) !important;
}
.p-4 {
  padding: var(--space-4) !important;
}
.p-6 {
  padding: var(--space-6) !important;
}

/* Text alignment */
.text-left {
  text-align: left !important;
}
.text-center {
  text-align: center !important;
}
.text-right {
  text-align: right !important;
}

/* Visually-hidden (for a11y) */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -3rem;
  background: #ffffff;
  color: var(--color-heading);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-subtle);
  z-index: 999;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Containers & Sections */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section {
  padding-block: var(--space-12);
}

.section-alt {
  background: linear-gradient(
    135deg,
    #ecfeff 0%,
    #f0fdf4 40%,
    #ffffff 100%
  );
}

.section-header {
  max-width: 40rem;
  margin-bottom: var(--space-8);
}

.section-header p {
  font-size: var(--font-size-md);
}

/* Alerts (used by JS) */
.alert {
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
}

.alert-success {
  background: var(--color-success-soft);
  border-color: var(--color-success);
  color: #065f46;
}

.alert-error {
  background: var(--color-danger-soft);
  border-color: var(--color-danger);
  color: #7f1d1d;
}

/* Horizontal divider utility */
.divider {
  border-top: 1px solid var(--color-border-subtle);
  margin-block: var(--space-6);
}

/* -----------------------------
   Responsive helpers
----------------------------- */
@media (min-width: 768px) {
  .section {
    padding-block: var(--space-16);
  }
}

@media (min-width: 1024px) {
  body {
    font-size: 1.02rem;
  }
}
