/* ==========================================================================
   Vietnamese Youth Foundation — vnyouth.com (single page)
   Implements the official brand system: four colors, three typefaces,
   no radius, no shadows. Motion is transform/opacity only and respects
   prefers-reduced-motion.
   ========================================================================== */

:root {
  --coral:       #C1442E;
  --coral-light: #E8674E;
  --gold:        #EBA23A;
  --ink:         #17242B;
  --paper:       #FBF6EE;

  --ink-body:   rgba(23,36,43,.85);
  --ink-lead:   rgba(23,36,43,.72);
  --ink-label:  rgba(23,36,43,.5);
  --ink-border: rgba(23,36,43,.14);
  --ink-hair:   rgba(23,36,43,.1);
  --paper-body:  rgba(251,246,238,.72);
  --paper-label: rgba(251,246,238,.55);
  --paper-rule:  rgba(251,246,238,.18);

  --font-ui:   "Archivo", "Segoe UI", system-ui, Arial, sans-serif;
  --font-text: "Newsreader", Georgia, "Times New Roman", serif;
  --font-logo: "Lora", Georgia, serif;

  --s-1: 8px; --s-2: 10px; --s-3: 14px; --s-4: 18px; --s-5: 20px; --s-6: 26px; --s-7: 34px; --s-8: 60px;
  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 64px);
  --header-h: 88px;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body { margin: 0; background: var(--paper); color: var(--ink-body); font: 300 17px/1.55 var(--font-text); overflow-x: clip; }
:lang(vi) { line-height: 1.6; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--coral); text-decoration-thickness: 1px; text-underline-offset: .12em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--gold); color: var(--ink); }

