:root {
  color-scheme: light;

  --background: oklch(0.978 0.004 85);
  --surface: oklch(1 0 0);
  --surface-soft: oklch(0.972 0.006 85);
  --foreground: oklch(0.18 0.01 85);
  --muted-foreground: oklch(0.52 0.012 85);
  --border: oklch(0.905 0.008 85);
  --border-strong: oklch(0.82 0.012 85);
  --primary: oklch(0.25 0.018 85);
  --primary-foreground: oklch(0.985 0 0);
  --ring: oklch(0.56 0.02 85);

  --accent: oklch(0.955 0.025 155);
  --accent-strong: oklch(0.89 0.055 155);
  --accent-foreground: oklch(0.33 0.07 155);
  --accent-ink: oklch(0.27 0.055 155);

  --danger: oklch(0.55 0.2 27);
  --danger-soft: oklch(0.965 0.02 27);
  --info: oklch(0.52 0.16 255);
  --info-soft: oklch(0.96 0.025 255);
  --warning: oklch(0.55 0.12 72);
  --warning-soft: oklch(0.97 0.035 82);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-card: 0 1px 2px oklch(0.2 0.01 85 / 0.04),
    0 18px 44px -32px oklch(0.2 0.01 85 / 0.28);
  --shadow-button: 0 1px 2px oklch(0.2 0.01 85 / 0.16),
    0 8px 20px -12px oklch(0.2 0.01 85 / 0.45);

  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

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

html {
  min-width: 320px;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(
      circle at 8% -10%,
      oklch(0.93 0.045 155 / 0.6),
      transparent 34rem
    ),
    radial-gradient(
      circle at 92% 8%,
      oklch(0.96 0.02 85 / 0.9),
      transparent 30rem
    ),
    var(--background);
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

svg {
  display: block;
}

.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;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

.shell {
  width: min(100% - 48px, 1180px);
  margin: 0 auto;
  padding: 28px 0 36px;
}

/* Header */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-button);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.brand-subtitle {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  line-height: 1.35;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid oklch(0.88 0.04 82);
  border-radius: 999px;
  background: var(--warning-soft);
  color: oklch(0.39 0.075 65);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
}

.demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: oklch(0.68 0.15 72);
  box-shadow: 0 0 0 3px oklch(0.68 0.15 72 / 0.14);
}

/* Intro */

.intro {
  max-width: 700px;
  padding: 54px 0 34px;
}

.eyebrow,
.kicker {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 14ch;
  margin: 12px 0 14px;
  font-size: clamp(2.15rem, 4.2vw, 3.35rem);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.lede {
  max-width: 58ch;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 1rem;
  line-height: 1.65;
}

/* Workspace */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 20px;
  align-items: start;
}

.report-pane,
.triage-pane {
  min-width: 0;
}

.pane-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  min-height: 54px;
  margin-bottom: 12px;
}

