/* Final presentation polish: typography, rhythm, tablet/mobile and accessibility. */

:root {
  --display-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif;
  --text-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--text-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

h1,
h2,
.approach-words strong,
.now-mark strong {
  font-family: var(--display-font);
  font-synthesis: none;
}

h1,
h2 {
  letter-spacing: -.045em;
}

p {
  hanging-punctuation: first last;
}

.eyebrow {
  line-height: 1.35;
  letter-spacing: .12em;
}

/* Navigation: precise proportions and better tap targets. */
.nav-shell {
  min-height: 52px;
}

.brand,
.nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: 170px;
  height: auto;
}

.nav-links a {
  padding: 0 2px;
}

/* Hero: retain impact while improving Vietnamese line spacing. */
.hero-content {
  max-width: 1080px;
  padding-top: clamp(132px, 16vh, 174px);
  padding-bottom: clamp(108px, 13vh, 148px);
}

.hero h1 {
  max-width: 1000px;
  margin-bottom: 30px;
  font-size: clamp(3.9rem, 6.75vw, 6.65rem);
  line-height: 1.055;
  letter-spacing: -.052em;
}

.hero-lead {
  max-width: 720px;
  margin-bottom: 28px;
  font-size: clamp(1.08rem, 1.35vw, 1.24rem);
  line-height: 1.62;
}

.hero-text-link {
  min-height: 44px;
  font-size: 15px;
}

.glow-blue,
.glow-green {
  filter: blur(42px);
  opacity: .42;
}

.river-line {
  opacity: .78;
}

/* Problem: editorial line lengths and a tighter page rhythm. */
.problem {
  padding: 132px 0;
}

.problem-layout {
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 80px;
}

.problem-copy {
  max-width: 600px;
}

.problem h2 {
  margin-bottom: 30px;
  font-size: clamp(2.9rem, 4.8vw, 4.85rem);
  line-height: 1.045;
}

.problem-copy > p {
  max-width: 55ch;
  font-size: clamp(1.03rem, 1.2vw, 1.14rem);
  line-height: 1.72;
}

.problem-thesis {
  margin-top: 28px;
  padding-top: 26px;
}

.signal-scene {
  min-height: 540px;
  border-radius: 32px;
  box-shadow: inset 0 0 0 1px rgba(13, 27, 61, .035);
}

.signal-scene::before {
  opacity: .4;
}

.sensor {
  width: 11px;
  height: 11px;
  box-shadow: 0 0 0 6px rgba(0, 182, 122, .05), 0 10px 24px rgba(13, 27, 61, .065);
}

.signal-labels {
  letter-spacing: .12em;
}

/* Approach: less diagram-like, more editorial. */
.approach {
  padding: 128px 0 124px;
}

.approach-heading {
  max-width: 880px;
}

.approach-heading h2 {
  margin-bottom: 24px;
  font-size: clamp(2.9rem, 4.75vw, 4.8rem);
  line-height: 1.045;
}

.approach-heading > p:last-child {
  max-width: 660px;
  font-size: 1.03rem;
  line-height: 1.68;
}

.approach-words {
  margin-top: 70px;
  border-top-color: rgba(255, 255, 255, .1);
}

.approach-words li {
  min-height: 168px;
  padding-top: 24px;
  padding-bottom: 18px;
  border-right-color: rgba(255, 255, 255, .07);
}

.approach-words strong {
  font-size: clamp(1.85rem, 2.35vw, 2.5rem);
  line-height: 1.06;
  letter-spacing: -.04em;
}

.approach-words span {
  color: rgba(216, 229, 241, .56);
  font-size: .9rem;
}

/* First experiment: quieter card, stronger hierarchy. */
.now {
  padding: 124px 0;
}

.now-layout {
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 72px;
  padding: 52px;
  border: 1px solid rgba(13, 27, 61, .045);
  border-radius: 32px;
  box-shadow: 0 22px 60px rgba(13, 27, 61, .035);
}

.now-copy h2 {
  margin-bottom: 26px;
  font-size: clamp(2.85rem, 4.45vw, 4.55rem);
  line-height: 1.045;
}

.now-copy > p {
  max-width: 62ch;
  font-size: 1.03rem;
  line-height: 1.7;
}

.now-copy > p:first-of-type {
  font-size: clamp(1.12rem, 1.4vw, 1.28rem);
  line-height: 1.58;
}

.now-mark {
  min-height: 250px;
}

/* Mekong brand moment. */
.origin {
  padding-top: 140px;
  padding-bottom: 112px;
}

.origin-inner {
  max-width: 980px;
}

.origin h2 {
  margin-bottom: 28px;
  font-size: clamp(3rem, 5.25vw, 5.25rem);
  line-height: 1.045;
}

.origin-inner > p:not(.eyebrow):not(.origin-closing) {
  max-width: 68ch;
  font-size: 1.07rem;
  line-height: 1.72;
}

.origin-closing {
  margin-top: 42px;
}

.contact-line {
  margin-top: 64px;
  padding-top: 24px;
}

.contact-line a {
  min-height: 44px;
}

