:root {
  --bg: #f7f3eb;
  --bg-deep: #ede6d6;
  --nav-solid: #f7f3eb;
  --card: #fff9f0;
  --text: #2d2926;
  --text-soft: #7a6e5d;
  --text-faint: #bfb3a0;
  --accent: #d4622b;
  --accent-deep: #b34d1d;
  --accent-light: rgba(212, 98, 43, 0.07);
  --accent-glow: rgba(212, 98, 43, 0.18);
  --teal: #3d7a6e;
  --teal-light: rgba(61, 122, 110, 0.08);
  --border: #e4d9c5;
  --radius: 10px;
  --page1-bg: #f7f3eb;
  --page2-bg: #f0ebe0;
  --page3-bg: #e8e0d5;
  --page4-bg: #f5f1ea;
  --page5-bg: #e8e0d5;
  --page6-bg: #f5f1ea;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  font-family: "Noto Serif SC", serif;
  background: var(--page1-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.6;
  transition:
    background 0.4s,
    color 0.4s;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  opacity: 0.035;
  filter: url(#noiseFilter);
  background: var(--text);
  mix-blend-mode: multiply;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  transition:
    padding 0.4s,
    box-shadow 0.4s;
}
nav.scrolled {
  backdrop-filter: blur(16px) saturate(1.5);
  background: rgba(247, 243, 235, 0.88);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.03);
  padding: 0 32px;
  transition:
    padding 0.4s,
    box-shadow 0.4s;
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 13px;
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
@media (hover: hover) {
  .nav-logo:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    box-shadow: 0 8px 18px rgba(212, 98, 43, 0.12);
  }
}
.nav-links {
  display: flex;
  gap: 24px;
}
.nav-links a {
  font-family: "Noto Serif SC", serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-soft);
  position: relative;
  padding: 2px 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: all 0.28s;
}
.nav-divider,
.nav-link-secondary {
  display: none;
}
@media (hover: hover) {
  .nav-links a:hover {
    color: var(--text);
  }
  .nav-links a:hover::after {
    width: 100%;
  }
}

