/* ── PhyCyber 3D — one engine, every 3D output. Deep, generative, spatial. ── */
:root {
  color-scheme: dark;
  --bg: #08080c;
  --surface: #101019;
  --elevated: #16161f;
  --line: #26262f;
  --line-soft: #1c1c25;
  --text: #f1f1f6;
  --muted: #9a9aab;
  --faint: #62626f;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --magenta: #ec4899;
  --amber: #f59e0b;
  --grad: linear-gradient(110deg, #22d3ee, #8b5cf6 52%, #ec4899);
  --grad-soft: linear-gradient(135deg, rgba(34,211,238,0.16), rgba(139,92,246,0.16), rgba(236,72,153,0.14));
  --r: 20px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 60; padding: 10px 16px; border-radius: 999px;
  background: var(--violet); color: #fff; font-size: 14px; font-weight: 700;
  transform: translateY(-160%); transition: transform 0.18s ease;
}
.skip-link:focus { transform: translateY(0); }
#top:focus { outline: none; }

/* atmospheric background glow */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(50% 40% at 80% -5%, rgba(139,92,246,0.22), transparent 60%),
    radial-gradient(45% 38% at 8% 6%, rgba(34,211,238,0.16), transparent 60%),
    radial-gradient(40% 35% at 60% 100%, rgba(236,72,153,0.12), transparent 60%);
}

/* header */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px clamp(18px, 4vw, 56px);
  background: rgba(8, 8, 12, 0.7); border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.5);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 7px; border-radius: 4px;
  border: 1.6px solid rgba(255,255,255,0.9); transform: rotate(0deg);
  border-right-color: rgba(255,255,255,0.35); border-bottom-color: rgba(255,255,255,0.35);
}
.brand b { font-weight: 800; }
.brand .g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.site-header nav { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 14px; font-weight: 600; }
.site-header nav a:hover { color: var(--text); }
.lang-toggle {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 700; font-size: 13px; padding: 6px 13px; border-radius: 999px; cursor: pointer;
  transition: border-color 0.15s;
}
.lang-toggle:hover { border-color: var(--violet); }

/* buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}
.button.primary { background: var(--grad); color: #fff; box-shadow: 0 12px 34px rgba(139, 92, 246, 0.4); }
.button.primary:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(139, 92, 246, 0.55); }
.button.secondary { background: rgba(255,255,255,0.04); color: var(--text); border: 1px solid var(--line); }
.button.secondary:hover { transform: translateY(-2px); border-color: var(--violet); }

/* hero */
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: clamp(28px, 5vw, 64px); align-items: center;
  width: min(1180px, calc(100% - 44px)); margin: 0 auto; padding: clamp(48px, 7vw, 92px) 0;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 700; color: var(--muted);
}
.eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 15ch; margin-bottom: 18px; font-size: clamp(34px, 4.6vw, 60px); font-weight: 850; line-height: 1.12; letter-spacing: -0.025em; }
.g-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 44ch; color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 22px; }
.io-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--faint); font-size: 13px; }
.io-row .chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; }

/* hero engine visual */
.engine {
  position: relative; border-radius: 26px; padding: 22px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 40px 90px rgba(0,0,0,0.55);
  overflow: hidden;
}
.engine::before {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background:
    linear-gradient(transparent 95%, rgba(139,92,246,0.18) 96%) 0 0 / 100% 26px,
    linear-gradient(90deg, transparent 95%, rgba(34,211,238,0.14) 96%) 0 0 / 26px 100%;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent 80%);
  mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent 80%);
}
.engine-core {
  position: relative; z-index: 1; margin: 6px auto 18px; width: 120px; height: 120px;
  border-radius: 26px; background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 0 50px rgba(139, 92, 246, 0.6);
  animation: float 5s ease-in-out infinite;
}
.engine-core::after { content: "3D"; font-weight: 900; font-size: 34px; color: #fff; letter-spacing: -0.04em; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
.engine-label { position: relative; z-index: 1; text-align: center; font-size: 12px; font-weight: 700; color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px; }
.engine-outputs { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.engine-outputs span {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 6px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--elevated); font-size: 12px; font-weight: 600; color: var(--muted);
}

/* sections */
.section { width: min(1140px, calc(100% - 44px)); margin: 0 auto; padding: clamp(56px, 8vw, 96px) 0; }
.section-head { max-width: 660px; margin: 0 auto clamp(36px, 5vw, 54px); text-align: center; }
.section-head .eyebrow { color: var(--muted); }
h2 { font-size: clamp(27px, 3.2vw, 42px); font-weight: 850; line-height: 1.16; letter-spacing: -0.025em; }
.section-head p { color: var(--muted); font-size: 17px; line-height: 1.6; margin-top: 12px; }

/* verticals grid */
.verticals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.vcard {
  display: block; position: relative; padding: 24px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s; overflow: hidden;
}
a.vcard .live { transition: background 0.18s; }
a.vcard:hover .live { background: rgba(34, 211, 238, 0.24); }
.vcard:hover { transform: translateY(-4px); border-color: rgba(139,92,246,0.5); box-shadow: 0 24px 50px rgba(0,0,0,0.5); }
.vcard .vic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; margin-bottom: 16px; background: var(--grad-soft); }
.vcard h3 { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.vcard p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0; }
.vcard .live { position: absolute; top: 18px; right: 18px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; background: rgba(34,211,238,0.14); color: var(--cyan); }

