/* ============================================================
   Malaysia Landing — immersive editorial system
   Palette: ink #0A0A0A · blue #0758D7 · paper #E8E8E2 · acid #B9FF2C
   Original implementation; no external assets.
   ============================================================ */

:root {
  --ink: #0a0a0a;
  --blue: #0758d7;
  --paper: #e8e8e2;
  --acid: #b9ff2c;
  --coral: #ff402e;
  --line: #bebeba;
  --muted: #61615e;
  --blue-soft: rgba(7, 88, 215, 0.55);
}

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

html, body { overflow-x: clip; }

html { scroll-behavior: auto; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: "DM Sans", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.7s ease, color 0.7s ease;
}

body[data-theme="blue"] { background: var(--blue); }
body[data-theme="paper"] { background: var(--paper); color: var(--ink); }

a { color: inherit; text-decoration: none; }

::selection { background: var(--acid); color: var(--ink); }

/* ---------- Lenis ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Noise overlay (original SVG turbulence) ---------- */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
  background-size: 140px 140px;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 66px;
  padding: 0 clamp(20px, 3vw, 46px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #fff;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.6s ease, background-color 0.6s ease, border-color 0.6s ease;
}

body[data-theme="paper"] .site-header {
  color: var(--ink);
  background: rgba(232, 232, 226, 0.92);
  border-bottom-color: rgba(10, 10, 10, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.brand-dot {
  width: 9px;
  height: 9px;
  background: var(--acid);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--acid);
}

nav { display: flex; gap: 27px; font-size: 11px; }
nav a { opacity: 0.8; transition: opacity 0.25s ease; position: relative; }
nav a:hover { opacity: 1; }
nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.header-cta {
  font-size: 11px;
  font-weight: 500;
  border-bottom: 1px dotted currentColor;
  padding-bottom: 2px;
  white-space: nowrap;
}
.header-cta span { color: var(--acid); font-size: 14px; }

/* ---------- Shared type / buttons ---------- */
.eyebrow {
  color: var(--acid);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.12em;
  margin-bottom: 24px;
}

.button {
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 14px 18px;
  font: 500 13px inherit;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border-radius: 0;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.button-primary { background: #fff; color: var(--ink); border-color: #fff; }
.button-primary:hover { background: var(--acid); color: var(--ink); border-color: var(--acid); }

.text-link {
  font-size: 13px;
  border-bottom: 1px dotted currentColor;
  transition: opacity 0.25s ease;
}
.text-link:hover { opacity: 0.7; }

/* ---------- HERO (dithered video first screen) ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 760px;
  overflow: hidden;
  isolation: isolate;
  background: #050505;
  color: #f4f4f4;
}

/* Hyperstudio blueprint atmosphere: background-only, so existing content stays intact. */
.hero-hyperstudio-atlas {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: .72;
  background:
    radial-gradient(circle, rgba(243,243,243,.18) 0 1px, transparent 1.2px) 0 0 / 12px 12px,
    linear-gradient(90deg, transparent 49.94%, rgba(193,193,193,.09) 50%, transparent 50.06%),
    linear-gradient(transparent 49.94%, rgba(193,193,193,.065) 50%, transparent 50.06%);
}
.hero-threads {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .96;
  mix-blend-mode: screen;
}
/* Threads is now the sole visual background. Keep prior assets in the project
   but do not layer a competing map / blueprint effect over the line field. */
.hero-hyperstudio-atlas,
.hero-image-map { display: none; }
.hero-hyperstudio-atlas::before {
  content: "";
  position: absolute;
  inset: 7% -4% 4% 28%;
  background-image: radial-gradient(circle, rgba(243,243,243,.6) 0 1px, transparent 1.25px);
  background-size: 8px 8px;
  clip-path: polygon(5% 33%,12% 20%,22% 23%,28% 15%,38% 22%,42% 35%,37% 48%,41% 61%,33% 76%,25% 66%,18% 72%,12% 58%,54% 34%,60% 20%,69% 23%,75% 15%,86% 24%,94% 20%,100% 33%,94% 45%,98% 56%,87% 61%,82% 77%,73% 71%,66% 79%,58% 65%,52% 53%);
  filter: drop-shadow(0 0 18px rgba(243,243,243,.05));
  animation: atlas-drift 16s ease-in-out infinite alternate;
}
.hero-hyperstudio-atlas::after {
  content: "";
  position: absolute;
  width: clamp(170px, 17vw, 270px);
  aspect-ratio: 1;
  right: clamp(28px, 9vw, 150px);
  top: 26%;
  border: 1px solid rgba(111,103,89,.28);
  border-radius: 50%;
  background: linear-gradient(90deg, transparent calc(50% - .5px), rgba(111,103,89,.36) 50%, transparent calc(50% + .5px)), linear-gradient(transparent calc(50% - .5px), rgba(111,103,89,.36) 50%, transparent calc(50% + .5px));
  box-shadow: inset 0 0 0 28px rgba(8,8,8,.13);
  animation: compass-breathe 5.6s ease-in-out infinite;
}
@keyframes atlas-drift {
  from { transform: translate3d(-6px,4px,0); background-position: 0 0; opacity: .38; }
  to { transform: translate3d(7px,-5px,0); background-position: 12px -8px; opacity: .82; }
}
@keyframes compass-breathe {
  0%,100% { transform: scale(.96); opacity: .35; }
  50% { transform: scale(1.04); opacity: .75; }
}

/* real video source (optional). Only used as a texture; hidden visually. */
.hero-video {
  position: absolute;
  opacity: 0;
  width: 2px;
  height: 2px;
  pointer-events: none;
}

.hero-map-poster,
.hero-map-video {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.hero-image-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .58;
}

/* dark gradients: top (under nav) + bottom-left (under title/meta) */
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(5, 5, 5, 0.78) 0%, rgba(5, 5, 5, 0.25) 26%, transparent 46%),
    linear-gradient(to top left, rgba(5, 5, 5, 0.9) 0%, rgba(5, 5, 5, 0.45) 24%, transparent 55%);
}

/* compact floating nav (Cregg-style text pills) */
.hero-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px clamp(20px, 3vw, 46px);
  flex-wrap: wrap;
}
.hero-nav-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hero-nav-btn {
  appearance: none;
  background: rgba(10, 10, 10, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  padding: 7px 14px;
  font: 500 11px inherit;
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.hero-nav-btn:hover,
.hero-nav-btn:focus-visible {
  background: var(--acid);
  border-color: var(--acid);
  color: #0a0a0a;
}
.hero-nav-brand { font-weight: 700; letter-spacing: 0.06em; }
.menu-toggle { display: none; }

/* headline — position/size driven by hero visual editor CSS variables */
.hero-title-block {
  position: absolute;
  left: var(--hero-title-x, clamp(20px, 4.5vw, 80px));
  top: var(--hero-title-y, 42%);
  transform: translateY(-50%);
  z-index: 3;
  max-width: min(var(--hero-title-maxw, 70vw), 1040px);
}
.hero-title {
  font-size: var(--hero-title-size-d, clamp(56px, 6.2vw, 110px));
  font-weight: var(--hero-title-weight, 600);
  line-height: var(--hero-title-lh, 1.04);
  letter-spacing: -0.04em;
  color: var(--hero-title-color, #f4f4f4);
  opacity: var(--hero-title-opacity, 1);
}
.hero-title-line { display: block; }
.hero-title-inner { display: inline-block; will-change: transform, opacity; }
.hero-title.title-enterprise { font-size: clamp(44px, 4.45vw, 76px); line-height: 1.1; max-width: 1120px; }

/* Interactive status signal (scrambled text): independently positioned */
.hero-flap-wrap {
  position: absolute;
  left: var(--hero-status-x, 5%);
  top: var(--hero-status-y, 78%);
  z-index: 3;
  padding: 0 0 4px 22px;
  opacity: var(--hero-status-opacity, 1);
}
.hero-flap-wrap::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 3px;
  width: 2px;
  background: linear-gradient(180deg, var(--hero-status-line-color, #62c5ff), rgba(98,197,255,.08));
  box-shadow: 0 0 18px rgba(57,178,255,.7);
}
.hero-flap-label {
  font-size: clamp(12px, .9vw, 16px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(218,236,255,.76);
  margin: 0 0 14px;
}
.scrambled-text {
  display: flex; align-items: baseline; flex-wrap: wrap; max-width: min(1040px, 80vw);
  color: var(--hero-status-color, #f7fbff); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--hero-status-size-d, clamp(42px, 4.5vw, 78px)); font-weight: 700; letter-spacing: .055em;
  line-height: 1.04; cursor: crosshair; user-select: none; white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0,0,0,.55), 0 0 32px rgba(60,164,255,.22);
}
.scrambled-char { display: inline-block; min-width: .2em; will-change: contents, color, text-shadow, transform; transition: color .16s ease, text-shadow .16s ease, transform .16s ease; }
.scrambled-char.is-accent { color: #75d3ff; text-shadow: 0 0 22px rgba(75,190,255,.95); }
.scrambled-char.is-scrambling { color: #67c7ff; text-shadow: 0 0 28px rgba(55,176,255,1); transform: translateY(-.04em) scale(1.07); }

/* quiet bottom-left meta */
.hero-meta {
  position: absolute;
  left: clamp(20px, 4.5vw, 80px);
  bottom: 116px;
  z-index: 3;
  opacity: 0.65;
}
.hero-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 8px;
  white-space: nowrap;
}
.hero-tags {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.65);
}

/* scroll hint + thin progress line (bottom-right) */
.hero-scroll {
  position: absolute;
  right: clamp(20px, 4.5vw, 80px);
  bottom: 36px;
  z-index: 3;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.6);
}
.hero-scroll span { color: rgba(255, 255, 255, 0.85); margin-left: 8px; }
.hero-base-line {
  position: absolute;
  right: clamp(20px, 4.5vw, 80px);
  bottom: 20px;
  width: 260px;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
#page-progress {
  display: block;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

/* compact fixed header: hidden from the very first frame while the hero nav is up */
body:has(.hero) .site-header {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s, color 0.6s ease, background-color 0.6s ease;
}
body:has(.hero).past-hero .site-header {
  visibility: visible;
  opacity: 1;
  transform: none;
}

/* mobile fullscreen menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }
.mobile-menu-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 46px;
  height: 46px;
  background: #2b2b2b;
  border: 1px solid #404040;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.mobile-menu-nav { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.mobile-menu-nav a {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #efefef;
  padding: 10px 46px;
  border-bottom: 1px solid #2a2a2a;
}
.mobile-menu-nav a:hover { color: #fff; }


/* ---------- SERVICES (sticky horizontal scene, JS-driven) ---------- */
.services {
  background: #0d0d0c;
  color: var(--paper);
}

.services-head {
  padding: clamp(96px, 13vw, 190px) clamp(24px, 7.8vw, 126px) 0;
}
.services-head h2 {
  font-size: clamp(40px, 5.3vw, 84px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1;
}
.services-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 42px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}
.services-count { color: var(--blue); font-weight: 600; letter-spacing: 0.1em; }
.services-scroll b { color: var(--acid); }

/* default (no JS / mobile): vertical stacked cards */
.services-pin { height: auto; overflow: visible; }
.services-track {
  display: block;
  padding: 30px clamp(24px, 7.8vw, 126px) 0;
}
.service-card {
  flex: none;
  width: 100%;
  height: auto;
  min-height: 0;
  margin-bottom: 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: clamp(26px, 3.4vw, 52px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.025);
  position: relative;
}
.service-card-primary {
  border-color: rgba(7, 88, 215, 0.75);
  background: linear-gradient(165deg, rgba(7, 88, 215, 0.18) 0%, rgba(7, 88, 215, 0.03) 55%, rgba(255, 255, 255, 0.02) 100%);
}
.service-card-inner { flex: 1; display: flex; flex-direction: column; }

@media (min-width: 761px) and (min-height: 850px) {
  .js-anim .services-pin {
    height: auto;
    min-height: 100vh;
  }
  .js-anim .services-track {
    display: flex;
    align-items: center;
    gap: 6vw;
    height: auto;
    min-height: 100vh;
    padding: clamp(56px, 8vh, 120px) clamp(24px, 7.8vw, 126px);
    will-change: transform;
  }
  .js-anim .service-card {
    flex: 0 0 min(72vw, 900px);
    height: auto;
    min-height: min(72vh, 640px);
    margin-bottom: 0;
    will-change: transform, opacity;
  }
}
@media (min-width: 761px) and (max-height: 850px) {
  .services-pin { height: auto; overflow: visible; }
  .services-track {
    display: block;
    padding: 30px clamp(24px, 7.8vw, 126px) 0;
    height: auto;
  }
  .service-card {
    flex: none;
    width: 100%;
    height: auto;
    min-height: 0;
    margin-bottom: 26px;
  }
}

.service-number {
  font-size: clamp(48px, 6vw, 92px);
  font-weight: 600;
  line-height: 1;
  color: var(--blue);
  letter-spacing: -0.04em;
}

.service-card h3 {
  font-size: clamp(28px, 3.4vw, 54px);
  font-weight: 500;
  letter-spacing: -0.05em;
  margin: 26px 0 14px;
}
.service-card p { color: rgba(255, 255, 255, 0.66); font-size: 14px; line-height: 1.7; max-width: 46ch; }

.service-list { list-style: none; margin-top: 28px; margin-bottom: 24px; }
.service-list li {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 15px 0;
  font-size: 15px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.service-list li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--acid);
  align-self: center;
}
.service-card-primary .service-list li::before { background: var(--blue); }

.service-card-cta {
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.service-card-cta .service-number { color: var(--acid); }
.service-card-cta h3 { margin-top: 0; }
.service-card-cta p { color: var(--muted); }
.service-card-cta .button { margin-top: 34px; background: var(--blue); color: #fff; border-color: var(--blue); }
.service-card-cta .button:hover { background: var(--ink); border-color: var(--ink); color: var(--acid); }

/* ---------- PROCESS (blue full screen) ---------- */
.process {
  background: var(--blue);
  color: #fff;
}
.process-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
}
.process-side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px clamp(30px, 5vw, 90px) 100px clamp(24px, 7.8vw, 126px);
}
.process-side .eyebrow { color: var(--acid); }
.process-side h2 {
  font-size: clamp(38px, 4.6vw, 74px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1;
}
.process-note { margin-top: 26px; color: #cfe0ff; font-size: 13px; }

.process-track { position: relative; padding-right: clamp(24px, 5vw, 90px); }
.process-progress {
  position: sticky;
  top: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.28);
  z-index: 2;
}
#process-progress-fill {
  display: block;
  height: 100%;
  background: var(--acid);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}
.process-step {
  min-height: 100vh;
  display: flex;
  align-items: center;
  gap: clamp(22px, 3.5vw, 54px);
  padding: 70px 0 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.26);
}
.process-step b {
  font-size: clamp(64px, 9vw, 150px);
  font-weight: 600;
  line-height: 1;
  color: var(--acid);
  letter-spacing: -0.04em;
  will-change: transform, opacity;
}
.process-step h3 { font-size: clamp(24px, 2.6vw, 42px); font-weight: 500; letter-spacing: -0.03em; margin-bottom: 14px; }
.process-step p { color: #d6e5ff; font-size: 14px; line-height: 1.75; max-width: 42ch; }
.process-step > div { will-change: transform, opacity; }

/* ---------- APPLICATION (paper) ---------- */
.application {
  background: var(--paper);
  color: var(--ink);
  display: grid;
  grid-template-columns: 0.68fr 1.32fr;
  gap: clamp(48px, 6vw, 110px);
  padding: clamp(90px, 12vw, 180px) clamp(24px, 7.8vw, 126px);
}
.application-intro > p:not(.eyebrow) { color: var(--muted); line-height: 1.8; max-width: 310px; }
.application-intro h2 {
  font-size: clamp(42px, 5.6vw, 92px);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.95;
}
.application-intro em { font-style: normal; color: var(--blue); }
.contact-box { margin-top: 45px; border-left: 2px solid var(--blue); padding-left: 17px; font-size: 12px; }
.contact-box span, .contact-box a { display: block; margin: 5px 0; }
.contact-box span { color: var(--muted); }
.contact-box a { font-weight: 600; }
.contact-box a:hover { color: var(--blue); }

form { padding: 5px 0; min-width: 0; }
.form-progress {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  font-size: 11px;
  color: #787875;
}
.form-progress .active { color: var(--blue); font-weight: 700; }

fieldset { border: 0; border-bottom: 1px solid var(--line); padding: 26px 0; }
legend { font-weight: 600; font-size: 14px; padding: 0 0 15px; }
legend small { color: var(--muted); font-weight: 400; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
label { display: grid; gap: 9px; font-size: 12px; font-weight: 500; }

input, select, textarea {
  appearance: none;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #a8a8a2;
  border-radius: 0;
  background: transparent;
  padding: 12px 1px;
  font: 14px/1.4 inherit;
  color: var(--ink);
  background-image: linear-gradient(var(--blue), var(--blue));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: border-color 0.3s ease, background-size 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-bottom-color: var(--blue);
  background-size: 100% 2px;
}
textarea { resize: vertical; line-height: 1.7; }

select {
  cursor: pointer;
  background-image: linear-gradient(var(--blue), var(--blue)), linear-gradient(var(--ink), var(--ink));
  background-size: 100% 2px, 0% 2px;
  background-repeat: no-repeat, no-repeat;
  background-position: 0 100%, calc(100% - 14px) 50%;
  padding-right: 26px;
}

.upload-area {
  border: 1px dashed #7a7a74;
  padding: 30px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.upload-area.drag-over { background: var(--acid); border-color: var(--ink); }
.upload-area input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { font-size: 26px; color: var(--blue); }
.upload-area strong { color: var(--ink); font-size: 13px; font-weight: 500; }
.upload-area small { font-weight: 400; }

.file-list { list-style: none; margin: 14px 0 0; }
.file-list li {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid #cbcbc5;
  font-size: 12px;
  color: var(--muted);
}
.file-list button { border: 0; background: none; color: #d62c25; cursor: pointer; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 28px 0 18px;
  font-size: 12px;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.6;
  cursor: pointer;
}
.consent input {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin: 0.1em 0 0;
  border: 1.5px solid #73736e;
  border-radius: 2px;
  background: #fff;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.consent input::after {
  content: "";
  width: 10px;
  height: 6px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform 140ms ease;
}
.consent input:checked { border-color: var(--blue); background: var(--blue); }
.consent input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.consent input:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.privacy-link { color: var(--blue); border-bottom: 1px dotted var(--blue); }

.form-error {
  margin: 16px 0;
  padding: 11px 13px;
  border-left: 3px solid var(--coral);
  background: rgba(255, 64, 46, 0.1);
  font-size: 12px;
  line-height: 1.6;
}
.submit-button { min-width: 190px; background: var(--blue); color: #fff; border-color: var(--blue); }
.submit-button:hover { background: var(--ink); border-color: var(--ink); color: var(--acid); }
.submit-button[disabled] { opacity: 0.5; cursor: not-allowed; }
.submit-button.is-submitting[disabled] { cursor: wait; }
.form-note { color: var(--muted); font-size: 10px; margin-top: 14px; }

/* ---------- Footer ---------- */
footer {
  background: var(--ink);
  color: #aaa;
  padding: 30px clamp(24px, 7.8vw, 126px);
  display: flex;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 10px;
}
.footer-link { color: #fff; border-bottom: 1px dotted #fff; }

/* ---------- Dialog ---------- */
dialog {
  width: min(560px, calc(100% - 32px));
  border: 0;
  padding: 36px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
}
dialog::backdrop { background: rgba(10, 10, 10, 0.82); }
.dialog-close { float: right; border: 0; background: none; font-size: 26px; cursor: pointer; color: inherit; }
dialog h2 { margin: 0; font-size: 32px; letter-spacing: -0.04em; }
dialog > p:not(.eyebrow):not(.application-no) { color: var(--muted); line-height: 1.7; }
.application-no { font-size: 13px; }
.application-no strong { color: var(--blue); font-size: 24px; letter-spacing: 0.03em; }
.upload-status { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 6px 0 16px; }
pre {
  white-space: pre-wrap;
  background: #f4f4ee;
  padding: 14px;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
  max-height: 210px;
  overflow: auto;
  color: var(--ink);
}
dialog .button { margin-top: 18px; background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- Initial states (only when JS is active) ---------- */
.js-enabled [data-reveal] { opacity: 0; transform: translateY(38px); }
.js-enabled [data-card-el] { opacity: 0; transform: translateY(30px); }
.js-enabled .process-step > b,
.js-enabled .process-step > div { opacity: 0.25; transform: scale(0.92); }
.js-enabled .hero-title-inner { opacity: 0; transform: translateY(24px); }
.js-enabled .hero-nav-btn,
.js-enabled .hero-kicker,
.js-enabled .hero-tags,
.js-enabled .hero-scroll,
.js-enabled .hero-base-line { opacity: 0; transform: translateY(14px); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.reduced-motion [data-reveal],
.reduced-motion [data-card-el],
.reduced-motion .hero-title-inner,
.reduced-motion .hero-nav-btn,
.reduced-motion .hero-kicker,
.reduced-motion .hero-tags,
.reduced-motion .hero-scroll,
.reduced-motion .hero-base-line,
.reduced-motion .process-step > b,
.reduced-motion .process-step > div {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  nav { display: none; }
  .hero-nav-right { display: none; }
  .menu-toggle { display: inline-block; }

  .hero { min-height: 100svh; height: 100svh; }
  .hero-hyperstudio-atlas::before { inset: 13% -20% 26% -18%; background-size: 9px 9px; opacity: .6; }
  .hero-hyperstudio-atlas::after { width: 145px; right: -38px; top: 15%; }
  .hero-title-block {
    left: var(--hero-title-x, 6%);
    top: var(--hero-title-y, 42%);
    transform: translateY(-50%);
    max-width: var(--hero-title-maxw, 90vw);
  }
  .hero-title { font-size: var(--hero-title-size-m, clamp(44px, 12vw, 66px)); line-height: 1.04; }
  .hero-title.title-enterprise { font-size: var(--hero-title-size-m, clamp(36px, 9.3vw, 54px)); }
  .hero-flap-wrap { left: var(--hero-status-x, 6%); top: var(--hero-status-y, 78%); padding-left: 14px; }
  .hero-flap-label { font-size: 10px; margin-bottom: 8px; }
  .scrambled-text { max-width: 88vw; font-size: var(--hero-status-size-m, clamp(28px, 8.7vw, 42px)); letter-spacing: .025em; white-space: normal; }
  .hero-meta { display: none; }
  .hero-scroll { bottom: 30px; right: clamp(20px, 6vw, 40px); }
  .hero-base-line { bottom: 16px; right: clamp(20px, 6vw, 40px); width: 40vw; }
  .hero-nav { padding: 16px clamp(16px, 5vw, 40px); }

  .services-head { padding-top: clamp(90px, 16vw, 120px); }
  .services-head h2 { font-size: clamp(34px, 9.5vw, 48px); }
  .services-meta { margin-top: 26px; }
  .services-pin { height: auto; overflow: visible; }
  .services-track {
    display: block;
    padding: 26px clamp(24px, 7vw, 40px) 0;
    height: auto;
  }
  .service-card {
    flex: none;
    width: 100%;
    height: auto;
    min-height: 0;
    margin-bottom: 26px;
    padding: 30px 26px;
  }
  .service-list { margin-bottom: 28px; }

  .process-grid { grid-template-columns: 1fr; }
  .process-side {
    position: static;
    height: auto;
    padding: 90px clamp(24px, 7vw, 40px) 40px;
  }
  .process-track { padding: 0 clamp(24px, 7vw, 40px) 90px; }
  .process-step { min-height: auto; padding: 54px 0; align-items: flex-start; }

  .application { grid-template-columns: 1fr; padding: 90px clamp(24px, 7vw, 40px); }
  .application-intro h2 { font-size: clamp(40px, 12vw, 56px); }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- i18n: language switch ---------- */
.lang-switch { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.lang-switch button {
  appearance: none;
  background: #2b2b2b;
  border: 1px solid #404040;
  border-radius: 0;
  color: #b8b8b8;
  font: 500 10px inherit;
  padding: 8px 9px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.lang-switch button:hover { background: #3a3a3a; color: #fff; }
.lang-switch button.is-active { background: #efefef; color: #0a0a0a; border-color: #efefef; }
.lang-switch-menu { margin-top: 42px; justify-content: center; }

/* hero title sizing for non-CJK languages */
.hero-title.title-wide { font-size: clamp(38px, 4.4vw, 76px); line-height: 1.1; }

/* WeChat display */
.wechat-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wechat-line strong { color: var(--ink); }
.copy-wechat {
  appearance: none;
  background: none;
  border: 1px solid var(--blue);
  border-radius: 0;
  color: var(--blue);
  font-size: 10px;
  padding: 4px 9px;
  cursor: pointer;
}
.wechat-copied { color: #0a7a1a; font-size: 10px; }
.wechat-qr {
  box-sizing: border-box;
  margin-top: 16px;
  width: 132px;
  aspect-ratio: 1;
  padding: 7px;
  border: 1px solid var(--blue);
  background: #eaf2ff;
}
.wechat-qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: hue-rotate(61deg) saturate(1.25) contrast(1.05);
}

/* failed file retry */
.failed-files { margin: 6px 0 14px; }
.failed-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #d5d5cf;
  font-size: 12px;
}
.failed-row span { color: #8f1f1a; }
.retry-btn { background: var(--blue); color: #fff; border-color: var(--blue); font-size: 11px; padding: 6px 12px; gap: 0; }
.retry-btn[disabled] { opacity: 0.55; }

/* ---------- RTL ---------- */
html[dir="rtl"] .hero-title-block { left: auto; right: clamp(20px, 4.5vw, 80px); text-align: right; }
html[dir="rtl"] .hero-meta { left: auto; right: clamp(20px, 4.5vw, 80px); text-align: right; }
html[dir="rtl"] .hero-scroll { right: auto; left: clamp(20px, 4.5vw, 80px); }
html[dir="rtl"] .hero-base-line { right: auto; left: clamp(20px, 4.5vw, 80px); }
html[dir="rtl"] .application,
html[dir="rtl"] .process-grid { direction: rtl; }
html[dir="rtl"] .service-card h3,
html[dir="rtl"] .service-card p,
html[dir="rtl"] .application-intro h2 { text-align: right; }

@media (max-width: 760px) {
  html[dir="rtl"] .hero-title-block { left: auto; right: clamp(20px, 6vw, 40px); }
  html[dir="rtl"] .hero-scroll { left: clamp(20px, 6vw, 40px); right: auto; }
  html[dir="rtl"] .hero-base-line { left: clamp(20px, 6vw, 40px); right: auto; }
}

@media (max-width: 760px) {
  .site-header nav { display: none; }
  .site-header .header-cta { display: none; }
  .hero-nav { flex-wrap: wrap; }
  .lang-switch button { font-size: 8px; padding: 6px 6px; }
  .wechat-qr { width: 116px; margin-top: 14px; }
}

/* ---------- Hero visual editor preview (inside /admin iframe) ---------- */
:root {
  --hero-title-size-d: clamp(56px, 6.2vw, 110px);
  --hero-title-size-m: clamp(44px, 12vw, 66px);
  --hero-status-size-d: clamp(42px, 4.5vw, 78px);
  --hero-status-size-m: clamp(28px, 8.7vw, 42px);
}
.hero-edit-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid #b9ff2c;
  background: rgba(185, 255, 44, 0.25);
  z-index: 6;
  cursor: nwse-resize;
}
.hero-edit-se { right: -8px; bottom: -8px; }
.hero-edit-guide {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  border: 1px dashed rgba(185, 255, 44, 0.6);
}
.hero-edit-guide-x { left: 0; right: 0; height: 0; }
.hero-edit-guide-y { top: 0; bottom: 0; width: 0; }
.hero-edit-tip {
  position: absolute;
  z-index: 6;
  font: 11px ui-monospace, monospace;
  color: #0a0a0a;
  background: #b9ff2c;
  padding: 3px 6px;
  pointer-events: none;
}
:focus-visible { outline: 2px solid #b9ff2c; outline-offset: 2px; }
