/* QuantX website - plain CSS, no build step. */

:root {
  --brand: #810132;
  --brand-deep: #5a0629;
  --ink: #211a1c;
  --paper: #f6f2ef;
  --surface: #ffffff;
  --line: #e3dad6;
  --muted: #6b5f5b;
  --body-muted: #4a4042;
  --dark: #140a09;
  --rose-rule: #a8414a;
  --on-dark: #eadfda;
  --on-dark-muted: #b9aaa4;
  --on-brand-muted: #f6e3de;

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1200px;
  --radius: 18px;
  --zoom-in: 1600px;
  --zoom-out: 1400px;
  --lens-hold: 600px;
  --lens-open: 1000px;
  --rank-hold: 1200px;

  --font: Montserrat, system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;

  color-scheme: light;
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, figure { margin: 0; }
img { display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
}

.kicker {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand);
}

.section-title {
  margin-top: 12px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -1px;
}

.full-stop { color: var(--brand); }

/* Buttons and links shaped as pills */
.pill {
  min-height: 48px;
  padding: 0 26px;
  display: flex;
  align-items: center;
  font-weight: 600;
  border: 1px solid var(--brand);
  border-radius: 999px;
  color: var(--brand);
}
.pill--solid { background: var(--brand); color: #ffffff; }
.pill--solid:hover { color: #ffffff; background: var(--brand-deep); }

/* Header */
/* Lies over the top of the hero so the hero scene fills the first screen */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--paper);
  padding-inline: var(--gutter);
  border-bottom: 2px solid var(--ink);
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  padding: 14px 0;
}
.brand { display: flex; align-items: center; min-height: 48px; }
.brand img { height: 46px; width: auto; }

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
  font-size: 14px;
  font-weight: 600;
}
.nav a { min-height: 44px; display: flex; align-items: center; }
.nav .pill { min-height: 44px; padding: 0 20px; }
.site-header .nav { font-size: 16px; }

/*
 * Hero: a one-screen scene pinned while the camera dives into the phone in the painting, the phone
 * screen unfolds into the trading terminal, then the camera pulls back from the terminal to the
 * microscope it was seen through and the lens opens, then grows past the screen while its dots
 * flow into the ticker symbols of the ranking board. Paintings cover the scene; JS places them.
 * Scroll lengths of the parts: --zoom-in, --zoom-out, --lens-hold, --lens-open, --rank-hold.
 */
.hero {
  --zoom-run: calc(var(--zoom-in) + var(--zoom-out) + var(--lens-hold) + var(--lens-open) + var(--rank-hold));
  position: relative;
  height: calc(100vh + var(--zoom-run));
  height: calc(100svh + var(--zoom-run));
}
.hero__scene {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--paper);
}
.hero__end {
  position: absolute;
  left: 0;
  top: var(--zoom-in);
  height: 100vh;
  height: 100svh;
}
.hero__frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  aspect-ratio: 1576 / 998;
  overflow: hidden;
  transform-origin: 0 0;
}
.hero__frame > img,
.hero__frame > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__phone {
  position: absolute;
  inset: 0;
  pointer-events: none;
  clip-path: polygon(27.379% 60.095%, 28.252% 60.195%, 27.903% 61.435%, 27.720% 61.774%, 27.348% 62.350%, 27.062% 62.625%, 27.007% 63.001%, 27.149% 63.439%, 26.317% 63.252%);
}
.hero__phone canvas {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  display: block;
}
.hero__tag {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 6px 12px;
  background: var(--brand);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 4px;
  transition: opacity 0.15s;
}