h1, h2, h3 { font-family: var(--font-ui); color: var(--ink); margin: 0 0 var(--s-4); text-wrap: balance; }
h1 { font-weight: 900; font-size: clamp(40px, 6.4vw, 92px); line-height: .96; letter-spacing: -.03em; }
h2 { font-weight: 900; font-size: clamp(30px, 4.2vw, 56px); line-height: 1.0; letter-spacing: -.025em; }
h3 { font-weight: 800; font-size: 22px; line-height: 1.2; }
p  { margin: 0 0 1em; max-width: 60ch; }
.lede { font-size: 19px; line-height: 1.5; color: var(--ink-lead); }
.statement { font: 300 clamp(24px, 3vw, 38px)/1.28 var(--font-text); color: var(--ink); max-width: 28ch; margin: 0; text-wrap: balance; }
strong { font-weight: 400; color: var(--ink); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 700 12px/1.4 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--coral); margin: 0 0 var(--s-4); }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.small { font: 500 12px/1.5 var(--font-ui); letter-spacing: .04em; color: var(--ink-label); }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: clamp(64px, 9vw, 130px); }
.section + .section { border-top: 1px solid var(--ink-hair); }
.cols { display: grid; gap: var(--s-7) var(--s-8); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) {
  .cols { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .cols--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .cols > .sticky { position: sticky; top: calc(var(--header-h) + 24px); }
}

/* Buttons */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 26px; font: 600 15px/1 var(--font-ui); border: 1px solid transparent; border-radius: 0; text-decoration: none; cursor: pointer; overflow: hidden; isolation: isolate; transition: color .25s var(--ease-out), border-color .25s; }
.btn::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: translateY(101%); transition: transform .35s var(--ease-out); z-index: -1; }
.btn:hover::after { transform: translateY(0); }
.btn--primary { background: var(--coral); color: var(--paper); border-color: var(--coral); }
.btn--primary:hover { color: var(--paper); border-color: var(--ink); }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--secondary:hover { color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(251,246,238,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ink-border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s-6); min-height: var(--header-h); }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--coral); transform-origin: left; transform: scaleX(0); }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); --mark: 56px; gap: calc(var(--mark) * .25); }
.brand svg { width: var(--mark); height: var(--mark); flex: none; }
.wordmark { display: grid; gap: calc(var(--mark) * .06); }
.wordmark .line-1 { font: 700 calc(var(--mark) * .346) / 1.06 var(--font-logo); letter-spacing: -.015em; color: var(--ink); white-space: nowrap; }
.wordmark .line-2 { font: 700 calc(var(--mark) * .163) / 1 var(--font-logo); letter-spacing: .26em; padding-left: .26em; text-transform: uppercase; color: var(--coral); text-align: center; }
.brand--reversed .wordmark .line-1 { color: var(--paper); }
.brand--reversed .wordmark .line-2 { color: var(--gold); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a { position: relative; font: 500 15px/1 var(--font-ui); color: var(--ink); text-decoration: none; padding: 14px 12px; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 8px; height: 2px; background: var(--coral); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out); }
.nav a:not(.btn):hover::after, .nav a.is-active::after { transform: scaleX(1); }
.nav .btn { margin-left: var(--s-3); min-height: 44px; padding: 0 18px; font-size: 14px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--ink-border); width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); padding: 0; }
.nav-toggle svg { width: 22px; height: 22px; }
@media (max-width: 860px) {
  :root { --header-h: 72px; }
  .brand { --mark: 46px; }
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--ink-border); flex-direction: column; align-items: stretch; padding: var(--s-2) var(--gutter) var(--s-5); gap: 0; }
  .nav.is-open { display: flex; }
  .nav a { padding: 16px 0; border-bottom: 1px solid var(--ink-hair); font-size: 17px; }
  .nav a:not(.btn)::after { display: none; }
  .nav a.is-active { color: var(--coral); }
  .nav .btn { margin: var(--s-4) 0 0; border-bottom: 1px solid var(--coral); }
}
@media (max-width: 400px) { .wordmark { display: none; } }

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero .wrap { display: grid; gap: var(--s-7) var(--s-8); grid-template-columns: minmax(0, 1fr); padding-block: clamp(48px, 7vw, 96px) clamp(40px, 6vw, 80px); align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.hero h1 { margin-bottom: var(--s-6); font-size: clamp(38px, 5vw, 66px); }
.hero h1 span { display: block; overflow: hidden; }
.hero h1 span i { display: block; font-style: normal; }
.hero h1 span:nth-child(3) i { color: var(--coral); }
.hero .lede { max-width: 46ch; margin-bottom: var(--s-6); }
.hero-photo { position: relative; margin: 0; }
.hero-photo::before { content: ""; position: absolute; inset: 0; border: 1px solid var(--coral); transform: translate(16px, 16px); pointer-events: none; }
.hero-photo img { position: relative; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 40%; }
@media (max-width: 899px) { .hero-photo img { aspect-ratio: 3 / 2; } }
.hero-photo figcaption { position: absolute; left: 0; bottom: -28px; }
figcaption { font: 500 12px/1.5 var(--font-ui); letter-spacing: .04em; color: var(--ink-label); margin-top: var(--s-2); }

/* Hero entrance */
.js .hero h1 span i { transform: translateY(110%); animation: rise .9s var(--ease-out) forwards; }
.js .hero h1 span:nth-child(2) i { animation-delay: .12s; }
.js .hero h1 span:nth-child(3) i { animation-delay: .24s; }
.js .hero .lede, .js .hero .btn-row { opacity: 0; animation: fade .8s var(--ease-out) .45s forwards; }
.js .hero-photo { opacity: 0; animation: fade 1s var(--ease-out) .3s forwards; }
.js .hero-photo img { animation: drift 14s ease-in-out infinite alternate; }
@keyframes rise { to { transform: translateY(0); } }
@keyframes fade { to { opacity: 1; } }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.06); } }


/* Full-bleed photo with statement (founding) */
.bleed { position: relative; min-height: min(88vh, 820px); display: grid; align-items: end; color: var(--paper); isolation: isolate; overflow: hidden; }
.bleed img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.bleed::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(23,36,43,.88) 0%, rgba(23,36,43,.35) 55%, rgba(23,36,43,0) 100%); }
.bleed .wrap { padding-block: clamp(48px, 7vw, 96px); display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .bleed .wrap { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: end; } }
.bleed .eyebrow { color: var(--gold); }
.bleed .statement { color: var(--paper); max-width: 32ch; }
.bleed figcaption { color: var(--paper-label); text-align: right; }
@supports (animation-timeline: view()) {
  .bleed img { animation: parallax linear both; animation-timeline: view(); scale: 1.15; }
  @keyframes parallax { from { translate: 0 -6%; } to { translate: 0 6%; } }
}

