:root {
  --night: #050a12;
  --night-2: #0a1422;
  --ink: #d9e6ef;
  --ink-soft: #aab9c7;
  --muted: #72869a;
  --line: rgba(154, 184, 207, 0.18);
  --blue: #2f73b7;
  --cyan: #70c4d8;
  --seal: #a93d42;
  --card: rgba(8, 18, 31, 0.72);
  --card-2: rgba(14, 29, 47, 0.64);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 82px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 8%, rgba(47, 115, 183, 0.18), transparent 32%),
    radial-gradient(circle at 82% 20%, rgba(112, 196, 216, 0.1), transparent 30%),
    linear-gradient(150deg, #03060b, var(--night) 42%, #07192b);
  font-family:
    "Songti SC", "STSong", "Noto Serif CJK SC", "PingFang SC", "Microsoft YaHei",
    serif;
  line-height: 1.72;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -5;
  background:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black, transparent 82%);
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.paper-noise {
  position: fixed;
  inset: 0;
  z-index: -4;
  opacity: 0.25;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.16) 0 1px, transparent 1.8px),
    radial-gradient(circle at 70% 65%, rgba(0, 0, 0, 0.55) 0 1px, transparent 1.6px);
  background-size: 19px 19px, 27px 27px;
  mix-blend-mode: screen;
}

.ink-flow {
  position: fixed;
  z-index: -3;
  width: 130vw;
  height: 34vh;
  pointer-events: none;
  filter: blur(30px);
  opacity: 0.14;
  background:
    linear-gradient(90deg, transparent, rgba(112, 196, 216, 0.34), rgba(47, 115, 183, 0.28), transparent),
    linear-gradient(180deg, transparent 8%, rgba(0, 0, 0, 0.72) 52%, transparent 92%);
  mask-image: linear-gradient(90deg, transparent, black 16%, black 82%, transparent);
  animation: inkFloat 18s ease-in-out infinite alternate;
}

.flow-left {
  left: -18vw;
  top: 12vh;
  transform: rotate(-9deg);
}

.flow-right {
  right: -18vw;
  bottom: 4vh;
  transform: rotate(8deg);
  animation-delay: -7s;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid rgba(154, 184, 207, 0.14);
  background: rgba(3, 8, 15, 0.72);
  backdrop-filter: blur(18px);
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.seal {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 3px;
  color: #f6eee2;
  background: var(--seal);
  box-shadow: inset 0 0 0 2px rgba(246, 238, 226, 0.22);
}

.nav-links {
  gap: clamp(14px, 2vw, 26px);
  color: var(--ink-soft);
  font-size: 15px;
}

.nav-links a {
  position: relative;
  padding: 6px 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
}

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: 116px clamp(20px, 6vw, 88px) 78px;
  overflow: hidden;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.72;
  filter: saturate(0.9) contrast(1.08) brightness(0.72);
  transform: scale(1.02);
  animation: slowPan 24s ease-in-out infinite alternate;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(3, 7, 13, 0.92), rgba(3, 7, 13, 0.68) 45%, rgba(3, 7, 13, 0.34)),
    linear-gradient(0deg, var(--night), transparent 46%);
}

.moon-mark {
  position: absolute;
  top: 20vh;
  right: 13vw;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(217, 230, 239, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 230, 239, 0.18), transparent 62%);
  filter: blur(0.4px);
  opacity: 0.72;
  animation: moonPulse 6s ease-in-out infinite alternate;
}

.hero-content {
  position: relative;
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 800px;
  margin-bottom: 24px;
  font-size: clamp(48px, 8vw, 104px);
  line-height: 1.04;
  letter-spacing: 0.08em;
  text-shadow: 0 18px 54px rgba(0, 0, 0, 0.55);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.16;
  letter-spacing: 0.04em;
}

h3 {
  margin-bottom: 12px;
  font-size: 23px;
  line-height: 1.34;
}

.hero-copy,
.section-heading > p,
.project-card p,
.story-card p,
.note-item p,
.life-card p,
.skill-group p {
  color: var(--ink-soft);
}

