/* ==========================================================================
   NovaPad — Base styles: tokens, resets, typography, layout primitives
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  /* Color tokens */
  --color-indigo: #14163A;
  --color-indigo-soft: #1F2250;
  --color-sand: #F7F3EC;
  --color-sand-deep: #EFE8DA;
  --color-amber: #E7A33E;
  --color-amber-deep: #C7822A;
  --color-teal: #1C7A64;
  --color-teal-deep: #145C4C;
  --color-charcoal: #201F2B;
  --color-white: #FFFFFF;
  --color-line: #E1D9C8;
  --color-danger: #B3452E;

  /* Text on dark surfaces */
  --color-indigo-text: #D8D9EE;
  --color-indigo-text-dim: #9A9CC2;

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6.5rem;

  /* Layout */
  --container-width: 1180px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 2px rgba(20, 22, 58, 0.06), 0 8px 24px -12px rgba(20, 22, 58, 0.18);
  --shadow-lift: 0 20px 45px -18px rgba(20, 22, 58, 0.35);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-charcoal);
  background: var(--color-sand);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.01em;
  color: var(--color-indigo);
}

h1 { font-size: clamp(2.4rem, 4.4vw, 3.9rem); font-weight: 500; }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.35rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 var(--space-4); max-width: 62ch; }

.text-lede {
  font-size: 1.15rem;
  color: #4B4A5C;
  max-width: 46ch;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

@media (max-width: 640px) {
  .container { padding-inline: var(--space-4); }
}

section { padding-block: var(--space-8); }
@media (max-width: 640px) {
  section { padding-block: var(--space-7); }
}

/* Focus visibility — never remove without replacing */
:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.96rem;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease-out), background 0.18s var(--ease-out), border-color 0.18s var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-amber);
  color: var(--color-indigo);
}
.btn-primary:hover { background: var(--color-amber-deep); }

.btn-ghost-light {
  background: transparent;
  border-color: rgba(216, 217, 238, 0.35);
  color: var(--color-indigo-text);
}
.btn-ghost-light:hover { border-color: var(--color-indigo-text); }

.btn-outline {
  background: transparent;
  border-color: var(--color-indigo);
  color: var(--color-indigo);
}
.btn-outline:hover { background: var(--color-indigo); color: var(--color-white); }

.btn-teal {
  background: var(--color-teal);
  color: var(--color-white);
}
.btn-teal:hover { background: var(--color-teal-deep); }

.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.85rem; }
.btn-block { width: 100%; justify-content: center; }

/* Visually hidden but accessible */
.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;
}

/* Skeleton / loading state */
.skeleton {
  background: linear-gradient(90deg, var(--color-sand-deep) 25%, #F5F0E4 37%, var(--color-sand-deep) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: #6B6A7C;
}
.empty-state i { font-size: 2.2rem; color: var(--color-teal); margin-bottom: var(--space-3); }

/* Toast */
.toast-stack {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.toast {
  background: var(--color-indigo);
  color: var(--color-white);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  animation: toast-in 0.25s var(--ease-out);
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--color-teal); }
.toast.error { border-left: 3px solid var(--color-danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .toast-stack { left: var(--space-4); right: var(--space-4); bottom: var(--space-4); }
  .toast { max-width: none; }
}
