/* ============================================================
   main.css — Design Tokens, Reset, Typography, Layout Utilities
   logsearch.xyz
   ============================================================ */

/* ----- CSS Custom Properties (Design Tokens) ----- */
:root {
  /* Colors — Dark Theme */
  --color-bg-primary: #0f1117;
  --color-bg-secondary: #161822;
  --color-bg-tertiary: #1c1f2e;
  --color-bg-elevated: #232738;
  --color-bg-hover: #2a2e42;

  --color-border: #2a2e42;
  --color-border-light: #353a50;

  --color-text-primary: #e4e6ef;
  --color-text-secondary: #9498ae;
  --color-text-muted: #6b6f85;
  --color-text-inverse: #0f1117;

  /* Accent — Teal/Blue */
  --color-accent: #22d3ee;
  --color-accent-hover: #06b6d4;
  --color-accent-muted: rgba(34, 211, 238, 0.12);
  --color-accent-text: #22d3ee;

  /* Semantic */
  --color-success: #34d399;
  --color-success-muted: rgba(52, 211, 153, 0.12);
  --color-error: #f87171;
  --color-error-muted: rgba(248, 113, 113, 0.12);
  --color-warning: #fbbf24;
  --color-warning-muted: rgba(251, 191, 36, 0.12);
  --color-info: #60a5fa;
  --color-info-muted: rgba(96, 165, 250, 0.12);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

  --fs-xs: 0.75rem;
  /* 12px */
  --fs-sm: 0.8125rem;
  /* 13px */
  --fs-base: 0.9375rem;
  /* 15px */
  --fs-md: 1rem;
  /* 16px */
  --fs-lg: 1.125rem;
  /* 18px */
  --fs-xl: 1.5rem;
  /* 24px */
  --fs-2xl: 2rem;
  /* 32px */
  --fs-3xl: 2.5rem;
  /* 40px */
  --fs-4xl: 3rem;
  /* 48px */

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --lh-tight: 1.2;
  --lh-normal: 1.5;
  --lh-relaxed: 1.65;

  /* Spacing */
  --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;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radii — smooth & rounded */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 20px rgba(34, 211, 238, 0.15);
  --shadow-glow-strong: 0 0 40px rgba(34, 211, 238, 0.25);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);

  /* Layout */
  --container-max: 1200px;
  --navbar-height: 68px;
  --sidebar-width: 260px;

  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* ----- Reset ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

body.scroll-locked {
  overflow: hidden;
}

a {
  color: var(--color-accent-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--fs-4xl);
}

h2 {
  font-size: var(--fs-3xl);
}

h3 {
  font-size: var(--fs-2xl);
}

h4 {
  font-size: var(--fs-xl);
}

h5 {
  font-size: var(--fs-lg);
}

code,
pre {
  font-family: var(--font-mono);
}

/* ----- Layout Utilities ----- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.section {
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
}

.section--sm {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.flex {
  display: flex;
}

.flex--center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex--between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex--col {
  display: flex;
  flex-direction: column;
}

.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);
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-accent {
  color: var(--color-accent-text);
}

.mt-auto {
  margin-top: auto;
}

.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);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----- Responsive Breakpoints ----- */
@media (max-width: 1024px) {
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --fs-4xl: 2.25rem;
    --fs-3xl: 1.875rem;
    --fs-2xl: 1.5rem;
  }

  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .section {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --fs-4xl: 1.875rem;
    --fs-3xl: 1.5rem;
  }
}

/* ----- Navbar Search ----- */
.navbar__search {
  display: flex;
  align-items: center;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0 var(--space-3);
  margin: 0 var(--space-4);
  flex: 1;
  max-width: 400px;
  transition: all var(--transition-fast);
}

.navbar__search:focus-within {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-glow);
  background: var(--color-bg-hover);
}

.navbar__search input {
  background: transparent;
  border: none;
  padding: var(--space-2) var(--space-3);
  width: 100%;
  color: var(--color-text-primary);
  outline: none;
  font-size: var(--fs-sm);
}

.navbar__search button {
  background: transparent;
  border: none;
  color: var(--color-accent);
  font-size: 1.1rem;
  padding: 0 var(--space-2);
  display: flex;
  align-items: center;
}

@media (max-width: 900px) {
    .navbar__search {
        display: none;
    }
}