/* ===================================
   PAPER LOOK — YCF Website (YCF-003, 30 Nov 2026)
   The brand canon: cream paper + grain, layered hills with shadows
   between them, Cormorant Garamond + Jost, the real logo.
   Loaded last; overrides only. Copy and markup are untouched —
   to roll back, remove this file's <link> and restore the old font URL.
   Rules: _HQ/Skills/ycf-brand/SKILL.md → Look.
   =================================== */

/* ── Tokens (redefine the old ones, add the paper set) ── */

:root {
  --paper: #F4EFE6;
  --paper-2: #ECE4D6;
  --paper-light: #FBF8F2;
  --sand: #D8CAB0;
  --sage: #A3A890;
  --olive: #6B7558;
  --forest: #33452F;
  --forest-deep: #26351F;
  --terra: #B4643F;        /* non-text accents only */
  --terra-ink: #9A4E2E;    /* small text: 5.2:1 on paper */
  --ink: #2F3327;

  --color-black: var(--ink);
  --color-dark: var(--forest);
  --color-text-body: #4E5044;
  --color-text-light: #6E6A58;
  --color-border: rgba(47, 51, 39, 0.16);
  --color-accent: var(--forest);
  --color-accent-hover: var(--forest-deep);
  --color-cream: var(--paper-2);
  --color-cta-bg: var(--forest);
  --color-overlay-dark: rgba(38, 53, 31, 0.97);

  /* Cormorant has no ฿, so the browser takes that one glyph from Jost / Noto Sans Thai */
  --font-heading: 'Cormorant Garamond', 'Jost', 'Noto Sans Thai', Georgia, serif;
  --font-body: 'Jost', 'Noto Sans Thai', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --nav-height: 84px;
  --grain: url('../images/paper-grain.png');
  --hill-h: 56px;          /* always less than the section's own padding */
  --hill-hero: 72px;
}

@media (min-width: 768px) {
  :root { --hill-h: 72px; --hill-hero: 110px; }
}

@media (min-width: 1024px) {
  :root { --hill-h: 110px; --hill-hero: 140px; }
}


/* ── Paper ── */

body {
  background: var(--grain) repeat, var(--paper);
  font-size: 17px;
  line-height: 1.65;
}

/* isolation lets the hills sit at z-index -1: above the section's own paper, below its content */
.section,
.footer {
  position: relative;
  isolation: isolate;
}

.section--cream {
  background: var(--grain) repeat, var(--paper-2);
}

.footer {
  background: var(--grain) repeat, var(--forest);
}

/* CTA band: warm sand (Kenneth, 30 Nov 2026) — light enough for the girl-under-the-tree scene to read */
.section--accent {
  background: var(--grain) repeat, var(--sand);
}


/* ── Hills: each edge draws inside its own section, never over the one above ── */

.hero::after,
.section--cream::before,
.section--cream + .section::before,
.section--accent::before,
.footer::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: var(--hill-h);
  z-index: -1;
  pointer-events: none;
  background-repeat: repeat, no-repeat;
  background-size: auto, 100% 100%;
  background-position: 0 0, center;
}

/* hero foot: sand, sage, paper */
.hero::after {
  bottom: -1px;
  height: var(--hill-hero);
  z-index: 0;
  background-image: var(--grain), url('../images/hills/edge-hero.svg');
}

/* cream section: paper hangs into its top */
.section--cream::before {
  top: -1px;
  background-image: var(--grain), url('../images/hills/edge-cream-top.svg');
}

/* the section after a cream one opens with cream, then sand and paper rise */
.section--cream + .section::before {
  top: 0;
  background-image: var(--grain), url('../images/hills/edge-cream-paper.svg');
}

/* footer: sage and forest rise (from paper, or from the sand CTA band) */
.section--accent::before,
.footer::before {
  top: 0;
  background-image: var(--grain), url('../images/hills/edge-paper-forest.svg');
}

.section--accent + .footer::before {
  background-image: var(--grain), url('../images/hills/edge-sand-forest.svg');
}

/* sand CTA band: a lighter sand step, then the band */
.section--accent::before {
  background-image: var(--grain), url('../images/hills/edge-paper-sand.svg');
}

.section--cream + .section--accent::before {
  background-image: var(--grain), url('../images/hills/edge-cream-sand.svg');
}

