:root {
  --bg: #e4eaf0;
  --ink: #15161a;
  --soft: rgb(21 22 26 / 0.8);
  --muted: rgb(21 22 26 / 0.58);
  --faint: rgb(21 22 26 / 0.36);
  --amber: 240 130 30;
  --pad: clamp(20px, 2.8vw, 44px);
  --orb-size: max(60vw, 76vh);
  --orb-top: max(18vh, 96px);
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@supports (height: 1svh) {
  :root {
    --orb-size: max(60vw, 76svh);
    --orb-top: max(18svh, 96px);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--pad);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Film grain keeps the large gradients from banding. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='.33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.16;
}

a {
  color: inherit;
}

/* ---------- backdrop ---------- */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, #edf0f2 0%, #e6ebef 45%, #dfe6ed 100%);
}

.haze,
.glow,
.orb {
  position: absolute;
  left: 50%;
  top: var(--orb-top);
}

.haze {
  width: calc(var(--orb-size) * 1.3);
  height: calc(var(--orb-size) * 1.1);
  translate: calc(-50% + var(--mx, 0) * 10px) calc(-14% + var(--my, 0) * 6px);
  background: radial-gradient(closest-side, rgb(244 190 140 / 0.5), rgb(244 200 160 / 0.26) 55%, transparent);
}

/* Hotter than it looks: the glass veil lightens everything below the rim. */
.glow {
  width: calc(var(--orb-size) * 1.06);
  aspect-ratio: 1;
  translate: calc(-50% + var(--mx, 0) * 22px) calc(-41% + var(--my, 0) * 14px);
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgb(var(--amber)) 16%,
    rgb(var(--amber) / 0.96) 19%,
    rgb(var(--amber) / 0.88) 22%,
    rgb(var(--amber) / 0.68) 26.5%,
    rgb(var(--amber) / 0.46) 31%,
    rgb(var(--amber) / 0.25) 37.5%,
    rgb(var(--amber) / 0.15) 44%,
    rgb(var(--amber) / 0.07) 67%,
    rgb(var(--amber) / 0)
  );
  filter: blur(10px);
}

.orb {
  width: var(--orb-size);
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgb(255 246 232 / 0.32) 0%, rgb(255 246 232 / 0.24) 25%, rgb(255 246 232 / 0.1) 45%, transparent 62%);
  box-shadow:
    inset 0 1.5px 0 rgb(255 255 255 / 0.95),
    inset 0 0 0 1px rgb(255 255 255 / 0.4);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  -webkit-mask-image: linear-gradient(180deg, #000 24%, transparent 64%);
  mask-image: linear-gradient(180deg, #000 24%, transparent 64%);
}

/* The ant walks the rim (driven by main.js); the fade stays in screen space. */
.trail {
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(var(--orb-top) + var(--orb-size) * 0.2), transparent calc(var(--orb-top) + var(--orb-size) * 0.36));
  mask-image: linear-gradient(180deg, #000 calc(var(--orb-top) + var(--orb-size) * 0.2), transparent calc(var(--orb-top) + var(--orb-size) * 0.36));
}

/* main.js reads the rendered width: 1 viewBox unit = width / 100. */
.ant {
  position: absolute;
  left: 0;
  top: 0;
  width: 25px;
  height: 16px;
  overflow: visible;
  transform-origin: 0 0;
  opacity: 0;
  transition: opacity 0.9s ease;
  will-change: transform, opacity;
}

.ant.is-on {
  opacity: var(--ant-o, 1);
  transition: none;
}

.ant ellipse,
.ant circle {
  fill: var(--ink);
}

.ant .eye {
  fill: #fff;
}

.ant path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ant .feeler {
  stroke-width: 2.8;
}

.ant .far {
  opacity: 0.5;
}

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

.top {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.top-start {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  width: 54px;
  color: var(--ink);
  text-decoration: none;
  line-height: 0;
}

.brand svg {
  display: block;
  width: 100%;
  height: auto;
  fill: currentColor;
}

.brand-word {
  display: flex;
  justify-content: space-between;
  font: 700 7px/1 var(--font);
  letter-spacing: 0;
  text-transform: uppercase;
}

.sep {
  width: 1px;
  height: 20px;
  background: rgb(21 22 26 / 0.22);
}

.lang,
.social a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgb(21 22 26 / 0.16);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.28);
  color: var(--soft);
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    translate 0.25s ease;
}

.lang {
  font: 600 10px/1 var(--font);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.lang:hover,
.social a:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.lang:focus-visible,
.social a:focus-visible,
.talk:focus-visible,
.nav a:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 99px;
}