.site-footer {
  padding-top: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* Tablet / iPad portrait and compact desktop. */
@media (max-width: 980px) {
  :root {
    --shell: min(100% - 44px, 1180px);
  }

  .hero {
    min-height: 88svh;
  }

  .hero-content {
    padding-top: 126px;
    padding-bottom: 104px;
  }

  .hero h1 {
    max-width: 850px;
    font-size: clamp(3.55rem, 8.4vw, 5.45rem);
    line-height: 1.06;
  }

  .hero-lead {
    max-width: 680px;
  }

  .problem {
    padding: 104px 0;
  }

  .problem-layout {
    gap: 52px;
  }

  .problem-copy {
    max-width: 700px;
  }

  .problem h2,
  .approach-heading h2,
  .now-copy h2,
  .origin h2 {
    line-height: 1.055;
  }

  .signal-scene {
    min-height: 460px;
    border-radius: 28px;
  }

  .approach {
    padding: 104px 0;
  }

  .approach-words {
    margin-top: 58px;
  }

  .approach-words li {
    min-height: 150px;
  }

  .now {
    padding: 104px 0;
  }

  .now-layout {
    gap: 44px;
    padding: 42px;
  }

  .origin {
    padding: 108px 0 94px;
  }
}

/* Mobile: preserve hierarchy without oversized typography or cramped Vietnamese. */
@media (max-width: 640px) {
  :root {
    --shell: calc(100vw - 32px);
  }

  .site-header {
    padding-top: env(safe-area-inset-top);
  }

  .nav-shell {
    min-height: 48px;
  }

  .brand img {
    width: 146px;
  }

  .nav-links a:last-child {
    min-height: 44px;
    padding-inline: 2px;
    font-size: 12px;
  }

  .hero {
    min-height: 90svh;
  }

  .hero-content {
    padding-top: 104px;
    padding-bottom: 84px;
  }

  .hero .eyebrow {
    margin-bottom: 20px;
    font-size: 9px;
    letter-spacing: .11em;
  }

  .hero h1 {
    max-width: 100%;
    margin-bottom: 24px;
    font-size: clamp(2.85rem, 13.3vw, 4rem);
    line-height: 1.085;
    letter-spacing: -.045em;
  }

  .hero-lead {
    max-width: 35ch;
    margin-bottom: 22px;
    font-size: .98rem;
    line-height: 1.64;
  }

  .hero-text-link {
    min-height: 44px;
    font-size: 14px;
  }

  .glow-blue,
  .glow-green {
    opacity: .3;
  }

  .problem {
    padding: 76px 0;
  }

  .problem-layout {
    gap: 38px;
  }

  .problem h2 {
    margin-bottom: 24px;
    font-size: clamp(2.35rem, 10.3vw, 3.25rem);
    line-height: 1.075;
    letter-spacing: -.04em;
  }

  .problem-copy > p {
    font-size: .98rem;
    line-height: 1.72;
  }

  .problem-thesis {
    margin-top: 24px;
    padding-top: 22px;
  }

  .signal-scene {
    min-height: 320px;
    border-radius: 22px;
  }

  .signal-scene::before {
    background-size: 36px 36px;
    opacity: .28;
  }

  .wave {
    height: 130px;
  }

  .sensor {
    width: 10px;
    height: 10px;
    box-shadow: 0 0 0 5px rgba(0, 182, 122, .045);
  }

  .signal-labels {
    left: 16px;
    right: 16px;
    bottom: 16px;
    gap: 8px;
    font-size: 7px;
    letter-spacing: .08em;
  }

  .approach {
    padding: 78px 0 74px;
  }

  .approach-heading h2 {
    margin-bottom: 20px;
    font-size: clamp(2.35rem, 10.3vw, 3.3rem);
    line-height: 1.075;
    letter-spacing: -.04em;
  }

  .approach-heading > p:last-child {
    max-width: 34ch;
    font-size: .97rem;
    line-height: 1.68;
  }

  .approach-words {
    margin-top: 44px;
  }

  .approach-words li,
  .approach-words li:not(:first-child),
  .approach-words li:nth-child(3) {
    min-height: 104px;
    padding: 18px 0;
  }

  .approach-words strong {
    font-size: 1.9rem;
    line-height: 1.08;
  }

  .approach-words span {
    margin-top: 12px;
    font-size: .88rem;
  }

  .now {
    padding: 76px 0;
  }

  .now-layout {
    gap: 34px;
    padding: 24px;
    border-radius: 22px;
  }

  .now-copy h2 {
    margin-bottom: 22px;
    font-size: clamp(2.3rem, 10vw, 3.15rem);
    line-height: 1.075;
    letter-spacing: -.04em;
  }

  .now-copy > p,
  .now-copy > p:first-of-type {
    font-size: .98rem;
    line-height: 1.7;
  }

  .now-mark {
    min-height: 0;
    padding-top: 20px;
  }

  .now-mark strong {
    font-size: 1.2rem;
  }

  .origin {
    padding: 80px 0 70px;
  }

  .origin h2 {
    margin-bottom: 24px;
    font-size: clamp(2.45rem, 10.5vw, 3.45rem);
    line-height: 1.075;
    letter-spacing: -.04em;
  }

  .origin-inner > p:not(.eyebrow):not(.origin-closing) {
    max-width: 35ch;
    font-size: .98rem;
    line-height: 1.72;
  }

  .origin-closing {
    margin-top: 32px;
    font-size: 1.22rem !important;
    line-height: 1.45 !important;
  }

  .contact-line {
    margin-top: 46px;
    padding-top: 22px;
    gap: 14px;
  }

  .contact-line > span {
    font-size: .9rem;
  }

  .contact-line a {
    max-width: 100%;
    min-height: 44px;
    font-size: 1.08rem;
    overflow-wrap: anywhere;
  }

  .footer-layout {
    gap: 14px;
  }

  .footer-brand span,
  .footer-layout > span {
    font-size: .8rem;
  }
}

/* Small phones. */
@media (max-width: 390px) {
  :root {
    --shell: calc(100vw - 28px);
  }

  .brand img {
    width: 138px;
  }

  .hero h1 {
    font-size: clamp(2.65rem, 13vw, 3.35rem);
  }

  .hero-lead {
    font-size: .95rem;
  }

  .signal-scene {
    min-height: 286px;
  }

  .now-layout {
    padding: 22px;
  }
}

@media (hover: none) {
  .hero-text-link span,
  .contact-line a span {
    transform: none !important;
  }
}

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


/* Technology signature: concise, brand-level expression of Mekavix's technical direction. */
.technology-line {
  margin: 30px 0 0;
  color: rgba(235, 244, 255, .82);
  font-size: .78rem;
  line-height: 1.7;
  font-weight: 650;
  letter-spacing: .095em;
  text-transform: uppercase;
}

.technology-line span {
  margin: 0 .38em;
  color: var(--emerald-soft);
  opacity: .82;
}

@media (max-width: 640px) {
  .technology-line {
    margin-top: 24px;
    max-width: 30ch;
    font-size: .7rem;
    line-height: 1.8;
    letter-spacing: .075em;
  }

  .technology-line span {
    margin: 0 .28em;
  }
}


/* Final QA refinement: cleaner copy rhythm and softer approach treatment. */
.approach-heading .approach-lead {
  max-width: 760px;
  margin: 0 auto;
  color: rgba(224, 235, 246, .68);
  font-size: 1.04rem;
  line-height: 1.72;
  text-align: center;
}

.technology-line {
  max-width: 920px;
  margin: 26px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 0;
  color: rgba(225, 236, 247, .72);
  font-size: .76rem;
  line-height: 1.6;
  font-weight: 680;
  letter-spacing: .09em;
  text-transform: uppercase;
  text-align: center;
}

.technology-line span {
  display: inline-flex;
  align-items: center;
}

.technology-line span:not(:last-child)::after {
  content: "·";
  margin: 0 .62em;
  color: var(--emerald-soft);
  opacity: .9;
}

.approach-words {
  max-width: 1160px;
  margin: 64px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  border-top: 0;
}

.approach-words li,
.approach-words li:not(:first-child),
.approach-words li:nth-child(3) {
  position: relative;
  min-height: 190px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.042), rgba(255,255,255,.018));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.025),
    0 14px 38px rgba(0,0,0,.08);
  transition: transform .24s ease, border-color .24s ease, background .24s ease;
}

