:root {
  --ink: #191919;
  --muted: #6f6f6f;
  --line: #e7e7e7;
  --soft: #f6f6f4;
  --surface: #ffffff;
  --green: #dff5df;
  --green-ink: #2c6b3f;
  --max: 1180px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--surface); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.skip-link { position: fixed; top: -80px; left: 18px; z-index: 100; padding: 10px 14px; background: var(--ink); color: white; }
.skip-link:focus { top: 18px; }

.site-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; width: min(var(--max), calc(100% - 40px)); height: 64px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.brand span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--ink); color: white; font: 700 11px/1 var(--mono); }
.main-nav { display: flex; align-items: center; gap: 28px; font-size: 13px; }
.main-nav a { color: #4d4d4d; }
.main-nav a:hover { color: var(--ink); }
.menu-button { display: none; padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; background: white; }

.profile-section { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 42px 0 78px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: #8d8d8d; font-size: 12px; }
.breadcrumbs b { color: #bcbcbc; font-weight: 400; }
.breadcrumbs strong { color: #555; font-weight: 500; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 100px; align-items: end; padding-top: 84px; }
.profile-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 24px; border-radius: 13px; background: #efefed; color: #676767; font: 700 22px/1 var(--mono); }
.profile-label { margin: 0 0 15px; color: #777; font: 700 10px/1 var(--mono); letter-spacing: .1em; }
.profile-main h1 { margin: 0; font-size: clamp(44px, 6vw, 72px); line-height: 1.05; letter-spacing: -.055em; }
.profile-summary { max-width: 690px; margin: 24px 0 0; color: #4d4d4d; font-size: 17px; line-height: 1.75; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border-radius: 7px; font-size: 13px; font-weight: 650; }
.primary-button { background: var(--ink); color: white; }
.primary-button:hover { background: #333; }
.secondary-button { border: 1px solid #d9d9d9; background: white; }
.secondary-button:hover { background: var(--soft); }
.profile-facts { border: 1px solid var(--line); border-radius: 12px; background: #fafafa; }
.profile-facts dl { margin: 0; }
.profile-facts dl > div { display: grid; grid-template-columns: 92px 1fr; gap: 20px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.profile-facts dl > div:last-child { border-bottom: 0; }
.profile-facts dt { color: #8a8a8a; font-size: 11px; }
.profile-facts dd { margin: 0; font-size: 12px; line-height: 1.55; }
.profile-facts dd span { color: #868686; }
.profile-facts dd i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #57a66a; }
.profile-categories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 760px; margin-top: 62px; }
.profile-categories article { display: flex; align-items: center; gap: 16px; min-height: 128px; padding: 24px; border-radius: 11px; background: var(--soft); }
.category-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; color: #656565; font-size: 25px; }
.profile-categories h2 { margin: 0; font-size: 16px; }
.profile-categories p { margin: 7px 0 0; color: #757575; font-size: 11px; line-height: 1.5; }

.projects-section { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 0 0 110px; }
.projects-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 22px; padding-top: 30px; border-top: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { min-height: 38px; padding: 0 14px; border: 1px solid #dedede; border-radius: 7px; background: white; cursor: pointer; font-size: 12px; }
.filters button:hover, .filters button.is-active { border-color: var(--ink); background: var(--ink); color: white; }
.projects-toolbar > p { margin: 0; color: #6b6b6b; font-size: 12px; white-space: nowrap; }
.projects-toolbar > p b { color: var(--ink); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 22px; }
.project-card { min-width: 0; }
.project-card[hidden] { display: none; }
.project-preview { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); cursor: pointer; text-align: left; }
.project-preview:hover { border-color: #b9b9b9; }
.project-info { padding: 15px 4px 0; }
.project-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.project-title-row p { margin: 0 0 6px; color: #898989; font: 600 9px/1 var(--mono); text-transform: uppercase; }
.project-title-row h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.status { flex: 0 0 auto; padding: 5px 8px; border-radius: 99px; background: #f0f0ee; color: #6f6f6f; font: 600 9px/1 var(--mono); }
.status.ready { background: var(--green); color: var(--green-ink); }
.project-description { min-height: 48px; margin: 13px 0 0; color: #666; font-size: 12px; line-height: 1.65; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.project-tags span { padding: 5px 7px; border-radius: 5px; background: var(--soft); color: #717171; font: 9px/1 var(--mono); }
.project-actions { display: flex; gap: 17px; margin-top: 15px; }
.project-actions a, .project-actions button { padding: 0; border: 0; background: none; cursor: pointer; font-size: 11px; font-weight: 650; text-decoration: underline; text-underline-offset: 4px; }

/* Agent preview */
.agent-preview { padding: 22px; background: #f1f3ef; }
.mock-browser { height: 100%; overflow: hidden; border: 1px solid #d8dcd5; border-radius: 8px; background: white; box-shadow: 0 9px 22px rgba(0,0,0,.05); }
.mock-bar { display: flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-bottom: 1px solid #ececec; }
.mock-bar i { width: 5px; height: 5px; border-radius: 50%; background: #c5c5c5; }
.mock-bar span { margin-left: auto; color: #999; font: 7px/1 var(--mono); }
.mock-app { display: grid; grid-template-columns: 23% 1fr; height: calc(100% - 28px); }
.mock-app aside { display: flex; flex-direction: column; gap: 13px; padding: 13px; border-right: 1px solid #ececec; background: #fafaf7; }
.mock-app aside b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: #d7ff6f; font: 7px/1 var(--mono); }
.mock-app aside span { width: 80%; height: 5px; border-radius: 3px; background: #e2e3df; }
.mock-app main { padding: 8% 8%; }
.mock-app main small { color: #999; font: 6px/1 var(--mono); letter-spacing: .06em; }
.mock-app main h3 { margin: 10px 0; font-size: clamp(15px, 2.2vw, 28px); line-height: 1.04; letter-spacing: -.04em; }
.mock-input { display: flex; align-items: center; justify-content: space-between; margin-top: 10%; padding: 9px; border: 1px solid #ddd; border-radius: 7px; color: #aaa; font-size: 7px; }
.mock-input b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: var(--ink); color: white; }

/* Intelligent TCM diagnosis preview */
.medicine-preview { display: grid; place-items: center; padding: 22px; background: #f4f1eb; }
.medicine-shell { width: 100%; height: 100%; overflow: hidden; border: 1px solid #ded8cd; border-radius: 8px; background: #fffdf9; box-shadow: 0 9px 22px rgba(67,49,27,.06); }
.medicine-header { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-bottom: 1px solid #eee8de; }
.medicine-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #294f45; color: #fff; font: 700 13px/1 serif; }
.medicine-header div { display: flex; flex-direction: column; gap: 4px; }
.medicine-header b { font-size: 10px; letter-spacing: .04em; }
.medicine-header small { color: #8a8378; font: 6px/1 var(--mono); letter-spacing: .08em; }
.medicine-header i { margin-left: auto; padding: 5px 7px; border-radius: 99px; background: #e8f0e7; color: #315b49; font: 700 7px/1 var(--mono); font-style: normal; }
.medicine-content { display: grid; grid-template-columns: minmax(120px, .9fr) 1.1fr; grid-template-rows: 1fr auto; align-items: center; gap: 8px 24px; height: calc(100% - 52px); padding: 20px 26px; }
.medicine-pulse { display: flex; align-items: center; gap: 4px; height: 74px; padding: 0 13px; border-radius: 7px; background: #294f45; }
.medicine-pulse span { display: block; flex: 1; height: 2px; background: #d5e4b1; transform-origin: center; }
.medicine-pulse span:nth-child(2) { transform: scaleY(8) rotate(8deg); }
.medicine-pulse span:nth-child(3) { transform: scaleY(22) rotate(-12deg); }
.medicine-pulse span:nth-child(4) { transform: scaleY(12) rotate(10deg); }
.medicine-pulse span:nth-child(5) { transform: scaleY(4) rotate(-6deg); }
.medicine-content > p { margin: 0; color: #3d3a34; font-size: clamp(11px, 1.5vw, 16px); font-weight: 650; line-height: 1.55; letter-spacing: -.02em; }
.medicine-methods { grid-column: 1 / -1; display: flex; gap: 8px; }
.medicine-methods span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #d8d1c5; border-radius: 50%; color: #645e54; font: 700 10px/1 serif; }

/* LLM preview */
.llm-preview { display: grid; place-items: center; padding: 7%; background: #f7f7f5; }
.pipeline { display: grid; grid-template-columns: repeat(5, auto); align-items: center; gap: 12px; width: 100%; }
.pipeline div { min-height: 105px; padding: 17px; border: 1px solid #d8d8d8; border-radius: 7px; background: white; }
.pipeline div:nth-of-type(2) { border-color: #999; }
.pipeline span, .pipeline b { display: block; }
.pipeline span { color: #999; font: 7px/1 var(--mono); }
.pipeline b { margin-top: 26px; font-size: clamp(9px, 1.2vw, 13px); line-height: 1.5; }
.pipeline i { color: #aaa; font-style: normal; }

/* Simulation preview */
.simulation-preview { background-color: #f3f4f1; background-image: linear-gradient(#e6e8e3 1px, transparent 1px), linear-gradient(90deg,#e6e8e3 1px,transparent 1px); background-size: 28px 28px; }
.road-map { position: absolute; inset: 0; }
.road-map p { position: absolute; right: 19px; bottom: 16px; margin: 0; padding: 7px 9px; border-radius: 5px; background: white; font: 700 8px/1 var(--mono); }
.road { position: absolute; background: #d0d3cf; }
.road.horizontal { left: 0; right: 0; top: 46%; height: 54px; border-top: 1px solid #a8ada8; border-bottom: 1px solid #a8ada8; }
.road.horizontal::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed white; }
.road.vertical { top: 0; bottom: 0; left: 35%; width: 54px; border-left: 1px solid #a8ada8; border-right: 1px solid #a8ada8; }
.road.vertical::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px dashed white; }
.car { position: absolute; z-index: 2; width: 18px; height: 9px; border-radius: 3px; background: #555; }
.car.c1 { left: 14%; top: calc(46% + 12px); }.car.c2 { left: calc(35% + 18px); top: 20%; transform: rotate(90deg); }.car.c3 { right: 19%; top: calc(46% + 34px); }
.rsu { position: absolute; z-index: 3; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #999; border-radius: 50%; background: white; font: normal 7px/1 var(--mono); }
.rsu.r1 { left: 26%; top: 30%; }.rsu.r2 { right: 24%; bottom: 18%; }

.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 110px; padding: 24px max(20px, calc((100% - var(--max)) / 2)); border-top: 1px solid var(--line); color: #777; font-size: 10px; }
.site-footer > div { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.site-footer strong { color: var(--ink); }.site-footer i { font-style: normal; }
.site-footer a:hover { color: var(--ink); }

.project-dialog { width: min(620px, calc(100% - 30px)); padding: 34px; border: 0; border-radius: 14px; box-shadow: 0 30px 90px rgba(0,0,0,.2); }
.project-dialog::backdrop { background: rgba(0,0,0,.38); }
.dialog-close { position: absolute; right: 17px; top: 16px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; }
.project-dialog > p:first-of-type { margin: 0 0 10px; color: #898989; font: 700 9px/1 var(--mono); text-transform: uppercase; }
.project-dialog h2 { margin: 0; padding-right: 40px; font-size: 30px; letter-spacing: -.035em; }
.dialog-content { margin-top: 24px; color: #555; font-size: 13px; line-height: 1.8; }
.dialog-content p { margin: 0 0 12px; }
.dialog-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.dialog-tags span { padding: 6px 8px; border-radius: 5px; background: var(--soft); color: #676767; font: 9px/1 var(--mono); }
.dialog-note { margin: 24px 0 0 !important; padding-top: 17px; border-top: 1px solid var(--line); color: #999; font-size: 10px; }

@media (max-width: 850px) {
  .profile-layout { grid-template-columns: 1fr; gap: 45px; padding-top: 60px; }
  .profile-facts { max-width: 520px; }
  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .header-inner, .profile-section, .projects-section { width: min(100% - 28px, var(--max)); }
  .menu-button { display: block; }
  .main-nav { position: absolute; left: 0; right: 0; top: 64px; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 14px 16px; border-bottom: 1px solid var(--line); background: white; }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 12px; border-bottom: 1px solid var(--line); }
  .profile-section { padding-top: 28px; }
  .profile-layout { padding-top: 46px; }
  .profile-summary { font-size: 15px; }
  .profile-categories { grid-template-columns: 1fr; }
  .projects-toolbar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .projects-toolbar > p { align-self: flex-end; margin-top: -48px; }
  .project-preview { aspect-ratio: 4 / 3; }
  .medicine-content { grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 10px; padding: 14px 18px; }
  .medicine-pulse { height: 46px; }
  .medicine-methods { grid-column: 1; }
  .pipeline { gap: 5px; }
  .pipeline div { padding: 10px; }.pipeline b { font-size: 8px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

/* Readability: keep supporting copy comfortably legible and high-contrast. */
.main-nav { font-size: 14px; }
.main-nav a { color: #343434; }
.breadcrumbs { color: #5f5f5f; font-size: 14px; }
.breadcrumbs b { color: #777; }
.breadcrumbs strong { color: #333; }
.profile-label { color: #505050; font-size: 12px; }
.profile-facts dt { color: #565656; font-size: 13px; }
.profile-facts dd { font-size: 14px; }
.profile-facts dd span { color: #5d5d5d; }
.profile-categories h2 { font-size: 18px; }
.profile-categories p { color: #555; font-size: 13px; }
.filters button, .projects-toolbar > p { font-size: 13px; }
.projects-toolbar > p { color: #4f4f4f; }
.project-title-row p { color: #575757; font-size: 11px; }
.status { color: #4f4f4f; font-size: 11px; }
.project-description { color: #454545; font-size: 14px; }
.project-tags span { color: #4f4f4f; font-size: 11px; }
.project-actions a, .project-actions button { font-size: 13px; }
.site-footer { color: #555; font-size: 13px; }
.project-dialog > p:first-of-type { color: #565656; font-size: 11px; }
.dialog-content { color: #3f3f3f; font-size: 14px; }
.dialog-tags span { color: #4b4b4b; font-size: 11px; }
.dialog-note { color: #5c5c5c; font-size: 13px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
