:root {
  --paper: #f3f7f1;
  --paper-deep: #e4ede5;
  --ink: #13221b;
  --muted: #55675e;
  --line: #cad9ce;
  --line-dark: #9bb2a3;
  --teal: #18745a;
  --teal-dark: #0c4c39;
  --red: #c38c45;
  --red-dark: #96692f;
  --white: #ffffff;
  --max: 1180px;
  --gutter: 64px;
  --ease: cubic-bezier(.22, .7, .2, 1);

  /* Type scale. Body is the anchor; everything else steps away from it so the
     hierarchy stays deliberate instead of drifting per component. */
  --fs-label: 12px;    /* form meta, monospace indices */
  --fs-kicker: 15px;   /* section kickers: the entry point into each section */
  --fs-small: 13px;    /* supporting captions */
  --fs-tag: 13.5px;    /* keyword chips */
  --fs-body: 15px;     /* default reading size */
  --fs-lead: 16px;     /* emphasised intro copy */
  --fs-h3: 19px;       /* card titles */
  --fs-h2: clamp(26px, 3.2vw, 37px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.7;
  letter-spacing: 0;
}
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.shell { width: min(calc(100% - var(--gutter)), var(--max)); margin: 0 auto; }
.sr-only, .honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link.sr-only, .sr-only:focus-within { left: auto; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--white); }
.skip-link:focus { top: 16px; }
.scroll-progress { position: fixed; top: 0; left: 0; z-index: 50; width: 100%; height: 3px; background: transparent; }
.scroll-progress span { display: block; height: 100%; width: 0; background: var(--teal); transition: width .12s linear; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(243, 247, 241, .94);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
  backdrop-filter: blur(12px);
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 8px 24px rgba(19, 34, 27, .04); }
.header-inner, .admin-header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; background: var(--ink); color: var(--paper); font-size: 11.5px; letter-spacing: .5px; }
.brand-name { font-size: 14.5px; }
.site-nav { display: flex; align-items: center; gap: 26px; color: var(--muted); font-size: 14px; }
.site-nav a { transition: color .2s ease; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--red); }
.site-nav .nav-contact { padding: 8px 13px; border: 1px solid var(--teal); color: var(--teal-dark); }
.site-nav .nav-contact:hover { color: var(--white); background: var(--ink); }
.nav-toggle { display: none; border: 0; background: transparent; padding: 8px 0 8px 8px; }
.nav-toggle span:not(.sr-only) { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; }

.hero { min-height: calc(90svh - 72px); display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: clamp(40px, 6vw, 96px); align-items: center; padding: clamp(52px, 5vw, 70px) 0 48px; }
.eyebrow, .project-type, .timeline-period { margin: 0; color: var(--teal); font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.section-index {
  display: inline-block;
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--red);
  color: var(--teal);
  font-size: var(--fs-kicker);
  font-weight: 700;
  letter-spacing: 1.4px;
}
.hero h1 { margin: 14px 0 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(46px, 6vw, 72px); line-height: 1.05; font-weight: 600; }
.hero-role { margin: 18px 0 0; color: var(--teal-dark); font-size: clamp(15px, 1.5vw, 18px); font-weight: 600; }
.hero-headline { max-width: 680px; margin: 28px 0 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(22px, 2.6vw, 29px); line-height: 1.35; }
.hero-summary { max-width: 620px; margin: 18px 0 0; color: var(--muted); font-size: clamp(14px, 1.1vw, 15.5px); }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 9px 17px; border: 1px solid transparent; font-size: 13px; font-weight: 700; transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--teal); color: var(--white); }
.button-primary:hover { background: var(--teal-dark); }
.text-link { display: inline-flex; gap: 9px; align-items: center; color: var(--teal-dark); font-size: 13px; font-weight: 700; }
.text-link span { color: var(--red); font-size: 18px; line-height: 1; transition: transform .2s ease; }
.text-link:hover span { transform: translateX(4px); }