.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  z-index: 1;
  background: var(--page1-bg);
}
.hero-inner {
  max-width: 640px;
  text-align: center;
}
.hero-greeting {
  font-family: "EB Garamond", serif;
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.6s ease 0.1s forwards;
}
.hero-name {
  font-family: "EB Garamond", "Noto Serif SC", serif;
  font-weight: 700;
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.7s ease 0.1s forwards;
}
.hero-divider {
  width: 108px;
  height: 2px;
  background: var(--accent);
  margin: 0 auto 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.5s ease 0.1s forwards;
}
.hero-intro {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text-soft);
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.6s ease 0.1s forwards;
}
.hero-intro em {
  font-style: normal;
  color: var(--accent);
}
.hero-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.6s ease 0.1s forwards;
}
.hero-tag {
  font-family: "Noto Serif SC", serif;
  font-weight: 400;
  font-size: 0.85rem;
  padding: 6px 16px;
  border: 1px solid #907a56;
  border-radius: 95px;
  color: var(--text-soft);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.hero-hitokoto {
  margin-top: 48px;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.6s ease 0.4s forwards;
}
.hitokoto-text {
  font-family: "Noto Serif SC", serif;
  font-size: 1.2rem;
  color: var(--text);
  line-height: 1.8;
  word-break: break-word;
}
.hitokoto-from {
  font-family: "EB Garamond", serif;
  font-size: 0.95rem;
  color: var(--text-soft);
  margin-top: 16px;
}

.site-counter {
  margin-top: 48px;
  font-family: "Noto Serif SC", serif;
  font-size: 0.85rem;
  color: var(--text-faint);
  opacity: 0;
  transform: translateY(20px);

  animation: slideUp 0.6s ease 0.5s forwards;
}

.counter-num {
  font-family: "EB Garamond", serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
  margin: 0 4px;
}

body.intro-active .site-counter {
  animation: none;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 40px;
}

.footer-text {
  flex: 1;
  text-align: left;
  font-size: 0.85rem;
  color: #afa596;
}

.footer-text span {
  cursor: default;
}

.footer-runtime {
  flex: 2;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-links {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: clamp(8px, 1.5vw, 22px);
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
}

.footer-links a {
  display: inline-block;
  font-size: clamp(0.66rem, 1.05vw, 0.85rem);
  color: var(--text-soft);
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;

  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, color;
}

@media (hover: hover) {
  .footer-links a:hover {
    transform: translateY(-4px);
    color: var(--accent);
  }
}

#runtime_span {
  font-family: "EB Garamond", "Noto Serif SC", serif;
  font-size: 0.9rem;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  line-height: 1;
}

@media (hover: hover) {
  .hero-tag:hover {
    transform: translateY(-4px);
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 10px 22px rgba(212, 98, 43, 0.08);
  }
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.intro-active .hero-greeting,
body.intro-active .hero-name,
body.intro-active .hero-divider,
body.intro-active .hero-intro,
body.intro-active .hero-tags,
body.intro-active .hero-hitokoto {
  animation: none;
}

#journey {
  position: relative;
  z-index: 1;
  background: var(--page2-bg);
}
.journey-scroll-room {
  height: 700vh;
  position: relative;
}
.journey-viewport {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
}
.journey-header {
  text-align: center;
  margin-bottom: 36px;
}
.section-label {
  font-family: "EB Garamond", serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-heading {
  font-family: "EB Garamond", "Noto Serif SC", serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}
.section-heading em {
  font-style: normal;
  color: var(--accent);
}
.journey-hint {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-top: 12px;
  letter-spacing: 0.04em;
}

.journey-track {
  width: 85%;
  max-width: 860px;
  position: relative;
  height: 240px;
}

.track-line {
  position: absolute;
  top: 120px;
  left: 34px;
  right: 34px;
  height: 2px;
  background: var(--border);
}

.track-progress {
  position: absolute;
  top: 120px;
  left: 34px;
  height: 2px;
  background: var(--accent);
  width: 0;
  will-change: width;
}

.rocket-wrapper {
  position: absolute;
  top: 120px;
  left: -4px;
  transform: translateY(-50%);
  z-index: 10;
  will-change: left;
  transition: left 0.05s linear;
}
.rocket-svg {
  display: block;
}
.flame-outer {
  transform-box: fill-box;
  transform-origin: right center;
  animation: flameOuter 0.4s ease-in-out infinite alternate;
}
.flame-inner {
  transform-box: fill-box;
  transform-origin: right center;
  animation: flameInner 0.25s ease-in-out infinite alternate;
}
@keyframes flameOuter {
  0% {
    transform: scaleX(1) scaleY(1);
    opacity: 0.75;
  }
  100% {
    transform: scaleX(0.82) scaleY(1.18);
    opacity: 1;
  }
}
@keyframes flameInner {
  0% {
    transform: scaleX(1);
    opacity: 0.85;
  }
  100% {
    transform: scaleX(0.7);
    opacity: 1;
  }
}

.milestone {
  position: absolute;
  top: 120px;
  transform: translateY(-50%);
  opacity: 0;
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.milestone.visible {
  opacity: 1;
}
.ms-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg-deep);
  position: relative;
  z-index: 3;
  transition:
    background 0.4s,
    transform 0.4s,
    box-shadow 0.4s;
}
.milestone.visible .ms-dot {
  background: var(--accent);
  transform: scale(1.25);
  box-shadow: 0 0 12px var(--accent-glow);
}
.ms-top {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
}
.ms-year {
  font-family: "EB Garamond", serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}
.ms-bottom {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 120px;
}
.ms-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}
.ms-desc {
  font-size: 0.85rem;
  color: var(--text-faint);
  line-height: 1.4;
  display: block;
}

#tech-stack {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  z-index: 1;
  background: var(--page3-bg);
}

.tech-inner {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.tech-header {
  margin-bottom: 48px;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.tech-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.tech-card img {
  width: 56px;
  height: 56px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-card span {
  font-family: "Noto Serif SC", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.05em;
}

@media (hover: hover) {
  .tech-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 16px 32px rgba(212, 98, 43, 0.08);
  }
  .tech-card:hover img {
    transform: scale(1.15) translateY(-2px);
  }
}


#projects {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  z-index: 1;
  background: var(--page4-bg);
}

.projects-inner {
  max-width: 940px;
  width: 100%;
  text-align: center;
}
.projects-header {
  margin-bottom: 48px;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 24px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 18px;
  min-height: 230px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
@media (hover: hover) {
  .project-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 16px 32px rgba(212, 98, 43, 0.08);
  }
}
.project-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "EB Garamond", serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  order: 1;
  margin-top: 0;
  margin-bottom: 6px;
  opacity: 1;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (hover: hover) {
  .project-card:hover .project-icon {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
  }
}
.project-name {
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--text);
  order: 2;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-desc {
  font-size: 1rem;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.6;
  order: 3;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (hover: hover) {
  .project-card:hover .project-name,
  .project-card:hover .project-desc {
    transform: scale(1.12);
  }
}

#friends {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  z-index: 1;
  background: var(--page5-bg);
}
.friends-inner {
  max-width: 940px;
  width: 100%;
  text-align: center;
  margin: 0 auto;
}
.friends-header {
  margin-bottom: 32px;
}
.friends-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  width: 100%;
  gap: 20px;
  margin: 0 auto;
}
.friend-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-radius: 18px;
  min-height: 238px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
