/*
  style.css
  A tidy, well-commented starter stylesheet.
  Sections: reset, variables, base typography, layout, components, utilities.
*/

/* -----------------------------
   Reset / Opinionated Normalize
   ----------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
ul, ol, li, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, figure,
figcaption, footer, header, hgroup, menu, nav, output,
section, summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: baseline;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  min-height: 100vh;
}

img, picture, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
}

/* -----------------------------
   Theme variables
   ----------------------------- */
:root {
  /* Colors */
  --bg: #ffffff;
  --surface: #ffffff;
  --muted: #6b7280; /* gray-500 */
  --text: #111827; /* gray-900 */
  --primary: #2563eb; /* blue-600 */
  --primary-600: #1d4ed8;
  --accent: #eab308; /* amber-500 */

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --container: 1200px;

  /* Sizing */
  --radius-sm: 4px;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.05);
  --shadow: 0 4px 12px rgba(16,24,40,0.08);

  /* Type scale */
  --fs-base: 16px;
  --fs-lg: 1.125rem;
  --fs-xl: 1.5rem;
  --fw-normal: 400;
  --fw-bold: 700;
}

/* Dark mode override via `body.dark` */
body.dark {
  --bg: #0b1220;
  --surface: #0f1724;
  --muted: #9ca3af;
  --text: #e6eef8;
  --primary: #60a5fa;
  --primary-600: #3b82f6;
  --accent: #fbbf24;
}

/* -----------------------------
   Utility: Container and layout
   ----------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.col {
  flex: 1 1 0;
}

/* Responsive grid for cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

/* -----------------------------
   Site header / nav
   ----------------------------- */
.site-header {
  background: linear-gradient(180deg, rgba(0,0,0,0.02), transparent);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.brand .logo {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 6px;
}
.brand .title {
  font-weight: var(--fw-bold);
  color: var(--text);
}

.nav {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: calc(var(--space-2) + 2px) var(--space-3);
  border-radius: var(--radius-sm);
}
.nav a:hover { color: var(--text); background: rgba(0,0,0,0.03); }

/* -----------------------------
   Hero
   ----------------------------- */
.hero {
  padding: calc(var(--space-5) * 1.5) 0;
  text-align: center;
  background: linear-gradient(180deg, rgba(37,99,235,0.06), transparent);
}
.hero h1 {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-3);
  font-weight: var(--fw-bold);
}
.hero p { color: var(--muted); max-width: 60ch; margin: 0 auto; }

/* -----------------------------
   Card component
   ----------------------------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.03);
}
.card .card-title { font-weight: var(--fw-bold); margin-bottom: var(--space-2); }
.card .card-body { color: var(--muted); font-size: var(--fs-lg); }

/* -----------------------------
   Buttons
   ----------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--space-2)) var(--space-3);
  gap: var(--space-2);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: var(--primary);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.secondary { background: var(--muted); color: var(--text); }

/* -----------------------------
   Forms
   ----------------------------- */
.input,
textarea,
select {
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,0,0,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}

label { display: block; margin-bottom: var(--space-2); color: var(--muted); font-size: 0.95rem; }

/* -----------------------------
   Sidebar / main layout
   ----------------------------- */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding: var(--space-5) 0;
}
@media (min-width: 1024px) {
  .layout { grid-template-columns: 280px 1fr; }
}
.sidebar {
  padding: var(--space-4);
}
.main {
  padding: var(--space-4);
}

/* -----------------------------
   Utilities
   ----------------------------- */
.sr-only {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
.text-center { text-align: center; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mb-3 { margin-bottom: var(--space-3); }
.p-2 { padding: var(--space-2); }

/* Small helpers for stacking children with consistent gaps */
.stack > * + * { margin-top: var(--space-3); }

/* -----------------------------
   Small print / footer
   ----------------------------- */
.site-footer {
  padding: var(--space-4) 0;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.04);
  margin-top: var(--space-5);
}

/* End of stylesheet */