.approach-words li::before {
  display: block;
  margin-bottom: 30px;
  color: rgba(108, 222, 185, .78);
  font-size: .68rem;
  font-weight: 720;
  letter-spacing: .14em;
}

.approach-words li:nth-child(1)::before { content: "01"; }
.approach-words li:nth-child(2)::before { content: "02"; }
.approach-words li:nth-child(3)::before { content: "03"; }
.approach-words li:nth-child(4)::before { content: "04"; }

.approach-words li:hover {
  transform: translateY(-2px);
  border-color: rgba(117, 196, 255, .16);
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.022));
}

.approach-words strong {
  margin-bottom: 18px;
  font-size: clamp(1.8rem, 2.15vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -.038em;
}

.approach-words span {
  max-width: 21ch;
  margin-top: auto;
  color: rgba(216, 229, 241, .58);
  font-size: .9rem;
  line-height: 1.58;
}

@media (max-width: 980px) and (min-width: 641px) {
  .approach-words {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .approach-words li,
  .approach-words li:not(:first-child),
  .approach-words li:nth-child(3) {
    min-height: 168px;
  }
}

.origin h2 {
  max-width: 1020px;
}

@media (prefers-reduced-motion: reduce) {
  .approach-words li {
    transition: none;
  }
}


/* Language switch */
.lang-switch {
  min-width: 36px;
  justify-content: center;
  margin-left: 2px;
  padding-left: 14px !important;
  border-left: 1px solid rgba(13, 27, 61, .12);
  color: rgba(13, 27, 61, .62) !important;
  font-weight: 700 !important;
  letter-spacing: .05em !important;
}

.lang-switch:hover,
.lang-switch:focus-visible {
  color: var(--navy) !important;
}
