:root {
  --paper: #f7f1e3;
  --paper-deep: #eee3cf;
  --ink: #2f2a24;
  --muted: #746b60;
  --faint: #a79a8b;
  --line: #d9cbb8;
  --card: rgba(255, 250, 240, 0.72);
  --accent: #c96442;
  --accent-dark: #9d4c32;
  --shadow: 0 28px 80px rgba(84, 61, 36, 0.13);
  --serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
  background:
    radial-gradient(circle at 16% 14%, rgba(201, 100, 66, 0.13), transparent 24rem),
    radial-gradient(circle at 86% 8%, rgba(90, 73, 48, 0.08), transparent 20rem),
    linear-gradient(120deg, rgba(47, 42, 36, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: auto, auto, 18px 18px, auto;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.26;
  background-image:
    linear-gradient(rgba(47, 42, 36, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 42, 36, 0.05) 1px, transparent 1px);
  background-size: 4px 4px, 7px 7px;
  mix-blend-mode: multiply;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: 91vh;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.08rem, 1.7vw, 1.35rem);
  text-decoration: none;
}

.brand-mark span,
.section-kicker span {
  width: 28px;
  aspect-ratio: 1;
  display: inline-block;
  background: var(--accent);
  clip-path: polygon(
    50% 0%,
    57% 35%,
    88% 12%,
    65% 43%,
    100% 50%,
    65% 57%,
    88% 88%,
    57% 65%,
    50% 100%,
    43% 65%,
    12% 88%,
    35% 57%,
    0% 50%,
    35% 43%,
    12% 12%,
    43% 35%
  );
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover,
.record-links a:hover {
  color: var(--accent-dark);
}

.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: center;
  gap: clamp(32px, 7vw, 96px);
  padding: 56px 0 84px;
}

.eyebrow,
.section-kicker p,
.card-index {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 900px;
  margin: 14px 0 24px;
  font-family: var(--serif);
  font-size: clamp(4.6rem, 11vw, 9.4rem);
  font-weight: 400;
  line-height: 0.92;
}

.hero h1 span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(2.15rem, 4.8vw, 4.8rem);
  white-space: nowrap;
}

.hero-lede {
  max-width: 750px;
  margin: 0;
  color: #4a4238;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.8vw, 2.45rem);
  line-height: 1.42;
}

.hero-briefs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-briefs span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(117, 101, 82, 0.2);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--muted);
  background: rgba(255, 250, 240, 0.36);
  font-size: 0.9rem;
}

.avatar-stamp {
  position: relative;
  width: min(100%, 370px);
  min-height: 108px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0 0;
  border: 1px solid rgba(117, 101, 82, 0.24);
  border-radius: 999px;
  padding: 12px 46px 12px 12px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.76), rgba(238, 227, 207, 0.46)),
    rgba(255, 250, 240, 0.58);
  box-shadow: 0 18px 50px rgba(84, 61, 36, 0.12);
}

.avatar-frame {
  position: relative;
  width: 82px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(201, 100, 66, 0.28);
  border-radius: 50%;
  background: var(--paper-deep);
  box-shadow: inset 0 0 0 5px rgba(247, 241, 227, 0.78);
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 46%;
}

.avatar-stamp figcaption {
  display: grid;
  gap: 2px;
  margin: 0;
  min-width: 0;
}

.avatar-stamp figcaption span {
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.15;
}

.avatar-stamp figcaption small {
  color: var(--muted);
  font-size: 0.78rem;
}

.avatar-spark {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 24px;
  aspect-ratio: 1;
  background: var(--accent);
  clip-path: polygon(
    50% 0%,
    57% 35%,
    88% 12%,
    65% 43%,
    100% 50%,
    65% 57%,
    88% 88%,
    57% 65%,
    50% 100%,
    43% 65%,
    12% 88%,
    35% 57%,
    0% 50%,
    35% 43%,
    12% 12%,
    43% 35%
  );
  opacity: 0.28;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}

.primary-link,
.quiet-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 18px;
  text-decoration: none;
}

.primary-link {
  color: #fffaf0;
  background: var(--ink);
  box-shadow: 0 12px 28px rgba(47, 42, 36, 0.18);
}

.contact-link {
  min-height: 62px;
  flex-direction: column;
  gap: 1px;
  padding: 9px 24px 10px;
  line-height: 1.18;
}

.contact-link span {
  font-size: 1.06rem;
  font-weight: 700;
}

.contact-link small {
  color: rgba(255, 250, 240, 0.62);
  font-size: 0.78rem;
  font-weight: 500;
}

.quiet-link {
  min-height: 62px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 250, 240, 0.42);
  padding-inline: 26px;
}

.identity-panel {
  position: relative;
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(117, 101, 82, 0.24);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.identity-panel div {
  position: relative;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
}

.identity-panel div:last-child {
  border-bottom: 0;
}

.identity-panel span {
  color: var(--faint);
  font-size: 0.82rem;
}

.identity-panel strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.2;
}

