/* AI 工厂 — layout & components */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  transition: background-color 0.28s ease, color 0.28s ease;
}

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

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

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  z-index: 100;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* —— Site chrome —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.28s ease, border-color 0.28s ease;
}

.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  font-size: 1.05rem;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #7ae8c8);
  box-shadow: 0 0 0 1px var(--line), 0 8px 20px var(--glow-soft);
  position: relative;
  flex-shrink: 0;
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid var(--accent-ink);
  border-radius: 4px;
  opacity: 0.85;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface-strong);
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

html[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 30px var(--glow-soft);
}

.btn--primary:hover {
  background: var(--accent-strong);
  color: var(--accent-ink);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--store {
  background: #111;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.82rem;
  opacity: 0.55;
  pointer-events: none;
}

html[data-theme="light"] .btn--store {
  background: #1a1a1a;
}

/* —— Hero (full-bleed Glance-style reveal) —— */
.hero {
  position: relative;
  overflow: hidden;
  min-height: min(100vh, 920px);
  isolation: isolate;
}

.hero-reveal__base,
.hero-reveal__alt {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
}

.hero-reveal__base {
  z-index: 0;
  background-image: var(--hero-base, url("/assets/hero-base.webp?v=12"));
  background-color: #d6dceb;
}

.hero-reveal__alt {
  z-index: 1;
  background-image: var(--hero-alt, url("/assets/hero-alt.webp?v=12"));
  background-color: #f0e6dc;
  --reveal-mask: radial-gradient(ellipse closest-side, #000 0%, #000 62%, rgba(0, 0, 0, 0.78) 76%, transparent 100%);
  -webkit-mask-image: var(--reveal-mask);
  mask-image: var(--reveal-mask);
  -webkit-mask-size: var(--reveal-width, 0px) var(--reveal-height, 0px);
  mask-size: var(--reveal-width, 0px) var(--reveal-height, 0px);
  -webkit-mask-position: var(--reveal-x, 0px) var(--reveal-y, 0px);
  mask-position: var(--reveal-x, 0px) var(--reveal-y, 0px);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  mask-mode: alpha;
}

html[data-theme="dark"] .hero-reveal__base {
  filter: brightness(0.72) saturate(0.9);
}

/* Do not filter .hero-reveal__alt — filter + soft mask creates grainy fringe */
html[data-theme="dark"] .hero-reveal__alt {
  filter: none;
}

.hero-reveal__sprite {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: clamp(56px, 5.6vw, 72px);
  aspect-ratio: 5 / 4;
  transform: translate3d(70vw, 80px, 0) translate(-50%, -50%);
  will-change: transform;
  pointer-events: none;
}

.hero-reveal__sprite img {
  width: 100%;
  height: auto;
  transform-origin: 50% 60%;
  will-change: transform;
  filter: drop-shadow(0 10px 18px rgba(76, 29, 149, 0.36));
  user-select: none;
  -webkit-user-drag: none;
}

.hero__ui {
  position: relative;
  z-index: 5;
  max-width: 1120px;
  margin: 0 auto;
  padding: 88px 22px 96px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: end;
  width: 100%;
  min-height: min(100vh, 920px);
  box-sizing: border-box;
}

.hero__copy {
  max-width: 34rem;
  padding: 8px 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
  backdrop-filter: blur(10px);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  font-weight: 800;
  color: var(--ink);
  text-shadow: 0 1px 0 color-mix(in srgb, var(--bg) 35%, transparent);
}

.hero h1 .accent {
  color: var(--accent);
}

.hero__sub {
  color: var(--ink-soft);
  margin: 0 0 28px;
  max-width: 42ch;
  font-size: 1.05rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__card {
  width: min(100%, 340px);
  justify-self: end;
  align-self: end;
  margin-bottom: 28px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero__card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.hero__card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.rating-row {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.rating-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.stars {
  color: #e8a54b;
  letter-spacing: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-reveal__sprite {
    animation: none;
    left: 58% !important;
    top: 42% !important;
    transform: translate(-50%, -50%) !important;
  }

  .hero-reveal__alt {
    -webkit-mask-image: none !important;
    mask-image: none !important;
    opacity: 0;
  }
}

/* —— Sections —— */
.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 22px;
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.section__head h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section__head p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 42ch;
}

.section__badge {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* —— Product matrix —— */
.product-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.product-rail::-webkit-scrollbar {
  height: 6px;
}

.product-rail::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}

@media (min-width: 900px) {
  .product-rail {
    grid-auto-flow: unset;
    grid-template-columns: repeat(3, 1fr);
    overflow: visible;
  }
}

.product-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 0 var(--line);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.product-card:hover {
  text-decoration: none;
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--card-accent, var(--accent)) 45%, var(--line));
}

.product-card__cover {
  height: 140px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--card-accent, var(--accent)) 55%, transparent),
    var(--surface-strong)
  );
  position: relative;
  overflow: hidden;
}

.product-card__cover::after {
  content: attr(data-label);
  position: absolute;
  left: 16px;
  bottom: 14px;
  font-weight: 800;
  font-size: 1.35rem;
  color: #fff;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s ease;
}

.product-card:hover .product-card__cover::after {
  transform: scale(1.04);
}

.product-card__body {
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.product-card__status {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--glow-soft);
  color: var(--accent);
}

.product-card__status--soon {
  background: var(--surface-strong);
  color: var(--muted);
}

.product-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.product-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.product-card__cta {
  font-weight: 700;
  color: var(--card-accent, var(--accent));
  font-size: 0.9rem;
}

.product-card--soon {
  opacity: 0.85;
  cursor: default;
}

.product-card--soon:hover {
  transform: none;
  box-shadow: none;
}

/* —— Process —— */
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.process-item {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.process-item__num {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.process-item h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.process-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* —— Reveal —— */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

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

  .hero__blob,
  .reveal,
  .product-card,
  .btn,
  .theme-toggle {
    animation: none !important;
    transition: none !important;
  }

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

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 40px 22px 56px;
}

.site-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: start;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

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

.site-footer__meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer__meta a {
  color: var(--muted);
}

/* —— Legal / simple pages —— */
.page-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 22px 80px;
}

.page-main h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0.2em 0 0.4em;
  letter-spacing: -0.02em;
}

.page-main .meta {
  color: var(--muted);
  margin-bottom: 24px;
}

.prose-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.prose-card h2 {
  font-size: 1.1rem;
  margin: 1.4em 0 0.45em;
}

.prose-card h2:first-child {
  margin-top: 0;
}

.prose-card p,
.prose-card li {
  color: var(--ink-soft);
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.crumb a {
  color: var(--accent);
}

/* —— Responsive —— */
@media (max-width: 860px) {
  .hero__ui {
    grid-template-columns: 1fr;
    padding-top: 148px;
    padding-bottom: 48px;
    min-height: auto;
    align-items: start;
  }

  .hero {
    min-height: 100svh;
  }

  .hero__card {
    justify-self: stretch;
    width: 100%;
    margin-bottom: 0;
  }

  .process-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
  }

  .site-header__inner {
    gap: 10px;
  }
}