.nav {
  display: flex;
  gap: clamp(22px, 2.4vw, 36px);
  font-size: 14px;
}

.nav a {
  text-decoration: none;
}

.nav .is-soon {
  color: var(--faint);
}

.nav .is-soon:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 99px;
}

.talk {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  text-decoration: none;
}

.talk span {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.talk svg {
  width: 9px;
  height: 9px;
  fill: none;
  stroke: rgb(var(--amber));
  stroke-width: 1.5;
  transition: translate 0.25s ease;
}

.talk:hover svg {
  translate: 2px -2px;
}

.talk.is-soon:hover svg {
  translate: none;
}

/* Coming-soon tip on Liên hệ + social icons */
.is-soon {
  position: relative;
  cursor: default;
}

.is-soon::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  translate: -50% 4px;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font: 500 11px/1.2 var(--font);
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, translate 0.18s ease;
  z-index: 5;
}

.is-soon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  translate: -50% 4px;
  border: 5px solid transparent;
  border-top-color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, translate 0.18s ease;
  z-index: 5;
}

/* Header sits at the top: tip opens downward */
.talk.is-soon::after,
.nav .is-soon::after {
  bottom: auto;
  top: calc(100% + 10px);
}

.talk.is-soon::before,
.nav .is-soon::before {
  bottom: auto;
  top: calc(100% + 4px);
  border-top-color: transparent;
  border-bottom-color: var(--ink);
}

.is-soon:hover::after,
.is-soon:hover::before,
.is-soon:focus-visible::after,
.is-soon:focus-visible::before,
.is-soon.is-tip::after,
.is-soon.is-tip::before {
  opacity: 1;
  translate: -50% 0px;
}

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

.hero {
  position: relative;
  z-index: 1;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(80px, 21vh, 220px) 0 clamp(16px, 2vh, 24px);
}

h1 {
  margin: 0;
  font-size: clamp(44px, max(5.6vw, 5.8vh), 88px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.sub {
  margin: 22px 0 0;
  font-size: clamp(14px, 1.1vw, 16px);
  color: var(--muted);
}

.tick {
  display: block;
  width: 1px;
  height: clamp(26px, 4vh, 40px);
  margin: clamp(28px, 5.8vh, 60px) 0 clamp(24px, 5.1vh, 52px);
  background: rgb(21 22 26 / 0.16);
}

.follow {
  margin: 0;
  font-size: clamp(15px, 1.15vw, 17px);
}

.follow span {
  display: inline-block;
}

.social {
  display: flex;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.social svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.social svg.wide {
  width: 19px;
  height: auto;
}

.social a:hover {
  translate: 0 -2px;
}

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

.bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13.5px;
  color: var(--soft);
}

.bottom p {
  margin: 0;
}

.clock {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .top {
    grid-template-columns: 1fr auto;
  }

  .nav {
    display: none;
  }

  h1 {
    font-size: clamp(40px, 11.5vw, 56px);
  }

  .social a {
    width: 40px;
    height: 40px;
  }

  .social svg {
    width: 15px;
    height: 15px;
  }

  .social svg.wide {
    width: 22px;
  }

  .bottom {
    font-size: 12.5px;
  }

  /* iOS Safari often composites mask+SVG poorly; JS already fades via --ant-o. */
  .trail {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .ant {
    width: 30px;
    height: 19px;
  }
}

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

@media (prefers-reduced-motion: no-preference) {
  .orb {
    animation: orb-in 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .glow {
    animation:
      glow-in 2.2s ease-out both,
      breathe 9s ease-in-out 2.2s infinite alternate;
  }

  .haze {
    animation: fade 2.4s ease-out both;
  }

  .top,
  .bottom {
    animation: fade 1s ease 0.2s both;
  }

  .hero > * {
    animation: rise 0.9s cubic-bezier(0.2, 0.65, 0.25, 1) both;
  }

  .hero > :nth-child(2) { animation-delay: 0.1s; }
  .hero > :nth-child(3) { animation-delay: 0.2s; }
  .hero > :nth-child(4) { animation-delay: 0.3s; }
  .hero > :nth-child(5) { animation-delay: 0.4s; }
}

@keyframes orb-in {
  from {
    opacity: 0;
    translate: -50% 32px;
  }
}

@keyframes glow-in {
  from {
    opacity: 0;
    scale: 0.7;
  }
}

@keyframes breathe {
  to {
    scale: 1.04;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}