/*
  Tailwind 自定义配置 CSS
  修改品牌颜色：优先调整 :root 变量；HTML 内 Tailwind extend colors 保持同步即可。
  所有动效统一 0.25s，避免夸张弹跳与闪烁。
*/
:root {
  --ink: #111111;
  --paper: #f8f8f8;
  --card: #ffffff;
  --accent: #3a5f70;
  --mist: #d9e1e5;
  --line: rgba(17, 17, 17, .11);
  --muted: #6d7377;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --duration: .25s;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 88px;
}

body {
  min-width: 320px;
}

img {
  display: block;
  max-width: 100%;
}

a,
button,
input,
select,
textarea {
  transition: color var(--duration) var(--ease), background-color var(--duration) var(--ease), border-color var(--duration) var(--ease), transform var(--duration) var(--ease), opacity var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.duration-250 {
  transition-duration: var(--duration);
}

.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

#siteHeader.is-scrolled {
  background: rgba(248, 248, 248, .88);
  border-bottom: 1px solid rgba(17, 17, 17, .08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

#siteHeader.is-scrolled a,
#siteHeader.is-scrolled button,
#siteHeader.is-scrolled span {
  color: var(--ink);
  border-color: rgba(17, 17, 17, .16);
}

.nav-link {
  position: relative;
  color: inherit;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 1px;
  background: currentColor;
  content: "";
  opacity: 0;
  transform: scaleX(.35);
  transform-origin: center;
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.nav-link:hover::after {
  opacity: .8;
  transform: scaleX(1);
}

.nav-cta,
.lang-toggle {
  border: 1px solid rgba(255, 255, 255, .35);
  padding: .65rem .9rem;
  color: white;
  font-size: .78rem;
  letter-spacing: .08em;
}

.nav-cta:hover,
.lang-toggle:hover {
  transform: translateY(-1px);
  border-color: currentColor;
}

.menu-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
}

.menu-button span {
  display: block;
  width: 18px;
  height: 1px;
  background: currentColor;
  color: white;
}

.menu-button span + span {
  margin-top: -14px;
}

.menu-button.is-open span:first-child {
  transform: translateY(7px) rotate(45deg);
}

.menu-button.is-open span:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  pointer-events: none;
  display: grid;
  max-height: 0;
  gap: 1px;
  overflow: hidden;
  background: rgba(248, 248, 248, .96);
  opacity: 0;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: max-height var(--duration) var(--ease), opacity var(--duration) var(--ease);
}

.mobile-menu.is-open {
  pointer-events: auto;
  max-height: 420px;
  opacity: 1;
}

.mobile-menu a {
  padding: 1rem 1.5rem;
  color: var(--ink);
  font-size: .95rem;
  background: rgba(255, 255, 255, .65);
}

.hero-section {
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: -18px;
  background-position: center;
  background-size: cover;
  filter: saturate(.82) contrast(.95) blur(1.5px);
  opacity: 0;
  transform: scale(1.03);
  animation: heroFade .9s var(--ease) forwards;
}

@keyframes heroFade {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scroll-cue {
  position: absolute;
  bottom: max(2rem, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 2;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .32);
  color: rgba(255, 255, 255, .82);
  transform: translateX(-50%);
}

.scroll-cue:hover {
  transform: translateX(-50%) translateY(3px);
}

.section-wrap {
  padding: clamp(5rem, 9vw, 8rem) clamp(1.25rem, 4vw, 3rem);
}

.section-heading {
  max-width: 760px;
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.section-heading h2,
.about-copy h2,
.journal-placeholder h2 {
  font-size: clamp(2rem, 5vw, 4.25rem);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: 0;
}

.section-heading p,
.about-copy p,
.journal-placeholder p {
  margin-top: 1.1rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.9;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  margin-bottom: 2rem;
}

.filter-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .7);
  padding: .78rem 1.05rem;
  color: var(--ink);
  font-size: .86rem;
}

.filter-btn:hover,
.filter-btn.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  transform: translateY(-1px);
}

.gallery-grid {
  column-count: 1;
  column-gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;
}

.gallery-item {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 1rem;
  cursor: zoom-in;
  break-inside: avoid;
  opacity: 1;
  transform: translateY(0);
}

.gallery-item.is-hidden {
  display: none;
}

.image-shell {
  position: relative;
  overflow: hidden;
  background: linear-gradient(100deg, #eeeeee 20%, #f7f7f7 35%, #e9e9e9 50%);
  background-size: 220% 100%;
  animation: skeleton 1.35s linear infinite;
}

.image-shell.is-loaded {
  animation: none;
  background: #e8e8e8;
}

@keyframes skeleton {
  to {
    background-position-x: -220%;
  }
}

.image-shell img {
  width: 100%;
  min-height: 260px;
  object-fit: cover;
  opacity: 0;
  filter: saturate(.86);
  transform: scale(1.01);
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease), filter var(--duration) var(--ease);
}

.image-shell.is-loaded img {
  opacity: 1;
}

.gallery-item:hover img {
  filter: saturate(.95);
  transform: scale(1.035);
}

.gallery-item:hover {
  box-shadow: 0 22px 52px rgba(17, 17, 17, .13);
}

