:root {
  --bg: #06131f;
  --bg-soft: #0b1f31;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --text: #f7efe2;
  --muted: #adc0c7;
  --muted-strong: #d9e4e3;
  --line: rgba(255, 255, 255, 0.18);
  --gold: #f3b35a;
  --coral: #e66c58;
  --blue: #4aa7c7;
  --deep: #020910;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 8px;
  --max: 1160px;
  --default-bg-image: url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=2400&q=85");
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 85% 8%, rgba(230, 108, 88, 0.16), transparent 24rem),
    radial-gradient(circle at 15% 35%, rgba(74, 167, 199, 0.14), transparent 26rem),
    linear-gradient(180deg, #081827 0%, var(--bg) 42%, #03080d 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

body.has-page-background {
  background:
    radial-gradient(circle at 85% 8%, rgba(230, 108, 88, 0.16), transparent 24rem),
    radial-gradient(circle at 15% 35%, rgba(74, 167, 199, 0.14), transparent 26rem),
    linear-gradient(180deg, rgba(8, 24, 39, 0.86) 0%, rgba(6, 19, 31, 0.82) 42%, rgba(3, 8, 13, 0.94) 100%),
    var(--page-bg-image);
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 70%, transparent);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(180deg, rgba(4, 13, 22, 0.48), rgba(4, 13, 22, 0.74)),
    var(--page-bg-image, var(--default-bg-image));
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity 240ms ease;
}

body.has-page-background::after {
  opacity: 1;
}

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

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--coral), var(--blue));
}

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 20;
  display: flex;
  width: min(calc(100% - 32px), var(--max));
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(2, 9, 16, 0.68);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px);
  transform: translateX(-50%);
}

.brand,
.site-nav {
  display: flex;
  align-items: center;
}

.brand {
  flex: 0 0 auto;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    linear-gradient(180deg, transparent 46%, rgba(6, 19, 31, 0.9) 47%),
    radial-gradient(circle at 50% 44%, var(--gold) 0 28%, transparent 29%),
    linear-gradient(180deg, #e66c58, #1e6a86);
  box-shadow: 0 0 24px rgba(243, 179, 90, 0.38);
}

.site-nav {
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.1;
  transition: color 180ms ease, background 180ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: end;
  gap: 42px;
  padding: 150px max(24px, calc((100vw - var(--max)) / 2)) 74px;
  overflow: hidden;
}

.sunset-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(2, 9, 16, 0.82) 0%, rgba(2, 9, 16, 0.42) 47%, rgba(2, 9, 16, 0.68) 100%),
    linear-gradient(180deg, rgba(4, 13, 22, 0.1) 0%, rgba(4, 13, 22, 0.2) 42%, #06131f 100%),
    var(--page-bg-image, var(--default-bg-image));
  background-position: center;
  background-size: cover;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-video[hidden] {
  display: none;
}

.sunset-scene::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 207, 128, 0.16), transparent 18rem),
    linear-gradient(180deg, rgba(2, 9, 16, 0) 0%, rgba(2, 9, 16, 0.26) 52%, #06131f 100%);
  pointer-events: none;
}

.hero-content {
  max-width: 780px;
  min-width: 0;
}

.section-code {
  margin: 0 0 16px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: 68px;
  line-height: 1.05;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-copy {
  max-width: 650px;
  margin-bottom: 32px;
  color: var(--muted-strong);
  font-size: 19px;
}

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

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), var(--coral));
  color: #1c0d08;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.hero-card,
.profile-card,
.profile-photo,
.timeline-item,
.finance-feature,
.principle,
.knowledge-card,
.note-card,
.section-search input {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  padding: 24px;
  align-self: end;
  min-width: 0;
}

.hero-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.hero-card strong {
  display: block;
  margin-bottom: 16px;
  font-size: 22px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-card p,
.section-heading p,
.profile-card p,
.timeline-item p,
.finance-feature p,
.principle p,
.knowledge-card p,
.note-card cite,
.site-footer {
  color: var(--muted);
}

.section {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
  padding: 110px 0;
}

.page-main {
  min-height: 100vh;
  padding-top: 74px;
}

.page-main .section {
  padding-top: 126px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.7fr);
  gap: 36px;
  align-items: end;
  margin-bottom: 38px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 44px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.section-heading p:last-child {
  margin-bottom: 0;
  white-space: pre-line;
}

.section-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -10px 0 28px;
}

.section-search {
  display: block;
  width: min(100%, 460px);
}

.section-search span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.section-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 180ms ease, background 180ms ease;
}

.section-search input:focus {
  border-color: rgba(243, 179, 90, 0.72);
  background: var(--panel-strong);
}

.section-search input::placeholder {
  color: rgba(173, 192, 199, 0.72);
}

.section-empty {
  margin: 28px 0 0;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

.profile-section {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 38px 22px;
}

.profile-section .section-heading,
.profile-grid {
  display: contents;
}

.profile-section .section-code {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
}

.profile-section .section-heading h2 {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
}

.profile-section .section-heading p:last-child {
  grid-column: 1;
  grid-row: 2;
}

.profile-section .section-tools {
  grid-column: 1;
  grid-row: 3;
  align-self: start;
  margin: 0;
}

.profile-section .profile-card {
  grid-column: 1;
  grid-row: 4;
}

.profile-section .profile-photo {
  grid-column: 2;
  grid-row: 2 / 5;
  align-self: stretch;
}

.profile-grid {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: start;
  gap: 22px;
}

.profile-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 26px;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    var(--panel);
}