.hero-system { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line-dark); padding: 17px 0 10px; }
.system-heading { display: flex; justify-content: space-between; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11.5px; letter-spacing: 1px; }
.live-state { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); }
.live-state i { display: inline-block; width: 7px; height: 7px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 4px rgba(24, 116, 90, .14); }
.signal-map { position: relative; height: 190px; margin: 22px 0 10px; overflow: hidden; border: 1px solid var(--line-dark); background: var(--paper-deep); }
.signal-map::before, .signal-map::after { content: ""; position: absolute; pointer-events: none; border-color: rgba(24, 116, 90, .18); }
.signal-map::before { inset: 22px 17px; border-top: 1px solid; border-bottom: 1px solid; }
.signal-map::after { top: 17px; bottom: 17px; left: 50%; border-left: 1px solid; }
.signal-map-label { position: absolute; top: 9px; left: 12px; z-index: 2; color: var(--teal); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 1px; }
.signal-line { position: absolute; z-index: 1; height: 1px; background: var(--line-dark); transform-origin: left center; }
.line-a { top: 94px; left: 19%; width: 27%; transform: rotate(-21deg); }
.line-b { top: 91px; left: 53%; width: 25%; transform: rotate(19deg); }
.line-c { top: 107px; left: 44%; width: 28%; transform: rotate(-28deg); }
.line-d { top: 92px; left: 26%; width: 44%; transform: rotate(5deg); opacity: .55; }
.signal-node { position: absolute; z-index: 2; display: grid; place-content: center; width: 62px; height: 62px; border: 1px solid var(--teal); border-radius: 50%; background: var(--paper); color: var(--teal-dark); text-align: center; box-shadow: 0 0 0 5px rgba(24, 116, 90, .08); }
.signal-node b { font: 10.5px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .5px; }
.signal-node small { margin-top: 1px; color: var(--muted); font-size: 9.5px; }
.node-edge-a { top: 56px; left: 12%; }
.node-core { top: 62px; left: 39%; width: 76px; height: 76px; border-color: var(--red); box-shadow: 0 0 0 7px rgba(195, 140, 69, .1); }
.node-cloud { top: 30px; right: 15%; }
.node-edge-b { bottom: 18px; right: 23%; }
.signal-packet { position: absolute; z-index: 3; width: 5px; height: 5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(195, 140, 69, .13); animation: packet-flow 3.2s linear infinite; }
.packet-a { top: 83px; left: 20%; }
.packet-b { top: 117px; left: 62%; animation-delay: 1.2s; }
@keyframes packet-flow { 0% { opacity: 0; transform: translateX(0) scale(.7); } 12% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(115px) scale(1); } }
.system-flow { list-style: none; padding: 0; margin: 22px 0 0; }
.system-flow li { display: grid; grid-template-columns: 31px 1fr; column-gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.system-flow li > span { grid-row: span 2; color: var(--red); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.system-flow strong { font-size: 14.5px; }
.system-flow small { color: var(--muted); font-size: 12.5px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.metric { display: flex; align-items: baseline; gap: 11px; min-height: 84px; padding: 23px 22px 20px 0; border-right: 1px solid var(--line); }
.metric:not(:first-child) { padding-left: 22px; }
.metric:last-child { border-right: 0; }
.metric strong { color: var(--teal-dark); font-family: Georgia, "Songti SC", serif; font-size: clamp(28px, 2.6vw, 34px); line-height: 1; font-weight: 700; }
.metric span { color: var(--muted); font-size: var(--fs-small); }

.section { padding: clamp(72px, 8vw, 126px) 0; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 21px 0 0; font-family: Georgia, "Songti SC", serif; font-size: var(--fs-h2); line-height: 1.3; font-weight: 600; }
.expertise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 70px; border-top: 1px solid var(--line-dark); }
.expertise-item { min-height: 375px; padding: 24px 26px 30px; border-right: 1px solid var(--line); }
.expertise-item:nth-child(3n + 1) { padding-left: 18px; }
.expertise-item:nth-child(3n) { border-right: 0; }
/* 12 cards over 3 columns = 4 full rows; rows 1-3 get a bottom rule. */
.expertise-item:nth-child(-n + 9) { border-bottom: 1px solid var(--line); }
.expertise-item:nth-child(n + 4) { padding-top: 28px; }
.item-number {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--red);
  border-radius: 50%;
  color: var(--red-dark);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: var(--fs-label);
  font-weight: 700;
}
.expertise-item h3 { margin: 30px 0 11px; font-size: var(--fs-h3); }
.expertise-item p { max-width: 320px; margin: 0; color: var(--muted); font-size: var(--fs-body); }
/* The first three cards are the primary positioning; give them visible weight. */
.expertise-item:nth-child(-n + 3) { background: rgba(255, 255, 255, .5); }
.expertise-item:nth-child(-n + 3) .item-number { border-color: var(--teal); background: var(--teal); color: var(--white); }
.expertise-item:nth-child(-n + 3) h3 { color: var(--teal-dark); }
.expertise-item:nth-child(-n + 3) h3::after {
  content: "重点方向";
  /* Card B is methodology knowledge rather than hands-on delivery; label it honestly. */
  display: inline-block;
  margin-left: 9px;
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--teal);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  vertical-align: 3px;
}

