/* ============================================
   Iya Oloja — Elevated Design System
   ============================================ */

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

/* --- Design Tokens --- */
:root {
  --green: #008751;
  --green-dark: #006b40;
  --green-light: #e8f5ee;
  --green-subtle: rgba(0, 135, 81, 0.08);

  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --bg-sunken: #f3f4f6;
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-subtle: #f0f0f0;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);

  --radius: 8px;
  --radius-lg: 12px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --duration: 0.2s;
  --duration-slow: 0.35s;

  color-scheme: light dark;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --green: #00a86b;
  --green-dark: #00c77b;
  --green-light: rgba(0, 168, 107, 0.12);
  --green-subtle: rgba(0, 168, 107, 0.06);

  --bg: #0f1117;
  --bg-elevated: #1a1d27;
  --bg-sunken: #141720;
  --text: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border: #2a2d3a;
  --border-subtle: #1f222d;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* --- Base --- */
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--duration-slow) var(--ease),
              color var(--duration-slow) var(--ease);
}

main {
  flex: 1;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Typography --- */
h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }

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

a {
  color: var(--green);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--green-dark);
}

/* --- Fade-in Animations --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero,
.docs,
.contribute,
.not-found {
  animation: fadeUp var(--duration-slow) var(--ease-out) both;
}

.feature,
.endpoint,
.option {
  animation: fadeUp var(--duration-slow) var(--ease-out) both;
}

.feature:nth-child(1) { animation-delay: 0.05s; }
.feature:nth-child(2) { animation-delay: 0.1s; }
.feature:nth-child(3) { animation-delay: 0.15s; }

.endpoint:nth-child(1) { animation-delay: 0.05s; }
.endpoint:nth-child(2) { animation-delay: 0.08s; }
.endpoint:nth-child(3) { animation-delay: 0.11s; }
.endpoint:nth-child(4) { animation-delay: 0.14s; }
.endpoint:nth-child(5) { animation-delay: 0.17s; }
.endpoint:nth-child(6) { animation-delay: 0.2s; }

/* ============================================
   Navigation
   ============================================ */
.nav {
  background: var(--green);
  padding: 0 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .nav {
  background: #141720;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: opacity var(--duration) var(--ease);
}

.nav-brand:hover {
  opacity: 0.85;
  color: #fff;
}

[data-theme="dark"] .nav-brand {
  color: var(--green);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: background var(--duration) var(--ease),
              color var(--duration) var(--ease);
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

[data-theme="dark"] .nav-links a {
  color: var(--text-secondary);
}

[data-theme="dark"] .nav-links a:hover {
  background: var(--green-subtle);
  color: var(--green);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration) var(--ease),
              color var(--duration) var(--ease);
  margin-left: 0.25rem;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

[data-theme="dark"] .theme-toggle {
  color: var(--text-secondary);
}

[data-theme="dark"] .theme-toggle:hover {
  background: var(--green-subtle);
  color: var(--green);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--bg-sunken);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.01em;
  transition: background var(--duration-slow) var(--ease),
              border-color var(--duration-slow) var(--ease);
}

/* ============================================
   Hero / Home Page
   ============================================ */
.hero {
  padding: 4.5rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 0.75rem;
  letter-spacing: -0.035em;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3.5rem;
  text-align: left;
}

.feature {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: box-shadow var(--duration) var(--ease),
              border-color var(--duration) var(--ease),
              transform var(--duration) var(--ease),
              background var(--duration-slow) var(--ease);
}

.feature:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--green);
  transform: translateY(-2px);
}

