/* Mobile composition: readable copy above a separate lower tree scene. */
@media (max-width: 900px) {
  :root { --mobile-gutter: clamp(20px, 6vw, 44px); --mobile-header: 72px; --scene-height: min(44svh, 420px); --muted: #62705e; }
  html { scroll-padding-top: calc(var(--mobile-header) + env(safe-area-inset-top, 0px) + 24px); }
  body { overflow-wrap: break-word; }
  .header { position: fixed; height: calc(var(--mobile-header) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) var(--mobile-gutter) 0; z-index: 100; background: #f5f3e9f5; backdrop-filter: blur(12px); }
  .header { padding-left: max(var(--mobile-gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--mobile-gutter), env(safe-area-inset-right, 0px)); }
  .brand { min-height: 48px; gap: 10px; }
  .brand svg { width: 25px; height: 34px; }
  .brand > span { font-size: 25px; letter-spacing: 3px; }
  .brand small { font-size: 6px; letter-spacing: 1.5px; }
  .desktop-nav, .account { display: none; }
  .menu-toggle { display: flex; position: relative; width: 48px; height: 48px; margin-right: -10px; padding: 0; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; }
  .menu-toggle span { position: absolute; display: block; width: 24px; height: 1px; background: var(--green); transition: transform .2s; }
  .menu-toggle span:first-child { transform: translateY(-4px); }
  .menu-toggle span:last-child { transform: translateY(4px); }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }
  .mobile-nav { position: fixed; inset: calc(var(--mobile-header) + env(safe-area-inset-top, 0px)) 0 auto; z-index: 99; display: flex; flex-direction: column; gap: 0; padding: 16px var(--mobile-gutter) 24px; background: var(--cream); box-shadow: 0 20px 35px #294b3614; max-height: calc(100dvh - var(--mobile-header) - env(safe-area-inset-top, 0px)); overflow-y: auto; overscroll-behavior: contain; }
  .mobile-nav a { display: flex; align-items: center; min-height: 56px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
  .mobile-nav a:last-child { margin-top: 12px; border-bottom: 0; font-size: 14px; }
  .menu-backdrop { position: fixed; inset: 0; z-index: 98; border: 0; background: #20382d45; backdrop-filter: blur(3px); cursor: pointer; }
  .menu-backdrop[hidden] { display: none; }
  .tree-stage { height: 100svh; }
  .tree-stage canvas { left: 50%; right: auto; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); top: auto; width: 100%; max-width: 580px; height: var(--scene-height); transform: translateX(-50%); }
  .sun-disc { width: min(90vw, 460px); height: min(90vw, 460px); top: auto; right: 50%; bottom: 64px; transform: translateX(50%); }
  .orbit { width: min(88vw, 440px); height: min(88vw, 440px); top: auto; right: 50%; bottom: 64px; transform: translateX(50%); }
  .orbit-two { width: min(69vw, 350px); height: min(69vw, 350px); right: 50%; bottom: 100px; transform: translateX(50%); }
  .stage-note { right: 0; left: 0; bottom: calc(47px + env(safe-area-inset-bottom, 0px)); justify-content: center; gap: 7px; font-size: 10px; }
  .growth-meter { left: var(--mobile-gutter); right: var(--mobile-gutter); top: auto; bottom: calc(19px + env(safe-area-inset-bottom, 0px)); flex-direction: row; gap: 12px; font-size: 10px; }
  .growth-meter i { flex: 1; width: auto; height: 1px; }
  .growth-meter b { height: 1px; width: 0; }
  .story-section { padding: calc(112px + env(safe-area-inset-top, 0px)) var(--mobile-gutter) calc(var(--scene-height) + 92px); min-height: 100svh; align-items: flex-start; }
  .story-section, .growth-story { scroll-margin-top: calc(-1 * (var(--mobile-header) + env(safe-area-inset-top, 0px) + 24px)); }
  .story-copy { position: relative; isolation: isolate; width: 100%; max-width: 560px; background: var(--cream); }
  /* A soft opaque backing keeps moving copy legible when it crosses the scene. */
  .story-copy::before { content: ''; position: absolute; z-index: -1; inset: -16px -12px -18px; background: var(--cream); box-shadow: 0 20px 24px 8px var(--cream); pointer-events: none; }
  .hero { min-height: max(100svh, 720px); padding-top: calc(var(--mobile-header) + 38px + env(safe-area-inset-top, 0px)); padding-bottom: 100px; }
  .eyebrow { font-size: 10px; line-height: 1.6; letter-spacing: 1.5px; margin-bottom: 23px; }
  h1 { font-size: clamp(52px, 14.8vw, 78px); line-height: 1.02; letter-spacing: -.065em; margin-bottom: 24px; }
  h1 em { font-size: 1.1em; }
  h2 { font-size: clamp(33px, 8.8vw, 49px); line-height: 1.12; letter-spacing: -.05em; margin-bottom: 24px; }
  .hero .lead, .story-copy .lead { font-size: 15px; line-height: 1.75; max-width: 480px; margin-bottom: 19px; }
  .story-copy > p:not(.eyebrow):not(.lead):not(.hero-footnote) { font-size: 15px; line-height: 1.8; max-width: 500px; }
  .button { min-height: 52px; padding: 15px 23px; margin-top: 5px; font-size: 14px; gap: 30px; }
  .hero-footnote, .hero-index { display: none; }
  .scroll-cue { left: var(--mobile-gutter); bottom: 22px; min-height: 44px; gap: 10px; font-size: 10px; line-height: 1.6; max-width: 180px; }
  .hero .scroll-cue { bottom: 92px; }
  .scroll-icon { width: 26px; height: 40px; flex-shrink: 0; }
  .inline-note { padding-left: 16px; font-size: 13px; line-height: 1.8; margin-top: 26px; }
  .mission-item { gap: 13px; margin-top: 24px; max-width: 500px; }
  .mission-item > span { width: 28px; height: 28px; font-size: 10px; }
  .mission-item h3 { font-size: 16px; line-height: 1.5; margin-bottom: 7px; }
  .mission-item p { font-size: 14px; line-height: 1.75; }
  .text-link { min-height: 48px; font-size: 13px; margin-top: 9px; gap: 22px; }
  .section-pad { padding: 64px var(--mobile-gutter); }
  .section-pad { scroll-margin-top: -24px; }
  .section-top { align-items: flex-start; gap: 20px; }
  .section-top > span { display: none; }
  .partner-row { display: block; margin-top: 32px; }
  .partner-row h2 { font-size: 38px; }
  .partner-logos { display: flex; width: 100%; gap: 30px; justify-content: space-between; margin-top: 38px; padding: 24px 0 0; border-top: 1px solid #cfd6c5; }
  .partner-logos img { width: 42%; max-width: 210px; max-height: 56px; }
  .heart { display: block; }
  .heart h2 { font-size: clamp(32px, 8.4vw, 46px); }
  .heart h2 em { display: inline; }
  .heart-copy > p:not(.eyebrow) { font-size: 15px; line-height: 1.8; max-width: 560px; }
  .handwritten { margin-top: 14px; font-size: 26px; }
  .letters { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 15px; height: auto; max-width: 480px; margin: 42px 0 0; padding-bottom: 40px; }
  .letter { position: static; width: 100%; border-width: 5px; box-shadow: 0 8px 20px #263e2514; transform: none; }
  .letter-two { margin-top: 22px; }
  .letter:hover { transform: none; }
  .letter-caption { right: auto; bottom: 0; left: 0; font-size: 10px; line-height: 1.5; }
  .landscape { height: clamp(340px, 65svh, 460px); }
  .landscape > div { left: var(--mobile-gutter); right: var(--mobile-gutter); }
  .landscape .eyebrow { font-size: 9px; line-height: 1.8; letter-spacing: 1px; max-width: 260px; }
  .landscape > div > p:last-child { font-size: clamp(35px, 9.3vw, 58px); letter-spacing: -.04em; line-height: 1.2; }
  .landscape-caption { left: var(--mobile-gutter); right: auto; bottom: 26px; font-size: 11px; }
  .contact-grid { display: block; margin-top: 34px; }
  .documents-heading { display: block; margin-bottom: 28px; }
  .documents-heading h2 { font-size: clamp(33px, 8.8vw, 46px); }
  .documents-heading > p { font-size: 15px; line-height: 1.8; margin: 24px 0 0; max-width: 500px; }
  .document-cards { grid-template-columns: 1fr; gap: 12px; }
  .document-card { display: grid; grid-template-columns: 28px minmax(0,1fr) 20px; column-gap: 14px; row-gap: 12px; align-content: center; min-height: 144px; padding: 24px 20px; }
  .document-card-top { display: contents; }
  .document-card-top svg { grid-column: 1; grid-row: 1 / 3; width: 27px; height: 33px; margin-top: 2px; }
  .document-card-top > span { grid-column: 3; grid-row: 1; font-size: 23px; }
  .document-card h3 { grid-column: 2; grid-row: 1; margin: 0; font-size: 20px; line-height: 1.4; letter-spacing: -.4px; }
  .document-open { grid-column: 2 / 4; grid-row: 2; font-size: 12px; line-height: 1.7; }
  .document-card:hover { transform: none; }
  .contact-grid h2 { font-size: clamp(45px, 12vw, 62px); }
  .contact-grid p:not(.eyebrow) { font-size: 15px; line-height: 1.8; }
  .contact-phone { display: flex; align-items: center; justify-content: space-between; min-height: 56px; margin: 26px 0 8px; font-size: clamp(24px, 7.3vw, 36px); letter-spacing: -.04em; white-space: nowrap; }
  .contact-phone span { font-size: 24px; margin-left: 8px; }
  .contact-email { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; }
  .contact-details { padding-top: 36px; margin-top: 30px; border-top: 1px solid var(--line); }
  .contact-details .eyebrow { font-size: 10px; line-height: 1.7; }
  .address { font-size: 16px; line-height: 1.8; min-height: 48px; }
  .address span { margin-left: 5px; }
  .social-title { margin-top: 36px !important; }
  .social-link { min-height: 80px; padding: 18px 0; font-size: 16px; }
  .social-icon { width: 42px; height: 42px; font-size: 15px; }
  .social-link small { font-size: 12px; line-height: 1.5; }
  .telegram { display: inline-flex; align-items: center; min-height: 48px; margin-top: 12px; font-size: 13px; }
  .footer { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
  .footer-brand { align-items: flex-start; gap: 22px; font-size: 35px; letter-spacing: 4px; min-height: 48px; }
  .footer-brand span { font-size: 19px; line-height: 1.4; max-width: 140px; letter-spacing: 0; }
  .footer-bottom { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 26px; padding-top: 22px; font-size: 11px; }
  .footer-bottom > span, .footer-bottom > a { min-height: 44px; display: flex; align-items: center; }
  .footer-bottom > span { display: block; padding: 14px 0; }
  .footer-bottom > a { margin-left: auto; }
  .legal { order: 3; flex-direction: column; width: 100%; gap: 0; padding-top: 12px; border-top: 1px solid #ffffff24; }
  .legal a { display: flex; align-items: center; min-height: 44px; padding: 10px 0; line-height: 1.6; }
  dialog { width: calc(100% - 24px); max-width: 560px; max-height: calc(100dvh - 24px); padding: 12px; border-radius: 12px; overscroll-behavior: contain; }
  .dialog-close { width: 44px; height: 44px; margin-bottom: 8px; }
}

@media (max-width: 360px) {
  :root { --mobile-gutter: 20px; }
  .eyebrow { font-size: 9px; letter-spacing: 1.1px; }
  .hero .lead { font-size: 14px; }
  .mission-item { gap: 10px; }
  .mission-item p { font-size: 14px; }
  .footer-brand { font-size: 30px; }
  .footer-brand span { max-width: 120px; font-size: 17px; }
  .document-card h3 { grid-column: 2 / 4; font-size: 18px; }
}

@media (max-width: 900px) and (max-height: 700px) {
  :root { --scene-height: 42svh; }
  .hero { padding-top: calc(var(--mobile-header) + 26px + env(safe-area-inset-top, 0px)); }
  .hero h1 { font-size: clamp(48px, 13.5vw, 65px); }
  .hero .eyebrow { margin-bottom: 18px; }
  .hero h1 { margin-bottom: 18px; }
  .hero .lead { line-height: 1.65; margin-bottom: 14px; }
  .tree-stage canvas { bottom: calc(30px + env(safe-area-inset-bottom, 0px)); }
  .stage-note, .hero .scroll-cue { display: none; }
  .sun-disc, .orbit { bottom: 22px; }
  .orbit-two { bottom: 48px; }
  .story-copy::before { bottom: -8px; box-shadow: 0 8px 12px 4px var(--cream); }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  :root { --mobile-header: 62px; --scene-height: 70svh; }
  .hero, .story-section { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
  .hero { min-height: max(100svh, 530px); }
  .story-copy { width: 53%; max-width: 480px; }
  .story-section { min-height: 100svh; padding-top: 94px; padding-bottom: 70px; }
  .hero h1 { font-size: 48px; }
  .story-section h2 { font-size: 33px; }
  .tree-stage canvas { left: auto; right: 0; width: 45%; transform: none; bottom: 38px; }
  .sun-disc, .orbit { width: 40vw; height: 40vw; right: 2%; bottom: 30px; transform: none; }
  .orbit-two { width: 31vw; height: 31vw; right: 6%; bottom: 52px; }
  .stage-note { display: flex; left: 56%; bottom: 18px; font-size: 9px; }
  .growth-meter { display: none; }
  .hero .scroll-cue { bottom: 24px; }
  .landscape { height: 330px; }
}