.expertise-item:nth-child(2) h3::after { content: "方法论基础"; background: var(--red-dark); }

.expertise-tags { display: flex; flex-wrap: wrap; gap: 8px 9px; margin: 20px 0 0; padding: 0; list-style: none; }
.expertise-tags li {
  padding: 3px 9px;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  background: rgba(255, 255, 255, .5);
  color: var(--teal-dark);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: var(--fs-tag);
  line-height: 1.45;
  white-space: nowrap;
}

.two-column { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: clamp(40px, 6vw, 90px); }
.sticky-heading { align-self: start; }
.timeline { border-top: 1px solid var(--line-dark); }
.timeline-item { position: relative; padding: 28px 0 36px 26px; border-bottom: 1px solid var(--line); }
.timeline-item::before { content: ""; position: absolute; top: 34px; left: -4px; width: 7px; height: 7px; background: var(--red); border-radius: 50%; }
.timeline-period { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; letter-spacing: 0; }
.timeline-item h3 { margin: 10px 0 0; font-size: 21px; line-height: 1.35; }
.timeline-role { margin: 6px 0 0; color: var(--teal-dark); font-size: 14px; font-weight: 700; }
.timeline-summary { margin: 16px 0 0; color: var(--ink); font-size: 15px; }
.timeline-item ul { margin: 9px 0 0; padding-left: 18px; color: var(--muted); font-size: 14.5px; }
.timeline-item li { padding: 3px 0; }

/* Grouping the role into tracks keeps unrelated duties from reading as one blob. */
.track-list { margin-top: 24px; }
.track + .track { margin-top: 20px; padding-top: 19px; border-top: 1px dashed var(--line); }
.track h4 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--teal-dark);
  font-size: 14.5px;
  font-weight: 700;
}
.track h4::before { content: ""; flex: 0 0 auto; width: 14px; height: 2px; background: var(--red); }

.leadership { background: #edf3ed; }
.leadership-heading { display: flex; align-items: end; justify-content: space-between; gap: clamp(30px, 4vw, 60px); }
.leadership-heading > p { max-width: 430px; margin: 0 0 5px; color: var(--muted); font-size: var(--fs-small); }
.leadership-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 66px; border-top: 1px solid var(--line-dark); }
.leadership-item { min-height: 300px; padding: 25px 24px 28px; border-right: 1px solid var(--line); }
.leadership-item:first-child { padding-left: 0; }
.leadership-item:last-child { padding-right: 0; border-right: 0; }
.leadership-item > span { color: var(--red); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.leadership-item h3 { margin: 30px 0 12px; font-size: var(--fs-h3); }
.leadership-item p { margin: 0; color: var(--muted); font-size: var(--fs-body); }
.leadership-item small { display: block; margin-top: 22px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--teal-dark); font-size: var(--fs-small); font-weight: 600; line-height: 1.7; }

