/* Public-surface density pass: fewer first-level sections, less chrome, same useful signal. */

.section {
  padding-top: clamp(70px, 8vw, 108px);
  padding-bottom: clamp(70px, 8vw, 108px);
}

.section-heading {
  max-width: 700px;
  margin-bottom: 34px;
}

.section-heading.compact { margin-bottom: 30px; }

.section-heading > p:last-child,
.elsewhere-copy,
.hero-copy {
  max-width: 58ch;
  line-height: 1.66;
}

h1 {
  max-width: 900px;
  font-size: clamp(3.15rem, 7.2vw, 6.65rem);
  line-height: .98;
  letter-spacing: -.058em;
}

h2 {
  font-size: clamp(2.3rem, 4.35vw, 4.45rem);
  line-height: 1.01;
  letter-spacing: -.047em;
}

/* Selected work: editorial index rather than a card wall. */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-card {
  min-height: 272px;
  padding: 26px 28px 24px;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  position: relative;
}

.project-card + .project-card { border-left: 1px solid var(--line); }
.project-card::after { content: none; }

.project-card .micro {
  color: var(--muted);
  margin-bottom: 26px;
}

.project-card h3 {
  font-size: clamp(1.55rem, 2.15vw, 2.05rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  margin-bottom: 12px;
}

.project-card > p:not(.micro) {
  color: var(--muted);
  max-width: 37ch;
  line-height: 1.62;
}

.project-meta {
  list-style: none;
  padding: 0;
  margin: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.project-meta li {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .69rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .035em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  font-weight: 760;
}

.project-link span:last-child { transition: transform .18s ease; }
a.project-link:hover span:last-child { transform: translate(3px, -3px); }

/* Recent evidence now belongs to Work, not its own first-level section. */
.recent-block {
  margin-top: 34px;
  display: grid;
  grid-template-columns: minmax(190px, .32fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.recent-heading .micro {
  color: var(--muted);
  margin-bottom: 10px;
}

.recent-heading h3 {
  font-size: clamp(1.25rem, 2vw, 1.72rem);
  line-height: 1.15;
  letter-spacing: -.035em;
  margin: 0;
  max-width: 16ch;
}

.recent-list { border-top: 1px solid var(--line); }

.recent-item {
  display: grid;
  grid-template-columns: minmax(150px, .32fr) minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}

.trace-meta {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.recent-copy {
  margin: 0;
  color: var(--ink);
  font-size: .98rem;
  line-height: 1.5;
}

.trace-state {
  white-space: nowrap;
  font-size: .72rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
}

/* Path: replace repeated card grammar with a quiet route index. */
.route-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 30px);
}

.route-card {
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.route-step {
  width: auto;
  height: auto;
  display: inline-block;
  margin: 0 0 20px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 760;
}

.route-context {
  display: block;
  min-height: 2.6em;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.route-card h3 {
  font-size: 1.26rem;
  margin-bottom: 8px;
}

.route-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* Principles are compressed into one panel inside Path. */
.defaults-panel {
  margin-top: 42px;
  padding: 26px 0 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(180px, .28fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
}

.defaults-intro .micro {
  color: var(--muted);
  margin-bottom: 10px;
}

.defaults-intro h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.default-lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.default-lines article { min-width: 0; }
.default-lines h4 {
  margin: 0 0 7px;
  font-size: .96rem;
  line-height: 1.25;
}
.default-lines p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}

.working-loop {
  grid-column: 2;
  margin: 6px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .72rem;
  font-weight: 760;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.working-loop b { color: var(--muted); font-weight: 500; }

.human-inline {
  padding: 20px 0 0;
  display: grid;
  grid-template-columns: minmax(180px, .28fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: baseline;
}

.human-inline .micro { color: var(--muted); margin: 0; }
.human-inline p { margin: 0; color: var(--muted); }

/* Contact and links share one closing section. */
.elsewhere {
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  align-items: start;
  gap: clamp(42px, 7vw, 96px);
}

.elsewhere-copyblock h2 { max-width: 780px; }
.elsewhere-copy { margin-bottom: 24px; }
.connect-tags { margin-top: 0; max-width: 680px; }

.link-list { border-top: 1px solid var(--line); }
.root-note {
  margin: 20px 0 0;
  max-width: 38ch;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.6;
}

/* Remove redundant depth cues; hierarchy now comes from type and rules. */
.focus-card { box-shadow: none; }

@media (hover: hover) and (pointer: fine) {
  .project-card { transition: background .18s ease; }
  .project-card:hover { background: rgba(255,255,255,.18); }
}

/* CJK typography: never inherit Latin negative tracking. */
html[lang="zh-CN"] body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.72;
}

html[lang="zh-CN"] h1,
html[lang="zh-CN"] h2,
html[lang="zh-CN"] h3,
html[lang="zh-CN"] h4,
html[lang="zh-CN"] .mini-title,
html[lang="zh-CN"] .project-card h3,
html[lang="zh-CN"] .recent-heading h3 {
  letter-spacing: 0;
  word-break: normal;
  overflow-wrap: break-word;
}

html[lang="zh-CN"] h1 {
  font-size: clamp(2.9rem, 6.5vw, 5.8rem);
  line-height: 1.12;
  font-weight: 720;
}

html[lang="zh-CN"] h1 em { letter-spacing: 0; }
html[lang="zh-CN"] h2 { line-height: 1.14; font-weight: 700; }
html[lang="zh-CN"] h3,
html[lang="zh-CN"] .project-card h3 { line-height: 1.28; font-weight: 680; }

html[lang="zh-CN"] p,
html[lang="zh-CN"] .hero-copy,
html[lang="zh-CN"] .section-heading > p:last-child,
html[lang="zh-CN"] .elsewhere-copy { line-height: 1.78; }

html[lang="zh-CN"] .hero-copy,
html[lang="zh-CN"] .section-heading > p:last-child,
html[lang="zh-CN"] .elsewhere-copy { max-width: 36em; }

html[lang="zh-CN"] .hero-kicker,
html[lang="zh-CN"] .eyebrow,
html[lang="zh-CN"] .micro,
html[lang="zh-CN"] .route-context,
html[lang="zh-CN"] .trace-meta { letter-spacing: .03em; }

html[lang="zh-CN"] .tag-list li,
html[lang="zh-CN"] .hero-tags li { line-height: 1.35; }

@media (max-width: 980px) {
  .project-grid { grid-template-columns: 1fr; }
  .project-card { min-height: 0; padding: 24px 0; }
  .project-card + .project-card { border-left: 0; border-top: 1px solid var(--line); }

  .route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .defaults-panel { grid-template-columns: 1fr; gap: 22px; }
  .working-loop { grid-column: 1; }
  .human-inline { grid-template-columns: 1fr; gap: 8px; }

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

@media (max-width: 720px) {
  .hero { padding-top: 58px; padding-bottom: 72px; }
  .note-card { display: none; }
  .system-map { min-height: 210px; }

  .recent-block { grid-template-columns: 1fr; gap: 18px; }
  .recent-heading h3 { max-width: none; }
  .recent-item { grid-template-columns: 1fr auto; gap: 8px 14px; }
  .recent-copy { grid-column: 1 / -1; grid-row: 2; }
  .trace-state { justify-self: end; }

  .route-grid { grid-template-columns: 1fr; gap: 28px; }
  .route-context { min-height: 0; }

  .default-lines { grid-template-columns: 1fr; gap: 0; }
  .default-lines article { padding: 14px 0; border-top: 1px solid var(--line); }
  .default-lines article:last-child { padding-bottom: 4px; }

  h1 { letter-spacing: -.045em; }
  html[lang="zh-CN"] h1 { letter-spacing: 0; }
}

@media (max-width: 560px) {
  .section { padding-top: 58px; padding-bottom: 58px; }
  .section-heading, .section-heading.compact { margin-bottom: 26px; }
  .project-card { padding: 21px 0; }
  .project-card .micro { margin-bottom: 18px; }
  .recent-item { padding: 16px 0; }
  .trace-state { font-size: .67rem; }
  .defaults-panel { margin-top: 34px; padding-top: 22px; }
  .human-inline { padding-top: 16px; }
  html[lang="zh-CN"] h1 { font-size: clamp(2.65rem, 12vw, 4.15rem); }
}
/* Full-width identity banner, followed by aligned copy and focus panels. */
.hero-layout { align-items: start; }
.hero-identity {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 120px minmax(0, 1fr);
  align-items: end; align-content: center; gap: 24px; margin-bottom: 8px;
  grid-column: 1 / -1;
  min-height: 196px; padding: 24px; border-radius: 20px;
  border: 1px solid var(--line); background: #343e43;
}
.hero-identity::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: url('/assets/portrait/coastal-banner.jpg') center 25% / cover;
}
.hero-identity::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(12,20,24,.02) 20%, rgba(12,20,24,.5));
}
:root .hero-identity .hero-kicker {
  margin: 0; min-width: 0; color: #fff;
  background: #202421; border-color: rgba(255,255,255,.25);
  line-height: 1.6; justify-self: start;
}
.hero-avatar {
  display: block; width: 120px; height: 120px; flex: 0 0 120px;
  border-radius: 50%; object-fit: cover; object-position: 38% 50%;
  border: 2px solid rgba(255,255,255,.9);
}
@media (max-width: 600px) {
  .hero-identity {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 14px; padding: 20px 16px; min-height: 220px; border-radius: 16px;
  }
  .hero-avatar { width: 80px; height: 80px; flex-basis: 80px; }
  :root .hero-identity .hero-kicker { align-self: flex-start; max-width: 100%; transform: none; }
}

/* The identity banner needs a compact gap below navigation. */
.hero { padding-top: clamp(24px, 3vw, 40px); }

/* Hero refinement: consistent main/subtitle hierarchy in both languages. */
.hero-copyblock #hero-title {
  margin: 30px 0 32px;
  line-height: 1.1;
}
.hero-copyblock #hero-title .hero-title-main,
.hero-copyblock #hero-title .hero-title-sub {
  display: block;
}
.hero-copyblock #hero-title .hero-title-sub {
  width: fit-content;
  max-width: 100%;
  margin-top: .38em;
  font-size: .72em;
  line-height: 1.2;
  letter-spacing: -.035em;
}
html[lang="zh-CN"] .hero-copyblock #hero-title {
  line-height: 1.19;
}
html[lang="zh-CN"] .hero-copyblock #hero-title .hero-title-sub {
  font-size: .69em;
  line-height: 1.36;
  letter-spacing: 0;
}
@media (max-width: 720px) {
  .hero-copyblock #hero-title {
    margin: 34px 0;
    font-size: clamp(2.6rem, 10.4vw, 4.2rem);
    line-height: 1.14;
  }
  html[lang="zh-CN"] .hero-copyblock #hero-title {
    font-size: clamp(2.55rem, 10.6vw, 3.8rem);
    line-height: 1.18;
  }
}
@media (max-width: 600px) {
  /* Shift only the mobile identity label; preserve the portrait position. */
  :root .hero-identity .hero-kicker {
    transform: translateY(36px);
  }
}

/* Ensure the emphasis is legible against both page themes. */
.hero-copyblock #hero-title .hero-title-sub {
  color: #865e00;
}
:root[data-theme="dark"] .hero-copyblock #hero-title .hero-title-sub {
  color: #ffd84d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .hero-copyblock #hero-title .hero-title-sub {
    color: #ffd84d;
  }
}