.identity-panel strong em {
  width: 0.42em;
  height: 1px;
  display: inline-block;
  margin: 0 0.3em 0.2em;
  background: currentColor;
  opacity: 0.42;
}

.element-card {
  overflow: hidden;
}

.element-card strong,
.personality-card strong {
  position: relative;
  z-index: 1;
}

.personality-card {
  overflow: hidden;
}

.zodiac-constellation,
.enfp-symbol {
  position: absolute;
  top: 50%;
  right: clamp(18px, 4vw, 36px);
  width: min(34%, 150px);
  min-width: 92px;
  transform: translateY(-50%);
  opacity: 0.18;
  color: var(--accent);
  pointer-events: none;
}

.enfp-symbol {
  width: min(36%, 150px);
  opacity: 0.16;
}

.zodiac-constellation path,
.enfp-symbol path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
}

.enfp-symbol .enfp-bubble {
  stroke-width: 3;
}

.enfp-symbol .enfp-spark {
  stroke-width: 3.8;
}

.zodiac-constellation circle,
.enfp-symbol circle {
  fill: currentColor;
}

.intro-section,
.manifesto {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(28px, 6vw, 84px);
  padding: clamp(72px, 9vw, 118px) 0;
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
}

.intro-copy h2,
.manifesto h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 5.5vw, 5.1rem);
  font-weight: 400;
  line-height: 1.02;
}

.intro-copy p,
.manifesto > p {
  margin: 28px 0 0;
  color: #4b4339;
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
}

.section-heading {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(28px, 6vw, 84px);
  align-items: start;
}

.section-heading h2 {
  max-width: 860px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  font-weight: 400;
  line-height: 1.04;
}

.compact-heading {
  align-items: end;
}

.compact-heading h2 {
  font-size: clamp(2rem, 4vw, 3.65rem);
}

.system-map-section,
.tech-stack-section,
.principles-section,
.timeline-section {
  padding: clamp(72px, 9vw, 118px) 0;
  border-bottom: 1px solid var(--line);
}

.system-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin-top: clamp(36px, 5vw, 58px);
  border: 1px solid rgba(117, 101, 82, 0.26);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(rgba(47, 42, 36, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 42, 36, 0.05) 1px, transparent 1px),
    rgba(255, 250, 240, 0.48);
  background-size: 20px 20px, 20px 20px, auto;
  box-shadow: 0 24px 64px rgba(84, 61, 36, 0.1);
}

.system-map::before {
  position: absolute;
  inset: 78px 8% auto;
  height: 1px;
  background: rgba(157, 76, 50, 0.34);
  content: "";
}

.map-node {
  position: relative;
  min-height: 268px;
  padding: 128px clamp(22px, 3vw, 30px) clamp(24px, 3vw, 30px);
  border-right: 1px solid rgba(117, 101, 82, 0.22);
}

.map-node:last-child {
  border-right: 0;
}

.map-node::before {
  position: absolute;
  top: 72px;
  left: clamp(22px, 3vw, 30px);
  width: 10px;
  aspect-ratio: 1;
  border: 2px solid var(--accent-dark);
  border-radius: 50%;
  background: var(--paper);
  content: "";
}

.map-node:not(:last-child)::after {
  position: absolute;
  top: 73px;
  right: -7px;
  width: 12px;
  aspect-ratio: 1;
  border-top: 1px solid rgba(157, 76, 50, 0.5);
  border-right: 1px solid rgba(157, 76, 50, 0.5);
  background: rgba(255, 250, 240, 0.74);
  transform: rotate(45deg);
  content: "";
}

.map-node p,
.map-node span,
.stack-card p,
.principle-list span {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.map-node h3 {
  max-width: 100%;
  margin: 26px 0 10px;
  font-family: var(--serif);
  font-size: clamp(1.22rem, 1.8vw, 1.7rem);
  font-weight: 400;
  line-height: 1.14;
}

.map-node span {
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
}

.map-node-strong {
  background: rgba(201, 100, 66, 0.08);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.feature-card {
  min-height: 390px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(26px, 3.4vw, 38px);
  border-right: 1px solid var(--line);
}

.feature-card:last-child {
  border-right: 0;
}

.feature-card h2 {
  margin: 22px 0 14px;
  font-family: var(--serif);
  font-size: clamp(1.58rem, 2.7vw, 2.35rem);
  font-weight: 400;
  line-height: 1.05;
}

.feature-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(34px, 5vw, 52px);
}

.stack-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(117, 101, 82, 0.24);
  border-radius: 8px;
  padding: clamp(24px, 3vw, 32px);
  background: rgba(255, 250, 240, 0.5);
}

.stack-card h3 {
  margin: 42px 0 16px;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.3vw, 2.08rem);
  font-weight: 400;
  line-height: 1.08;
}

.stack-card p:last-child {
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.72;
  text-transform: none;
}