@media (hover: hover) {
  .friend-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 16px 32px rgba(212, 98, 43, 0.08);
  }
}
.friend-avatar {
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "EB Garamond", serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-faint);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.friend-avatar i {
  font-size: 3.8rem;
  color: var(--accent);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.friend-avatar img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.friend-avatar img.fish {
  width: 80px;
  height: 80px;
}
@media (hover: hover) {
  .friend-card:hover .friend-avatar {
    color: var(--accent);
    transform: translateY(-2px);
  }
  .friend-card:hover .friend-avatar img,
  .friend-card:hover .friend-avatar i {
    transform: scale(1.22);
  }
}
.friend-name {
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.friend-desc {
  font-size: 0.9rem;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.4;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (hover: hover) {
  .friend-card:hover .friend-name,
  .friend-card:hover .friend-desc {
    transform: scale(1.12);
  }
}
.friend-card.wide {
  grid-column: span 2;
}

#contact {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  z-index: 1;
  background: var(--page6-bg);
}
.contact-inner {
  width: 100%;
  text-align: center;
}
.contact-header {
  margin-bottom: 32px;
}
.contact-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
.contact-icon {
  width: 80px;
  height: 80px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (hover: hover) {
  .contact-icon:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(212, 98, 43, 0.1);
  }
}
.contact-icon i {
  font-size: 28px;
  color: var(--accent);
}
@media (hover: hover) {
  .contact-icon:hover i {
    color: var(--accent-deep);
  }
}
.contact-label {
  height: 80px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  min-width: 280px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (hover: hover) {
  .contact-label:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(212, 98, 43, 0.1);
  }
}
.contact-label-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}
.contact-label-value {
  font-size: 0.95rem;
  color: var(--text-faint);
  margin-top: 4px;
}
@media (hover: hover) {
  .contact-row:hover .contact-icon,
  .contact-row:hover .contact-label {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 10px 25px rgba(212, 98, 43, 0.1);
  }
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  z-index: 999;
  transition:
    padding 0.4s,
    box-shadow 0.4s;
}

footer.scrolled {
  backdrop-filter: blur(16px) saturate(1.5);
  background: rgba(247, 243, 235, 0.88);
  box-shadow: 0 -1px 12px rgba(0, 0, 0, 0.03);
  padding: 0 32px;
  transition:
    padding 0.4s,
    box-shadow 0.4s;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 40px;
}
.footer-text {
  flex: 1;
  text-align: left;
  font-size: 0.85rem;
  color: #afa596;
}
.footer-accent {
  color: var(--accent);
}

.footer-runtime {
  flex: 2;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.no-scroll {
  overflow: hidden !important;
  height: 100vh !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 600px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.4s ease forwards;
  overflow: hidden;
  display: block;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
}

.modal-title {
  font-family: "EB Garamond", serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
}

.modal-close {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-faint);
}

.modal-body {
  padding: 30px 40px;
  max-height: calc(80vh - 70px);
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--text);
  font-family: "Noto Serif SC", serif;
  line-height: 1.8;
}

.modal-body h1 {
  font-family: "EB Garamond", serif;
  font-size: 1.6rem;
  color: var(--accent);
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: 1px;
}

.modal-body hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 24px 0;
}

.modal-body h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--text);
  display: flex;
  align-items: center;
}

.modal-body h2::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--accent);
  margin-right: 12px;
  border-radius: 2px;
}

.modal-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 12px;
  color: var(--text-soft);
}

.modal-body p {
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.modal-body strong {
  color: var(--text);
  font-weight: 600;
}

.modal-body ul {
  list-style: none;
  padding-left: 4px;
  margin-bottom: 24px;
}

.modal-body li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: var(--text-soft);
  display: flex;
  align-items: flex-start;
}

.modal-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 8px;
  height: 1px;
  background: var(--text-faint);
}

.modal-body li:hover::before {
  background: var(--accent);
}

.modal-body a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-light);
  transition: all 0.3s;
}

.modal-body a:hover {
  border-bottom-color: var(--accent);
  background: var(--accent-light);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#runtime_span {
  font-family: "EB Garamond", "Noto Serif SC", serif;
  font-size: 0.9rem;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  line-height: 1;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-d1 {
  transition-delay: 0.1s;
}
.reveal-d2 {
  transition-delay: 0.2s;
}
.reveal-d3 {
  transition-delay: 0.3s;
}
.reveal-d4 {
  transition-delay: 0.4s;
}
.reveal-d5 {
  transition-delay: 0.5s;
}

::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-faint);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-soft);
}