.hero-copy {
  max-width: 670px;
  font-size: clamp(17px, 2vw, 21px);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid rgba(154, 184, 207, 0.24);
  border-radius: 2px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.button.primary {
  color: #03101c;
  background: linear-gradient(135deg, #d9e6ef, #70c4d8);
  box-shadow: 0 18px 42px rgba(47, 115, 183, 0.28);
}

.button.secondary {
  color: var(--ink);
  background: rgba(217, 230, 239, 0.06);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}

.module-overview,
.section,
.contact-section,
.site-footer {
  padding-left: clamp(20px, 6vw, 88px);
  padding-right: clamp(20px, 6vw, 88px);
}

.subpage-main {
  min-height: calc(100vh - 78px);
  padding-top: 46px;
}

.module-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding-top: 48px;
  padding-bottom: 48px;
  background: linear-gradient(180deg, rgba(5, 10, 18, 0.95), rgba(8, 18, 31, 0.7));
}

.module-tile,
.project-card,
.skill-group,
.story-card,
.note-item,
.life-card,
.data-message,
.message-form,
.contact-section {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(217, 230, 239, 0.06), transparent 45%),
    var(--card);
  box-shadow: 0 1px 0 rgba(217, 230, 239, 0.04);
  backdrop-filter: blur(10px);
}

.module-tile::before,
.project-card::before,
.story-card::before,
.note-item::before,
.life-card::before,
.message-form::before,
.skill-group::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(112, 196, 216, 0.12), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(47, 115, 183, 0.11), transparent 38%);
  pointer-events: none;
}