.pane-head h2 {
  margin: 5px 0 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  min-width: 220px;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted-foreground);
  border-bottom: 1.5px solid var(--muted-foreground);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.select-wrap select {
  width: 100%;
  min-height: 40px;
  padding: 8px 38px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  appearance: none;
  background: var(--surface);
  color: var(--foreground);
  font-size: 0.78rem;
  font-weight: 550;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-wrap select:hover {
  border-color: var(--border-strong);
}

.select-wrap select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

/* Report card */

.report-card {
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.report-meta time {
  margin-left: 3px;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  line-height: 1.3;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.2;
  text-transform: uppercase;
}

.tag-bug {
  border-color: oklch(0.9 0.03 27);
  background: var(--danger-soft);
  color: var(--danger);
}

.tag-new {
  border-color: oklch(0.9 0.035 255);
  background: var(--info-soft);
  color: var(--info);
}

.tag-in-progress {
  border-color: oklch(0.9 0.035 82);
  background: var(--warning-soft);
  color: var(--warning);
}

.tag-done {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: var(--accent-foreground);
}

.report-card h3 {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 1.85rem);
  font-weight: 620;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.report-description {
  max-width: 64ch;
  margin: 0;
  color: oklch(0.32 0.012 85);
  font-size: 0.94rem;
  line-height: 1.7;
}

.report-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 2px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.report-facts div {
  min-width: 0;
}

.report-facts dt {
  margin-bottom: 4px;
  color: var(--muted-foreground);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.report-facts dd {
  margin: 0;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 550;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Triage panel */

.sim-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border: 1px solid var(--accent-strong);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.triage-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 30px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(
      circle at 100% 0%,
      oklch(0.92 0.06 155 / 0.55),
      transparent 18rem
    ),
    linear-gradient(180deg, var(--surface) 0%, oklch(0.985 0.009 155) 100%);
  box-shadow: var(--shadow-card);
}

.state-view {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.state-view[hidden],
[hidden] {
  display: none !important;
}

.triage-card::after {
  position: absolute;
  right: -46px;
  bottom: -60px;
  width: 190px;
  height: 190px;
  border: 1px solid oklch(0.82 0.055 155 / 0.45);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.empty-visual {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 33px;
  place-items: center;
  border: 1px solid var(--accent-strong);
  border-radius: 17px;
  background: var(--accent);
  color: var(--accent-ink);
}

.active-visual,
.alert-visual,
.outcome-visual {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 33px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 17px;
}

.active-visual {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: var(--accent-ink);
}

.alert-visual {
  border-color: oklch(0.9 0.03 27);
  background: var(--danger-soft);
  color: var(--danger);
}

.alert-visual svg {
  width: 25px;
  height: 25px;
}

.outcome-visual {
  border-radius: 50%;
}

.outcome-visual svg {
  width: 24px;
  height: 24px;
}

.outcome-visual-success {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: var(--accent-ink);
}

.outcome-visual-muted {
  background: var(--surface-soft);
  color: var(--muted-foreground);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid oklch(0.72 0.08 155 / 0.35);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-visual svg {
  width: 25px;
  height: 25px;
}

.empty-orbit {
  position: absolute;
  inset: -9px;
  border: 1px solid oklch(0.82 0.05 155 / 0.55);
  border-radius: 22px;
  transform: rotate(-9deg);
}

.state-label {
  margin: 0 0 7px;
  color: var(--accent-foreground);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.triage-card h3 {
  max-width: 16ch;
  margin: 0 0 12px;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 620;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.triage-copy {
  max-width: 42ch;
  margin: 0 0 26px;
  color: oklch(0.4 0.015 155);
  font-size: 0.9rem;
  line-height: 1.65;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 12px 15px 12px 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.button-primary {
  width: 100%;
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-button);
}

.button-primary:hover {
  background: oklch(0.31 0.018 85);
}

.button-primary:active {
  transform: translateY(1px);
}

.button-secondary {
  width: auto;
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--foreground);
}

.button-secondary:hover {
  border-color: var(--muted-foreground);
  background: var(--surface-soft);
}

.button-ghost {
  width: auto;
  border-color: transparent;
  background: transparent;
  color: var(--muted-foreground);
}

.button-ghost:hover {
  background: var(--surface-soft);
  color: var(--foreground);
}

.button-small {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.73rem;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.suggestion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 2px 0 20px;
}

.tag-feature {
  border-color: oklch(0.89 0.04 255);
  background: var(--info-soft);
  color: var(--info);
}

.tag-question {
  border-color: oklch(0.9 0.035 82);
  background: var(--warning-soft);
  color: var(--warning);
}

.tag-priority-high {
  border-color: oklch(0.9 0.03 27);
  background: var(--danger-soft);
  color: var(--danger);
}

.tag-priority-medium {
  border-color: oklch(0.9 0.035 82);
  background: var(--warning-soft);
  color: var(--warning);
}

.tag-priority-low {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--muted-foreground);
}

.suggestion-warning {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid oklch(0.9 0.03 27);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: oklch(0.45 0.16 27);
  font-size: 0.78rem;
  font-weight: 550;
  line-height: 1.45;
}

.suggestion-warning[hidden] {
  display: none !important;
}

.suggestion-block {
  padding: 15px 16px;
  border: 1px solid oklch(0.91 0.03 155);
  border-radius: var(--radius-md);
  background: oklch(1 0 0 / 0.62);
}

.suggestion-block + .suggestion-block {
  margin-top: 10px;
}

.suggestion-label {
  margin: 0 0 6px;
  color: var(--muted-foreground);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.suggestion-summary {
  margin: 0;
  color: var(--foreground);
  font-size: 0.88rem;
  line-height: 1.55;
}

.next-steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.15rem;
  color: var(--foreground);
  font-size: 0.82rem;
  line-height: 1.45;
}

.next-steps li::marker {
  color: var(--accent-foreground);
  font-weight: 700;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.action-row .button {
  flex: 1 1 140px;
  justify-content: center;
  width: auto;
}

.progress {
  height: 4px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: oklch(0.88 0.03 155 / 0.55);
}

.progress span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-ink);
  animation: progress 1.15s ease-in-out infinite alternate;
}

@keyframes progress {
  from {
    transform: translateX(-30%);
  }
  to {
    transform: translateX(150%);
  }
}

.triage-card[data-state="failure"] .state-label,
.triage-card[data-state="invalid"] .state-label {
  color: var(--danger);
}

.triage-card[data-state="accepted"] .state-label {
  color: var(--accent-foreground);
}

.triage-card[data-state="dismissed"] .state-label {
  color: var(--muted-foreground);
}

.microcopy {
  position: relative;
  z-index: 1;
  margin: 16px 0 0;
  color: var(--muted-foreground);
  font-size: 0.7rem;
  line-height: 1.4;
  text-align: center;
}

/* Demo controls */

.demo-controls {
  margin-top: 12px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: oklch(1 0 0 / 0.38);
}

.demo-controls-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.demo-controls-head h2 {
  margin: 4px 0 0;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.demo-controls-head > p {
  max-width: 30ch;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  line-height: 1.45;
}

.demo-control-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.control-field {
  display: grid;
  gap: 6px;
}

.control-label {
  color: var(--muted-foreground);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.control-select {
  min-width: 220px;
}

.control-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.flow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 30px;
  color: var(--muted-foreground);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.flow-line {
  height: 1px;
  flex: 1 1 auto;
  background: var(--border);
}

/* Footer */

.footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-top: 42px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.footer p {
  max-width: 64ch;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  line-height: 1.55;
}

.footer strong {
  color: var(--foreground);
  font-weight: 650;
}

.footer-note {
  flex: 0 0 auto;
  font-size: 0.68rem !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.footer-note a {
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.footer-note a:hover {
  text-decoration-color: var(--foreground);
}

/* Responsive */

@media (max-width: 900px) {
  .shell {
    width: min(100% - 36px, 720px);
  }

  .intro {
    padding-top: 42px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .triage-card {
    min-height: auto;
  }

  .flow {
    margin-top: 0;
  }
}

@media (max-width: 600px) {
  .shell {
    width: min(100% - 28px, 540px);
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
    padding-bottom: 20px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .brand-mark svg {
    width: 21px;
    height: 21px;
  }

  .brand-subtitle {
    display: none;
  }

  .demo-badge {
    max-width: 150px;
    min-height: 30px;
    padding: 6px 9px;
    font-size: 0.65rem;
    line-height: 1.3;
    white-space: normal;
  }

  .intro {
    padding: 34px 0 26px;
  }

  .intro h1 {
    max-width: 12ch;
    font-size: clamp(2rem, 11vw, 2.75rem);
  }

  .lede {
    font-size: 0.92rem;
  }

  .pane-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 10px;
  }

  .select-wrap {
    width: 100%;
  }

  .sim-pill {
    align-self: flex-start;
  }

  .report-card,
  .triage-card {
    padding: 22px;
  }

  .report-card h3 {
    font-size: 1.55rem;
  }

  .report-description {
    font-size: 0.9rem;
  }

  .report-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .report-facts div:last-child {
    grid-column: 1 / -1;
  }

  .triage-card h3 {
    font-size: 1.7rem;
  }

  .flow {
    flex-wrap: wrap;
    gap: 7px;
  }

  .flow-line {
    min-width: 14px;
  }

  .action-row .button {
    flex-basis: 100%;
  }

  .demo-controls-head,
  .demo-control-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .demo-controls-head > p {
    max-width: none;
  }

  .control-select {
    width: 100%;
  }

  .control-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .control-buttons .button {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
    margin-top: 30px;
  }

  .footer-note {
    white-space: normal;
  }
}

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