.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--page1-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}
.intro-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}
.intro-logo-wrapper {
  width: 72px;
  height: 72px;
  padding: 3px;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  transform-origin: 50% 50%;
}
.intro-logo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ========== 汉堡菜单按钮 ========== */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  z-index: 1001;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== 1024px 以下小屏幕适配 ========== */
@media (max-width: 1024px) {
  nav {
    padding: 14px 24px;
  }
  nav.scrolled {
    padding: 10px 24px;
  }
  .hero,
  #tech-stack,
  #projects,
  #friends,
  #contact {
    padding: 60px 24px;
  }
  .journey-viewport {
    padding: 0 24px;
  }
  .journey-track {
    width: 90%;
  }
  .tech-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .friends-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .contact-label {
    min-width: 240px;
  }
  .footer-inner {
    padding: 0 24px;
  }
}

/* ========== 768px 以下平板适配 ========== */
@media (max-width: 768px),
  (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  nav {
    padding: 12px 20px;
  }
  nav.scrolled {
    padding: 8px 20px;
  }

  /* 汉堡菜单 */
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 240px;
    height: 100vh;
    background: var(--card);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 22px;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
  }
  .nav-links.open {
    right: 0;
  }
  .nav-links a {
    font-size: 1.1rem;
  }
  .nav-divider {
    display: block;
    width: 40px;
    height: 1px;
    background: var(--border);
    margin: 4px 0;
    border: none;
  }
  .nav-link-secondary {
    display: block;
    font-size: 0.9rem !important;
    color: var(--text-faint) !important;
  }

  .hero,
  #tech-stack,
  #projects,
  #friends,
  #contact {
    height: auto;
    min-height: 100vh;
    padding: 60px 20px;
  }

  /* Journey 移动端竖直时间线 — 彻底重置 */
  #journey {
    overflow: visible !important;
  }
  .journey-scroll-room {
    height: auto !important;
    position: static !important;
  }
  .journey-viewport {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    min-height: 100vh !important;
    display: block !important;
    padding: 50px 20px 40px !important;
  }
  .journey-header {
    margin-bottom: 40px;
    display: block !important;
    text-align: center !important;
  }
  .journey-hint {
    display: none !important;
  }
  .journey-track {
    position: relative !important;
    width: 100% !important;
    max-width: 460px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 620px !important;
  }
  .track-line {
    position: absolute !important;
    left: 50% !important;
    top: 10% !important;
    bottom: 10% !important;
    width: 2px !important;
    height: auto !important;
    background: var(--border) !important;
    display: block !important;
    transform: translateX(-50%) !important;
  }
  .track-progress {
    display: none !important;
  }
  .rocket-wrapper {
    display: none !important;
  }
  .milestone {
    position: relative !important;
    left: 0 !important;
    top: auto !important;
    transform: none !important;
    opacity: 1 !important;
    width: calc(50% - 28px) !important;
    display: flex !important;
    flex: 1 1 20% !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 6px 0 !important;
    margin: 0 !important;
  }
  .milestone.is-left {
    align-self: flex-start !important;
    text-align: right !important;
    padding-right: 22px !important;
  }
  .milestone.is-right {
    align-self: flex-end !important;
    text-align: left !important;
    padding-left: 22px !important;
  }
  .ms-dot {
    position: absolute !important;
    top: 50% !important;
    right: auto !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background: var(--accent) !important;
    border: 2px solid var(--page2-bg) !important;
    box-shadow: 0 0 0 2px var(--border) !important;
    z-index: 3;
    transform: translateY(-50%) !important;
  }
  .milestone.is-left .ms-dot {
    left: calc(100% + 22px) !important;
  }
  .milestone.is-right .ms-dot {
    left: -34px !important;
  }
  .ms-top {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    text-align: inherit !important;
    white-space: normal !important;
    margin-bottom: 4px;
    display: block !important;
  }
  .ms-year {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.06em;
  }
  .ms-bottom {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    text-align: inherit !important;
    width: auto !important;
    display: block !important;
  }
  .ms-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    display: block !important;
    margin-bottom: 6px;
  }
  .ms-desc {
    font-size: 0.85rem;
    color: var(--text-soft);
    display: block !important;
    line-height: 1.6;
  }

  /* 技术栈 */
  .tech-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .tech-card {
    padding: 24px 12px;
  }
  .tech-card img {
    width: 44px;
    height: 44px;
  }

  /* 项目 */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .project-card {
    padding: 28px 16px 24px;
    min-height: 200px;
  }
  .project-name {
    font-size: 1.2rem;
  }

  /* 友链 */
  .friends-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 16px;
  }
  .friend-card {
    padding: 28px 12px;
    min-height: 200px;
  }

  /* 联系：icon + label 合并为一个竖直卡片 */
  .contact-row {
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: calc(50% - 8px);
    min-width: 140px;
    max-width: 180px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 12px;
  }
  .contact-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }
  .contact-icon {
    background: none;
    border: none;
    border-radius: 0;
    width: auto;
    height: auto;
  }
  .contact-label {
    background: none;
    border: none;
    border-radius: 0;
    min-width: auto;
    height: auto;
    padding: 0;
    margin: 0;
  }
  /* Footer */
  .footer-links-desktop {
    display: none;
  }
  .footer-inner {
    flex-direction: column;
    gap: 10px;
    padding: 0 20px;
    text-align: center;
    justify-content: center;
    align-items: center;
  }
  .footer-text {
    font-size: 0.78rem;
    flex: none;
  }
  .footer-runtime {
    flex: none;
  }
  #runtime_span {
    font-size: 0.75rem;
  }
}

