/* ==========================================================================
   Sections: hero, about, skills, projects, cv, contact, footer
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/* Hero                                                                       */
/* -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding-top: clamp(136px, 17vw, 196px);
  padding-bottom: clamp(40px, 6vw, 96px);
  overflow: clip;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__inner .skeleton__line {
  margin-inline: auto;
}

.status {
  display: inline-flex;
  align-items: center;
  margin-bottom: 28px;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 480px) {
  .status {
    font-size: 11px;
  }
}

.hero__kicker {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero__kicker-sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
}

/* On narrow screens, stack the name above the role instead of wrapping mid-line. */
@media (max-width: 600px) {
  .hero__kicker {
    flex-direction: column;
    gap: 6px;
  }

  .hero__kicker-sep {
    display: none;
  }
}

.hero__title {
  max-width: 13em;
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.04em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.hero__title[data-pending] {
  width: min(100%, 7.5em);
  --sk-h: 0.4em;
  --sk-gap: 0.31em;
}

/* Accent: *emphasised* words switch to a light, condensed monospace. */
.hero__title em,
.contact__lead em,
.about__text em {
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 300;
  letter-spacing: -0.05em;
  font-variation-settings: "wdth" 82;
}

:root:lang(zh) .hero__title {
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.hero__subtitle {
  max-width: 46ch;
  margin-top: 26px;
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.2rem);
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
}

.hero__subtitle[data-pending] {
  width: min(100%, 26em);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 38px;
}

.hero__stage {
  position: relative;
  margin-top: clamp(56px, 7vw, 88px);
  perspective: 1800px;
}

.hero__glow {
  position: absolute;
  left: 50%;
  top: -8%;
  width: min(1100px, 110%);
  height: 90%;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(var(--glow-rgb), var(--glow-strength)), transparent 72%);
  filter: blur(30px);
  pointer-events: none;
}

.hero__device {
  position: relative;
  width: min(100% - 2 * var(--gutter), 1100px);
  margin-inline: auto;
  transform-origin: 50% 100%;
  transform: rotateX(var(--tilt, 0deg)) scale(var(--scale, 1));
  will-change: transform;
}

/* -------------------------------------------------------------------------- */
/* About                                                                      */
/* -------------------------------------------------------------------------- */

.about__grid {
  display: grid;
  gap: 56px;
}

@media (min-width: 960px) {
  .about__grid {
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
    align-items: end;
    gap: 96px;
  }
}

.about__text p {
  font-size: var(--fs-xl);
  font-weight: 450;
  line-height: 1.32;
  letter-spacing: -0.028em;
  text-wrap: pretty;
}

:root:lang(zh) .about__text p {
  line-height: 1.55;
  letter-spacing: 0;
}

.about__text p[data-pending] {
  --sk-h: 0.5em;
  --sk-gap: 0.41em;
}

.about__text p + p {
  margin-top: 0.9em;
}

/* Word-by-word reveal driven by scroll (see motion.js). */
.about__text .word {
  opacity: 0.16;
  transition: opacity 500ms var(--ease-out);
}

.about__text .word.is-lit {
  opacity: 1;
}

.facts {
  border-top: 1px solid var(--line);
}

.facts:empty {
  display: none;
}

.fact {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-s);
}

.fact dt {
  color: var(--text-muted);
}

.fact dd {
  text-align: right;
}

/* -------------------------------------------------------------------------- */
/* Experience                                                                 */
/* -------------------------------------------------------------------------- */

.jobs {
  border-top: 1px solid var(--line);
}

.job {
  display: grid;
  gap: 14px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 860px) {
  .job {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr);
    gap: 48px;
  }
}

.job__period {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.job__place {
  margin-top: 6px;
  font-size: var(--fs-s);
  color: var(--text-faint);
}

.job__main {
  display: grid;
  gap: 12px;
}

.job__role {
  font-family: var(--font-display);
  font-size: var(--fs-l);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.job__company {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: -6px;
  color: var(--text-muted);
}

.job__company a {
  border-bottom: 1px solid var(--line-strong);
}

.job__type {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.job__summary {
  max-width: 62ch;
  color: var(--text-muted);
  text-wrap: pretty;
}

.job .tags {
  margin-top: 4px;
}

/* -------------------------------------------------------------------------- */
/* Skills                                                                     */
/* -------------------------------------------------------------------------- */

.skills__list {
  border-top: 1px solid var(--line);
}

.skill-row {
  display: grid;
  gap: 18px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 860px) {
  .skill-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr);
    align-items: baseline;
    gap: 48px;
  }
}

.skill-row__title {
  font-family: var(--font-display);
  font-size: var(--fs-l);
  font-weight: 400;
  letter-spacing: -0.02em;
  transition: transform var(--dur-3) var(--ease-out);
}

.skill-row:hover .skill-row__title {
  transform: translateX(6px);
}

.skill-row__title[data-pending] {
  width: 9em;
}

/* -------------------------------------------------------------------------- */
/* Projects                                                                   */
/* -------------------------------------------------------------------------- */

.projects__grid {
  display: grid;
  gap: clamp(56px, 7vw, 88px) clamp(24px, 3vw, 40px);
}

@media (min-width: 900px) {
  .projects__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project--wide {
    grid-column: 1 / -1;
  }
}

.project__media {
  --tint: rgb(var(--glow-rgb));
  position: relative;
  padding: 9% 7% 9%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--panel);
  transition: border-color var(--dur-3) ease;
}

