/* Framely marketing site — shared styles (landing EN + VI) */
:root {
  --surface: #f6f6f6;
  --canvas: #ffffff;
  --ink: #101010;
  --on-accent: #ffffff;
  --accent: #ff6105;
  --radius: 24px;
  --phone-pad: 48px;
  --font-rounded: ui-rounded, "SF Pro Rounded", "SF Pro Display", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
:target { scroll-margin-top: 24px; }

body {
  font-family: var(--font-rounded);
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Full-height page shell ---- */
.page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 1.8vh, 22px) clamp(16px, 2.4vw, 50px);
  overflow: hidden;
}

/* ---- Top / bottom bars (on the grey surface) ---- */
.bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(6px, 6.4vw, 130px);
}
.topbar { padding-bottom: clamp(12px, 1.6vh, 20px); }
.botbar { padding-top: clamp(12px, 1.6vh, 20px); }

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}
.brand .mark { width: auto; height: 26px; display: block; }
.brand .mark-solo { display: none; } /* mobile-only logo mark */
.brand .name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.30em;
  margin-right: -0.30em; /* trim trailing tracking so the wordmark stays centered */
  color: var(--ink);
}

.badge { display: inline-block; line-height: 0; transition: transform 0.15s ease, opacity 0.2s ease; }
.badge img { height: 44px; width: auto; display: block; }
.badge:hover { transform: translateY(-1px); opacity: 0.9; }

.botbar a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}
.botbar a:hover { opacity: 1; }
.foot-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* ---- Hero card ---- */
.hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(
    to top,
    #ffce7b 0%,
    #b7a4d5 37.457%,
    #5c6eee 93.644%
  );
  isolation: isolate;
}

/* rotating grass globe peeking up from the bottom */
.hero-globe {
  position: absolute;
  left: 50%;
  bottom: clamp(-1200px, -118vh, -520px);
  width: clamp(620px, 146vh, 1400px);
  aspect-ratio: 1 / 1;
  transform: translate(calc(-50% + var(--globe-x, 0px)), var(--globe-y, 0px));
  transition: transform 0.3s ease-out;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  will-change: transform;
}
.hero-globe img {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 50%;
  animation: globe-spin 60s linear infinite;
}
@keyframes globe-spin {
  to { transform: rotate(360deg); }
}

/* cursor-following line grid (canvas injected by hero-fx.js) — sits BELOW the globe */
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* film grain */
.hero-grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0.10;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

/* phone mockup — video screen behind a transparent-screen bezel.
   Keeps --phone-pad breathing room top & bottom; width derives from the bezel aspect. */
.hero-phone {
  position: absolute;
  top: var(--phone-pad);
  right: clamp(16px, 5vw, 88px);
  height: calc(100% - var(--phone-pad) * 2);
  aspect-ratio: 1187 / 2421; /* bezel PNG aspect → derives width from height */
  width: auto;
  z-index: 4;
  pointer-events: none;
  user-select: none;
  transform: translate(var(--phone-x, 0px), var(--phone-y, 0px));
  transition: transform 0.3s ease-out;
  filter: drop-shadow(0 40px 60px rgba(20, 22, 60, 0.30));
}
/* video sits in the transparent screen window of bezel.png (measured from its alpha;
   the PNG carries a drop-shadow margin, so the screen is inset, not full-bleed).
   bezel frame (on top) covers the edges + rounds the corners. */
.hero-phone-screen {
  position: absolute;
  /* Overshoot the screen hole by 4px each side so no transparent/anti-aliased
     seam shows; the video sits BEHIND the bezel, so the frame covers the overshoot. */
  left: calc(5.14% - 4px);
  top: calc(2.23% - 4px);
  width: calc(89.55% + 8px);
  height: calc(95.5% + 8px);
  object-fit: cover;
  object-position: center;
  border-radius: 13% / 6%;   /* ~device screen corner so corners tuck inside the bezel */
}
.hero-phone-bezel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero-globe img { animation: none; }
  .hero-globe, .hero-phone, .hero-content { transition: none; }
}

