:root {
  color-scheme: dark;
  --bg: #03070d;
  --line: rgba(161, 176, 202, 0.24);
  --line-soft: rgba(134, 151, 180, 0.17);
  --text: #f4f6f8;
  --dim: #9aa1ad;
  --cyan: #00e5f3;
  --cyan-ink: #001116;
  --cyan-text: #53e6ef;
  --cyan-soft: rgba(0, 229, 243, 0.12);
  --font-ui: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --font-text: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --header-height: 66px;
  --workspace-gap: 24px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

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

button,
input {
  font: inherit;
}

.page-grid {
  position: fixed;
  inset: 60px 0 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(64, 164, 221, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 164, 221, 0.11) 1px, transparent 1px);
  background-size: 72px 68px;
  mask-image: radial-gradient(circle at 54% 22%, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.35) 38%, transparent 77%);
}

.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 59% 33%, rgba(0, 128, 255, 0.24), transparent 22%),
    radial-gradient(circle at 100% 2%, rgba(0, 229, 243, 0.08), transparent 28%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), transparent 55%, rgba(0, 0, 0, 0.26));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 210px 1fr auto;
  align-items: center;
  gap: 26px;
  min-height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(134, 151, 180, 0.23);
  background: rgba(2, 6, 11, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
}

.brand img {
  display: block;
  width: 44px;
  height: auto;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 3.6vw, 56px);
  font-family: var(--font-ui);
  font-size: 18px;
  letter-spacing: -0.08em;
  white-space: nowrap;
}

.main-nav a {
  position: relative;
  padding: 20px 0;
  color: var(--text);
}

.main-nav a:hover {
  color: var(--cyan);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-button,
.contact-button,
.button,
.chips button,
.assistant-input {
  border-radius: 4px;
}

.lang-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 18px;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.lang-button.active {
  background: var(--cyan);
  color: var(--cyan-ink);
}

.lang-button:hover,
.contact-button:hover,
.button:hover,
.chips button:hover {
  transform: translateY(-1px);
}

.contact-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: var(--font-text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.contact-button {
  padding: 0 16px;
  font-size: 16px;
}

.contact-button svg,
.button svg,
.education svg,
.project-row svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--workspace-gap);
  width: min(calc(100vw - 192px), 1556px);
  min-height: calc(100dvh - (var(--header-height) * 2));
  margin: 0 auto;
  padding: 20px 0 0;
}

.hero {
  display: contents;
}

.hero-copy {
  min-height: 0;
  padding: clamp(12px, 2.2vh, 28px) 0 0 8px;
  overflow: visible;
}

.assistant-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(0, 229, 243, 0.8);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.42;
  }
}

h1 {
  display: flex;
  align-items: baseline;
  gap: clamp(14px, 1.9vw, 28px);
  margin: 0 0 12px;
  font-family: var(--font-text);
  font-size: clamp(58px, 5.9vw, 108px);
  line-height: 0.96;
  font-weight: 800;
  letter-spacing: -0.075em;
  text-shadow: 0 2px 20px rgba(255, 255, 255, 0.16);
  white-space: nowrap;
}

h1 .word {
  display: inline-block;
}

.tagline {
  margin: 0 0 14px;
  font-size: clamp(24px, 2.05vw, 34px);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.intro {
  max-width: 760px;
  margin: 0 0 24px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.education {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 28px;
  color: var(--cyan-text);
  font-family: var(--font-ui);
  font-size: 17px;
  letter-spacing: -0.08em;
}

.education svg {
  width: 27px;
  height: 27px;
  stroke-width: 1.55;
}

.hero-actions {
  display: flex;
  gap: clamp(18px, 2.2vw, 32px);
  flex-wrap: wrap;
}

.button {
  min-width: 172px;
  height: 48px;
  padding: 0 24px;
  background: transparent;
  color: var(--cyan);
  font-size: 17px;
}

.button-secondary {
  border-color: rgba(255, 255, 255, 0.66);
  color: var(--text);
}

.button:hover,
.contact-button:hover,
.chips button:hover {
  background: var(--cyan-soft);
  box-shadow: 0 0 26px rgba(0, 229, 243, 0.1);
}

.hero-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.assistant-card,
.data-card {
  background: linear-gradient(135deg, rgba(3, 8, 15, 0.83), rgba(3, 8, 15, 0.61));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 40px rgba(0, 229, 243, 0.018);
}

.assistant-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 20px 24px 18px;
  border-radius: 8px;
}

.assistant-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 4px 14px;
  border-bottom: 1px solid var(--line);
}

.assistant-head h2 {
  margin: 0;
  color: var(--cyan);
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.08em;
}

.assistant-body {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px 4px 16px;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.72;
  letter-spacing: -0.08em;
}

.prompt-mark {
  color: var(--cyan);
}

.assistant-body p {
  margin: 0;
  max-width: 560px;
  white-space: pre-line;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--cyan);
  animation: blink 850ms steps(2, end) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

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

.chips button {
  min-height: 40px;
  border: 1px solid rgba(0, 229, 243, 0.75);
  background: rgba(0, 18, 24, 0.16);
  color: var(--cyan);
  cursor: pointer;
  font-family: var(--font-text);
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.assistant-input {
  display: grid;
  grid-template-columns: 1fr auto;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: rgba(4, 8, 13, 0.72);
}

.assistant-input:focus-within {
  border-color: rgba(0, 229, 243, 0.52);
}

.assistant-input input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 15px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  letter-spacing: -0.08em;
}

.assistant-input input::placeholder {
  color: rgba(244, 246, 248, 0.58);
}