/* content starts a clear step below any edge that opens its section */
.section--cream,
.section--cream + .section:not(.section--accent) {
  padding-top: calc(var(--hill-h) + var(--space-xl));
}

/* two cream sections in a row: no edge between them */
.section--cream + .section--cream::before {
  content: none;
}

.footer {
  padding-top: calc(var(--space-2xl) + var(--hill-h));
}

/* ── Navigation ── */

.nav--solid,
.nav--subpage {
  background-color: rgba(244, 239, 230, 0.96);
  box-shadow: 0 1px 0 var(--color-border);
}

/* the real logo, in a paper circle; the link text stays for screen readers */
.nav__logo,
.footer__logo {
  display: block;
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--paper) url('../images/ycf-logo.png') center / 46px auto no-repeat;
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
}

.nav--transparent .nav__logo {
  box-shadow: 0 2px 10px rgba(20, 26, 18, 0.25);
}

.footer__logo {
  width: 72px;
  height: 72px;
  background-size: 58px auto;
}

.nav__link {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.nav__donate {
  background-color: var(--forest);
  color: var(--paper);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.nav__donate:hover {
  background-color: var(--forest-deep);
}

.nav--transparent .nav__donate {
  background-color: var(--paper);
  color: var(--forest);
}

.nav--transparent .nav__donate:hover {
  background-color: #fff;
}

.nav__burger-icon,
.nav__burger-icon::before,
.nav__burger-icon::after {
  background-color: var(--paper);
}

.nav__burger.active .nav__burger-icon {
  background-color: transparent;
}

.mobile-menu__link {
  font-weight: 500;
  color: var(--paper);
}


/* ── Hero ── */

.hero {
  isolation: isolate;
  padding-bottom: calc(var(--space-2xl) + var(--hill-hero));
}

.hero__overlay {
  background: linear-gradient(90deg, rgba(20, 26, 18, 0.6) 0%, rgba(20, 26, 18, 0.25) 60%, rgba(20, 26, 18, 0.1) 100%);
}

.heading-hero {
  font-weight: 500;
  font-size: clamp(48px, 7vw, 104px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

/* text-only subpage heroes sit on deeper paper with a hill foot */
/* text-only heroes: undo responsive.css's phone rule (.hero 85vh). The photo hero keeps it, so its
   headline stays clear of the boy's face. Without :has() the text heroes are just taller. */
.hero--subpage:not(:has(.hero__bg)) {
  min-height: auto;
}

.hero--subpage {
  background: var(--grain) repeat, var(--paper-2);
  padding-bottom: calc(var(--space-xl) + var(--hill-hero));
}

/* subpage hero with its photo below the headline (About): breadcrumbs and h1 on paper, the photo
   full-bleed beneath, the hill edge rising over its foot. Wider than the photo's 3:2, so only the
   empty sides crop and every face shows; the hill covers less than the 11 % below the lowest chin. */
.hero--subpage.hero--photo {
  flex-direction: column;
  align-items: stretch;
  min-height: auto;
  padding-bottom: 0;
}

.hero--photo .breadcrumb {
  padding: 0;
  border-bottom: 0;
  margin-bottom: var(--space-md);
}

.hero__photo {
  margin-top: var(--space-xl);
  aspect-ratio: 1 / 1;
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero--subpage.hero--photo::after {
  height: 48px;
}

@media (min-width: 768px) {
  .hero__photo { aspect-ratio: 4 / 3; }
  .hero--subpage.hero--photo::after { height: var(--hill-hero); }
}

/* Phones: show every photo whole (Kenneth, 30 Nov 2026: "on mobile some pictures look cut").
   A square crop cut children off at the sides of the wide photos. At the photo's own shape the hero
   is short (≈260px), so the hill drops to 24px — it stays below the lowest chin (About: 88.5 %). */
@media (max-width: 767px) {
  .hero__photo { aspect-ratio: auto; }
  .hero__photo img { height: auto; }
  .hero--subpage.hero--photo::after { height: 24px; }

  .card__image-wrap { aspect-ratio: auto; }
  .card__image { height: auto; }
}

/* Team photos: whole only where they stack one per row (2 across from 480px needs equal heights) */
@media (max-width: 479px) {
  .team-member__image-wrap { aspect-ratio: auto; }
  .team-member__image { height: auto; }
}

/* the one subpage hero with a photo: white type over it */
.hero__bg ~ .hero__content .heading-page {
  color: #fff;
}


/* ── Type ── */

.heading-page,
.heading-statement,
.heading-section,
.cta-block__heading,
.pillar__title {
  font-weight: 500;
  letter-spacing: -0.005em;
}

.heading-page {
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 1.05;
}

.heading-statement {
  font-size: clamp(30px, 4.2vw, 58px);
  line-height: 1.12;
}

.heading-statement--grey {
  color: var(--olive);
}

.heading-section {
  font-size: clamp(28px, 3.2vw, 42px);
}

.heading-card {
  font-family: var(--font-heading);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.15;
}

.label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terra-ink);
}

.body-text {
  font-size: 17px;
  line-height: 1.65;
}

.section-divider {
  border-top-color: rgba(47, 51, 39, 0.18);
}

.arrow-link {
  font-size: 15px;
  font-weight: 400;
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
}

/* a dot, not a one-sided border */
.fact-list__item {
  position: relative;
  border-left: 0;
  padding-left: 18px;
  font-weight: 400;
}

.fact-list__item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--terra);
}

@media (max-width: 767px) {
  .heading-page {
    font-size: clamp(36px, 9vw, 52px);
  }
}


/* ── Photos: plain rectangles, a soft lift off the paper ── */

.full-image,
.video-embed,
.card__image-wrap,
.team-member__image-wrap,
.director-feature__image-wrap,
.contact-map {
  border-radius: 4px;
  background-color: var(--paper-2);
  box-shadow: 0 16px 36px -20px rgba(30, 30, 20, 0.5);
}


/* ── Stats and funding ── */

.stat {
  border-top-color: rgba(47, 51, 39, 0.18);
}

.stat__label {
  font-size: 14px;
  color: var(--color-text-light);
}

.stat__number {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(56px, 6.4vw, 80px);
}

.funding-row__label {
  font-size: 22px;
  font-weight: 500;
}

.funding-row__shortfall,
.pillar__shortfall {
  color: var(--terra-ink);
}

.funding-row__bar {
  background-color: rgba(47, 51, 39, 0.1);
}

.funding-row__bar-fill {
  background-color: var(--olive);
}

.registry__name {
  font-size: 21px;
  font-weight: 500;
}

.registry__amount {
  font-weight: 500;
}


/* ── Buttons ── */

.btn,
.cta-block__button,
.footer__submit {
  font-weight: 400;
  letter-spacing: 0.04em;
}

.btn--primary,
.cta-block__button,
.footer__submit {
  background-color: var(--forest);
  color: var(--paper);
}

.btn--primary:hover,
.cta-block__button:hover {
  background-color: var(--forest-deep);
}

.btn--outline,
.cta-block__button--outline {
  background-color: transparent;
  color: var(--forest);
  border: 1px solid var(--forest);
}

.btn--outline:hover,
.cta-block__button--outline:hover {
  background-color: var(--forest);
  color: var(--paper);
}

.footer__submit {
  background-color: var(--paper);
  color: var(--forest);
}

.footer__submit:hover {
  background-color: #fff;
}

.cta-block__heading {
  font-size: clamp(44px, 6.5vw, 88px);
  color: var(--ink);
}


/* ── Forms ── */

.form__input,
.form__textarea {
  background-color: var(--paper-light);
  border-color: rgba(47, 51, 39, 0.2);
}

.form__input:focus,
.form__textarea:focus {
  border-color: var(--forest);
}


/* ── Footer ── */

.footer__top {
  border-bottom-color: rgba(244, 239, 230, 0.18);
}

.footer__social-link,
.footer__contact-item {
  color: rgba(244, 239, 230, 0.75);
}

.footer__social-link:hover,
.footer__contact-item:hover {
  color: var(--paper);
}

.footer__newsletter-title {
  font-weight: 500;
  color: var(--paper);
}

.footer__input {
  border-color: rgba(244, 239, 230, 0.3);
  color: var(--paper);
}

.footer__input::placeholder {
  color: rgba(244, 239, 230, 0.6);
}

.footer__input:focus {
  border-color: var(--paper);
}

.footer__bottom {
  color: rgba(244, 239, 230, 0.65);
}

/* Jost runs wider than Inter: give the email column room so it never breaks mid-word */
@media (min-width: 1024px) {
  .footer__top {
    grid-template-columns: 0.8fr 1.3fr 1.2fr;
  }
}


/* ── Cut-paper motifs (YCF-003, 30 Nov 2026) ──
   One per page, decoration only: never in place of a photo, never over text.
   A section opts in with class="motif motif--<name>". The motif is a ::after that takes
   its own place in the layout (a grid cell or the end of a column), so it cannot cover text.
   Art: designer/output/print-2026-11/art/MOTIFS.md (the flat renders are canon). */

.motif--home      { --motif: url('../images/motifs/home-320.webp');      --motif-2x: url('../images/motifs/home-640.webp');      --motif-ratio: 1453 / 1618; }
.motif--reading   { --motif: url('../images/motifs/reading-320.webp');   --motif-2x: url('../images/motifs/reading-640.webp');   --motif-ratio: 1490 / 1436; }
.motif--walking   { --motif: url('../images/motifs/walking-320.webp');   --motif-2x: url('../images/motifs/walking-640.webp');   --motif-ratio: 1524 / 1504; }
.motif--graduate  { --motif: url('../images/motifs/graduate-320.webp');  --motif-2x: url('../images/motifs/graduate-640.webp');  --motif-ratio: 1468 / 1564; }
.motif--boy-tree  { --motif: url('../images/motifs/boy-tree-320.webp');  --motif-2x: url('../images/motifs/boy-tree-640.webp');  --motif-ratio: 1700 / 1761; }

.motif .section-intro::after,
.motif .contact-grid__column:last-child::after {
  content: "";
  display: block;
  width: 200px;
  max-width: 100%;
  aspect-ratio: var(--motif-ratio);
  background: var(--motif) center / contain no-repeat;
  pointer-events: none;
  align-self: center;
  margin-top: var(--space-sm);
}

/* Sharper on retina. Guarded: with var() inside, a browser without image-set() would blank the motif, not fall back */
@supports (background-image: image-set(url('x.png') 1x)) {
  .motif .section-intro::after,
  .motif .contact-grid__column:last-child::after {
    background-image: image-set(var(--motif) 1x, var(--motif-2x) 2x);
  }
}

.motif .contact-grid__column:last-child::after {
  margin: var(--space-xl) auto 0;   /* centred on phones, like the others */
}

/* Tablet: under the label, in the label column.
   The intro's own children are pinned to row 1 so the motif shares a cell and never bumps them. */
@media (min-width: 768px) {
  .motif .section-intro > :nth-child(1) { grid-column: 1; grid-row: 1; }
  .motif .section-intro > :nth-child(2) { grid-column: 2; grid-row: 1; }
  .motif .section-intro::after {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    justify-self: start;
    margin-top: var(--space-xl);
  }
  .motif .contact-grid__column:last-child::after {
    width: 240px;
    margin-left: 0;
  }
}

/* Desktop: the empty third column of a three-column intro */
@media (min-width: 1024px) {
  .motif .section-intro > :nth-child(3) { grid-column: 3; grid-row: 1; }
  .motif .section-intro::after {
    width: 240px;
    grid-column: 3;
    justify-self: end;
    align-self: start;
    margin-top: 0;
  }
  /* home: "Learn more" already sits in column 3 — the motif goes below it, same cell */
  .motif--home .section-intro::after {
    margin-top: var(--space-xl);
  }
  /* two-column intro (How to give): under the label, which has the whole left column */
  .motif .section-intro--two-col::after {
    grid-column: 1;
    justify-self: start;
    align-self: end;
  }
}


/* ── Brand scene: the girl under the tree (YCF-003, 30 Nov 2026) ──
   YCF's motion brand icon, in the CTA band beside the heading (every page with a CTA). 11 paper layers from
   designer/output/print-2026-11/art/layers/girl-tree/ (positions and timing from girl-tree-layered.html).
   Static by default; it builds itself in when main.js adds .visible (the .fade-up observer).
   No motion at all for people who ask for reduced motion. */

.scene {
  position: relative;
  width: min(260px, 70vw);
  aspect-ratio: 1000 / 900;
  margin: 0 auto var(--space-md);
}

/* the old .cta-block padding (Xpx 0) wiped the container's side gutter: the phone button ran edge to edge */
.cta-block {
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* CTA band: the scene on the left, heading and button on the right, balanced on the centre line */
@media (min-width: 768px) {
  .cta-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--space-xl);
    align-items: center;
    text-align: left;
  }
  .cta-block .scene {
    grid-column: 1;
    grid-row: 1 / span 2;
    justify-self: end;
    width: min(460px, 100%);
    margin: 0;
  }
  .cta-block .cta-block__heading {
    grid-column: 2;
    align-self: end;
  }
  .cta-block .cta-block__button {
    grid-column: 2;
    justify-self: start;
    align-self: start;
  }
}