@media (min-width: 900px) {
  .project--wide .project__media {
    padding: 5% 16% 6%;
  }
}

.project__media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 60% at 50% 105%, color-mix(in srgb, var(--tint) 38%, transparent), transparent 72%);
  opacity: 0.5;
  transition: opacity var(--dur-3) ease;
}

.project__media .device {
  transition: transform 900ms var(--ease-out);
}

/* Invisible button stretched over the laptop: opens the enlarged view. */
.project__open {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  cursor: zoom-in;
}

.project__open:focus-visible {
  outline-offset: -3px;
}

.project__zoom {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
  font-size: 12px;
  color: var(--text);
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity var(--dur-2) ease,
    transform var(--dur-2) var(--ease-out);
}

.project__zoom svg {
  width: 13px;
  height: 13px;
}

.project__media:hover .project__zoom,
.project__open:focus-visible .project__zoom {
  opacity: 1;
  transform: none;
}

@media (hover: none) {
  .project__zoom {
    opacity: 1;
    transform: none;
  }
}

.project:hover .project__media {
  border-color: var(--line-strong);
}

.project:hover .project__media::before {
  opacity: 0.9;
}

.project:hover .project__media .device {
  transform: translateY(-1.5%) scale(1.015);
}

.project__meta {
  display: grid;
  gap: 10px;
  padding: 24px 4px 0;
}

.project__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.project__title {
  font-family: var(--font-display);
  font-size: var(--fs-l);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.project__title[data-pending] {
  width: 8em;
}

.project__year {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.project__role {
  font-size: var(--fs-s);
  color: var(--text-faint);
}

.project__summary {
  max-width: 56ch;
  color: var(--text-muted);
  text-wrap: pretty;
}

.project__points {
  display: grid;
  gap: 6px;
  max-width: 60ch;
  color: var(--text-muted);
}

.project__points li {
  position: relative;
  padding-left: 1.3em;
}

.project__points li::before {
  content: "-";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  color: var(--text-faint);
}

.project__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}

.project__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-s);
  font-weight: 500;
}

.project__cta svg {
  width: 15px;
  height: 15px;
  transition: transform var(--dur-2) var(--ease-out);
}

.project:hover .project__cta svg {
  transform: translate(2px, -2px);
}

/* -------------------------------------------------------------------------- */
/* CV                                                                         */
/* -------------------------------------------------------------------------- */

.cv__card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px 40px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--panel);
}

.cv__doc {
  display: flex;
  align-items: center;
  gap: 22px;
}

/* Small decorative sheet of paper (not a preview). */
.cv__thumb {
  flex: none;
  display: grid;
  align-content: start;
  gap: 4px;
  width: 52px;
  aspect-ratio: 1 / 1.414;
  padding: 9px 8px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5);
  transform: rotate(-4deg);
  transition: transform var(--dur-3) var(--ease-out);
}

.cv__card:hover .cv__thumb {
  transform: rotate(0deg) translateY(-2px);
}

.cv__thumb i {
  height: 2px;
  border-radius: 1px;
  background: #dcdce1;
}

.cv__thumb i:first-child {
  width: 60%;
  height: 4px;
  margin-bottom: 3px;
  background: #b9b9c0;
}

.cv__thumb i:nth-child(3n) {
  width: 75%;
}

.cv__name {
  font-family: var(--font-display);
  font-size: var(--fs-l);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.cv__meta {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.cv__langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.cv__langs-label {
  margin-right: 4px;
  font-size: 12px;
  color: var(--text-faint);
}

.cv__langs a {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  transition:
    color var(--dur-2) ease,
    border-color var(--dur-2) ease;
}

.cv__langs a:hover,
.cv__langs a[aria-current="true"] {
  color: var(--text);
  border-color: var(--line-strong);
}

.cv__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* -------------------------------------------------------------------------- */
/* Contact                                                                    */
/* -------------------------------------------------------------------------- */

.contact__lead {
  max-width: 34ch;
  margin-bottom: clamp(28px, 4vw, 48px);
  font-size: clamp(1.3rem, 1rem + 1.2vw, 2rem);
  font-weight: 450;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--text-muted);
  text-wrap: balance;
}

.email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.email__link {
  font-family: var(--font-display);
  font-size: var(--fs-huge);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  transition: background-size 700ms var(--ease-out);
}

.email__link:hover,
.email__link:focus-visible {
  background-size: 100% 2px;
}

.email__link[data-pending] {
  width: min(100%, 7em);
  --sk-h: 0.42em;
}

.email__copy {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line-strong);
}

.email__copy svg {
  width: 18px;
  height: 18px;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-top: clamp(40px, 5vw, 64px);
}

.socials:empty {
  display: none;
}

.socials a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-s);
  color: var(--text-muted);
  transition: color var(--dur-2) ease;
}

.socials a:hover {
  color: var(--text);
}

.socials svg {
  width: 14px;
  height: 14px;
  transition: transform var(--dur-2) var(--ease-out);
}

.socials a:hover svg {
  transform: translate(2px, -2px);
}

/* -------------------------------------------------------------------------- */
/* Footer                                                                     */
/* -------------------------------------------------------------------------- */

.footer {
  padding: 28px 0 max(36px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-faint);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer__top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color var(--dur-2) ease;
}

.footer__top:hover {
  color: var(--text);
}

.footer__top svg {
  width: 14px;
  height: 14px;
}
