:root {
  --bg: #ffffff;
  --ink: #101522;
  --muted: #5f6b7f;
  --line: #dbe3ee;
  --soft-line: #edf1f6;
  --surface: #f8fafc;
  --green: #0f5f32;
  --green-2: #0c7a3d;
  --blue: #1d4ed8;
  --red: #dc2626;
  --amber: #f59e0b;
  --shadow: 0 18px 50px rgba(16, 21, 34, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

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

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  color: #0b3f23;
  font-size: 31px;
  font-weight: 780;
  letter-spacing: 0;
}

.nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  color: #1f2937;
  font-size: 14px;
  font-weight: 620;
}

.nav a {
  border-bottom: 2px solid transparent;
  padding: 23px 0 21px;
}

.nav a:hover {
  border-bottom-color: var(--green);
}

.language-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 142px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.language-toggle button {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #344054;
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
}

.language-toggle button.is-active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 1px 5px rgba(16, 21, 34, 0.11);
}

.header-action,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: 0;
}

.header-action {
  padding: 0 18px;
  background: #0a4728;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 95, 50, 0.18);
}

.header-action svg,
.primary-button svg,
.hero-checks svg,
.workflow-node svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(560px, 1.5fr);
  gap: 54px;
  padding: 56px 40px 28px;
  align-items: start;
  min-height: auto;
}

.hero-copy {
  max-width: 560px;
}

.hero h1 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(58px, 5.7vw, 88px);
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 820;
}

body[data-locale="ko"] .hero h1 {
  font-size: clamp(52px, 5vw, 76px);
  word-break: keep-all;
}

body[data-locale="ko"] .hero-text,
body[data-locale="ko"] .hero-checks,
body[data-locale="ko"] .detail-card h3,
body[data-locale="ko"] .regulation-grid h3 {
  word-break: keep-all;
}

.route {
  margin: 20px 0 18px;
  padding-bottom: 18px;
  border-bottom: 3px solid var(--green);
  color: var(--green);
  font-size: clamp(26px, 3vw, 37px);
  font-weight: 780;
  letter-spacing: 0;
}

.route span {
  padding: 0 8px;
}

.hero-text {
  max-width: 520px;
  margin: 0 0 22px;
  color: #1f2937;
  font-size: 18px;
}

.hero-checks {
  display: grid;
  gap: 8px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
  color: #1e293b;
  font-size: 15px;
}

.hero-checks li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
}

.hero-checks svg {
  color: var(--green);
  margin-top: 2px;
}

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

.primary-button {
  border: 0;
  padding: 0 23px;
  background: linear-gradient(180deg, var(--green-2), var(--green));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(15, 95, 50, 0.16);
}

.secondary-button {
  padding: 0 23px;
  border: 1px solid #9aa5b5;
  background: #fff;
  color: #182230;
}

.risk-workbench,
.example-output,
.llm-panel,
.api-section,
.visuals,
.input-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.risk-workbench {
  padding: 24px;
}

.workbench-top,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.workbench-top h2,
.section-title h2,
.llm-panel h2,
.api-section h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.section-title > div {
  min-width: 0;
}

.section-title p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.workbench-top span {
  color: var(--blue);
  font-size: 14px;
  font-weight: 780;
}

.workflow {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 26px minmax(110px, 1fr) 26px minmax(110px, 1fr) 26px minmax(116px, 0.95fr);
  align-items: stretch;
  gap: 14px;
  margin-top: 24px;
}

.workflow-node,
.score-panel {
  min-height: 178px;
  border: 1.5px solid #9ca3af;
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}

.workflow-node {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
}

.workflow-node:first-child {
  border-color: var(--blue);
  color: var(--blue);
}

.workflow-node:nth-of-type(2) {
  border-color: var(--green);
  color: var(--green);
}

.workflow-node.selected {
  border-color: var(--blue);
  color: var(--blue);
  background: #f8fbff;
}

.workflow-node h3,
.score-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.workflow-node p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.flow-arrow {
  align-self: center;
  color: var(--ink);
  font-size: 31px;
  font-weight: 500;
}

