/* ═══════════════════════════════════════════════
   mini task ai — Base Styles & Typography
   ═══════════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font: 400 var(--text-base)/1.6 var(--font-body);
  color: var(--text-primary);
  background: var(--bg-void);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Noise Texture Overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: 1.1;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
}

h3 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-lg);
  font-weight: 600;
}

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

a {
  color: var(--accent-violet);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-smooth);
}
a:hover {
  color: var(--purple-300);
}

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

code {
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent-fuchsia);
}

pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
}

/* ── Selection ── */
::selection {
  background: rgba(124, 58, 237, 0.35);
  color: var(--text-primary);
}

/* ── Focus Ring ── */
:focus-visible {
  outline: 2px solid var(--accent-violet);
  outline-offset: 2px;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--purple-800);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--purple-700);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--purple-800) transparent;
}

/* ── Lists ── */
ul, ol { list-style: none; }

/* ── Images ── */
img, svg {
  display: block;
  max-width: 100%;
}

/* ── Buttons base ── */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ── Inputs base ── */
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) var(--ease-smooth);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
}

/* ── Utility Classes ── */
.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;
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glass {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(26, 19, 54, 0.8);
  border: 1px solid var(--border-subtle);
}

/* ── 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;
  }
}

/* ── Print ── */
@media print {
  body::before { display: none; }
  .sidebar, .app-header, .ai-panel, .fab-button { display: none !important; }
  .main-content { margin: 0 !important; padding: 16px !important; }
  * {
    color: #000 !important;
    background: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
}