/* left copy */
.hero-content {
  position: absolute;
  z-index: 5;
  left: clamp(24px, 7.9%, 130px);
  top: clamp(36px, 19%, 184px);
  width: min(779px, 50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(18px, 2.9vh, 28px);
  transform: translate(var(--text-x, 0px), var(--text-y, 0px));
  transition: transform 0.3s ease-out;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 99px;
  border: 0.5px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}
.pill .spark {
  font-size: 12px;
  line-height: 1;
}
/* animated shiny sweep (ported from Magic UI AnimatedShinyText) */
.pill .shiny {
  --shiny-width: 85px;
  color: rgba(255, 255, 255, 0.72);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.95) 50%,
    transparent
  );
  background-size: var(--shiny-width) 100%;
  background-repeat: no-repeat;
  background-position: calc(-100% - var(--shiny-width)) 0;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shiny-text 8s infinite;
}
@keyframes shiny-text {
  0%, 90%, 100% { background-position: calc(-100% - var(--shiny-width)) 0; }
  30%, 60% { background-position: calc(100% + var(--shiny-width)) 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pill .shiny { animation: none; }
}

.hero-content h1 {
  font-weight: 700;
  text-transform: uppercase;
  color: var(--on-accent);
  font-size: clamp(38px, 5.4vw, 80px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.lead {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.7vh, 24px);
  max-width: 590px;
  font-size: clamp(15px, 1.35vw, 20px);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.94);
}

.hero-content .badge { margin-top: clamp(2px, 0.6vh, 6px); }

/* ---- Responsive: mobile becomes a taller, scrollable card ---- */
@media (max-width: 900px) {
  /* let the page grow past the viewport and scroll */
  .page {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .bar { padding-inline: 0; }

  /* topbar: logo MARK only (no wordmark) + badge, 16 to hero below */
  .topbar { padding-top: 0; padding-bottom: 16px; }
  .topbar .badge img { height: 44px; }
  .botbar { padding-top: 32px; } /* 32 from card bottom to footer */
  .brand .mark-word, .brand .name { display: none; }
  .brand .mark-solo { display: block; width: 40px; height: 40px; }

  /* hero: flow column, height driven by its content */
  .hero {
    flex: none;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px 0;
    overflow: hidden;
  }
  .hero-content {
    order: 1;
    position: static;
    inset: auto;
    width: 100%;
    max-width: 360px;
    margin: 0;
    gap: 16px;
    align-items: center;
    text-align: center;
    transform: none;
  }
  .hero-content .badge { display: none; }
  .hero-content h1 { font-size: 32px; line-height: 1.1; }
  .lead { align-items: center; font-size: 15px; line-height: 1.4; gap: 16px; }

  /* phone flows below the copy, 32 gap; 48 of grass beneath it */
  .hero-phone {
    order: 2;
    position: relative;
    inset: auto;
    transform: none;
    margin-top: 32px;
    margin-bottom: 48px;
    width: min(86%, 330px);
    height: auto;
    z-index: 4;
  }

  /* grass fills the bottom of the card, behind the phone */
  .hero-globe {
    left: 50%;
    bottom: -300px;
    width: min(180%, 640px);
    transform: translate(-50%, 0);
    z-index: 2;
  }
}

/* very short viewports: shrink the type so nothing clips */
@media (max-height: 640px) {
  .hero-content h1 { font-size: clamp(30px, 6vw, 52px); }
  .hero-content { gap: 14px; top: clamp(24px, 10%, 96px); }
  .lead { font-size: 15px; gap: 12px; }
}

/* ---- Document pages (privacy policy, EN + VI) ---- */
.doc-header {
  max-width: 880px;
  margin-inline: auto;
  padding-block: clamp(16px, 3vh, 24px);
  padding-inline: clamp(16px, 4vw, 32px); /* match .doc so logo + Home align to the white card edges */
}

.backlink {
  color: var(--ink);
  opacity: 0.72;
  text-decoration: none;
  font-size: 14px;
  padding: 8px 16px;
  border: 1px solid rgba(16, 16, 16, 0.12);
  border-radius: 999px;
  transition: opacity 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.backlink:hover { opacity: 1; border-color: rgba(16, 16, 16, 0.28); }

.doc {
  max-width: 880px;
  margin: 0 auto clamp(40px, 6vw, 80px);
  padding-inline: clamp(16px, 4vw, 32px);
  line-height: 1.65;
}

.card {
  background: var(--canvas);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 64px);
  box-shadow: 0 30px 60px -34px rgba(16, 16, 16, 0.22);
}

.card h1 {
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.updated { color: #6b6b70; font-size: 14px; margin-bottom: 32px; }

.card h2 { font-size: 20px; font-weight: 600; margin: 32px 0 12px; }
.card p { color: #3a3a3c; margin-bottom: 14px; }
.card ul { margin: 0 0 14px 22px; color: #3a3a3c; }
.card li { margin-bottom: 8px; }
.card a { color: var(--accent); text-decoration: none; }
.card a:hover { text-decoration: underline; }

.note {
  margin-top: 36px;
  padding: 18px 20px;
  border: 1px solid rgba(16, 16, 16, 0.10);
  border-radius: 14px;
  background: #fafafa;
  color: #6b6b70;
  font-size: 14px;
}

.doc-footer {
  justify-content: center;
  gap: 10px;
  padding-block: 28px 44px;
  font-size: 13px;
}
.doc-footer, .doc-footer a { color: #6b6b70; }
.doc-footer a { text-decoration: none; }
.doc-footer a:hover { color: var(--ink); }
.doc-footer .sep { opacity: 0.5; }