.score-panel {
  display: grid;
  align-content: center;
  gap: 9px;
  border-color: #475467;
}

.score-panel strong {
  color: var(--red);
  font-size: 30px;
  line-height: 1;
}

.score-panel span {
  color: var(--red);
  font-size: 15px;
  font-weight: 760;
}

.score-meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e 0 24%, #eab308 24% 58%, #f97316 58% 76%, #ef4444 76% 100%);
}

.score-meter i {
  display: block;
  width: 91%;
  height: 100%;
  border-right: 3px solid #0f172a;
}

.model-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.model-strip div {
  display: grid;
  gap: 5px;
  justify-items: center;
  text-align: center;
}

.model-strip strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--green);
}

.model-strip span {
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 40px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.metrics article {
  min-height: 148px;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.metrics article:last-child {
  border-right: 0;
}

.metrics span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.metrics strong {
  display: block;
  margin: 10px 0 4px;
  color: var(--green);
  font-size: 28px;
  line-height: 1;
}

.metrics article:nth-child(2) strong,
.metrics article:nth-child(3) strong {
  color: var(--blue);
}

.metrics p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-section {
  padding: 30px 40px 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.detail-card {
  min-height: 184px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.detail-card h3 {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.25;
}

.detail-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.metric-explainer {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(0, 1.38fr);
  gap: 18px;
  margin: 0 0 28px;
  padding: 24px 40px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f7faf9;
}

.metric-explainer h2 {
  margin: 0 0 8px;
  font-size: 25px;
}

.metric-explainer p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.metric-explainer article {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.metric-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.metric-explainer span,
.template-heading span,
.regulation-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.metric-explainer strong {
  display: block;
  margin: 6px 0 8px;
  color: var(--blue);
  font-size: 30px;
  line-height: 1;
}

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 24px;
  padding: 12px 40px 28px;
}

.input-section {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
  gap: 22px;
  margin: 0 40px 28px;
  padding: 24px;
}

.input-copy {
  min-width: 0;
}

.input-copy textarea {
  width: 100%;
  min-height: 132px;
  margin-top: 18px;
  padding: 15px 16px;
  resize: vertical;
  border: 1px solid #b7c2d0;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  outline: none;
}

.input-copy textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 95, 50, 0.11);
}

.input-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.template-picker {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--soft-line);
}

.template-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.template-heading strong {
  color: var(--green);
  font-size: 12px;
}

.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-button {
  max-width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #dbe4ef;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 740;
  text-align: left;
}

.template-button:hover,
.template-button.is-selected {
  border-color: var(--green);
  background: #effaf3;
  color: #0b3f23;
}

.research-lane {
  display: grid;
  gap: 12px;
}

.research-lane div {
  display: grid;
  align-content: center;
  min-height: 70px;
  padding: 14px 16px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface);
}

.research-lane span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.research-lane strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
}

.example-output,
.llm-panel {
  padding: 24px;
}

.section-title span {
  padding: 7px 11px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: var(--red);
  font-size: 14px;
  font-weight: 780;
  background: #fff7f7;
}

.facility-meta {
  display: grid;
  grid-template-columns: 1fr 0.4fr 0.8fr;
  gap: 16px;
  margin: 22px 0;
}

.facility-meta div {
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: var(--surface);
}

dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 690;
}

.scenario-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 18px;
}

.scenario-strip span {
  padding: 7px 10px;
  border: 1px solid #dbe4ef;
  border-radius: 6px;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 760;
}

.finding {
  padding: 18px;
  border-left: 4px solid var(--green);
  background: #f7fcf9;
}

.finding h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.finding p {
  margin: 0;
  color: #344054;
  font-size: 14px;
}

.output-table,
.api-table {
  display: grid;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.output-table [role="row"],
.api-table [role="row"] {
  display: grid;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--soft-line);
}

.output-table [role="row"] {
  grid-template-columns: minmax(180px, 1.1fr) 90px minmax(180px, 1fr);
}

.api-table [role="row"] {
  grid-template-columns: 0.72fr 1.15fr 1.05fr 0.45fr;
}

