:root {
  color-scheme: light;
  --bg: #f4f3ee;
  --bg-2: #e8f2f6;
  --bg-3: #f7efe5;
  --ink: #0b1426;
  --muted: #4e5d6c;
  --accent: #0a6d8c;
  --accent-2: #f08a24;
  --accent-3: #f2c94c;
  --glass: rgba(255, 255, 255, 0.82);
  --card: rgba(255, 255, 255, 0.94);
  --stroke: rgba(11, 20, 38, 0.12);
  --shadow: 0 18px 46px rgba(10, 109, 140, 0.16);
  --font-display: "Sora", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Sora", sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: radial-gradient(900px 520px at 80% -10%, #d8f0fb 0%, transparent 60%),
    radial-gradient(700px 480px at -10% 20%, #ffe3c8 0%, transparent 55%),
    linear-gradient(135deg, var(--bg), var(--bg-2), var(--bg-3));
  color: var(--ink);
  min-height: 100vh;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image: linear-gradient(rgba(11, 20, 38, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 20, 38, 0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  z-index: 0;
  mix-blend-mode: multiply;
}

main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 90px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--stroke);
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

nav a:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(11, 20, 38, 0.1);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(120deg, rgba(242, 201, 76, 0.35), rgba(240, 138, 36, 0.2));
  color: var(--ink);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(240, 138, 36, 0.5);
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero {
  display: grid;
  gap: 20px;
  padding: 32px;
  border-radius: 30px;
  background: var(--glass);
  box-shadow: var(--shadow);
  border: 1px solid rgba(10, 109, 140, 0.2);
  backdrop-filter: blur(12px);
  animation: fadeUp 0.7s ease both;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 52px);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 860px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(10, 109, 140, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(10, 109, 140, 0.3);
}

.hero-metrics,
.summary-grid,
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.metric-card,
.card,
.chart-card {
  background: var(--card);
  border: 1px solid rgba(10, 109, 140, 0.14);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(11, 20, 38, 0.08);
  display: grid;
  gap: 10px;
  animation: fadeUp 0.6s ease both;
}

.metric-card span:first-child {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.metric-card strong {
  font-family: var(--font-display);
  font-size: 22px;
}

.metric-card em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}

.section {
  display: grid;
  gap: 18px;
  padding: 26px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--stroke);
  box-shadow: 0 16px 40px rgba(11, 20, 38, 0.08);
  backdrop-filter: blur(10px);
  scroll-margin-top: 80px;
  animation: fadeUp 0.7s ease both;
  content-visibility: auto;
  contain-intrinsic-size: 900px;
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
}

.section p {
  color: var(--muted);
  line-height: 1.7;
}

.tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  width: fit-content;
  background: rgba(10, 109, 140, 0.12);
  color: var(--accent);
  font-weight: 600;
}

.step-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.step-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(10, 109, 140, 0.08), rgba(240, 138, 36, 0.06));
  border: 1px solid rgba(10, 109, 140, 0.18);
}

.step-num {
  font-weight: 700;
  color: var(--accent);
  font-size: 16px;
}

.step-body strong {
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.step-body span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  display: block;
}

.callout {
  border-left: 4px solid var(--accent-2);
  background: rgba(240, 138, 36, 0.12);
  padding: 14px 16px;
  border-radius: 12px;
  display: grid;
  gap: 6px;
}

.callout code {
  font-family: var(--font-display);
  background: rgba(11, 20, 38, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

canvas {
  width: 100%;
  height: 240px;
  background: linear-gradient(180deg, rgba(10, 109, 140, 0.06), rgba(255, 255, 255, 0.9));
  border-radius: 16px;
  border: 1px solid rgba(11, 20, 38, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(15, 28, 46, 0.08);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(10, 109, 140, 0.14);
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}

.table-note {
  font-size: 12px;
  color: var(--muted);
}

.footer {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.data-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.data-controls label {
  font-weight: 600;
  color: var(--muted);
}

.data-controls select {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(10, 109, 140, 0.2);
  background: #fff;
  font-family: var(--font-body);
}

.data-table {
  margin-top: 12px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(10, 109, 140, 0.16);
  overflow: auto;
  max-height: 520px;
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(11, 20, 38, 0.08);
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #f7fafc;
  z-index: 1;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 10;
}

.modal.is-open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 20, 38, 0.45);
}

.modal-content {
  position: relative;
  width: min(880px, 92vw);
  max-height: 80vh;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(10, 109, 140, 0.2);
  box-shadow: 0 20px 50px rgba(11, 20, 38, 0.18);
  animation: fadeUp 0.3s ease both;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-body {
  display: grid;
  gap: 12px;
}

.highlight-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(10, 109, 140, 0.16);
  background: rgba(10, 109, 140, 0.06);
  display: grid;
  gap: 6px;
}

.highlight-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.highlight-title {
  font-weight: 600;
}

.highlight-role {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(240, 138, 36, 0.18);
  color: var(--accent-2);
  font-weight: 600;
}

.highlight-role.assistant {
  background: rgba(10, 109, 140, 0.18);
  color: var(--accent);
}

.highlight-role.note {
  background: rgba(242, 201, 76, 0.2);
  color: #8d6a00;
}

@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 720px) {
  nav {
    justify-content: flex-start;
  }

  .hero {
    padding: 24px;
  }

  .hero-metrics,
  .summary-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