.scene__layer { position: absolute; height: auto; }
.scene__trunk  { left: 19%;   top: 10.15%; width: 40%;   --d: .35s; }
.scene__leaf-2 { left: 29%;   top: 4%;     width: 29%;   --d: .7s; }
.scene__leaf-1 { left: 14%;   top: 9.5%;   width: 29%;   --d: 1.05s; }
.scene__leaf-4 { left: 43%;   top: 11.5%;  width: 29%;   --d: 1.4s; }
.scene__leaf-5 { left: 44.5%; top: 23.5%;  width: 24%;   --d: 1.9s;  scale: -1 1; }
.scene__leaf-6 { left: 24%;   top: 24.5%;  width: 20%;   --d: 1.75s; scale: -1 1; }
.scene__leaf-3 { left: 29.5%; top: 20.5%;  width: 28%;   --d: 1.75s; }
.scene__hill   { left: 15%;   top: 64.25%; width: 71.7%; --d: 0s; }
.scene__girl   { left: 39.8%; top: 45.63%; width: 25%;   --d: 2.45s; }
.scene__bag    { left: 32.2%; top: 67.32%; width: 11.2%; --d: 2.1s; }
.scene__bird   { left: 19.6%; top: 31.75%; width: 6.2%;  --d: 2.6s;  scale: -1 1; }