.output-table [role="row"]:last-child,
.api-table [role="row"]:last-child {
  border-bottom: 0;
}

.table-head {
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.output-table span,
.api-table span,
.api-table strong {
  font-size: 13px;
}

.output-table strong {
  color: var(--green);
  font-size: 14px;
}

.llm-panel p {
  margin: 14px 0 18px;
  color: #344054;
  font-size: 15px;
}

.llm-panel ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.llm-panel li {
  position: relative;
  padding-left: 18px;
  color: #1f2937;
  font-size: 14px;
}

.llm-panel li::before {
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.dataset-count {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #b7d7c4;
  border-radius: var(--radius);
  background: #f3fbf6;
}

.dataset-count span,
.dataset-count small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.dataset-count strong {
  display: block;
  margin: 5px 0;
  color: var(--green);
  font-size: 26px;
}

.regulation-section {
  padding: 30px 40px 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.regulation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.regulation-grid article {
  min-height: 186px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.regulation-grid h3 {
  margin: 8px 0 8px;
  font-size: 17px;
  line-height: 1.22;
}

.regulation-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.visuals,
.api-section {
  margin: 0 40px 28px;
  padding: 24px;
}

.section-title a {
  color: var(--blue);
  font-size: 14px;
  font-weight: 760;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

figure img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

figcaption {
  padding: 12px 14px;
  color: #344054;
  font-size: 13px;
  font-weight: 710;
}

.api-section {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 28px;
  align-items: start;
}

.api-section p {
  margin: 14px 0 0;
  color: #344054;
  font-size: 16px;
}

.api-table {
  margin-top: 0;
}

.api-table strong {
  color: var(--green);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 40px 40px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.is-running .score-panel strong,
.is-running [data-output-status] {
  animation: pulse 0.65s ease-in-out 2;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .risk-workbench {
    max-width: 100%;
  }

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

  .detail-grid,
  .regulation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    flex-wrap: wrap;
    padding: 16px 20px;
    gap: 14px;
  }

  .brand {
    font-size: 26px;
  }

  .nav {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    font-size: 12px;
  }

  .nav a {
    padding: 4px 0;
  }

  .header-action {
    display: none;
  }

  .language-toggle {
    margin-left: auto;
    min-width: 134px;
  }

  .hero {
    padding: 34px 20px 20px;
    gap: 28px;
    width: 100%;
    max-width: 100vw;
    grid-template-columns: minmax(0, 1fr);
  }

  .hero h1 {
    max-width: 100%;
    font-size: 41px;
  }

  body[data-locale="ko"] .hero h1 {
    font-size: 38px;
    line-height: 1.05;
  }

  .hero-copy,
  .risk-workbench {
    width: 100%;
    max-width: 350px;
    min-width: 0;
    justify-self: start;
  }

  .hero-text,
  .hero-checks li,
  .workbench-top span,
  .workflow-node p {
    overflow-wrap: anywhere;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
    max-width: 350px;
  }

  .route {
    font-size: 25px;
  }

  .workflow {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }

  .model-strip,
  .metrics,
  .metric-explainer,
  .metric-card-list,
  .detail-grid,
  .facility-meta,
  .demo-grid,
  .regulation-grid,
  .api-section,
  .input-section {
    grid-template-columns: 1fr;
  }

  .metrics,
  .detail-section,
  .visuals,
  .regulation-section,
  .api-section,
  .input-section {
    margin-right: 20px;
    margin-left: 20px;
  }

  .metric-explainer {
    padding-right: 20px;
    padding-left: 20px;
  }

  .detail-section {
    padding-right: 20px;
    padding-left: 20px;
  }

  .regulation-section {
    padding-right: 20px;
    padding-left: 20px;
  }

  .metrics article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metrics article:last-child {
    border-bottom: 0;
  }

  .demo-grid {
    padding-right: 20px;
    padding-left: 20px;
  }

  .output-table [role="row"],
  .api-table [role="row"] {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 12px 14px;
  }

  .figure-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    padding: 24px 20px 32px;
  }
}

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