.assistant-input button {
  border: 0;
  padding: 0 20px;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.lower-grid {
  display: contents;
}

.data-card {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 22px 28px 20px;
  border-radius: 6px;
  overflow: hidden;
}

.data-card h2 {
  margin: 0 0 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.matrix {
  display: grid;
  flex: 1 1 auto;
  grid-template-rows: repeat(4, minmax(0, 1fr));
}

.matrix-row {
  display: grid;
  grid-template-columns: 48px 150px minmax(0, 1fr);
  align-items: center;
  min-height: 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-ui);
  letter-spacing: -0.08em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 360ms ease, transform 360ms ease;
}

.matrix-row:last-child {
  border-bottom: 0;
}

.matrix-row.visible {
  opacity: 1;
  transform: translateY(0);
}

.index,
.matrix-row p {
  color: var(--text);
  font-size: 13px;
}

.matrix-row strong {
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.matrix-row p {
  margin: 0;
  line-height: 1.5;
}

.matrix-row:hover strong,
.project-row:hover strong,
.project-row:hover svg {
  color: var(--cyan);
}

.view-all {
  position: absolute;
  right: 26px;
  top: 18px;
  color: var(--dim);
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: -0.06em;
}

.view-all::before {
  content: "→ ";
}

.project-list {
  display: grid;
  flex: 1 1 auto;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.project-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 14px;
  min-height: 0;
  border-bottom: 1px solid var(--line-soft);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 360ms ease, transform 360ms ease;
}

.project-row:last-child {
  border-bottom: 0;
}

.project-row.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-row strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.04em;
  transition: color 160ms ease;
}

.project-row p {
  margin: 0;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.55;
  letter-spacing: -0.08em;
}

.project-action {
  color: var(--cyan);
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.project-row svg {
  width: 28px;
  height: 28px;
  transition: color 160ms ease, transform 160ms ease;
}

.project-row:hover svg {
  transform: translateX(3px);
}

@media (min-width: 1181px) and (max-height: 760px) {
  .shell {
    --workspace-gap: 18px;
    padding-top: 14px;
  }

  h1 {
    font-size: clamp(52px, 5.4vw, 80px);
    margin-bottom: 8px;
  }

  .tagline {
    margin-bottom: 8px;
    font-size: clamp(22px, 2vw, 28px);
  }

  .intro {
    margin-bottom: 14px;
    font-size: 15px;
    line-height: 1.45;
  }

  .education {
    margin-bottom: 18px;
    font-size: 15px;
  }

  .button {
    height: 42px;
  }

  .assistant-card {
    padding: 16px 20px 14px;
  }

  .assistant-head {
    padding-bottom: 10px;
  }

  .assistant-body {
    padding: 14px 4px 10px;
    font-size: 14px;
    line-height: 1.55;
  }

  .chips {
    gap: 10px;
    margin-bottom: 12px;
  }

  .chips button {
    min-height: 34px;
  }

  .assistant-input {
    min-height: 40px;
  }

  .data-card {
    padding: 16px 22px 14px;
  }

  .matrix-row {
    grid-template-columns: 40px 118px minmax(0, 1fr);
  }

  .index,
  .matrix-row p,
  .project-row p {
    font-size: 12px;
  }

  .matrix-row strong,
  .project-row strong {
    font-size: 14px;
  }
}

@media (max-width: 1180px) {
  .shell {
    display: block;
    width: auto;
    height: auto;
    padding: 22px 24px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    order: 3;
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .hero,
  .lower-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero {
    min-height: unset;
  }

  .lower-grid {
    margin-top: 24px;
  }

  .hero-panel {
    padding-top: 4px;
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: auto;
    padding: 14px 16px 0;
    gap: 14px;
  }

  .brand {
    width: 42px;
  }

  .brand img {
    width: 42px;
  }

  .contact-button span {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .lang-button,
  .contact-button {
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
  }

  .main-nav {
    gap: 24px;
    font-size: 15px;
  }

  .main-nav a {
    padding: 4px 0 14px;
  }

  .shell {
    padding: 26px 16px;
  }

  .hero-copy {
    padding: 0;
  }

  .education,
  .intro,
  .assistant-body,
  .assistant-input input,
  .assistant-input button {
    font-size: 16px;
  }

  h1 {
    gap: 10px;
    font-size: clamp(56px, 18vw, 88px);
    letter-spacing: -0.075em;
    white-space: normal;
  }

  .tagline {
    font-size: 26px;
  }

  .hero-actions {
    gap: 14px;
  }

  .button {
    flex: 1 1 100%;
    min-width: 0;
    height: 56px;
    font-size: 18px;
  }

  .assistant-card {
    min-height: 0;
    padding: 20px 16px 16px;
  }

  .assistant-head h2 {
    font-size: 18px;
  }

  .assistant-body {
    min-height: 128px;
    line-height: 1.75;
  }

  .chips {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .chips button {
    min-height: 48px;
    font-size: 14px;
  }

  .assistant-input {
    min-height: 54px;
  }

  .data-card {
    padding: 22px 18px;
  }

  .matrix-row {
    grid-template-columns: 42px 100px 1fr;
    align-items: start;
    min-height: 0;
    padding: 16px 0;
  }

  .index,
  .matrix-row p,
  .project-row p {
    font-size: 14px;
  }

  .matrix-row strong,
  .project-row strong {
    font-size: 16px;
  }

  .project-row {
    grid-template-columns: 1fr 24px;
    grid-template-rows: auto auto auto;
    row-gap: 8px;
    column-gap: 8px;
    min-height: 124px;
    padding: 14px 0;
  }

  .project-action {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
    width: max-content;
    margin-top: 2px;
  }

  .project-row p {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .project-row svg {
    grid-column: 2;
    grid-row: 1;
  }
}

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