.principle-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: clamp(34px, 5vw, 52px);
  border-top: 1px solid var(--line);
}

.principle-list article {
  min-height: 218px;
  padding: clamp(24px, 3vw, 32px) clamp(18px, 2.4vw, 28px);
  border-right: 1px solid var(--line);
}

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

.principle-list h3 {
  margin: 38px 0 12px;
  font-family: var(--serif);
  font-size: clamp(1.32rem, 2vw, 1.78rem);
  font-weight: 400;
  line-height: 1.14;
}

.principle-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.manifesto {
  align-items: start;
}

.manifesto > p {
  margin-top: 6px;
  font-size: clamp(1.16rem, 1.8vw, 1.44rem);
}

.timeline-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 34px);
  margin: clamp(38px, 5vw, 56px) 0 0;
  padding: 0;
  list-style: none;
}

.timeline-list::before {
  position: absolute;
  top: 28px;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--line);
  content: "";
}

.timeline-list li {
  position: relative;
  padding-top: 62px;
}

.timeline-list li::before {
  position: absolute;
  top: 21px;
  left: 0;
  width: 14px;
  aspect-ratio: 1;
  border: 2px solid var(--accent-dark);
  border-radius: 50%;
  background: var(--paper);
  content: "";
}

.timeline-list time {
  display: block;
  color: var(--accent-dark);
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.timeline-list p {
  max-width: 280px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.tag-section {
  padding: clamp(72px, 9vw, 112px) 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.tags span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  color: #4a4034;
  background: rgba(255, 250, 240, 0.48);
  font-size: 0.95rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(238, 227, 207, 0.72);
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner p {
  margin: 0;
}

.record-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
}

.record-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.police-record img {
  flex: 0 0 auto;
}

@media (max-width: 980px) {
  .hero {
    min-height: auto;
  }

  .hero-grid,
  .intro-section,
  .manifesto,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    padding-top: 38px;
  }

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

  .identity-panel div:nth-child(even) {
    border-right: 0;
  }

  .identity-panel div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .identity-panel div {
    border-right: 1px solid var(--line);
  }

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

  .system-map {
    grid-template-columns: 1fr;
  }

  .system-map::before {
    top: 8%;
    right: auto;
    bottom: 8%;
    left: 34px;
    width: 1px;
    height: auto;
  }

  .map-node {
    min-height: 176px;
    border-right: 0;
    border-bottom: 1px solid rgba(117, 101, 82, 0.22);
    padding: 34px clamp(22px, 3vw, 30px) 30px 66px;
  }

  .map-node:last-child {
    border-bottom: 0;
  }

  .map-node::before {
    top: 34px;
    left: 28px;
  }

  .map-node:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -7px;
    left: 29px;
    transform: rotate(135deg);
  }

  .map-node h3 {
    margin-top: 34px;
  }

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

  .principle-list article:nth-child(2n) {
    border-right: 0;
  }

  .principle-list article {
    border-bottom: 1px solid var(--line);
  }

  .principle-list article:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .feature-card:nth-child(2) {
    border-right: 0;
  }

  .feature-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .page-shell,
  .footer-inner {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    min-height: 68px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }

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

  .hero-grid {
    padding-bottom: 58px;
  }

  .hero h1 {
    font-size: clamp(3.25rem, 17vw, 4.7rem);
  }

  .hero h1 span {
    white-space: normal;
  }

  .hero-lede {
    font-size: 1.24rem;
  }

  .avatar-stamp {
    width: 100%;
    min-height: 96px;
    padding-right: 38px;
  }

  .avatar-frame {
    width: 72px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-link,
  .quiet-link {
    width: 100%;
  }

  .identity-panel,
  .content-grid,
  .stack-grid,
  .principle-list,
  .timeline-list {
    grid-template-columns: 1fr;
  }

  .identity-panel div,
  .feature-card,
  .feature-card:nth-child(2) {
    border-right: 0;
  }

  .identity-panel div {
    min-height: 82px;
  }

  .feature-card {
    min-height: 300px;
    border-bottom: 1px solid var(--line);
  }

  .feature-card:last-child {
    border-bottom: 0;
  }

  .system-map-section,
  .tech-stack-section,
  .principles-section,
  .timeline-section {
    padding: 58px 0;
  }

  .stack-card {
    min-height: 220px;
  }

  .principle-list article,
  .principle-list article:nth-child(2n) {
    border-right: 0;
  }

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

  .timeline-list {
    gap: 0;
  }

  .timeline-list::before {
    top: 0;
    right: auto;
    bottom: 0;
    left: 7px;
    width: 1px;
    height: auto;
  }

  .timeline-list li {
    padding: 0 0 38px 36px;
  }

  .timeline-list li:last-child {
    padding-bottom: 0;
  }

  .timeline-list li::before {
    top: 4px;
    left: 0;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 22px 0;
  }

  .record-links {
    justify-content: flex-start;
  }
}