.projects { background: var(--paper-deep); }
.projects-heading { display: flex; justify-content: space-between; align-items: end; }
.project-list { margin-top: 66px; border-top: 1px solid var(--line-dark); }
.project-item { position: relative; display: grid; grid-template-columns: 62px minmax(0, 1fr) minmax(150px, 220px); gap: clamp(16px, 2vw, 28px); padding: 31px 0 34px; border-bottom: 1px solid var(--line); transition: padding-left .25s ease, background .25s ease; }
.project-item::before { content: ""; position: absolute; top: 0; bottom: 0; left: -18px; width: 3px; background: var(--teal); transform: scaleY(0); transform-origin: center; transition: transform .25s ease; }
.project-item:hover { padding-left: 12px; background: rgba(255,255,255,.24); }
.project-item:hover::before { transform: scaleY(1); }
.project-number { color: var(--red); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.project-type { color: var(--muted); letter-spacing: 0; text-transform: none; }
.project-main h3 { margin: 8px 0 10px; font-size: 21px; line-height: 1.35; }
.project-main > p:not(.project-type) { max-width: 650px; margin: 0 0 15px; color: var(--muted); font-size: var(--fs-body); }
.project-tags { display: flex; flex-wrap: wrap; align-content: start; justify-content: end; gap: 7px; list-style: none; margin: 0; padding: 0; }
.project-tags li { padding: 4px 9px; border: 1px solid var(--line-dark); border-radius: 3px; color: var(--teal-dark); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--fs-small); white-space: nowrap; }

.skill-list { margin: 0; border-top: 1px solid var(--line-dark); }
.skill-row { display: grid; grid-template-columns: minmax(120px, 160px) minmax(0, 1fr); gap: clamp(16px, 2vw, 28px); padding: 23px 0; border-bottom: 1px solid var(--line); }
.skill-row dt { color: var(--teal-dark); font-weight: 700; font-size: var(--fs-body); }
.skill-row dd { margin: 0; color: var(--muted); font-size: var(--fs-body); }

.credential-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.privacy-note { max-width: 280px; margin: 0; color: var(--muted); font-size: var(--fs-small); text-align: right; }
.credential-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 21px; margin-top: 58px; }
.credential-card { background: var(--white); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s ease; }
.credential-card:hover { transform: translateY(-5px); box-shadow: 0 16px 30px rgba(19, 34, 27, .08); }
.credential-image { display: block; width: 100%; padding: 0; border: 0; background: var(--paper-deep); aspect-ratio: 1.4; overflow: hidden; }
.credential-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.credential-card:hover .credential-image img { transform: scale(1.035); }
.credential-copy { padding: 17px 17px 18px; }
.credential-copy > span { color: var(--red); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11.5px; }
.credential-copy h3 { margin: 8px 0 4px; font-size: 16px; }
.credential-copy p { margin: 0; color: var(--muted); font-size: var(--fs-small); }
.text-credential { margin: 22px 0 0; color: var(--muted); font-size: var(--fs-small); }

