/* ─── impeccable.style design foundation for AgenticUptime ─────────────────── */
/* 3-layer CSS: impeccable-base.css → theme CSS → page CSS */
/* Apache 2.0 — impeccable.style */

/* ─── Motion system: ease-out-quart (no bounce/elastic) ────────────────────── */
:root {
  --ease-default: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-leave: cubic-bezier(0.7, 0, 0.84, 0);
  --duration-micro: 150ms;
  --duration-state: 250ms;
  --duration-layout: 400ms;
  --duration-entrance: 600ms;

  /* Typography: 1.333x perfect fourth with clamp() fluid sizing */
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: clamp(1.125rem, 1.5vw + 0.5rem, 1.333rem);
  --text-xl: clamp(1.333rem, 2vw + 0.5rem, 1.777rem);
  --text-2xl: clamp(1.777rem, 3vw + 0.5rem, 2.369rem);
  --text-3xl: clamp(2rem, 3.5vw + 0.5rem, 3.157rem);
  --text-4xl: clamp(2.25rem, 5vw + 0.5rem, 4.209rem);

  /* Spatial: 4pt grid */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
}

/* ─── Base resets ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--theme-bg, #FAF9F5);
  margin: 0;
  padding: 0;
  font-size: var(--theme-font-size, 15px);
  color: var(--theme-text, #191919);
  font-weight: 500;
  font-family: var(--theme-font-family, 'Geist Sans', 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
  line-height: var(--theme-line-height, 1.6);
}

/* ─── imp-darkbg: dark-bg typography compensation ──────────────────────────── */
.imp-darkbg .tyga-night {
  letter-spacing: 0.01em;
}

/* ─── Links ────────────────────────────────────────────────────────────────── */
a {
  color: var(--theme-accent, #7A6A8A);
  text-decoration: none;
  transition: color var(--duration-state) var(--ease-default);
}
.imp-motion a {
  transition: all var(--duration-state) var(--ease-default);
}
a:hover {
  color: var(--theme-accent-hover, #6A5A7A);
}

/* ─── imp-focus: :focus-visible (never outline:none without replacement) ──── */
.imp-focus a:focus-visible,
.imp-focus button:focus-visible,
.imp-focus input:focus-visible,
.imp-focus textarea:focus-visible,
.imp-focus select:focus-visible,
.imp-focus [role="button"]:focus-visible {
  outline: 2px solid var(--theme-accent, #7A6A8A);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── imp-touch: min 44px touch targets ────────────────────────────────────── */
.imp-touch a,
.imp-touch button { min-height: 44px; }

/* ─── Button states (always on — safe defaults) ───────────────────────────── */
button:active, [role="button"]:active {
  transform: scale(0.97);
  transition-duration: var(--duration-micro);
}
button:disabled, button[aria-busy="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Headings ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-top: 0;
  color: var(--theme-text, #191919);
  font-family: var(--theme-font-family, 'Geist Sans', 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif);
}

h1 { font-size: 28px; line-height: 36px; }
h2 { font-size: 24px; line-height: 32px; }
h3 { font-size: 20px; line-height: 28px; }
h4 { font-size: 16px; line-height: 24px; }

/* ─── imp-typo: proportional typography scale (1.333x perfect fourth) ──────── */
.imp-typo h1 { font-size: var(--text-2xl); line-height: 1.15; }
.imp-typo h2 { font-size: var(--text-xl); line-height: 1.2; }
.imp-typo h3 { font-size: var(--text-lg); line-height: 1.3; }
.imp-typo h4 { font-size: var(--text-base); line-height: 1.4; }

/* ─── imp-measure: enforce 65ch text measure ───────────────────────────────── */
.imp-measure p,
.imp-measure li { max-width: 65ch; }

/* ─── Cards ────────────────────────────────────────────────────────────────── */
.imp-card {
  background: var(--theme-card-bg, #ffffff);
  border-radius: var(--theme-card-radius, 14px);
  box-shadow: var(--theme-card-shadow, 0 2px 10px rgba(0,0,0,0.06));
  border: 1px solid var(--theme-border, #E5E4E0);
  transition: all var(--duration-state) var(--ease-default);
}
.imp-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.imp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--duration-state) var(--ease-default);
  font-family: inherit;
}
.imp-btn-primary {
  background: var(--theme-btn-primary-bg, #191919);
  color: var(--theme-btn-primary-text, #fff);
}
.imp-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.imp-btn-secondary {
  background: var(--theme-btn-secondary-bg, #F5F4F0);
  color: var(--theme-btn-secondary-text, #191919);
  border: 1px solid var(--theme-border, #E5E4E0);
}
.imp-btn-secondary:hover {
  background: var(--theme-bg-tertiary, #E5E4E0);
}

/* ─── Forms ────────────────────────────────────────────────────────────────── */
.imp-input {
  background: var(--theme-input-bg, #fff);
  border: 1px solid var(--theme-input-border, #E5E4E0);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--theme-text, #191919);
  font-family: inherit;
  transition: border-color var(--duration-state) var(--ease-default);
}
.imp-input:focus {
  outline: none;
  border-color: var(--theme-input-focus-border, #7A6A8A);
}

/* ─── Tags / Badges ────────────────────────────────────────────────────────── */
.imp-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--theme-tag-bg, #F5F4F0);
  color: var(--theme-tag-text, #6B6B6B);
}

/* ─── Status colors (always available) ─────────────────────────────────────── */
:root {
  --status-success: #4A7A5B;
  --status-warning: #9A7B4F;
  --status-danger: #9A4A4A;
  --status-info: #5A6A7A;
}

.imp-status-success { color: var(--status-success); }
.imp-status-warning { color: var(--status-warning); }
.imp-status-danger { color: var(--status-danger); }
.imp-status-info { color: var(--status-info); }

/* ─── Hero entrance stagger ────────────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── Dark/Light mode toggle button ────────────────────────────────────────── */
.imp-mode-toggle {
  background: var(--theme-bg-secondary, #f5f5f7);
  border: 1px solid var(--theme-border, #E5E4E0);
  width: 40px;
  height: 40px;
  min-height: 40px; /* override imp-touch 44px */
  border-radius: 50%;
  cursor: pointer;
  color: var(--theme-text-muted, #999);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-state) var(--ease-default);
}
.imp-mode-toggle:hover {
  background: var(--theme-bg-tertiary, #e5e5e7);
  color: var(--theme-text, #191919);
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --text-3xl: clamp(1.5rem, 4vw + 0.5rem, 2.369rem);
    --text-4xl: clamp(1.75rem, 5vw + 0.5rem, 3.157rem);
  }
}
