/* =========================================================
   HKZ — minimal visual wordmark
   ========================================================= */

:root {
  --bg: #0B0C0E;
  --bg-soft: #101114;
  --fg: #EDEAE4;
  --muted: #8A8880;
  --accent: #C8A96A;
  --line: rgba(237, 234, 228, 0.12);
  --line-strong: rgba(237, 234, 228, 0.26);

  --font-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Times New Roman", "Songti SC", Georgia, serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --pad: clamp(1.25rem, 5vw, 5rem);
  --maxw: 1280px;
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: inherit;
}

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

/* ---------- Ambient layers ---------- */

.glow {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    620px circle at var(--mx, 50%) var(--my, 24%),
    rgba(200, 169, 106, 0.09),
    transparent 62%
  );
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.3s var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.25rem, 3vw, 2rem) var(--pad);
  border-bottom: 1px solid transparent;
  transition: padding 0.5s var(--ease), background 0.5s var(--ease),
    border-color 0.5s var(--ease);
}

.nav.is-scrolled {
  padding-block: 0.9rem;
  background: rgba(11, 12, 14, 0.72);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

.nav__brand {
  display: inline-flex;
  align-items: flex-start;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1;
  text-decoration: none;
}

.nav__brand span {
  margin-left: 0.15em;
  font-size: 0.5em;
  color: var(--accent);
  letter-spacing: 0;
  transform: translateY(-0.25em);
}

.nav__links {
  display: flex;
  gap: clamp(1.25rem, 3.5vw, 2.75rem);
}

.nav__links a {
  position: relative;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.35s var(--ease);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.4rem;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.45s var(--ease);
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--fg);
}

.nav__links a:hover::after,
.nav__links a.is-active::after {
  transform: scaleX(1);
  transform-origin: left center;
}

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

.hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: 8rem var(--pad) clamp(4.5rem, 10vh, 7rem);
  overflow: hidden;
}

.hero__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  animation: fadeUp 0.9s var(--ease) 0.1s both;
}

.hero__wordmark {
  display: flex;
  align-items: flex-start;
  margin-top: clamp(0.75rem, 2vh, 1.5rem);
  font-size: clamp(8rem, 23.5vw, 21rem);
  font-weight: 500;
  line-height: 0.82;
  letter-spacing: -0.045em;
}

.hero__wordmark .letter {
  display: inline-block;
  animation: letterIn 1.25s var(--ease) both;
}

.hero__wordmark .letter:nth-child(1) {
  animation-delay: 0.15s;
}

.hero__wordmark .letter:nth-child(2) {
  animation-delay: 0.27s;
}

.hero__wordmark .letter:nth-child(3) {
  animation-delay: 0.39s;
}

.hero__reg {
  margin-top: 0.35em;
  margin-left: 0.12em;
  font-size: clamp(1rem, 1.7vw, 1.5rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  color: var(--accent);
  animation: fadeIn 1s var(--ease) 0.9s both;
}

.hero__tagline {
  margin-top: clamp(1.75rem, 4.5vh, 3rem);
  font-size: clamp(0.85rem, 1.15vw, 1rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  animation: fadeUp 1s var(--ease) 0.75s both;
}

.hero__tagline span {
  color: var(--accent);
  margin-inline: 0.35em;
}

.hero__scroll {
  position: absolute;
  right: var(--pad);
  bottom: clamp(1.75rem, 5vh, 3rem);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.35s var(--ease);
  animation: fadeIn 1s var(--ease) 1.15s both;
}

.hero__scroll:hover {
  color: var(--fg);
}

.hero__scroll-track {
  position: relative;
  display: block;
  width: 52px;
  height: 1px;
  overflow: hidden;
  background: var(--line-strong);
}

.hero__scroll-line {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: scrollLine 2.6s var(--ease) 1.6s infinite;
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(4.5rem, 11vw, 9rem) var(--pad);
  scroll-margin-top: 4.5rem;
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

.section__index {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.section__title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

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

.about__body {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 8vw, 9rem);
  align-items: start;
}

.about__lead {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.9vw, 2.5rem);
  line-height: 1.28;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.about__aside {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 0.35rem;
}

.about__text {
  max-width: 44ch;
  font-size: clamp(0.92rem, 1.1vw, 1rem);
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- Selected ---------- */

.work {
  list-style: none;
  border-top: 1px solid var(--line);
}

.work__row {
  border-bottom: 1px solid var(--line);
}

.work__row a {
  position: relative;
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 1fr) 3rem;
  align-items: center;
  gap: 1rem;
  padding: clamp(1.35rem, 2.8vw, 2.1rem) 0.5rem;
  text-decoration: none;
  transition: background 0.45s var(--ease), padding 0.45s var(--ease);
}

.work__row a:hover {
  background: rgba(237, 234, 228, 0.035);
  padding-inline: 1.25rem;
}

.work__no {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  transition: color 0.35s var(--ease);
}

.work__name {
  font-size: clamp(1.6rem, 3.4vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  transition: transform 0.5s var(--ease), color 0.35s var(--ease);
}

.work__desc {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.work__arrow {
  justify-self: end;
  font-size: 1.2rem;
  color: var(--accent);
  opacity: 0.3;
  transform: translate(-8px, 8px);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}

.work__row a:hover .work__name {
  transform: translateX(6px);
}

.work__row a:hover .work__no {
  color: var(--accent);
}

.work__row a:hover .work__arrow {
  opacity: 1;
  transform: translate(0, 0);
}

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

.contact__body {
  padding-top: clamp(0.5rem, 2vw, 1.5rem);
}

.contact__label {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact__email {
  position: relative;
  display: inline-block;
  margin-top: clamp(1rem, 2.5vw, 1.75rem);
  font-size: clamp(1.75rem, 6.5vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-decoration: none;
  color: var(--fg);
}

.contact__email::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.08em;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s var(--ease);
}

.contact__email:hover::after,
.contact__email:focus-visible::after {
  transform: scaleX(1);
}

.contact__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: clamp(1.75rem, 4vw, 3rem);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(200, 169, 106, 0.12);
}

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

.footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem var(--pad) 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.35s var(--ease);
}

.footer a:hover {
  color: var(--fg);
}

.footer__clock {
  font-variant-numeric: tabular-nums;
}

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Keyframes ---------- */

@keyframes letterIn {
  0% {
    opacity: 0;
    transform: translateY(0.42em) rotate(1.5deg);
    filter: blur(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0);
    filter: blur(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scrollLine {
  0% {
    transform: translateX(-100%);
  }
  45%,
  55% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .about__body {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .work__row a {
    grid-template-columns: 2.75rem minmax(0, 1fr) 2rem;
  }

  .work__desc {
    display: none;
  }
}

@media (max-width: 560px) {
  .nav__links {
    gap: 1rem;
  }

  .nav__links a {
    font-size: 0.72rem;
  }

  .hero {
    padding-top: 7rem;
  }

  .hero__eyebrow {
    font-size: 0.66rem;
    letter-spacing: 0.18em;
  }

  .hero__tagline {
    letter-spacing: 0.22em;
  }

  .hero__scroll {
    right: auto;
    left: var(--pad);
  }

  .contact__meta,
  .footer {
    letter-spacing: 0.1em;
  }
}

@media (hover: none), (pointer: coarse) {
  .glow {
    display: none;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