.feature h3 {
  color: var(--green);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.feature p {
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Quick Start */
.quick-start {
  text-align: left;
  max-width: 580px;
  margin: 0 auto;
}

.quick-start h2 {
  margin-bottom: 1.25rem;
  color: var(--text);
}

/* Code Blocks */
.code-block {
  background: var(--bg-sunken);
  color: var(--text);
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  transition: border-color var(--duration) var(--ease),
              background var(--duration-slow) var(--ease);
}


/* Terminal */
.terminal {
  background: var(--bg-sunken);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
  transition: background var(--duration-slow) var(--ease),
              border-color var(--duration-slow) var(--ease);
}

.terminal-header {
  display: flex;
  gap: 6px;
  padding: 0.7rem 0.9rem;
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .terminal-header {
  background: rgba(255, 255, 255, 0.03);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.terminal-body {
  padding: 0.9rem 1rem;
}

.terminal-line {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.2rem 0;
  line-height: 1.7;
}

.terminal-prompt {
  color: var(--green);
  margin-right: 0.5rem;
  font-weight: 500;
}

.quick-start-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #fff;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1.5px solid var(--green);
  cursor: pointer;
  margin: 0.6rem 0.5rem 0 0;
  transition: all var(--duration) var(--ease);
  letter-spacing: 0.01em;
}

.btn:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
  margin: 0;
}

.btn-outline {
  background: transparent;
  color: var(--green);
}

.btn-outline:hover {
  background: var(--green);
  color: #fff;
}

/* ============================================
   Docs Page
   ============================================ */
.docs {
  padding: 3rem 0;
}

.docs h1 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.docs > p {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

.endpoint {
  margin-bottom: 0;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  transition: border-color var(--duration-slow) var(--ease);
}

.endpoint:last-child {
  border-bottom: none;
}

.endpoint h2 {
  margin-bottom: 0.6rem;
  color: var(--text);
}

.endpoint p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.endpoint pre {
  background: var(--bg-sunken);
  padding: 1.15rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  line-height: 1.6;
  transition: background var(--duration-slow) var(--ease),
              border-color var(--duration-slow) var(--ease);
}

.endpoint table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.875rem;
}

.endpoint th,
.endpoint td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.endpoint th {
  font-weight: 600;
  color: var(--text);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.endpoint td {
  color: var(--text-secondary);
}

details {
  margin-top: 0.6rem;
}

details summary {
  cursor: pointer;
  color: var(--green);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.35rem 0;
  transition: color var(--duration) var(--ease);
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

details summary:hover {
  color: var(--green-dark);
}

details[open] summary {
  margin-bottom: 0.5rem;
}

/* ============================================
   Contribute Page
   ============================================ */
.contribute {
  padding: 3rem 0;
}

.contribute h1 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.contribute > p {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

.contribute-options {
  display: grid;
  gap: 1.5rem;
}

.option {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: box-shadow var(--duration) var(--ease),
              border-color var(--duration) var(--ease),
              background var(--duration-slow) var(--ease);
}

.option:hover {
  box-shadow: var(--shadow-sm);
}

.option h2 {
  margin-bottom: 0.5rem;
  color: var(--green);
  font-size: 1.2rem;
}

.option > p {
  font-size: 0.9rem;
}

.option pre {
  background: var(--bg-sunken);
  padding: 1.15rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  line-height: 1.6;
  transition: background var(--duration-slow) var(--ease),
              border-color var(--duration-slow) var(--ease);
}

.option ol {
  padding-left: 1.25rem;
  margin: 0.75rem 0;
}

.option ol li {
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ============================================
   Form
   ============================================ */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-top: 1.25rem;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease),
              background var(--duration-slow) var(--ease);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.field input:hover,
.field textarea:hover {
  border-color: #c0c4cc;
}

[data-theme="dark"] .field input:hover,
[data-theme="dark"] .field textarea:hover {
  border-color: #3a3d4a;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-light);
}

/* Map Picker */
.map-picker {
  width: 100%;
  height: 280px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden;
  cursor: crosshair;
  transition: border-color var(--duration) var(--ease);
}

.map-picker:hover {
  border-color: var(--green);
}

.label-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 0.35rem;
}

.coords-display {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  min-height: 1.2em;
}

.coords-display.active {
  color: var(--green);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-message {
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  line-height: 1.5;
}

.form-message:empty {
  display: none;
}

.form-message.success {
  color: var(--green);
  background: var(--green-light);
}

.form-message.error {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

/* ============================================
   404 Page
   ============================================ */
.not-found {
  text-align: center;
  padding: 6rem 0;
}

.not-found h1 {
  font-size: 5rem;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.not-found p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

/* ============================================
   Inline Code
   ============================================ */
code {
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  font-size: 0.82em;
  font-family: var(--font-mono);
  transition: background var(--duration-slow) var(--ease),
              border-color var(--duration-slow) var(--ease);
}

.code-block code {
  background: none;
  border: none;
  padding: 0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
  .hero {
    padding: 3rem 0 2rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .features {
    gap: 1rem;
  }

  .feature {
    padding: 1.25rem;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .nav-inner {
    height: 48px;
  }

  .nav-links {
    gap: 0;
  }

  .nav-links a {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }

  .option {
    padding: 1.5rem;
  }

  .docs,
  .contribute {
    padding: 2rem 0;
  }

  .not-found h1 {
    font-size: 3.5rem;
  }

  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.2rem; }
}

/* ============================================
   Selection & Focus
   ============================================ */
::selection {
  background: var(--green-light);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================
   Scrollbar (webkit)
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