/* how it works */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { padding: 26px 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.step .n { font-size: 13px; font-weight: 800; color: var(--violet); letter-spacing: 0.08em; margin-bottom: 14px; }
.step h3 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0; }

/* moat band */
.moat { background: linear-gradient(135deg, rgba(34,211,238,0.06), rgba(236,72,153,0.06)); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.moat-inner { width: min(1140px, calc(100% - 44px)); margin: 0 auto; padding: clamp(48px, 7vw, 84px) 0; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.moat-list { display: grid; gap: 14px; }
.moat-row { display: flex; gap: 14px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.moat-row .d { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--grad-soft); }
.moat-row b { display: block; font-size: 16px; margin-bottom: 3px; }
.moat-row span { color: var(--muted); font-size: 14px; line-height: 1.55; }

/* apply */
.apply { width: min(880px, calc(100% - 44px)); margin: 0 auto clamp(40px, 6vw, 70px); text-align: center; }
.apply .eyebrow { color: var(--muted); }
.apply h2 { margin-bottom: 12px; }
.apply > p { color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 52ch; margin: 0 auto 26px; }
.waitlist-form { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 560px; margin: 0 auto; }
.waitlist-form input, .waitlist-form select {
  min-height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 500; flex: 1 1 200px;
}
.waitlist-form input:focus, .waitlist-form select:focus { outline: 2px solid rgba(139,92,246,0.4); border-color: var(--violet); }
.waitlist-form .button { flex: 1 1 100%; }
.form-status { min-height: 22px; margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.form-status.success { color: var(--cyan); }
.form-status.error { color: var(--magenta); }
.boundary { margin-top: 22px; font-size: 12.5px; color: var(--faint); line-height: 1.5; }

/* footer */
.site-footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  width: min(1140px, calc(100% - 44px)); margin: 0 auto; padding: 28px 0 44px;
  color: var(--faint); font-size: 13.5px; border-top: 1px solid var(--line-soft);
}

/* responsive */
@media (max-width: 900px) {
  .site-header nav a { display: none; }
  .hero-inner, .moat-inner { grid-template-columns: 1fr; }
  .hero-inner { text-align: center; }
  .hero-copy .eyebrow, .hero-actions, .io-row { justify-content: center; }
  .engine { order: -1; }
  .verticals, .how { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .verticals, .how { grid-template-columns: 1fr; }
  h1 { font-size: 35px; }
  .site-footer { flex-direction: column; }
}

/* ── real engine demo ── */
.demo-frame {
  max-width: 920px; margin: 0 auto; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 40px 90px rgba(0,0,0,0.55), 0 0 0 1px rgba(139,92,246,0.14);
}
.demo-video { display: block; width: 100%; height: auto; background: #000; }
.demo-cap {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line);
}
.demo-cap a { color: var(--cyan); font-weight: 700; }
.vcard .soon {
  position: absolute; top: 18px; right: 18px; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; background: rgba(245,158,11,0.14); color: var(--amber);
}

.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1000px; margin: 0 auto; }
.demo-3d { display: block; width: 100%; height: 300px; background: radial-gradient(120% 100% at 50% 0%, #14141f, #0a0a10); --poster-color: transparent; }
@media (max-width: 760px) { .demo-grid { grid-template-columns: 1fr; } }

/* ════ PhyCyber 3D v2 — platform layout ════ */
/* prompt box */
.prompt-box { margin: 22px 0 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 14px 16px; box-shadow: inset 0 0 0 1px rgba(139,92,246,0.06); }
.prompt-box textarea { width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; line-height: 1.55; resize: none; outline: none; }
.prompt-box textarea::placeholder { color: var(--faint); }
.prompt-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.up-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.up { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--elevated); }
.hero-actions { margin-top: 18px; }

/* hero visual showcase */
.hero-visual { display: grid; gap: 14px; }
.showcase-main, .showcase-tile { position: relative; margin: 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 30px 70px rgba(0,0,0,0.5); }
.showcase-main img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.showcase-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.showcase-tile img { display: block; width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.showcase-main figcaption, .showcase-tile figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 16px 12px; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(transparent, rgba(8,8,12,0.85)); }
.showcase-tile figcaption { font-size: 11.5px; padding: 14px 10px 9px; }
.showcase-tile.real { border-color: rgba(34,211,238,0.4); }
.showcase-tile.real::after { content: "LIVE"; position: absolute; top: 8px; right: 8px; font-size: 9px; font-weight: 800; color: var(--cyan); background: rgba(34,211,238,0.16); padding: 3px 7px; border-radius: 999px; }

/* card grids */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { padding: 24px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s; }
.card:hover { transform: translateY(-4px); border-color: rgba(139,92,246,0.5); box-shadow: 0 24px 50px rgba(0,0,0,0.5); }
.card .ci { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-size: 23px; margin-bottom: 15px; background: var(--grad-soft); }
.card h3 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }
.card .ctag { display: inline-block; margin-top: 14px; font-size: 12px; font-weight: 600; color: var(--cyan); }
.sol-card { background: linear-gradient(160deg, var(--surface), #0c0c14); }

/* case cards */
.case-card { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface); transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s; }
.case-card:hover { transform: translateY(-4px); border-color: rgba(139,92,246,0.5); box-shadow: 0 26px 56px rgba(0,0,0,0.55); }
.case-img img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.case-body { padding: 20px 22px 24px; }
.case-body h3 { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.case-body p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 12px; }
.case-link { font-size: 14px; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* CTA band */
.cta-band { position: relative; overflow: hidden; margin: clamp(40px,6vw,72px) auto; width: min(1140px, calc(100% - 44px)); border-radius: 28px; border: 1px solid var(--line); background: radial-gradient(120% 140% at 80% 0%, rgba(139,92,246,0.28), transparent 60%), radial-gradient(100% 120% at 10% 100%, rgba(34,211,238,0.18), transparent 60%), #0c0c14; }
.cta-inner { padding: clamp(40px,6vw,72px) clamp(24px,5vw,64px); text-align: center; }
.cta-inner h2 { margin-bottom: 12px; }
.cta-inner p { color: var(--muted); font-size: 17px; max-width: 56ch; margin: 0 auto 26px; line-height: 1.6; }

@media (max-width: 900px) {
  .grid4, .grid3 { grid-template-columns: 1fr 1fr; }
  .hero-visual { order: 2; }
}
@media (max-width: 600px) {
  .grid4, .grid3, .showcase-row { grid-template-columns: 1fr; }
  .showcase-row { grid-template-columns: 1fr 1fr; }
}

/* ── 3D dynamic: parallax tilt + Ken Burns ── */
.tilt { transition: transform 0.28s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; will-change: transform; }
.showcase-main img, .case-img img { animation: kenburns 24s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.03); } to { transform: scale(1.11) translate(-1%, -1.5%); } }
@media (prefers-reduced-motion: reduce) { .showcase-main img, .case-img img { animation: none; } .tilt { transition: none; } }

/* ════ ui-ux-pro-max polish: SVG icons, gradient borders, generation feel, reveal ════ */
.ci { color: var(--violet); }
.ci svg { width: 24px; height: 24px; display: block; }
.ci.c1 svg, .card:nth-child(1) .ci svg { color: var(--cyan); }
.ci.c4 svg { color: var(--cyan); }
.ci.c5 svg, .ci.c6 svg { color: var(--magenta); }
.up { cursor: pointer; transition: border-color .2s, color .2s; }
.up:hover { border-color: var(--violet); color: var(--text); }

/* gradient-border ring on hover (premium depth) */
.card, .case-card { position: relative; isolation: isolate; }
.card::after, .case-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .28s ease; pointer-events: none; z-index: 2;
}
.card:hover::after, .case-card:hover::after { opacity: .9; }
.case-card { cursor: pointer; }

/* prompt-box: animated generative shimmer border */
.prompt-box { position: relative; }
.prompt-box::before {
  content: ""; position: absolute; inset: -1px; border-radius: 17px; padding: 1px;
  background: linear-gradient(110deg, transparent 25%, rgba(139,92,246,.7), rgba(34,211,238,.7) 55%, transparent 80%);
  background-size: 220% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: pmshimmer 4.5s linear infinite; pointer-events: none;
}
@keyframes pmshimmer { to { background-position: 220% 0; } }

/* scroll reveal */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); }
[data-reveal].in { opacity: 1; transform: none; }

/* larger, more generous section rhythm + focus */
.eyebrow { letter-spacing: .01em; }
a:focus-visible, button:focus-visible, .card:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .prompt-box::before { animation: none; }
}

/* ── fix: align engine-demo frames (equal landscape size, centered media) ── */
.demo-grid { align-items: stretch; }
.demo-frame { display: flex; flex-direction: column; }
.demo-video, .demo-3d {
  width: 100%; height: auto; aspect-ratio: 16 / 10;
  object-fit: contain;
  background: radial-gradient(130% 110% at 50% 0%, #16161f, #0a0a10);
}
.demo-cap { margin-top: auto; }
@media (max-width: 760px) { .demo-video, .demo-3d { aspect-ratio: 4 / 3; } }

/* fix v2: model-viewer ignores aspect-ratio; use fixed equal heights */
.demo-video, .demo-3d { aspect-ratio: auto !important; height: 380px !important; width: 100% !important; object-fit: contain; display: block; }
@media (max-width: 760px) { .demo-video, .demo-3d { height: 300px !important; } }
