/* Mobile-specific composition. Desktop/tablet remain controlled by refinement.css + polish.css. */

@media (max-width: 640px) {
  :root {
    --shell: calc(100vw - 36px);
  }

  html {
    scroll-padding-top: calc(60px + env(safe-area-inset-top));
  }

  [id] {
    scroll-margin-top: calc(60px + env(safe-area-inset-top));
  }

  /* Header: one clear action, no desktop navigation compression. */
  .site-header {
    background: rgba(255, 255, 255, .9);
    border-bottom-color: rgba(13, 27, 61, .055);
    backdrop-filter: saturate(170%) blur(18px);
    -webkit-backdrop-filter: saturate(170%) blur(18px);
  }

  .nav-shell {
    min-height: 52px;
    padding-inline: 0;
  }

  .brand {
    min-height: 48px;
  }

  .brand img {
    width: 136px;
  }

  .nav-links {
    gap: 0;
  }

  .nav-links a:not(:last-child) {
    display: none;
  }

  .nav-links a:last-child {
    min-width: 58px;
    min-height: 44px;
    justify-content: flex-end;
    padding: 0;
    font-size: 12px;
    font-weight: 590;
    color: rgba(13, 27, 61, .74);
  }

  /* Hero: content-led, not a shrunken full-screen desktop hero. */
  .hero {
    min-height: auto;
  }

  .hero-content {
    max-width: none;
    padding-top: calc(94px + env(safe-area-inset-top));
    padding-bottom: 72px;
  }

  .hero .eyebrow {
    max-width: 100%;
    margin-bottom: 18px;
    font-size: 9px;
    line-height: 1.4;
    letter-spacing: .105em;
  }

  .hero h1 {
    max-width: 100%;
    margin-bottom: 22px;
    font-size: clamp(2.62rem, 12.2vw, 3.22rem);
    line-height: 1.105;
    letter-spacing: -.038em;
  }

  .hero-lead {
    max-width: 32ch;
    margin-bottom: 20px;
    font-size: .96rem;
    line-height: 1.68;
  }

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

  .glow-blue {
    width: 82vw;
    height: 82vw;
    right: -42vw;
    top: 8%;
    opacity: .24;
  }

  .glow-green {
    width: 62vw;
    height: 62vw;
    right: 4vw;
    bottom: -34vw;
    opacity: .2;
  }

  .river-line {
    height: 150px;
    opacity: .48;
  }

  /* Problem: one editorial flow, then a compact visual. */
  .problem {
    padding: 72px 0 68px;
  }

  .problem-layout {
    display: block;
  }

  .problem-copy {
    max-width: none;
  }

  .problem .eyebrow {
    margin-bottom: 16px;
  }

  .problem h2 {
    max-width: 10.5ch;
    margin-bottom: 22px;
    font-size: clamp(2.28rem, 10.4vw, 2.85rem);
    line-height: 1.105;
    letter-spacing: -.035em;
  }

  .problem-copy > p {
    max-width: none;
    margin-bottom: 16px;
    font-size: .97rem;
    line-height: 1.72;
  }

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

  .signal-scene {
    width: 100%;
    min-height: 0;
    aspect-ratio: 1.08 / 1;
    margin-top: 36px;
    border-radius: 20px;
  }

  .signal-scene::before {
    background-size: 32px 32px;
    opacity: .22;
  }

  .wave {
    height: 108px;
  }

  .sensor {
    width: 9px;
    height: 9px;
    border-width: 1.5px;
    box-shadow: 0 0 0 4px rgba(0, 182, 122, .04);
  }

  .signal-labels {
    left: 14px;
    right: 14px;
    bottom: 13px;
    font-size: 6.5px;
    letter-spacing: .065em;
  }

  /* Approach: rows designed for thumbs and narrow screens. */
  .approach {
    padding: 72px 0 66px;
  }

  .approach-heading {
    text-align: left;
  }

  .approach-heading .eyebrow {
    margin-bottom: 16px;
  }

  .approach-heading h2 {
    max-width: 10ch;
    margin-bottom: 20px;
    font-size: clamp(2.3rem, 10.5vw, 2.9rem);
    line-height: 1.095;
    letter-spacing: -.035em;
  }

  .approach-heading > p:last-child {
    max-width: 32ch;
    margin: 0;
    font-size: .96rem;
    line-height: 1.68;
  }

  .approach-words {
    margin-top: 38px;
    display: block;
    border-top: 1px solid rgba(255, 255, 255, .11);
  }

  .approach-words li,
  .approach-words li:not(:first-child),
  .approach-words li:nth-child(3) {
    min-height: 0;
    padding: 18px 0;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: center;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
  }

  .approach-words strong {
    font-size: 1.72rem;
    line-height: 1.08;
    letter-spacing: -.035em;
  }

  .approach-words span {
    max-width: none;
    margin: 0;
    font-size: .84rem;
    line-height: 1.5;
  }

  /* First experiment: remove the nested desktop card on phones. */
  .now {
    padding: 72px 0;
    background: #fff;
  }

  .now-layout {
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .now-copy {
    max-width: none;
  }

  .now-copy .eyebrow {
    margin-bottom: 16px;
  }

  .now-copy h2 {
    max-width: 11ch;
    margin-bottom: 22px;
    font-size: clamp(2.28rem, 10.2vw, 2.85rem);
    line-height: 1.1;
    letter-spacing: -.035em;
  }

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

  .now-copy > p:first-of-type {
    color: #25364f;
    font-size: 1.03rem;
  }

  .now-mark {
    min-height: 0;
    margin-top: 32px;
    padding: 20px 0 0;
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 14px;
    align-items: start;
    border: 0;
    border-top: 1px solid rgba(13, 27, 61, .1);
  }

  .now-index {
    padding-top: 3px;
  }

  .now-mark div {
    gap: 5px;
  }

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

  /* Mekong ending: compact but still a brand moment. */
  .origin {
    padding: 76px 0 calc(68px + env(safe-area-inset-bottom));
  }

  .origin .eyebrow {
    margin-bottom: 16px;
  }

  .origin h2 {
    max-width: 10.6ch;
    margin-bottom: 22px;
    font-size: clamp(2.35rem, 10.6vw, 3rem);
    line-height: 1.095;
    letter-spacing: -.035em;
  }

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

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

  .contact-line {
    margin-top: 38px;
    padding-top: 20px;
    display: block;
  }

  .contact-line > span {
    display: block;
    margin-bottom: 10px;
    font-size: .86rem;
  }

  .contact-line a {
    min-height: 40px;
    font-size: 1.02rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .origin-ambient span {
    height: 128px;
    opacity: .66;
  }

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

  .footer-layout {
    gap: 12px;
  }

  .footer-brand {
    gap: 3px;
  }
}

/* Narrow phones: preserve clean wrapping without shrinking body text. */
@media (max-width: 380px) {
  :root {
    --shell: calc(100vw - 30px);
  }

  .brand img {
    width: 130px;
  }

  .hero-content {
    padding-top: calc(88px + env(safe-area-inset-top));
    padding-bottom: 64px;
  }

  .hero h1 {
    font-size: clamp(2.48rem, 12vw, 2.82rem);
  }

  .hero-lead,
  .problem-copy > p,
  .approach-heading > p:last-child,
  .now-copy > p,
  .origin-inner > p:not(.eyebrow):not(.origin-closing) {
    font-size: .94rem;
  }

  .signal-scene {
    aspect-ratio: 1 / 1;
  }

  .approach-words strong {
    font-size: 1.58rem;
  }

  .approach-words li,
  .approach-words li:not(:first-child),
  .approach-words li:nth-child(3) {
    grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
    gap: 14px;
  }

  .contact-line a {
    font-size: .98rem;
  }
}

/* Short mobile viewports: avoid making the hero feel trapped. */
@media (max-width: 640px) and (max-height: 700px) {
  .hero-content {
    padding-top: calc(82px + env(safe-area-inset-top));
    padding-bottom: 56px;
  }

  .hero h1 {
    font-size: clamp(2.42rem, 11.5vw, 2.95rem);
  }

  .hero-lead {
    line-height: 1.58;
  }
}


/* Final mobile composition: full-width reading rhythm and card-based approach. */
@media (max-width: 640px) {
  .hero {
    min-height: auto;
  }

  .hero-content {
    padding-top: calc(96px + env(safe-area-inset-top));
    padding-bottom: 72px;
  }

  .hero h1 {
    max-width: 100%;
    margin-bottom: 20px;
    font-size: clamp(2.58rem, 11.9vw, 3.18rem);
    line-height: 1.07;
    letter-spacing: -.04em;
  }

  .hero-lead {
    max-width: 100%;
    margin-bottom: 18px;
    font-size: .98rem;
    line-height: 1.7;
  }

  .hero-text-link {
    margin-top: 0;
  }

  .approach {
    padding-top: 76px;
    padding-bottom: 76px;
  }

  .approach-heading {
    max-width: none;
    margin: 0;
    text-align: left;
  }

  .approach-heading h2 {
    max-width: 100%;
    margin-bottom: 20px;
  }

  .approach-heading .approach-lead {
    max-width: none;
    margin: 0;
    font-size: .97rem;
    line-height: 1.7;
    text-align: left;
  }

  .technology-line {
    max-width: none;
    margin: 22px 0 0;
    justify-content: flex-start;
    gap: 7px 0;
    font-size: .7rem;
    line-height: 1.7;
    letter-spacing: .075em;
    text-align: left;
  }

  .technology-line span:not(:last-child)::after {
    margin: 0 .5em;
  }

  .approach-words {
    margin-top: 38px;
    grid-template-columns: 1fr;
    gap: 12px;
    border: 0;
  }

  .approach-words li,
  .approach-words li:not(:first-child),
  .approach-words li:nth-child(3) {
    min-height: 0;
    padding: 22px 20px 20px;
    display: block;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 20px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.042), rgba(255,255,255,.018));
  }

  .approach-words li::before {
    margin-bottom: 20px;
  }

  .approach-words strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.74rem;
    line-height: 1.08;
  }

  .approach-words span {
    display: block;
    max-width: none;
    margin: 0;
    font-size: .88rem;
    line-height: 1.58;
  }

  .origin h2 {
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: clamp(2.42rem, 11.5vw, 2.78rem);
  }

  .technology-line {
    font-size: .67rem;
  }

  .approach-words strong {
    font-size: 1.62rem;
  }
}


/* Mobile language navigation */
@media (max-width: 640px) {
  .nav-links {
    gap: 12px;
  }

  .nav-links a:not(.nav-contact):not(.lang-switch) {
    display: none !important;
  }

  .nav-contact,
  .lang-switch {
    display: inline-flex !important;
    min-height: 44px;
    align-items: center;
  }

  .nav-contact {
    min-width: auto !important;
    justify-content: flex-end !important;
    padding: 0 !important;
    font-size: 12px !important;
  }

  .lang-switch {
    min-width: 34px;
    justify-content: flex-end;
    margin-left: 0;
    padding-left: 12px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 380px) {
  .nav-links {
    gap: 10px;
  }

  .lang-switch {
    min-width: 30px;
    padding-left: 10px !important;
  }
}