/* What we do — commitments light up as you read */
.commitments { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.commitments li { position: relative; padding: clamp(22px, 3vw, 34px) 0 clamp(22px, 3vw, 34px) 0; border-bottom: 1px solid var(--ink-hair); font: 300 clamp(22px, 2.6vw, 34px)/1.3 var(--font-text); color: var(--ink); max-width: 30ch; transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.commitments li strong { font: 800 .82em/1.25 var(--font-ui); color: var(--ink); display: block; margin-bottom: 6px; letter-spacing: -.01em; }
.commitments li::before { content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--coral); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease-out); }
.js .commitments li { opacity: .28; }
.js .commitments li.is-lit { opacity: 1; }
.js .commitments li.is-lit::before { transform: scaleX(1); }

/* About */
.photo { margin: 0; position: relative; }
.photo img { width: 100%; object-fit: cover; }
.photo--land img { aspect-ratio: 3 / 2; }
.photo--tall img { aspect-ratio: 4 / 5; }
.photo--framed::before { content: ""; position: absolute; inset: 0; border: 1px solid var(--coral); transform: translate(-16px, 16px); pointer-events: none; }
.photo--framed img { position: relative; }

/* Bridging generations — black and white photograph, split */
.bridge { background: var(--ink); color: var(--paper-body); }
.bridge .split { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .bridge .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 90vh; } }
.bridge figure { margin: 0; position: relative; min-height: 60vh; }
.bridge img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.bridge figcaption { position: absolute; left: var(--gutter); bottom: var(--s-4); color: var(--paper-label); }
.bridge .text { padding: clamp(48px, 7vw, 110px) var(--gutter); display: grid; align-content: center; gap: var(--s-5); }
@media (min-width: 900px) { .bridge .text { padding-inline: clamp(40px, 5vw, 80px); max-width: 680px; } }
.bridge .eyebrow { color: var(--gold); }
.bridge h2 { color: var(--paper); }
.bridge p { color: var(--paper-body); font-size: 18px; }
.bridge .quote-card { border-color: var(--gold); margin-top: var(--s-2); }
.bridge .quote-card::before { color: var(--gold); }
.bridge .quote-card p { color: var(--paper); }

.quote-card { border: 1px solid var(--coral); padding: clamp(26px, 4vw, 44px); position: relative; }
.quote-card::before { content: "\201C"; font: 900 96px/0.6 var(--font-ui); color: var(--coral); display: block; margin-bottom: var(--s-4); }
.quote-card p { font: 300 clamp(22px, 2.4vw, 28px)/1.35 var(--font-text); color: var(--ink); margin: 0; max-width: 34ch; text-wrap: balance; }