.avatar {
  display: grid;
  width: 112px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(243, 179, 90, 0.34);
  border-radius: 50%;
  background:
    linear-gradient(180deg, transparent 47%, rgba(6, 19, 31, 0.86) 48%),
    radial-gradient(circle at 50% 42%, var(--gold) 0 30%, transparent 31%),
    linear-gradient(180deg, #e66c58, #236a80);
  color: rgba(255, 255, 255, 0.88);
  font-family: Georgia, serif;
  font-size: 42px;
  box-shadow: 0 18px 60px rgba(243, 179, 90, 0.22);
}

.avatar.has-image {
  background: rgba(255, 255, 255, 0.08);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card h3,
.timeline-item h3,
.finance-feature h3,
.principle h3,
.knowledge-card h3 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.3;
}

.profile-photo {
  position: relative;
  min-height: 260px;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(74, 167, 199, 0.18), rgba(230, 108, 88, 0.12)),
    var(--panel);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.profile-photo figcaption {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 26px;
  color: var(--muted);
  font-size: 15px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
}

.plain-list {
  display: grid;
  gap: 18px;
}

.timeline::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 110px;
  width: 1px;
  content: "";
  background: linear-gradient(var(--gold), rgba(255, 255, 255, 0.08));
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 26px;
  padding: 26px 30px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045));
}

.plain-entry {
  grid-template-columns: 1fr;
}

.timeline-item::before {
  position: absolute;
  top: 34px;
  left: 104px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  content: "";
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(243, 179, 90, 0.14);
}

.plain-entry::before {
  display: none;
}

.plain-entry p {
  margin-bottom: 0;
}

.plain-entry cite {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-style: normal;
  font-size: 14px;
}

time {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 20px;
}

.finance-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 22px;
}

.finance-feature {
  min-height: 420px;
  padding: 34px;
  background:
    radial-gradient(circle at 78% 20%, rgba(243, 179, 90, 0.18), transparent 12rem),
    linear-gradient(145deg, rgba(230, 108, 88, 0.14), rgba(255, 255, 255, 0.04));
}

.big-number {
  display: block;
  margin-bottom: 90px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 92px;
  line-height: 0.9;
}

.principles {
  display: grid;
  gap: 18px;
}

.principle {
  padding: 24px;
}

.principle span,
.card-index {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(243, 179, 90, 0.34);
  border-radius: 50%;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.knowledge-grid,
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.knowledge-card,
.note-card {
  min-height: 260px;
  padding: 28px;
}

.knowledge-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045)),
    var(--panel);
}

.note-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(74, 167, 199, 0.16), transparent 9rem),
    var(--panel);
}

.note-card p {
  color: var(--muted-strong);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 24px;
  line-height: 1.55;
}

.note-card cite {
  font-style: normal;
  font-size: 14px;
}

.site-footer {
  display: flex;
  width: min(calc(100% - 48px), var(--max));
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 50px 0 54px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.site-footer p {
  margin-bottom: 0;
}

.site-footer a {
  color: var(--gold);
  font-weight: 700;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.profile-section .profile-card.reveal,
.profile-section .profile-photo.reveal {
  opacity: 1;
  transform: none;
}

@keyframes drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-360px);
  }
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 190px;
  }

  .hero-card {
    width: 100%;
    max-width: 520px;
  }

  h1 {
    font-size: 50px;
  }

  .profile-section {
    display: block;
  }

  .profile-section .section-heading,
  .profile-grid {
    display: grid;
  }

  .profile-section .section-code,
  .profile-section .section-heading h2,
  .profile-section .section-heading p:last-child,
  .profile-section .section-tools,
  .profile-section .profile-card,
  .profile-section .profile-photo {
    grid-column: auto;
    grid-row: auto;
  }

  .section-heading,
  .profile-grid,
  .finance-layout,
  .knowledge-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-header {
    top: 10px;
    width: min(calc(100% - 20px), var(--max));
    padding: 12px;
  }

  .site-nav a {
    padding: 7px 8px;
    font-size: 13px;
  }

  .hero {
    padding: 198px 20px 62px;
    width: 100%;
  }

  .sun {
    left: 60%;
    width: 140px;
  }

  h1 {
    font-size: 34px;
    line-height: 1.12;
    word-break: break-all;
  }

  .hero-copy {
    font-size: 16px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .hero-content,
  .hero-card {
    width: 100%;
    max-width: 350px;
  }

  .hero-card strong {
    font-size: 20px;
    word-break: break-all;
  }

  .section {
    width: min(calc(100% - 32px), var(--max));
    padding: 78px 0;
  }

  .section-heading h2 {
    font-size: 34px;
  }

  .profile-card,
  .profile-photo,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .profile-card {
    padding: 26px;
  }

  .timeline::before,
  .timeline-item::before {
    display: none;
  }

  .big-number {
    margin-bottom: 58px;
    font-size: 70px;
  }

  .note-card p {
    font-size: 21px;
  }

  .site-footer {
    flex-direction: column;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
