/* KevinWeb — pidanai-style editorial layout: floating glass header, full-height
   hero, then product sections in a two-column layout. Plain CSS, no libraries. */

:root {
  --bg: #ffffff;
  --fg: #070707;
  --muted: rgba(7, 7, 7, 0.58);
  --faint: rgba(7, 7, 7, 0.4);
  --line: rgba(7, 7, 7, 0.12);
  --dot: rgba(7, 7, 7, 0.13);
  --card: linear-gradient(145deg, rgba(7, 7, 7, 0.045), rgba(7, 7, 7, 0) 46%), #fbfbfb;
  --pad: clamp(20px, 5vw, 72px);
  --font-main: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", STSong, Didot,
    "Bodoni 72", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-main);
  transition: color 0.5s ease;
}

/* the faint dot field behind the whole page, like pidanai's stage */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle at center, var(--dot) 0 1.05px, transparent 1.18px);
  background-size: 38px 38px;
  -webkit-mask-image: radial-gradient(circle at center, #000 0 23%, rgba(0, 0, 0, 0.76) 47%, transparent 82%);
  mask-image: radial-gradient(circle at center, #000 0 23%, rgba(0, 0, 0, 0.76) 47%, transparent 82%);
  transform: translate3d(var(--grid-x, 0px), var(--grid-y, 0px), 0);
  will-change: transform;
}

body::after {
  content: "";
  position: fixed;
  inset: -18vh -14vw;
  z-index: -2;
  pointer-events: none;
  opacity: 0.5;
  background:
    radial-gradient(circle, rgba(120, 190, 255, 0.18) 0 22%, transparent 54%),
    radial-gradient(circle, rgba(255, 190, 210, 0.16) 0 20%, transparent 52%),
    radial-gradient(circle, rgba(190, 170, 255, 0.16) 0 22%, transparent 56%),
    radial-gradient(circle, rgba(170, 240, 215, 0.15) 0 18%, transparent 50%);
  background-size: 42vmax 42vmax, 38vmax 38vmax, 46vmax 46vmax, 34vmax 34vmax;
  background-position: 8% 14%, 84% 8%, 78% 78%, 18% 82%;
  background-repeat: no-repeat;
  filter: blur(88px) saturate(1.1);
}

a,
button {
  cursor: pointer;
}

::selection {
  background: rgba(59, 130, 246, 0.16);
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  width: min(calc(100% - 32px), 1180px);
  height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 clamp(20px, 4vw, 58px);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: saturate(1.2) blur(20px);
  backdrop-filter: saturate(1.2) blur(20px);
  box-shadow:
    inset 0 0 0 1px rgba(7, 7, 7, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 12px 34px rgba(7, 7, 7, 0);
  transition: box-shadow 0.4s ease, background-color 0.4s ease;
}

.site-header.on {
  background: rgba(255, 255, 255, 0.74);
  box-shadow:
    inset 0 0 0 1px rgba(7, 7, 7, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 18px 44px rgba(7, 7, 7, 0.08);
}

.logo {
  justify-self: start;
  color: var(--fg);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-decoration: none;
}

.nav-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.nav-pill {
  padding: 12px 19px;
  border-radius: 13px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-align: center;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(7, 7, 7, 0.05);
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.nav-pill:hover {
  transform: translateY(-1px);
  background-color: rgba(7, 7, 7, 0.035);
  box-shadow: inset 0 0 0 1px rgba(7, 7, 7, 0.09), 0 8px 20px rgba(7, 7, 7, 0.05);
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 96px 24px 72px;
  transition: opacity 0.42s ease, filter 0.42s ease;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 34vw;
  max-width: 520px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(7, 7, 7, 0.035);
  filter: blur(60px);
  pointer-events: none;
}

.hero::before {
  top: 22%;
  left: 7%;
}

.hero::after {
  right: 10%;
  bottom: 14%;
}

.hero-stage {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 168px);
  display: grid;
  place-items: center;
}

.hero-copy {
  width: min(100%, 1280px);
  position: relative;
  text-align: center;
  opacity: 0;
  filter: blur(14px);
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg))
    translate3d(var(--move-x, 0px), var(--move-y, 0px), 0);
  transform-style: preserve-3d;
  transition: transform 130ms ease-out, opacity 0.9s ease, filter 0.9s ease;
  will-change: transform;
}

html.ready .hero-copy {
  opacity: 1;
  filter: none;
}

@media (scripting: none) {
  .hero-copy {
    opacity: 1;
    filter: none;
  }
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(46px, 9.4vw, 148px);
  line-height: 0.86;
  letter-spacing: -0.09em;
  white-space: nowrap;
}

.title-strong {
  font-family: var(--font-display);
  font-weight: 700;
}

.title-light {
  font-family: var(--font-main);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.08em;
}

.eyebrow,
.subtitle,
.scroll-hint {
  color: var(--muted);
  font-size: clamp(14px, 1.6vw, 19px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 22px;
  font-size: 0.78em;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.subtitle {
  width: min(100%, 680px);
  margin: 24px auto 0;
  line-height: 1.7;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 38px;
  margin: 0;
  transform: translateX(-50%);
  font-size: 13px;
  white-space: nowrap;
  animation: hintFloat 2.6s ease-in-out infinite;
}

@keyframes hintFloat {
  0%,
  100% {
    transform: translate(-50%, 0);
    opacity: 0.7;
  }
  50% {
    transform: translate(-50%, 6px);
    opacity: 1;
  }
}

/* pointer lens: a black block that reveals the white Chinese title */
.lens {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 0;
  text-align: center;
  pointer-events: none;
  background: #070707;
  color: #fff;
  opacity: 0;
  transition: opacity 0.18s ease;
  -webkit-mask-image: radial-gradient(
    circle var(--lr, clamp(84px, 13vw, 150px)) at var(--cx, 50%) var(--cy, 50%),
    #000 calc(100% - 16px),
    transparent 100%
  );
  mask-image: radial-gradient(
    circle var(--lr, clamp(84px, 13vw, 150px)) at var(--cx, 50%) var(--cy, 50%),
    #000 calc(100% - 16px),
    transparent 100%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.lens.on {
  opacity: 1;
}

.lens .eyebrow {
  color: rgba(255, 255, 255, 0.5);
}

.lens .subtitle {
  color: rgba(255, 255, 255, 0.66);
}

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

/* ---------- product sections ---------- */

.product-section {
  position: relative;
  padding: clamp(72px, 9vh, 120px) var(--pad) clamp(24px, 4vh, 48px);
  scroll-margin-top: 110px;
}

.product-layout {
  width: min(100%, 1320px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(0, 1.45fr);
  gap: clamp(22px, 4vw, 54px);
  align-items: center;
}

.product-layout.flip .product-copy {
  order: 2;
}

.product-layout.flip .product-window {
  order: 1;
}

.product-copy {
  position: relative;
  padding: clamp(28px, 4vw, 52px);
  border: 1px solid var(--line);
  border-radius: 38px;
  background: var(--card);
  box-shadow:
    0 26px 78px rgba(7, 7, 7, 0.07),
    inset 0 1px rgba(255, 255, 255, 0.6);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg))
    translateY(var(--lift, 0px));
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.section-kicker {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.product-copy h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 4.6vw, 74px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.product-copy p {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.75;
}

.spec-list {
  display: grid;
  gap: 12px;
  margin-top: clamp(24px, 3.4vw, 38px);
}

.spec-list span {
  display: grid;
  gap: 5px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.spec-list strong {
  color: var(--fg);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease,
    color 0.25s ease;
}

.btn.solid {
  background: var(--fg);
  color: #fff;
}

.btn.solid:hover {
  transform: translateY(-1px);
  background: #1d1d1d;
}

.btn.quiet {
  min-height: 38px;
  padding: 0.3rem 0.15rem;
  color: var(--fg);
  border-radius: 0;
  font-weight: 700;
  background: none;
}

.btn.quiet::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn.quiet {
  position: relative;
}

.btn.quiet:hover::after {
  transform: scaleX(1);
}

.product-window {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #f6f6f6;
  box-shadow:
    0 38px 105px rgba(7, 7, 7, 0.14),
    inset 0 1px rgba(255, 255, 255, 0.6);
  aspect-ratio: 16 / 10;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg))
    translateY(var(--lift, 0px));
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.product-window img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-window::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent 22%, transparent 74%, rgba(255, 255, 255, 0.2)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 18%);
  opacity: 0.5;
}

.product-window.terminal {
  display: flex;
  flex-direction: column;
  background: #0b0b0b;
  color: #e8e8e8;
  border-color: rgba(7, 7, 7, 0.18);
}

.product-window.terminal::after {
  display: none;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.term-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.term-bar span {
  margin-left: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.term-body {
  margin: 0;
  padding: clamp(18px, 2.4vw, 30px);
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(11px, 1.1vw, 14px);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.78);
  white-space: pre-wrap;
}

.link-rows {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.link-row span {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.link-row small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.link-row i {
  font-style: normal;
  color: var(--muted);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.link-row:hover {
  transform: translateX(3px);
}

.link-row:hover i {
  transform: translate(3px, -3px);
}

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(60px, 10vh, 120px);
  padding: 28px var(--pad) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.site-footer a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

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

.reveal {
  opacity: 0;
  transform: translate3d(0, 54px, 0) scale(0.98);
  filter: blur(10px);
  transition:
    opacity 0.76s cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0s),
    transform 0.76s cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0s),
    filter 0.76s cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0s);
}

.reveal.in {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: none;
}

html.has-scrolled .hero {
  opacity: 0.62;
  filter: blur(2px);
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .product-layout {
    grid-template-columns: 1fr;
  }

  .product-layout.flip .product-copy,
  .product-layout.flip .product-window {
    order: 0;
  }
}

@media (max-width: 900px) {
  .site-header {
    top: 12px;
    height: auto;
    padding: 14px 18px;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px 12px;
    border-radius: 28px;
  }

  .nav-pills {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-pills::-webkit-scrollbar {
    display: none;
  }

  .nav-pill {
    min-width: auto;
    padding: 10px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .header-actions {
    gap: 8px;
  }

  .hero {
    padding-top: 132px;
    min-height: 88vh;
  }

  .hero-copy h1 {
    font-size: clamp(54px, 17vw, 92px);
    letter-spacing: -0.075em;
  }

  .product-section {
    padding-top: 64px;
  }

  .product-copy {
    border-radius: 28px;
  }

  .product-copy h3 {
    font-size: clamp(34px, 9.5vw, 52px);
  }

  .product-window {
    border-radius: 20px;
  }
}

@media (max-width: 560px) {
  .logo {
    font-size: 17px;
    letter-spacing: 0.12em;
  }

  .link-row {
    grid-template-columns: 1fr auto;
  }

  .link-row small {
    display: none;
  }

  .term-body {
    font-size: 10.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy,
  .reveal,
  .product-copy,
  .product-window {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
    animation: none;
  }

  .scroll-hint {
    animation: none;
  }

  html.has-scrolled .hero {
    opacity: 1;
    filter: none;
  }
}

/* hide the system cursor only on the homepage first screen */
.hero { cursor: none; }
.hero a, .hero button { cursor: pointer; }