.contact { background: var(--ink); color: var(--paper); border-bottom: 0; }
.contact-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(44px, 6vw, 100px); align-items: start; }
.contact .section-index { color: #93d5ac; }
.contact h2 { color: var(--paper); }
.contact-intro > p:not(.section-index) { max-width: 410px; margin: 22px 0 0; color: #c3cfcb; font-size: var(--fs-body); }
.contact-methods { display: flex; gap: 10px; margin-top: 38px; }
.contact-method { display: grid; grid-template-columns: auto auto; column-gap: 14px; align-items: center; padding: 13px 15px; border: 1px solid #51605b; background: transparent; color: var(--paper); text-align: left; transition: border-color .2s ease, background .2s ease; }
.contact-method:hover { border-color: #91c8aa; background: #202d26; }
.contact-method span { grid-row: span 2; color: #9bd6b0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.contact-method strong { font-size: 14.5px; }
.contact-method small { color: #9aa9a4; font-size: 11.5px; }
.message-panel { padding-top: 2px; }
.message-form { border-top: 1px solid #51605b; }
.form-row { position: relative; padding-top: 19px; border-bottom: 1px solid #51605b; }
.form-row label { display: block; color: #a5b3ae; font-size: 12.5px; }
.form-row label span { color: #6f7e78; }
.form-row input, .form-row textarea { display: block; width: 100%; padding: 5px 0 12px; border: 0; outline: 0; background: transparent; color: var(--paper); resize: vertical; }
.form-row input:focus, .form-row textarea:focus { box-shadow: 0 2px 0 #91c8aa; }
.form-row textarea { min-height: 120px; }
.form-row input::placeholder, .form-row textarea::placeholder { color: #64726e; }
.field-meta { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 9px; color: #9fada8; font-size: var(--fs-label); }
.field-error { color: #ff9e87; font-size: 12px; }
.submit-button { margin-top: 24px; }
.notice { padding: 11px 13px; margin-bottom: 17px; border: 1px solid; font-size: 13px; }
.notice-success { border-color: #579d75; color: #c7ecd3; background: rgba(87, 157, 117, .13); }
.notice-error { border-color: #dd765f; color: #ffb8a6; background: rgba(221, 118, 95, .1); }
.copy-toast { position: fixed; bottom: 25px; left: 50%; z-index: 70; padding: 10px 14px; background: var(--paper); color: var(--ink); border: 1px solid var(--line-dark); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: opacity .2s ease, transform .2s ease; }
.copy-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.certificate-dialog { width: min(1000px, calc(100% - 30px)); max-height: calc(100% - 30px); padding: 0; border: 1px solid var(--line-dark); background: var(--paper); color: var(--ink); box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.certificate-dialog::backdrop { background: rgba(14, 19, 18, .78); }
.dialog-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.dialog-bar h2 { margin: 0; font-size: 14px; }
.dialog-bar button { width: 30px; height: 30px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 26px; line-height: 1; }
.certificate-dialog > img { max-height: calc(100vh - 90px); width: 100%; object-fit: contain; }

.site-footer { padding: 25px 0; background: var(--paper-deep); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; color: #4b5c54; font-size: var(--fs-small); }
.footer-inner p { display: flex; align-items: center; gap: 15px; margin: 0; }
.footer-inner strong { color: var(--ink); font-size: 13px; }
.footer-meta a { color: var(--teal-dark); }
.footer-meta a:hover, .footer-meta a:focus-visible { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

/* Admin surfaces reuse the same restrained visual language. */
.admin-page { min-height: 100vh; background: var(--paper-deep); }
.admin-auth { min-height: 100vh; display: grid; place-items: center; padding: 30px; }
.admin-auth-panel { width: min(100%, 440px); padding: 36px; background: var(--paper); border: 1px solid var(--line); }
.admin-auth-panel > div:nth-of-type(1) { margin: 74px 0 28px; }
.admin-auth-panel h1, .admin-title h1 { margin: 12px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 38px; font-weight: 600; }
.admin-auth-panel > div:nth-of-type(1) > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.admin-login-form { border-top-color: var(--line-dark); }
.admin-login-form .form-row { border-bottom-color: var(--line); }
.admin-login-form .form-row label { color: var(--muted); }
.admin-login-form .form-row input { color: var(--ink); }
.admin-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.text-button { padding: 0; border: 0; background: transparent; color: var(--teal-dark); font-size: 12px; font-weight: 700; }
.text-button:hover { color: var(--red); }
.text-button.danger { color: var(--red-dark); }
.admin-main { padding: 78px 0 100px; }
.admin-title { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 30px; border-bottom: 1px solid var(--line-dark); }
.admin-title > p { margin: 0; color: var(--muted); font-size: 12px; }
.admin-title > p strong { color: var(--red); font-size: 20px; }
.message-list { border-top: 0; }
.admin-message { padding: 23px 0 25px; border-bottom: 1px solid var(--line); }
.admin-message.is-unread { border-left: 3px solid var(--red); padding-left: 15px; }
.message-meta { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.message-meta > div { display: flex; align-items: center; gap: 12px; }
.message-meta strong { font-size: 15px; }
.message-contact, .message-meta time { color: var(--muted); font-size: 12.5px; }
.read-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line-dark); }
.is-unread .read-dot { background: var(--red); }
.message-content { max-width: 800px; margin: 13px 0 18px; white-space: pre-wrap; font-size: var(--fs-body); }
.message-actions { display: flex; gap: 18px; }
.message-actions form { margin: 0; }
.empty-state { padding: 50px 0; color: var(--muted); }
.empty-state strong { color: var(--ink); }
.empty-state p { margin: 5px 0; font-size: 13px; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 30px; text-align: center; }
.error-page h1 { margin: 16px 0 8px; font-family: Georgia, "Songti SC", serif; font-size: 42px; }
.error-page p:not(.section-index) { color: var(--muted); }
.error-page .button { margin-top: 15px; }

.reveal { opacity: 1; transform: translateY(20px); transition: transform .65s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal:nth-child(2) { transition-delay: .06s; }
.reveal:nth-child(3) { transition-delay: .12s; }

/* Laptop / small desktop: keep three columns but relax the fixed gutter. */
@media (max-width: 1080px) {
  :root { --gutter: 52px; }
  .expertise-item { min-height: 340px; padding: 22px 24px 28px; }
  .leadership-item { min-height: 285px; padding: 24px 20px 26px; }
  .signal-node { width: 58px; height: 58px; }
  .node-core { width: 70px; height: 70px; }
}

/* Tablet landscape and below: two-column grids. */
@media (max-width: 900px) {
  :root { --gutter: 42px; }
  .shell { width: min(calc(100% - var(--gutter)), var(--max)); }
  .hero-inner { grid-template-columns: 1fr; gap: 52px; padding-top: 61px; }
  .hero-system { max-width: 580px; }
  .two-column { grid-template-columns: 1fr; gap: 52px; }
  .sticky-heading { position: static; }
  .contact-layout { gap: 55px; }
  .credential-grid { grid-template-columns: repeat(2, 1fr); }
  .expertise-grid { grid-template-columns: repeat(2, 1fr); }
  .expertise-item:nth-child(n) { min-height: 315px; padding: 24px 22px 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .expertise-item:nth-child(2n) { border-right: 0; }
  .expertise-item:last-child { border-bottom: 0; }
  .leadership-grid { grid-template-columns: repeat(2, 1fr); }
  .leadership-item:nth-child(n) { min-height: 280px; padding: 25px 26px 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .leadership-item:nth-child(2n + 1) { padding-left: 0; }
  .leadership-item:nth-child(2n) { padding-right: 0; border-right: 0; }
  .leadership-item:nth-last-child(-n + 2) { border-bottom: 0; }
  .expertise-item p { max-width: none; }
  .project-item { grid-template-columns: 48px minmax(0, 1fr); }
  .project-tags { grid-column: 2; justify-content: start; margin-top: 4px; }
  .signal-map { height: 200px; }
}

/* Tablet portrait: stack the project/skill rows before the phone breakpoint. */
@media (max-width: 760px) {
  :root { --gutter: 36px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric { min-height: 74px; padding: 20px 16px 18px 0; }
  .metric:not(:first-child) { padding-left: 16px; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .credential-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-methods { flex-wrap: wrap; }
  .contact-method { flex: 1 1 200px; }
}

/* Phone. */
@media (max-width: 640px) {
  :root { --gutter: 32px; }
  .shell { width: min(calc(100% - var(--gutter)), var(--max)); }
  .header-inner { min-height: 62px; }
  .site-nav { position: absolute; top: 62px; left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 7px 16px 16px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 15px 30px rgba(19,34,27,.07); }
  .site-nav.is-open { display: flex; }
  .site-nav { font-size: 15px; }
  .site-nav a { padding: 13px 0; border-bottom: 1px solid var(--line); }
  .site-nav .nav-contact { margin-top: 10px; padding: 13px 12px; border: 1px solid var(--ink); text-align: center; }
  .nav-toggle { display: block; min-width: 44px; min-height: 44px; }
  .hero { min-height: 0; }
  .hero-inner { padding: 56px 0 42px; gap: 45px; }
  .hero h1 { font-size: 50px; }
  .hero-role { font-size: 15px; }
  .hero-headline { margin-top: 22px; font-size: 23px; }
  .hero-summary { font-size: 14px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric { min-height: 68px; padding: 18px 14px 16px 0; }
  .metric:not(:first-child) { padding-left: 14px; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metric strong { font-size: 25px; }
  .section { padding: 84px 0; }
  .section-heading h2 { font-size: 30px; }
  .expertise-grid { grid-template-columns: 1fr; margin-top: 46px; }
  .expertise-item, .expertise-item:nth-child(n) { min-height: 0; padding: 22px 0 26px; border-right: 0; border-bottom: 1px solid var(--line); }
  .expertise-item:nth-child(-n + 3) { padding: 22px 16px 26px; }
  .expertise-item:last-child { border-bottom: 0; }
  .expertise-item h3 { margin-top: 20px; }
  .expertise-item h3::after { display: block; margin: 7px 0 0; }
  .expertise-item p { max-width: none; }
  .expertise-tags { margin-top: 18px; gap: 8px; }
  .expertise-tags li { font-size: 12.5px; white-space: normal; }
  .project-tags li { font-size: 12.5px; white-space: normal; }
  .leadership-heading { display: block; }
  .leadership-heading > p { max-width: none; margin-top: 18px; }
  .leadership-grid { grid-template-columns: 1fr; margin-top: 42px; }
  .leadership-item:nth-child(n) { min-height: 0; padding: 23px 0 27px; border-right: 0; border-bottom: 1px solid var(--line); }
  .leadership-item:last-child { border-bottom: 0; }
  .leadership-item h3 { margin-top: 22px; }
  .project-list { margin-top: 45px; }
  .projects-heading { display: block; }
  .project-item { grid-template-columns: 34px 1fr; gap: 11px; padding: 25px 0 28px; }
  .project-tags { grid-column: 2; justify-content: start; }
  .skill-row { grid-template-columns: 1fr; gap: 7px; padding: 18px 0; }
  .credential-heading { display: block; }
  .privacy-note { max-width: none; margin-top: 17px; text-align: left; }
  .credential-grid { grid-template-columns: 1fr; gap: 18px; margin-top: 37px; }
  .credential-image { aspect-ratio: 1.5; }
  .signal-map { height: 176px; }
  .signal-node { width: 56px; height: 56px; }
  .node-core { width: 66px; height: 66px; }
  .signal-node small { font-size: 9px; }
  .contact-layout { gap: 44px; }
  .contact-methods { flex-wrap: wrap; margin-top: 28px; }
  .contact-method { flex: 1 1 100%; min-height: 52px; }
  .hero-actions { flex-wrap: wrap; gap: 16px; }
  .button { min-height: 46px; }
  .footer-inner { display: block; }
  .footer-inner p + p { margin-top: 8px; }
  .admin-auth { padding: 16px; }
  .admin-auth-panel { padding: 24px; }
  .admin-auth-panel > div:nth-of-type(1) { margin-top: 55px; }
  .admin-main { padding-top: 50px; }
  .admin-title { display: block; }
  .admin-title > p { margin-top: 16px; }
  .message-meta { display: block; }
  .message-meta time { display: block; margin: 8px 0 0 19px; }
}

/* Very narrow phones (iPhone SE and similar). */
@media (max-width: 380px) {
  :root { --gutter: 24px; }
  .hero h1 { font-size: 42px; }
  .brand-name { font-size: 13px; }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 0; padding: 15px 0; border-right: 0; }
  .metric:nth-child(n) { padding-left: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
  .project-item { grid-template-columns: 26px 1fr; gap: 9px; }
  .expertise-tags li, .project-tags li { font-size: 12px; padding: 3px 7px; }
}

/* Wide screens: let the reading measure grow a little rather than stay pinned. */
@media (min-width: 1500px) {
  :root { --max: 1280px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
}
