/* The landing page (public/login/welcome.html): the app's colours (login.css, src/index.css) with the mark's amber, in
   light and dark by the system's setting. Motion in CSS alone: the hero rises in, the example conversation plays once,
   the cards rise as they scroll into view (where the browser has scroll-driven animations; elsewhere they are simply
   there), and none of it under prefers-reduced-motion. */
:root {
  --background: #f7f8fa;
  --foreground: #11151e;
  --muted: #5d6576;
  --card: #ffffff;
  --border: #e6e9ef;
  --accent: #e9a23b;
  --accent-deep: #c47a10;
  --accent-soft: rgb(233 162 59 / 0.13);
  --primary: #11151e;
  --primary-foreground: #ffffff;
  --shadow: 0 1px 2px rgb(16 20 30 / 0.04), 0 10px 30px rgb(16 20 30 / 0.05);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0d1118;
    --foreground: #eaeef5;
    --muted: #97a0b3;
    --card: #151b27;
    --border: rgb(255 255 255 / 0.07);
    --accent: #f0b04f;
    --accent-deep: #f4bf68;
    --accent-soft: rgb(240 176 79 / 0.12);
    --primary: #eaeef5;
    --primary-foreground: #0d1118;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, Roboto,
    sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
body {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a {
  color: inherit;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* a warm light behind the hero, drifting slowly */
.glow {
  position: absolute;
  inset: -20rem 0 auto;
  height: 46rem;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(38rem 22rem at 50% 50%, var(--accent-soft), transparent 70%);
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift {
  from {
    transform: translateX(-6%) scale(1);
  }
  to {
    transform: translateX(6%) scale(1.08);
  }
}

/* the nav: the mark and Sign in, nothing else (no sign-up for now) */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 12px
    max(20px, env(safe-area-inset-left));
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 18px;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.brand img {
  border-radius: 8px;
}
/* x²: the wordmark, its 2 in the mark's amber */
.mark {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.mark sup {
  margin-left: 1px;
  font-size: 0.6em;
  color: var(--accent-deep);
}
/* still in beta (2026-10-20): a small chip beside the wordmark */
.beta {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-left: -2px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.signin {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  backdrop-filter: blur(8px);
  font-size: 15px;
  font-weight: 560;
  text-decoration: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.signin:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

main {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

/* the hero */
.hero {
  text-align: center;
  padding: clamp(48px, 10vh, 112px) 0 clamp(56px, 9vh, 96px);
}
.eyebrow {
  display: inline-block;
  margin: 0 0 20px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 80px);
  line-height: 1.02;
  font-weight: 720;
  letter-spacing: -0.04em;
}
h1 span,
h2 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-deep), var(--accent));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s ease-in-out infinite;
}
@keyframes shine {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}
.lede {
  max-width: 33rem;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 20px);
  text-wrap: balance;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 18px;
  margin-top: 32px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 30px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn.primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow);
}
.btn.primary:hover {
  transform: translateY(-2px);
}
.invite {
  color: var(--muted);
  font-size: 14px;
}

/* the hero rises in, one line after another */
.rise {
  animation: rise 0.9s var(--ease) both;
}
.hero .rise:nth-child(2) {
  animation-delay: 0.08s;
}
.hero .rise:nth-child(3) {
  animation-delay: 0.16s;
}
.hero .rise:nth-child(4) {
  animation-delay: 0.24s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* a moment of it: what you say, it thinks, what it says back (played once) */
.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 30rem;
  margin: 56px auto 0;
  text-align: left;
}
.chat .bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 44px;
  margin-bottom: 10px;
}
.chat .bars span {
  width: 5px;
  height: 14px;
  border-radius: 3px;
  background: var(--accent);
  animation: breathe 1.4s ease-in-out infinite;
}
.chat .bars span:nth-child(2) {
  animation-delay: 0.12s;
}
.chat .bars span:nth-child(3) {
  animation-delay: 0.24s;
}
.chat .bars span:nth-child(4) {
  animation-delay: 0.36s;
}
.chat .bars span:nth-child(5) {
  animation-delay: 0.48s;
}
@keyframes breathe {
  0%,
  100% {
    height: 12px;
  }
  50% {
    height: 38px;
  }
}
.chat p {
  margin: 0;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.45;
}
.chat .you {
  align-self: flex-end;
  max-width: 86%;
  border-bottom-right-radius: 6px;
  background: var(--primary);
  color: var(--primary-foreground);
  animation: pop 0.6s var(--ease) 0.7s both;
}
/* the typing dots and the reply share one place: the reply takes over where the dots were */
.chat .reply {
  display: grid;
  max-width: 86%;
}
.chat .reply > * {
  grid-area: 1 / 1;
  align-self: start;
  justify-self: start;
}
.chat .typing {
  display: flex;
  gap: 4px;
  padding: 14px 16px;
  border-bottom-left-radius: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  animation: typing 1.5s var(--ease) 1.3s both;
}
.chat .typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: dot 0.9s ease-in-out infinite;
}
.chat .typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.chat .typing span:nth-child(3) {
  animation-delay: 0.3s;
}
.chat .tuan {
  border-bottom-left-radius: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: pop 0.6s var(--ease) 2.8s both;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes typing {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  15%,
  85% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
  }
}
@keyframes dot {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* what it does */
.does {
  padding: 24px 0 72px;
  text-align: center;
}
h2 {
  margin: 0 auto 36px;
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.08;
  font-weight: 710;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  text-align: left;
}
.grid article {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.grid article:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.grid svg {
  width: 22px;
  height: 22px;
  padding: 9px;
  box-sizing: content-box;
  border-radius: 12px;
  background: var(--accent-soft);
  fill: none;
  stroke: var(--accent-deep);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.grid h3 {
  margin: 16px 0 4px;
  font-size: 17px;
  font-weight: 640;
  letter-spacing: -0.01em;
}
.grid p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
@media (max-width: 860px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* built to grow: the skills that plug in */
.grow {
  padding: 24px 0 72px;
  text-align: center;
}
.grow h2 {
  margin-bottom: 14px;
}
.grow > p {
  max-width: 34rem;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 17px;
  text-wrap: balance;
}
.skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.skills li {
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.skills li:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent-deep);
}
.skills li.soon {
  border-style: dashed;
}

/* the close: where it works, and the line */
.close {
  padding: 24px 0 96px;
  text-align: center;
}
.close h2 {
  margin-bottom: 12px;
}
.close > p {
  max-width: 30rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
  text-wrap: balance;
}
.where {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}
.where li {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
}

/* rising into view as the page scrolls (scroll-driven animations; elsewhere simply there) */
@supports (animation-timeline: view()) {
  .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

.foot {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 20px max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}
.foot .links {
  display: flex;
  gap: 20px;
}
.foot a {
  text-decoration: none;
}
.foot a:hover {
  color: var(--foreground);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .chat .typing {
    display: none;
  }
}