.gallery-item figcaption {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  left: .75rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(17, 17, 17, .62);
  padding: .72rem .8rem;
  color: white;
  font-size: .72rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.gallery-item figcaption span {
  color: rgba(255, 255, 255, .72);
  text-align: right;
}

.resume-layout,
.about-layout,
.contact-layout {
  display: grid;
  max-width: 1180px;
  margin: 0 auto;
  gap: clamp(2rem, 5vw, 4rem);
}

.resume-layout {
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
}

.resume-panel {
  align-self: start;
  border: 1px solid var(--line);
  background: var(--card);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.resume-panel h3 {
  font-size: 1.7rem;
  font-weight: 750;
}

.lead {
  margin-top: .9rem;
  color: var(--muted);
  line-height: 1.8;
}

.info-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.8rem;
}

.info-list div {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.info-list dt {
  color: var(--muted);
  font-size: .78rem;
}

.info-list dd {
  margin-top: .35rem;
  font-weight: 500;
}

.skill-list {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.skill-row span {
  display: flex;
  justify-content: space-between;
  margin-bottom: .45rem;
  font-size: .86rem;
  font-weight: 500;
}

.skill-row i {
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) var(--level), rgba(17, 17, 17, .1) var(--level));
}

.download-btn,
.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin-top: 2rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  padding: .95rem 1.2rem;
  color: white;
  font-weight: 600;
}

.download-btn:hover,
.submit-btn:hover {
  transform: translateY(-2px);
  background: var(--accent);
  border-color: var(--accent);
}

.timeline {
  position: relative;
  display: grid;
  gap: 1.25rem;
  padding-left: 1.7rem;
}

.timeline::before {
  position: absolute;
  top: .5rem;
  bottom: .5rem;
  left: 0;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline article {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.25rem;
}

.timeline article::before {
  position: absolute;
  top: .42rem;
  left: -1.95rem;
  width: .55rem;
  height: .55rem;
  border: 2px solid var(--accent);
  background: white;
  content: "";
}

.timeline span {
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.timeline h3 {
  margin-top: .45rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.timeline p {
  margin-top: .6rem;
  color: var(--muted);
  line-height: 1.8;
}

.about-layout {
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr);
  align-items: center;
}

.about-photo {
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: grayscale(.16) saturate(.82);
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.7rem;
}

.service-tags span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
  padding: .62rem .78rem;
  color: #42484b;
  font-size: .82rem;
}

.journal-placeholder {
  margin: 0 auto;
  max-width: 1180px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 4vw, 3rem);
}

.contact-layout {
  grid-template-columns: minmax(0, 1fr) minmax(280px, .75fr);
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: .5rem;
  color: #42484b;
  font-size: .86rem;
  font-weight: 600;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfbfb;
  padding: .95rem 1rem;
  color: var(--ink);
  font-weight: 400;
  outline: none;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(58, 95, 112, .1);
}

.form-notice {
  min-height: 1.5rem;
  color: var(--accent);
  font-size: .9rem;
}

.contact-side {
  display: grid;
  align-content: start;
  gap: 1.25rem;
}

.contact-lines {
  display: grid;
  border-top: 1px solid var(--line);
}

.contact-lines a {
  display: flex;
  align-items: center;
  gap: .8rem;
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
  color: var(--ink);
}

.contact-lines a:hover {
  color: var(--accent);
  transform: translateX(3px);
}

.contact-lines i {
  width: 1.2rem;
  color: var(--accent);
}

.map-placeholder {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(17, 17, 17, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, .08) 1px, transparent 1px),
    #eef1f2;
  background-size: 34px 34px;
}

.map-placeholder span {
  position: absolute;
  left: 1.2rem;
  bottom: 1rem;
  color: var(--muted);
  font-size: .86rem;
}

.map-placeholder i {
  position: absolute;
  top: 48%;
  left: 50%;
  color: var(--accent);
  font-size: 1.7rem;
  transform: translate(-50%, -50%);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding: 1.4rem clamp(1.25rem, 4vw, 3rem);
  color: var(--muted);
  font-size: .82rem;
}

.back-to-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 40;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, .12);
  background: rgba(255, 255, 255, .86);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(5, 5, 5, .92);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: min(92vw, 1500px);
  max-height: 82vh;
  object-fit: contain;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .4);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .2);
  color: white;
}

.lightbox-close {
  top: 1.2rem;
  right: 1.2rem;
}

.lightbox-prev {
  left: 1.2rem;
}

.lightbox-next {
  right: 1.2rem;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, .12);
}

.lightbox-caption {
  position: absolute;
  right: 1.2rem;
  bottom: 1.2rem;
  left: 1.2rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  color: white;
  font-size: .86rem;
  text-align: center;
}

.lightbox-caption span {
  color: rgba(255, 255, 255, .68);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}

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

@media (min-width: 640px) {
  .gallery-grid {
    column-count: 2;
    column-gap: 1.15rem;
  }

  .gallery-item {
    margin-bottom: 1.15rem;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    column-count: 3;
    column-gap: 1.25rem;
  }

  .gallery-item {
    margin-bottom: 1.25rem;
  }
}

@media (max-width: 900px) {
  .resume-layout,
  .about-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .about-photo {
    max-width: 520px;
  }
}

@media (max-width: 640px) {
  .gallery-item figcaption,
  .lightbox-caption,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 4.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