/* Activities — snap-scrolling gallery */
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 560px); gap: var(--s-4); overflow-x: auto; scroll-snap-type: x mandatory; padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2)); padding-bottom: var(--s-4); scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery figure { margin: 0; scroll-snap-align: start; position: relative; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery figure.tall img { aspect-ratio: 4 / 5; }
.gallery figcaption { position: absolute; left: 0; bottom: 0; background: var(--paper); color: var(--ink); font: 700 12px/1.4 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; padding: 10px 14px; margin: 0; }
.gallery figcaption.serve { background: var(--coral); color: var(--paper); }
.gallery-hint { display: flex; align-items: center; gap: 12px; margin-top: var(--s-2); }
.gallery-hint .bar { width: 120px; height: 2px; background: var(--ink-border); position: relative; overflow: hidden; }
.gallery-hint .bar i { position: absolute; inset: 0; background: var(--coral); transform-origin: left; transform: scaleX(.2); transition: transform .2s; }
.pair { display: grid; gap: var(--s-7) var(--s-8); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .pair { grid-template-columns: 1fr 1fr; } }
.pair .statement { font-size: clamp(22px, 2.2vw, 28px); }

/* Get involved */
.band { background: var(--ink); color: var(--paper-body); position: relative; overflow: hidden; }
.band .wrap { padding-block: clamp(70px, 10vw, 140px); display: grid; gap: var(--s-7) var(--s-8); grid-template-columns: minmax(0, 1fr); align-items: end; position: relative; }
@media (min-width: 860px) { .band .wrap { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.band .eyebrow { color: var(--gold); }
.band .statement { color: var(--paper); }
.band .ask { font: 900 clamp(88px, 18vw, 240px)/.85 var(--font-ui); letter-spacing: -.05em; color: var(--gold); margin: var(--s-6) 0 0; display: inline-block; }
.js .band .ask { transform: translateY(40%); opacity: 0; transition: transform 1s var(--ease-out), opacity .8s; }
.js .band.is-in .ask { transform: none; opacity: 1; }
.band .btn--primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.band .btn--primary::after { background: var(--gold); }
.band .btn--primary:hover { color: var(--ink); border-color: var(--gold); }
.band .btn--secondary { color: var(--paper); border-color: var(--paper-body); }
.band .btn--secondary::after { background: var(--paper); }
.band .btn--secondary:hover { color: var(--ink); border-color: var(--paper); }
.band .btn-row { flex-direction: column; align-items: stretch; }
@media (min-width: 860px) { .band .btn-row { justify-self: end; min-width: 260px; } }
.band-mark { position: absolute; right: -4%; top: -10%; width: min(46vw, 520px); opacity: .07; pointer-events: none; }

/* Contact */
.form { display: grid; gap: var(--s-4); }
.form label { display: grid; gap: 6px; font: 600 13px/1.4 var(--font-ui); letter-spacing: .02em; color: var(--ink); }
.form input, .form select, .form textarea { font: 300 17px/1.4 var(--font-text); min-height: 50px; padding: 12px 14px; border: 1px solid var(--ink-border); border-radius: 0; background: #fff; color: var(--ink); width: 100%; transition: border-color .2s; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
.form textarea { min-height: 180px; resize: vertical; }
.form .row { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form .note { font: 500 12px/1.5 var(--font-ui); letter-spacing: .02em; color: var(--ink-label); margin: 0; }
.form .status { font: 500 15px/1.5 var(--font-ui); color: var(--ink); margin: 0; }
.form .status[data-state="error"] { color: var(--coral); }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer { background: var(--ink); color: var(--paper-body); border-top: 1px solid var(--paper-rule); }
.site-footer .wrap { display: grid; gap: var(--s-7) var(--s-8); grid-template-columns: minmax(0, 1fr); padding-block: var(--s-8) var(--s-7); }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr); } }
.brand--stacked { flex-direction: column; align-items: flex-start; --mark: 64px; gap: var(--s-4); margin-bottom: var(--s-5); }
.brand--stacked .wordmark { justify-items: start; }
.brand--stacked .wordmark .line-2 { text-align: left; padding-left: 0; }
.site-footer p { font-size: 16px; color: var(--paper-body); max-width: 34ch; }
.site-footer h3 { color: var(--paper); font: 700 12px/1.4 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; margin-bottom: var(--s-4); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); font: 300 16px/1.5 var(--font-text); }
.site-footer li { margin: 0; }
.site-footer a { color: var(--paper); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid var(--paper-rule); }
.footer-bottom .wrap { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-7); justify-content: space-between; padding-block: var(--s-5); }
.footer-bottom p { margin: 0; font: 500 12px/1.6 var(--font-ui); letter-spacing: .04em; color: var(--paper-label); max-width: none; }

/* Scroll reveal (only when JS is on; resting state is visible) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal[data-delay="1"] { transition-delay: .12s; }
.js .reveal[data-delay="2"] { transition-delay: .24s; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .hero h1 span i, .js .hero .lede, .js .hero .btn-row, .js .hero-photo, .js .reveal, .js .band .ask { opacity: 1 !important; transform: none !important; }
  .js .commitments li { opacity: 1; }
  .bleed img { scale: 1; translate: 0; }
}

/* Five commitments — small archive portrait beside the list */
.photo--archive { max-width: 260px; margin-top: var(--s-6); }
.photo--archive img { aspect-ratio: 200 / 415; object-fit: cover; filter: saturate(.9); }
@media (max-width: 899px) { .photo--archive { max-width: 200px; } }

/* Activities lead photo */
.photo--lead { margin-bottom: clamp(40px, 6vw, 72px); }
.photo--lead img { aspect-ratio: 21 / 9; object-position: 50% 45%; }
@media (max-width: 700px) { .photo--lead img { aspect-ratio: 4 / 3; } }