/* the wrapper is not faded; its layers do the entrance */
.scene.fade-up { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  .scene.visible .scene__hill  { animation: scene-rise .9s cubic-bezier(.2,.8,.2,1) var(--d) both; }
  .scene.visible .scene__trunk { transform-origin: 50% 100%; animation: scene-grow 1s cubic-bezier(.2,.8,.2,1) var(--d) both; }
  .scene.visible [class*="scene__leaf"] {
    transform-origin: 50% 90%;
    animation: scene-pop .7s cubic-bezier(.3,1.4,.5,1) var(--d) both,
               scene-sway 5s ease-in-out calc(var(--d) + .7s) infinite alternate;
  }
  .scene.visible .scene__leaf-1 { animation-duration: .7s, 6s; }
  .scene.visible .scene__leaf-3 { animation-duration: .7s, 4.4s; }
  .scene.visible .scene__leaf-4 { animation-duration: .7s, 5.4s; }
  .scene.visible .scene__girl,
  .scene.visible .scene__bag   { animation: scene-settle .8s cubic-bezier(.2,.8,.2,1) var(--d) both; }
  .scene.visible .scene__bird  {
    transform-origin: 40% 100%;
    animation: scene-land 1.1s cubic-bezier(.2,.7,.3,1) var(--d) both,
               scene-bob 4s ease-in-out calc(var(--d) + 1.1s) infinite;
  }
}

@keyframes scene-rise   { from { opacity: 0; transform: translateY(12%); } to { opacity: 1; transform: none; } }
@keyframes scene-grow   { from { opacity: 0; transform: scaleY(.2); }      to { opacity: 1; transform: none; } }
@keyframes scene-pop    { from { opacity: 0; transform: scale(.4); }       to { opacity: 1; transform: none; } }
@keyframes scene-sway   { from { transform: rotate(-2.2deg); }             to { transform: rotate(2.2deg); } }
@keyframes scene-settle { from { opacity: 0; transform: translateY(-6%); } to { opacity: 1; transform: none; } }
@keyframes scene-land {
  from { opacity: 0; transform: translate(160%, -220%) rotate(-12deg); }
  70%  { opacity: 1; transform: translate(0, -8%) rotate(3deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes scene-bob { 0%, 82%, 100% { transform: none; } 86% { transform: rotate(-7deg); } 90% { transform: none; } 94% { transform: rotate(-5deg); } }
