:root {
  --bg: #030305;
  --panel: rgba(255, 255, 255, 0.03);
  --accent: #f6c23e;
  --text-muted: rgba(255, 255, 255, 0.7);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Helvetica Neue", sans-serif;
  background-color: var(--bg);
  color: #f7f6f2;
}

.page {
  min-height: 100vh;
  background: var(--bg);
}

.hero {
  position: relative;
  min-height: 100vh;
  padding: 2rem 6vw 6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: var(--bg);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 7, 7, 0) 0%, rgba(7, 7, 7, 0.95) 70%);
  z-index: 0;
  animation: shimmer 8s ease-in-out infinite;
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 64, 129, 0.35), rgba(15, 76, 129, 0.45));
  mix-blend-mode: screen;
  z-index: 1;
}

.hero__nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hero__backgrounds {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero__bg.is-active {
  opacity: 1;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo img {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.logo__text {
  display: flex;
  flex-direction: column;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.logo__name {
  font-size: 0.85rem;
  position: relative;
  color: #fff;
}

.logo__name::after {
  content: "上澄科技有限公司";
  position: absolute;
  left: 2px;
  top: 0;
  color: rgba(246, 194, 62, 0.8);
  clip-path: inset(0 0 50% 0);
  animation: glitch 2s infinite;
}

.logo__tagline {
  font-size: 0.55rem;
  letter-spacing: 0.5em;
  color: rgba(255, 255, 255, 0.6);
}

.nav__links {
  display: flex;
  gap: 1rem;
}

.nav__links a {
  color: #f0f0f0;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav__cta {
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: transparent;
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s ease;
}

.nav__cta:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hero__content {
  position: relative;
  z-index: 2;
  margin-top: 5rem;
  max-width: 680px;
  animation: float 16s ease-in-out infinite;
}

.eyebrow {
  letter-spacing: 0.4em;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.hero__content h1 {
  font-size: clamp(2.5rem, 4vw, 4rem);
  margin: 0.5rem 0 1rem;
  line-height: 1.2;
}

.lead {
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
}

.hero__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.btn--primary {
  background: var(--accent);
  color: #070707;
}

.btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
}

.btn:hover {
  transform: translateY(-2px);
}

.hero__note {
  color: var(--text-muted);
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  margin-top: 2rem;
  text-transform: uppercase;
}

@keyframes glitch {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-1px, 1px);
  }
  40% {
    transform: translate(1px, -1px);
  }
  60% {
    transform: translate(-1px, -1px);
  }
  80% {
    transform: translate(1px, 1px);
  }
  100% {
    transform: translate(0);
  }
}

.hero__scroll {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  letter-spacing: 0.5em;
  font-size: 0.75rem;
  cursor: pointer;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  animation: scroll-pulse 2s ease-in-out infinite;
  pointer-events: auto;
}
.hero__scroll.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px);
}

.back-to-top {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(7, 7, 7, 0.6);
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

main {
  background: var(--bg);
}

.panel {
  padding: 5rem 6vw;
}

.panel--glass {
  background: rgba(17, 16, 23, 0.85);
  backdrop-filter: blur(24px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.panel--dark {
  background: var(--bg);
}

#contact {
  background-image: linear-gradient(180deg, rgba(3, 3, 5, 0.95), rgba(3, 3, 5, 0.85)), url("https://images.unsplash.com/photo-1529429617124-aee7119cfa1b?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.panel--light {
  background: #111018;
}

.panel--split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  align-items: stretch;
}

.panel__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.panel__heading h2 {
  font-size: clamp(2.2rem, 3vw, 3rem);
  margin: 0.5rem 0 1rem;
}

.panel__heading p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
}

.panel__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}

.panel__stats span {
  font-size: 2rem;
  font-weight: 600;
}

.panel__stats p {
  margin: 0.2rem 0 0;
  color: rgba(255, 255, 255, 0.7);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (min-width: 1200px) {
  .service-grid {
    grid-template-columns: repeat(3, minmax(200px, 1fr));
  }
}

.service-grid article {
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem;
  min-height: 250px;
  background-image: radial-gradient(circle at top, rgba(246, 194, 62, 0.15), transparent 60%);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.service-grid h3 {
  margin-top: 1rem;
}

.service-card__media {
  height: 180px;
  border-radius: 0.75rem;
  background-size: cover;
  background-position: center;
  filter: saturate(1.1);
  transition: transform 1s ease;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.service-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.7) 100%);
  z-index: 1;
}

.project-grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.project-grid article {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.project-grid article.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.project__media {
  height: 190px;
  border-radius: 0.8rem;
  background-size: cover;
  background-position: center;
  margin-bottom: 1rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.contact-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.7);
}

.contact-form input,
.contact-form textarea {
  margin-top: 0.4rem;
  padding: 0.85rem 1rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.contact__info {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  line-height: 1.6;
}

.contact__info a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer {
  padding: 2rem 6vw;
  text-align: center;
  background: #050505;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

.panel[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: transform 0.9s ease, opacity 0.9s ease;
}

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

article[data-reveal] {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 0.2;
  }
}

@keyframes scroll-pulse {
  0% {
    transform: translate(-50%, 0);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -12px);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, 0);
    opacity: 0.8;
  }
}

@media (max-width: 768px) {
  .hero__nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav__links {
    flex-wrap: wrap;
  }

  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