.module-tile {
  display: grid;
  min-height: 218px;
  padding: 22px;
  align-content: space-between;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.module-tile:hover {
  transform: translateY(-5px);
  border-color: rgba(112, 196, 216, 0.42);
  background:
    linear-gradient(135deg, rgba(112, 196, 216, 0.12), transparent 50%),
    var(--card-2);
}

.module-index {
  display: inline-flex;
  color: var(--cyan);
  font-weight: 900;
}

.module-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(112, 196, 216, 0.36);
  border-radius: 50%;
  color: #e8f5fb;
  background:
    radial-gradient(circle at 35% 28%, rgba(112, 196, 216, 0.24), transparent 52%),
    rgba(217, 230, 239, 0.05);
  box-shadow:
    inset 0 0 0 8px rgba(217, 230, 239, 0.025),
    0 18px 40px rgba(0, 0, 0, 0.22);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.module-tile strong {
  display: block;
  font-size: 22px;
}

.module-tile em {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section {
  padding-top: 84px;
  padding-bottom: 84px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.7fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 34px;
}

.section-heading .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -16px;
}

.section-heading > p {
  margin-bottom: 4px;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 18px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 430px;
  padding: 24px;
}

.project-card.featured {
  border-top: 5px solid var(--cyan);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.project-meta span {
  padding: 5px 10px;
  border: 1px solid rgba(112, 196, 216, 0.28);
  border-radius: 999px;
  background: rgba(112, 196, 216, 0.08);
  color: #bde9f1;
  font-size: 13px;
  font-weight: 800;
}

.project-card ul {
  margin: auto 0 0;
  padding-left: 18px;
  color: var(--ink-soft);
}

.project-card li + li {
  margin-top: 8px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.skill-group {
  min-height: 142px;
  padding: 20px;
}

.data-message {
  padding: 24px;
}

.data-message p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.skill-group h3 {
  color: var(--ink);
  font-size: 18px;
}

.skill-group p {
  margin-bottom: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.module-section {
  border-top: 1px solid rgba(154, 184, 207, 0.08);
  background:
    radial-gradient(circle at 86% 6%, rgba(47, 115, 183, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(3, 8, 15, 0.12), rgba(3, 8, 15, 0.38));
}

.story-grid,
.life-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.story-card,
.life-card,
.note-item {
  padding: 24px;
}

.story-card {
  min-height: 230px;
}

.story-card span {
  display: inline-flex;
  margin-bottom: 44px;
  color: var(--cyan);
  font-weight: 900;
}

.project-card h2,
.story-card h2,
.story-card h3,
.note-item h2,
.note-item h3,
.life-card strong {
  color: var(--ink);
}

.project-card h2,
.story-card h2,
.note-item h2,
.skill-group h2 {
  margin-bottom: 12px;
  font-size: 23px;
  line-height: 1.34;
}

.photo-card {
  padding: 0;
}

.photo-card > span {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 2;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid rgba(217, 230, 239, 0.18);
  background: rgba(3, 8, 15, 0.68);
  backdrop-filter: blur(10px);
}

.photo-card figure {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  min-height: 330px;
  margin: 0;
}

.photo-card img {
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
  object-position: center 58%;
  filter: saturate(0.86) contrast(1.05) brightness(0.82);
}

.photo-card figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 64px 22px 22px;
  color: #edf8ff;
  background: linear-gradient(180deg, transparent, rgba(3, 8, 15, 0.86));
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.note-list {
  display: grid;
  gap: 14px;
}

.note-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 0.45fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: baseline;
}

.note-item time {
  color: var(--cyan);
  font-weight: 900;
}

.note-title h2,
.note-item h2,
.note-item h3,
.note-item p {
  margin-bottom: 0;
}

.note-title {
  display: grid;
  gap: 8px;
}

.note-category {
  width: fit-content;
  padding: 3px 9px;
  border: 1px solid rgba(112, 196, 216, 0.28);
  border-radius: 999px;
  color: #bde9f1;
  background: rgba(112, 196, 216, 0.08);
  font-size: 13px;
  font-weight: 850;
}

.life-card {
  min-height: 170px;
}

.life-card strong {
  display: block;
  margin-bottom: 42px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 24px;
}

.message-section {
  background:
    radial-gradient(circle at 16% 18%, rgba(112, 196, 216, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(3, 8, 15, 0.22), rgba(7, 19, 32, 0.5));
}

.message-form {
  display: grid;
  gap: 18px;
  max-width: 820px;
  padding: clamp(22px, 4vw, 34px);
}

.message-form label {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.message-form span {
  color: var(--cyan);
  font-weight: 900;
}

.message-form input,
.message-form textarea {
  width: 100%;
  border: 1px solid rgba(154, 184, 207, 0.24);
  border-radius: 2px;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(3, 8, 15, 0.54);
  font: inherit;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.message-form textarea {
  resize: vertical;
  min-height: 150px;
}

.message-form input:focus,
.message-form textarea:focus {
  border-color: rgba(112, 196, 216, 0.74);
  box-shadow: 0 0 0 4px rgba(112, 196, 216, 0.11);
  background: rgba(5, 14, 25, 0.78);
}

.message-form .button {
  position: relative;
  z-index: 1;
  justify-self: start;
}

.hidden-field {
  display: none;
}

.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 clamp(20px, 6vw, 88px) 78px;
  padding: 42px;
  background:
    linear-gradient(120deg, rgba(3, 8, 15, 0.96), rgba(10, 31, 52, 0.9)),
    radial-gradient(circle at 85% 15%, rgba(112, 196, 216, 0.22), transparent 34%);
}

.contact-section h2 {
  max-width: 760px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 22px;
  padding-bottom: 24px;
  color: var(--muted);
  border-top: 1px solid rgba(154, 184, 207, 0.12);
}

.thanks-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.thanks-panel {
  width: min(760px, 100%);
  padding: clamp(30px, 6vw, 58px);
  border: 1px solid var(--line);
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(217, 230, 239, 0.08), transparent 45%),
    var(--card);
  box-shadow: var(--shadow);
}

.thanks-panel h1 {
  font-size: clamp(42px, 8vw, 82px);
}

.thanks-panel p:not(.eyebrow) {
  max-width: 560px;
  color: var(--ink-soft);
  font-size: 18px;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.72s ease,
    transform 0.72s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes slowPan {
  from {
    transform: scale(1.02) translate3d(-0.6%, -0.4%, 0);
  }
  to {
    transform: scale(1.08) translate3d(1.4%, 0.8%, 0);
  }
}

@keyframes inkFloat {
  from {
    background-position: 0% 50%, 0% 50%;
  }
  to {
    background-position: 100% 50%, 35% 50%;
  }
}

@keyframes moonPulse {
  from {
    opacity: 0.42;
    transform: scale(0.96);
  }
  to {
    opacity: 0.72;
    transform: scale(1.05);
  }
}

@media (max-width: 1120px) {
  .module-overview,
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-list,
  .story-grid,
  .life-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .site-header {
    padding: 12px 18px;
  }

  .brand span:last-child {
    display: none;
  }

  .nav-links {
    gap: 10px;
    font-size: 14px;
  }

  .hero {
    min-height: 88vh;
    padding: 98px 20px 58px;
  }

  h1 {
    font-size: clamp(42px, 16vw, 70px);
  }

  .module-overview,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .note-item,
  .contact-section,
  .site-footer {
    grid-template-columns: 1fr;
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading .eyebrow {
    margin-bottom: 0;
  }

  .contact-section {
    margin-left: 20px;
    margin-right: 20px;
    padding: 28px;
  }
}
