@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=IBM+Plex+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --font-body: "Space Grotesk", sans-serif;
  --font-display: "Fraunces", serif;
  --primary: #0f766e;
  --primary-hover: #0b5f58;
  --accent: #0f766e;
  --accent-strong: #0b5f58;
  --accent-soft: rgba(15, 118, 110, 0.18);
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --surface-0: #f8fafc;
  --surface-1: #ffffff;
  --surface-2: #eef2f6;
  --border-subtle: rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 48px rgba(15, 23, 42, 0.14);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.1);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --cardBg: rgba(255, 255, 255, 0.9);
  --altCardBg: rgba(248, 250, 252, 0.95);
  --text: var(--ink-900);
  --userIcon: #f59e0b;
  --successBg: #dcfce7;
  --successText: #166534;
  --successBorder: #86efac;
  --errorBg: #fee2e2;
  --errorText: #991b1b;
  --errorBorder: #fecaca;
  --warningBg: #fef3c7;
  --warningText: #92400e;
  --warningBorder: #fcd34d;
  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--ink-900);
  --bs-body-bg: transparent;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--ink-900);
  line-height: 1.6;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(254, 243, 199, 0.9), transparent 60%),
    radial-gradient(800px 520px at 95% 0%, rgba(219, 234, 254, 0.9), transparent 60%),
    radial-gradient(600px 400px at 50% 100%, rgba(187, 247, 208, 0.7), transparent 60%),
    #f8fafc;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  opacity: 0.6;
  pointer-events: none;
}

body::before {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -120px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.3), transparent 65%);
}

body::after {
  width: 520px;
  height: 520px;
  bottom: -200px;
  left: -160px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.22), transparent 65%);
}

h1,
h2,
h3,
.display-font {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

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

.app-shell {
  position: relative;
  min-height: 100vh;
}

.app-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  animation: slideDown 0.6s ease both;
  position: relative;
  z-index: 90;
  overflow: visible;
}

.app-header .app-title {
  font-family: var(--font-display);
  color: var(--primary);
  font-weight: 600;
}

.app-header .app-subtitle {
  color: var(--ink-500);
  font-size: 0.95rem;
}

.nav-link {
  color: var(--ink-500);
  font-weight: 500;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown {
  position: relative;
}

.nav-trigger {
  cursor: pointer;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  color: var(--ink-700);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  font: inherit;
  line-height: 1;
  appearance: none;
}

.nav-trigger::after {
  content: \"▾\";
  font-size: 0.75rem;
  opacity: 0.7;
}

.nav-dropdown:hover > .nav-trigger {
  color: var(--primary);
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.12);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  min-width: 220px;
  padding: 0.4rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
  z-index: 120;
  pointer-events: auto;
}

.nav-dropdown:hover .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu .nav-link {
  width: 100%;
  justify-content: flex-start;
  padding: 0.45rem 0.8rem;
}

.nav-link:hover {
  color: var(--ink-900);
  background: rgba(15, 118, 110, 0.08);
}

.nav-link.active,
.nav-link[aria-current="page"] {
  color: var(--primary);
  background: rgba(15, 118, 110, 0.18);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.3);
  font-weight: 600;
}

.card {
  background: var(--cardBg);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  animation: riseIn 0.55s ease both;
  animation-delay: var(--delay, 0s);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-900);
}

.card-link {
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(15, 118, 110, 0.35);
}

.input-field {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.16);
  color: var(--ink-900);
  border-radius: var(--radius-md);
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.input-field::placeholder {
  color: rgba(100, 116, 139, 0.9);
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  color: #fff;
  border: none;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(15, 118, 110, 0.28);
  filter: saturate(1.05);
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 16px 28px rgba(15, 118, 110, 0.28);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-700);
  border: 1px solid rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-outline:hover {
  color: var(--primary);
  border-color: rgba(15, 118, 110, 0.4);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

button:disabled,
.btn-primary:disabled,
.btn-outline:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-500);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--ink-900);
  border-color: rgba(15, 23, 42, 0.12);
}

.btn-primary,
.btn-outline,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  margin-bottom: 1rem;
}

.tab {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  color: var(--ink-500);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  text-align: center;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--ink-900);
}

.tab.active {
  color: var(--primary);
  background: rgba(15, 118, 110, 0.18);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.35);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.badge-gray {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.badge-red {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.mono {
  font-family: "IBM Plex Mono", "Fira Code", Consolas, "Courier New", monospace;
}

.source-citation {
  color: #2563eb;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.source-citation:hover {
  color: #1d4ed8;
  text-decoration-style: solid;
}

blockquote.with-citation {
  border-left: 4px solid #2563eb;
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--ink-700);
  font-style: italic;
}

blockquote.with-citation footer {
  margin-top: 0.5rem;
  color: var(--ink-500);
  font-style: normal;
  font-size: 0.875rem;
}

.table-shell {
  background: var(--cardBg);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.table-shell table {
  width: 100%;
  border-collapse: collapse;
}

.table-shell .table {
  margin-bottom: 0;
}

.table-shell thead {
  background: rgba(15, 23, 42, 0.04);
  color: var(--ink-500);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.table-shell th,
.table-shell td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.table-shell tr:hover {
  background: rgba(15, 118, 110, 0.06);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--ink-500);
  font-weight: 600;
}

.hero-title {
  font-size: clamp(2.5rem, 3.4vw, 3.5rem);
  color: var(--ink-900);
  font-weight: 600;
  line-height: 1.05;
}

.hero-subtitle {
  color: var(--ink-500);
  max-width: 38rem;
}

.card-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.app-shell .card:nth-of-type(1) {
  --delay: 0.03s;
}

.app-shell .card:nth-of-type(2) {
  --delay: 0.08s;
}

.app-shell .card:nth-of-type(3) {
  --delay: 0.13s;
}

.app-shell .card:nth-of-type(4) {
  --delay: 0.18s;
}

.app-shell .card:nth-of-type(5) {
  --delay: 0.23s;
}

.app-shell .card:nth-of-type(6) {
  --delay: 0.28s;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.5);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
}

* {
  scrollbar-color: rgba(100, 116, 139, 0.5) rgba(148, 163, 184, 0.2);
  scrollbar-width: thin;
}

input,
select,
textarea,
button {
  font-family: inherit;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
}

:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.5);
  outline-offset: 2px;
}

#statusMessage,
#errorDetails {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.modal-content {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .app-header {
    animation: none !important;
  }

  .btn-primary,
  .btn-outline {
    transition: none;
  }
}

@media (max-width: 1024px) {
  .app-header nav {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .nav-dropdown {
    width: 100%;
  }

  .nav-trigger {
    width: 100%;
    justify-content: space-between;
  }

  .nav-menu {
    position: static;
    width: 100%;
    margin-top: 0.5rem;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav-dropdown:not(:hover):not(:focus-within) .nav-menu {
    display: none;
  }

  .nav-dropdown:focus-within > .nav-trigger {
    color: var(--primary);
    border-color: rgba(15, 118, 110, 0.35);
    background: rgba(15, 118, 110, 0.12);
  }
}