.hero__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(246, 242, 239, 0.95);
  border-top: 2px solid var(--ink);
  padding-inline: var(--gutter);
  z-index: 2;
}
.hero__bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 40px;
  padding: 16px 0;
}
.hero__title {
  font-size: clamp(26px, 3.7vw, 54px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -1.5px;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Intro: logo bars draw in, then the small bar opens as a window onto the painting */
.intro {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.intro__hero {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  aspect-ratio: 1576 / 998;
  opacity: 0;
}
.intro__logo {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
}
.intro__mark {
  width: clamp(84px, 10vw, 148px);
  display: grid;
  grid-template-columns: 62fr 15fr 23fr;
  row-gap: clamp(8px, 1.1vw, 15px);
}
.intro__bar {
  height: clamp(20px, 2.5vw, 36px);
  background: linear-gradient(90deg, var(--brand-deep), var(--brand));
  transform-origin: left center;
}
.intro__bar--yang { grid-column: 1 / 4; }
.intro__bar--yin-left { grid-column: 1; }
.intro__bar--yin-right { grid-column: 3; background: linear-gradient(90deg, #6a0430, var(--brand)); }
.intro__word {
  font-size: clamp(46px, 6.6vw, 100px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--dark);
}

/* End state of the hero zoom: heading beside the terminal the phone screen became */
.story-data {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  pointer-events: none;
}
.story-data__inner {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 48px;
}
.story-data__copy { flex: 1 1 300px; max-width: 420px; opacity: 0; }
.story-data__title {
  max-width: 397px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -1px;
}
.story-data__title em {
  display: block;
  margin-top: calc(0.54em + 6px);
  font-style: normal;
  font-size: 2em;
  line-height: 0.95;
  letter-spacing: -4px;
  white-space: nowrap;
  color: var(--brand);
}
.story-data__terminal {
  flex: 999 1 420px;
  min-width: 0;
  height: min(560px, calc(100svh - 160px));
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  opacity: 0;
  transform-origin: 0 0;
  will-change: transform, opacity;
}
.story-data__terminal canvas { width: 100%; height: 100%; display: block; }

/* End state of the zoom out: the microscope painting under a lens veil, beside "Quan sát là Chìa khoá" */
.story-lens {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
}
.story-lens__art {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
.story-lens > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.story-lens__copy {
  position: absolute;
  inset: 0;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  pointer-events: none;
  opacity: 0;
}
.story-lens__copy .container { width: 100%; }
.story-lens__stack {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.story-lens__title {
  font-size: clamp(48px, 6.4vw, 92px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -3px;
}
.story-lens__line {
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.story-lens__echo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 800;
}
.story-lens__echo span:nth-child(2) { opacity: 0.62; }
.story-lens__echo span:nth-child(3) { opacity: 0.36; }
.story-lens__echo span:nth-child(4) { opacity: 0.16; }

/* Last part of the hero: the ranking board the lens's dots flow into */
.story-order {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
}
.story-order canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.story-order__caption {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 48px 16px 24px;
  text-align: center;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(246, 242, 239, 0) 0%, var(--paper) 42%);
  opacity: 0;
}
.story-order__lead { font-size: clamp(16px, 1.7vw, 24px); color: var(--body-muted); }
.story-order__title {
  margin-top: 4px;
  font-size: clamp(28px, 3.6vw, 50px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -1px;
}

/* Content sections */
.section { padding: 0 var(--gutter) 96px; }
.section > .container {
  border-top: 2px solid var(--ink);
  padding-top: 64px;
}

.about { padding: 96px var(--gutter); border-top: 2px solid var(--ink); }
.about > .container { display: flex; flex-direction: column; gap: 40px; }
.about__head { display: flex; flex-direction: column; gap: 24px; }
.about p { text-align: justify; }
.about__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pillar { padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.pillar__line { width: 72px; height: 12px; background: var(--brand); }
.pillar__line--broken {
  background: none;
  display: grid;
  grid-template-columns: 30px 30px;
  gap: 12px;
}
.pillar__line--broken::before,
.pillar__line--broken::after { content: ""; background: var(--brand); }
.pillar h3 {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--brand);
}
.pillar__statement { font-size: 28px; line-height: 1.25; font-weight: 600; }
.pillar__detail { color: var(--muted); }

.origin > .container { display: flex; flex-wrap: wrap; gap: 40px 64px; align-items: flex-start; }
.origin__copy { flex: 1 1 300px; display: flex; flex-direction: column; gap: 20px; }
.origin__copy p { color: var(--body-muted); text-align: justify; }
.team {
  flex: 2 1 480px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
}
.team figure { display: flex; flex-direction: column; gap: 6px; }
.team img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 15%;
  border-radius: 16px;
  margin-bottom: 8px;
}
.team figcaption { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.team__role { font-family: var(--mono); font-size: 14px; color: var(--muted); }

.insights > .container { display: flex; flex-direction: column; gap: 40px; }
.insights__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.insights__all { min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--brand); }
.posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.post { overflow: hidden; display: flex; flex-direction: column; color: var(--ink); }
.post__cover {
  --angle: 150deg;
  height: 170px;
  background:
    linear-gradient(var(--angle), rgba(129, 1, 50, 0) 20%, var(--brand) 130%),
    radial-gradient(#ffffff 1.6px, rgba(255, 255, 255, 0) 2.2px) 0 0 / 8px 8px,
    var(--brand);
}
.post:nth-child(2) .post__cover { --angle: 210deg; }
.post:nth-child(3) .post__cover { --angle: 30deg; }
.post__body { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.post__meta { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.post__title { font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -0.5px; }
.post__summary { color: var(--muted); }
.post__more { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--brand); }

.faq > .container { display: flex; flex-wrap: wrap; gap: 32px 80px; }
.faq__head { flex: 1 1 260px; }
.faq__list { flex: 3 1 480px; display: flex; flex-direction: column; }
.faq details { border-bottom: 1px solid var(--line); padding: 8px 0; }
.faq summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary [aria-hidden] { font-family: var(--mono); color: var(--brand); }
.faq details p { margin: 0 0 16px; max-width: 640px; color: var(--muted); text-align: justify; }

.contact { padding: 0 var(--gutter) 96px; }
.contact__band {
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--brand);
  color: #ffffff;
  border-radius: var(--radius);
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 48px;
}
.contact__band > div { flex: 1 1 320px; }
.contact__title { font-size: clamp(32px, 4vw, 48px); line-height: 1.1; font-weight: 800; letter-spacing: -1px; }
.contact__band p { margin-top: 12px; color: var(--on-brand-muted); }
.contact__email { font-family: var(--mono); font-size: clamp(16px, 2.2vw, 22px); font-weight: 700; }
.contact__email:hover { color: #ffffff; text-decoration: underline; }

/* Footer */
.site-footer {
  background: var(--dark);
  color: var(--on-dark);
  padding: 64px var(--gutter) 32px;
}
.site-footer > .container { display: flex; flex-direction: column; gap: 40px; }
.site-footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; }
.site-footer__brand { display: flex; flex-direction: column; gap: 12px; }
.site-footer__mark { display: flex; align-items: center; gap: 12px; }
.site-footer__wordmark { font-weight: 700; letter-spacing: 3px; color: var(--on-dark-muted); }
.site-footer__slogan { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; color: #ffffff; }
.site-footer__slogan .full-stop { color: #c0475a; }
.site-footer .nav { align-items: flex-start; }
.site-footer a:hover { color: #ffffff; }
.site-footer__legal {
  border-top: 1px solid var(--rose-rule);
  padding-top: 20px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--on-dark-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

/* 404 */
.not-found { padding: 96px var(--gutter); text-align: center; }
.not-found .container { display: flex; flex-direction: column; align-items: center; gap: 16px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__tag { transition: none; }
}
