/* Warm, spacious editorial direction inspired by MiMo's visual language. */
:root {
  --paper: #fcfaf8;
  --ink: #171717;
  --muted: #77716b;
  --line: #eee7df;
  --accent: #8f5b42;
  --wash: #f3ede8;
  --serif: Georgia, 'Noto Serif SC', 'Songti SC', serif;
}

html { scroll-padding-top: 100px; }
body { background: var(--paper); color: var(--ink); font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; }
button, input, select { font-family: inherit; }
::selection { background: #ead7c2; color: #191613; }

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  width: min(100% - 48px, 1260px);
  max-width: none;
  padding: 16px 4px;
  background: #fcfaf8e8;
  border-bottom: 1px solid #eae2da;
  backdrop-filter: blur(18px);
}
.brand { font-family: Georgia, serif; font-size: 23px; font-weight: 500; letter-spacing: -.06em; gap: 10px; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; font: 18px/1 Georgia, serif; background: #1c1b1a; }
.brand small { font-family: system-ui, sans-serif; font-size: 8px; letter-spacing: .18em; font-weight: 500; }
.header nav { gap: clamp(14px, 2.3vw, 34px); }
.header nav a { font-size: 12px; color: #66615d; transition: color .2s ease; }
.header nav a:hover, .header nav a.active { color: #161514; }
.header nav a.active:after { width: 16px; height: 1px; left: calc(50% - 8px); bottom: -6px; background: #171717; border-radius: 0; }
.search-toggle { font-size: 12px; color: #45403c; }
.search-toggle kbd { border-radius: 999px; padding: 0 7px; }

main { max-width: 1260px; padding-bottom: 110px; }
body[data-page='home'] main { padding-top: 0; }
.intro-kicker, .tiny-label, .gallery-section-label, .eyebrow { color: #8b7665; letter-spacing: .18em; }
.small-dot { background: #b77e58; }

/* A centered personal introduction leads into a warm, cinematic visual panel. */
.identity-hero { padding: 0 0 76px; border-bottom: 0; }
.identity-hero > .intro-kicker { display: none; }
.identity-grid { display: flex; flex-direction: column; gap: 0; padding: 0; }
.identity-copy { text-align: center; padding: clamp(70px, 9vw, 130px) 20px 62px; max-width: 940px; margin: 0 auto; }
.identity-alias { font: 400 clamp(25px, 3.2vw, 46px)/1.2 Georgia, 'Noto Serif SC', serif; color: #1b1918; letter-spacing: -.035em; margin: 0 0 8px; }
.identity-copy h1 { font: 400 clamp(68px, 9.2vw, 130px)/1 Georgia, serif; letter-spacing: -.075em; margin: 0 0 20px; }
.name-dot { color: #ad7654; }
.identity-role { font-size: 14px; letter-spacing: .06em; color: #675f59; }
.identity-bio { max-width: 660px; margin: 18px auto 26px; color: #7e7771; font-size: 14px; line-height: 2; }
.identity-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.identity-actions a { display: inline-flex; align-items: center; min-height: 42px; padding: 0 21px; border: 1px solid #dfd6ce; border-radius: 999px; transition: background .2s, transform .2s, border-color .2s; }
.identity-actions a:hover { transform: translateY(-2px); border-color: #bea998; background: #f7efe7; }
.identity-actions .primary-action, .primary-action { color: white; background: #1b1a19; border: 1px solid #1b1a19; border-radius: 999px; padding: 12px 22px; }
.identity-actions .primary-action:hover, .primary-action:hover { color: white; background: #3a3531; border-color: #3a3531; }
.identity-portrait {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: clamp(330px, 38vw, 480px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 28px;
  background: radial-gradient(circle at 52% 55%, #f9e9d7 0 12%, #e4c19e 37%, #a66c50 75%, #614638 100%);
}
.identity-portrait::before, .identity-portrait::after { content: ''; position: absolute; z-index: -1; border: 1px solid #fff7ed66; border-radius: 50%; width: 490px; height: 490px; box-shadow: 0 0 0 88px #fff7ed14, 0 0 0 175px #fff7ed0c; }
.identity-portrait::after { width: 700px; height: 700px; border-color: #fff6ec3b; box-shadow: none; }
.identity-portrait img { width: clamp(185px, 22vw, 290px); height: clamp(185px, 22vw, 290px); aspect-ratio: 1; object-fit: cover; filter: none; border-radius: 50%; border: 6px solid #fffbf2cc; box-shadow: 0 24px 70px #3f2a1e45; transition: transform .5s ease; }
.identity-portrait:hover img { transform: translateY(-6px) rotate(-2deg); }
.identity-portrait figcaption { position: absolute; left: 32px; right: 32px; bottom: 28px; display: flex; flex-direction: row; justify-content: space-between; margin: 0; color: #fff8ef; font: 10px/1.4 system-ui, sans-serif; letter-spacing: .18em; text-shadow: 0 1px 6px #5e3f2d66; }
.intro-bottom { padding: 19px 3px 0; border: 0; color: #8e8379; font-size: 11px; }
.intro-bottom a { color: #3e3832; }

.personal-intro-section {
  display: grid;
  grid-template-columns: minmax(270px, .9fr) 1.1fr;
  align-items: center;
  gap: clamp(35px, 7vw, 110px);
  padding: 18px 0 86px;
  border-bottom: 1px solid var(--line);
}
.personal-intro-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 350px;
  overflow: hidden;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 43%, #f3f1e5 0 20%, #e8eadc 64%, #d9dfd0 100%);
}
.personal-intro-visual::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border: 1px solid #fbfff399;
  border-radius: 50%;
  box-shadow: 0 0 0 65px #ffffff32, 0 0 0 135px #ffffff21;
}
.personal-intro-visual img {
  position: relative;
  width: min(62%, 250px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 20px 60px #45513b29;
}
.personal-intro-copy h2 {
  margin: 19px 0 24px;
  font: 400 clamp(31px, 3.6vw, 49px)/1.48 var(--serif);
  letter-spacing: -.045em;
}
.personal-intro-copy p { max-width: 500px; color: #756f69; font-size: 14px; line-height: 2.2; }
.personal-intro-copy .text-link { display: inline-block; margin-top: 20px; border-bottom: 1px solid #aa8b73; font-size: 13px; }

/* Distinct, generous sections keep the long personal page easy to explore. */
.shelf-section, .food-section, .identity-section { padding: 86px 0; border-bottom: 1px solid var(--line); }
.shelf-heading, .food-heading { align-items: end; }
.shelf-heading h2, .food-heading h2, .identity-section > h2 { font-family: var(--serif); font-size: clamp(30px, 3.1vw, 42px); font-weight: 400; line-height: 1.35; letter-spacing: -.045em; }
.shelf-heading h2 span, .food-heading h2 span { color: #b0a39a; font-size: .52em; letter-spacing: 0; }
.shelf-toolbar { padding: 14px 0 18px; }
.shelf-filters button, .live-controls button, .kind-controls button, .live-status-controls select, .food-bottom button { border-radius: 999px; background: transparent; }
.shelf-filters button.active, .live-controls button.selected, .kind-controls button.selected { color: #181614; border-color: #bcaa9b; background: #f5eee8; }
.poster-card { border-radius: 15px; overflow: hidden; background: #f3ede8; border: 1px solid #eee5dc; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease; }
.poster-image { overflow: hidden; }
.poster-image img, .food-photo img { transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.poster-caption { padding: 16px 15px 19px; }
.poster-caption h3 { font-size: 17px; }
.live-empty, .missing-cover { background: #f4eee8; }
.food-track > * { border-radius: 16px; }
.research-grid { gap: 18px; }
.research-card { background: #f3ede8; border-color: #eee5dc; border-radius: 18px; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.research-card:hover { transform: translateY(-5px); border-color: #ddcbbd; box-shadow: 0 16px 36px #4d342110; }
.research-card:nth-child(2) { background: #f1e9e0; }
.project-top { padding: 25px 28px 0; color: #7d7065; }
.project-motif { height: 180px; }
.project-motif > span { color: #886248; }
.project-motif i, .research-card:nth-child(2) .project-motif i { border-color: #d0ae92; background: #edd8c466; }
.project-copy { background: #fffaf78c; border-color: #eadfd5; padding: 22px 28px 28px; }
.project-copy h3 { font-size: 25px; }
.project-tags span { border-color: #e5d6c9; color: #876e59; border-radius: 999px; padding: 5px 10px; }
.publication-row { padding: 28px 0; }
.publication-row h3 { font-size: 20px; }
.identity-contact { padding: 84px 0 20px; display: block; }
.identity-contact h2 { font-size: clamp(30px, 3.1vw, 42px); line-height: 1.45; }
.identity-contact p { font-size: 14px; }
.identity-contact a { display: inline-block; margin-top: 10px; border-bottom: 1px solid #b59a83; }

/* Inner pages share the same warm typography and restrained card treatment. */
.page-heading { padding: 76px 0 40px; }
.page-heading h1 { font-size: clamp(40px, 5vw, 70px); letter-spacing: -.05em; }
.resume-page, .research-detail, .identity-about { padding-top: 34px; }
.resume-page h1, .research-detail h1 { letter-spacing: -.04em; }
.resume-section, .method-flow, .writing-empty { border-color: #e9dfd5; }
.method-flow, .writing-empty { background: #f5eee8; border-radius: 16px; overflow: hidden; }
.identity-about img { border-radius: 24px; filter: none; }
.print-button, .cv-download { border-radius: 999px; }
dialog { background: #fcfaf8; border-color: #e8ded5; border-radius: 18px; }
dialog::backdrop { background: #1b171a72; }
footer { border-color: var(--line); }

@media (max-width: 900px) {
  .identity-grid { display: flex; flex-direction: column; gap: 0; }
  .identity-copy h1 { font-size: clamp(62px, 10vw, 100px); }
  .identity-portrait { height: 360px; }
  .shelf-section, .food-section, .identity-section { padding: 62px 0; }
  .personal-intro-section { gap: 30px; }
  .personal-intro-visual { min-height: 290px; }
}

@media (max-width: 620px) {
  .header { width: 100%; padding: 12px 18px; gap: 12px; }
  .brand { font-size: 20px; }
  .brand-mark { width: 28px; height: 28px; font-size: 17px; }
  .header nav { order: 3; width: 100%; gap: 0; justify-content: space-between; overflow-x: auto; padding: 6px 0 1px; }
  .header nav a { flex: 0 0 auto; font-size: 11px; }
  main { margin: 0 18px; padding-bottom: 62px; }
  .identity-copy { padding: 62px 0 42px; }
  .identity-alias { font-size: 25px; }
  .identity-copy h1 { font-size: clamp(54px, 13vw, 78px); margin-bottom: 19px; }
  .identity-role, .identity-bio { font-size: 12px; }
  .identity-bio { margin: 13px auto 21px; }
  .identity-actions { gap: 8px; }
  .identity-actions a { min-height: 38px; padding: 0 14px; font-size: 10px; }
  .identity-portrait { height: 310px; border-radius: 17px; }
  .identity-portrait img { width: 190px; height: 190px; }
  .identity-portrait figcaption { left: 18px; right: 18px; bottom: 17px; font-size: 8px; letter-spacing: .08em; }
  .intro-bottom { align-items: flex-start; gap: 8px; }
  .identity-hero { padding-bottom: 30px; }
  .personal-intro-section { grid-template-columns: 1fr; gap: 27px; padding: 16px 0 52px; }
  .personal-intro-visual { min-height: 290px; }
  .personal-intro-copy h2 { font-size: 32px; }
  .shelf-section, .food-section, .identity-section { padding: 48px 0; }
  .shelf-heading h2, .food-heading h2, .identity-section > h2 { font-size: 29px; }
  .research-grid { grid-template-columns: 1fr; }
  .identity-contact { padding: 52px 0 8px; }
  .identity-contact h2 { font-size: 29px; }
  .page-heading { padding: 48px 0 27px; }
  .page-heading h1 { font-size: 37px; }
  .identity-about { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .identity-portrait img, .research-card, .identity-actions a, .poster-card, .poster-image img, .food-card, .food-photo img { transition: none; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .poster-card:hover, .poster-card:focus-within { transform: translateY(-3px); box-shadow: 0 12px 28px #4d342112; }
  .poster-card:hover .poster-image img, .food-card:hover .food-photo img { transform: scale(1.045); }
  .food-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px #4d342112; }
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes card-appear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .poster-track .poster-card, .food-track .food-card {
    animation: card-appear .5s cubic-bezier(.2,.7,.2,1) backwards;
  }
  .poster-track .poster-card:nth-child(2), .food-track .food-card:nth-child(2) { animation-delay: .045s; }
  .poster-track .poster-card:nth-child(3), .food-track .food-card:nth-child(3) { animation-delay: .09s; }
  .poster-track .poster-card:nth-child(4), .food-track .food-card:nth-child(4) { animation-delay: .135s; }
  .poster-track .poster-card:nth-child(n+5), .food-track .food-card:nth-child(n+5) { animation-delay: .18s; }
}