/* ========== 480px 以下手机适配 ========== */
@media (max-width: 480px) {
  nav {
    padding: 10px 14px;
  }

  .nav-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .hero {
    padding: 60px 16px;
  }
  .hero-greeting {
    font-size: 1rem;
  }
  .hero-name {
    font-size: 2.4rem;
  }
  .hero-intro {
    font-size: 0.95rem;
  }
  .hero-tags {
    gap: 6px;
  }
  .hero-tag {
    font-size: 0.72rem;
    padding: 4px 12px;
  }
  .hero-hitokoto {
    margin-top: 32px;
    padding: 0 8px;
  }
  .hitokoto-text {
    font-size: 1rem;
  }
  .hitokoto-from {
    font-size: 0.85rem;
  }
  .site-counter {
    margin-top: 32px;
  }

  /* Journey */
  .journey-viewport {
    padding: 40px 16px;
  }
  .journey-track {
    min-height: 560px !important;
  }
  .ms-title {
    font-size: 1rem;
  }
  .ms-desc {
    font-size: 0.8rem;
  }

  /* 技术栈 */
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .tech-card {
    padding: 20px 10px;
    gap: 10px;
  }
  .tech-card img {
    width: 36px;
    height: 36px;
  }
  .tech-card span {
    font-size: 0.85rem;
  }

  /* 项目 */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .project-card {
    padding: 24px 20px;
    min-height: 160px;
  }
  .project-name {
    font-size: 1.1rem;
  }
  .project-desc {
    font-size: 0.85rem;
  }

  /* 友链 */
  .friends-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .friend-card {
    padding: 20px 10px;
    min-height: 170px;
  }
  .friend-avatar {
    width: 60px;
    height: 60px;
  }
  .friend-avatar img {
    width: 60px;
    height: 60px;
  }
  .friend-avatar img.fish {
    width: 54px;
    height: 54px;
  }
  .friend-name {
    font-size: 1rem;
  }
  .friend-desc {
    font-size: 0.8rem;
  }

  /* 联系 */
  .contact-row {
    width: calc(50% - 7px);
    min-width: 130px;
    max-width: 170px;
    padding: 24px 10px;
    gap: 14px;
    border-radius: 14px;
  }
  .contact-icon i {
    font-size: 22px;
  }
  .contact-label-name {
    font-size: 0.95rem;
  }
  .contact-label-value {
    font-size: 0.8rem;
  }

  /* Footer */
  .footer-inner {
    padding: 0 16px;
    gap: 10px;
  }
  .footer-text {
    font-size: 0.75rem;
  }
  #runtime_span {
    font-size: 0.72rem;
  }

  /* Modal */
  .modal-content {
    border-radius: 10px;
  }
  .modal-header {
    padding: 16px 20px;
  }
  .modal-body {
    padding: 20px 24px;
  }
  .modal-body h1 {
    font-size: 1.3rem;
  }
}

/* ========== 触屏设备禁用 hover ========== */
@media (hover: none) {
  .tech-card:hover,
  .project-card:hover,
  .friend-card:hover,
  .contact-row:hover .contact-icon,
  .contact-row:hover .contact-label,
  .contact-icon:hover,
  .contact-label:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
  }
  .tech-card:active,
  .project-card:active,
  .friend-card:active {
    transform: scale(0.97);
    transition-duration: 0.15s;
  }
}
