/*
  Cuentos del Oasis — Static production stylesheet
  Design: Jardín Nocturno del Oasis
  Local fonts and assets. No build process required.
*/

@font-face { font-family: "DM Sans"; src: url("assets/fonts/dm-sans-300.ttf") format("truetype"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("assets/fonts/dm-sans-400.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("assets/fonts/dm-sans-500.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("assets/fonts/playfair-display-400.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("assets/fonts/playfair-display-500.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("assets/fonts/playfair-display-600.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("assets/fonts/playfair-display-400-italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("assets/fonts/playfair-display-500-italic.ttf") format("truetype"); font-weight: 500; font-style: italic; font-display: swap; }

:root {
  --night: #13251d;
  --night-soft: #183126;
  --night-panel: #1c382b;
  --moss: #507f5d;
  --cream: #f5edd6;
  --sand: #c9a263;
  --terra: #d4714a;
  --text-muted: #b8b5a7;
  --line: rgba(245, 237, 214, .12);
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "DM Sans", Arial, sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; min-width: 320px; color: var(--cream); background: var(--night); font-family: var(--font-body); font-size: 16px; font-weight: 300; line-height: 1.65; -webkit-font-smoothing: antialiased; }
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.skip-link { position: fixed; z-index: 100; top: 1rem; left: 1rem; padding: .75rem 1rem; color: var(--night); background: var(--cream); border-radius: 5px; transform: translateY(-180%); transition: transform .2s ease; }
.skip-link:focus { transform: translateY(0); }
.container { width: min(100% - 2.5rem, 1180px); margin-inline: auto; }
.narrow { width: min(100%, 740px); margin-inline: auto; text-align: center; }

/* Header */
.site-header { position: fixed; z-index: 50; inset: 0 0 auto; height: 72px; background: rgba(14, 30, 22, .75); backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: background .3s ease, border-color .3s ease; }
.site-header.is-scrolled { background: rgba(14, 30, 22, .96); border-color: var(--line); }
.header-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.brand img { width: 32px; height: 32px; }
.brand-name { display: grid; color: var(--cream); font: 500 1.05rem/1 var(--font-display); }
.brand-name small { margin-top: .17rem; color: var(--sand); font-size: .73em; letter-spacing: .08em; }
.desktop-nav { display: flex; align-items: center; gap: 1.45rem; font-size: .81rem; font-weight: 400; color: var(--text-muted); }
.desktop-nav a:not(.nav-cta) { transition: color .2s ease; }
.desktop-nav a:not(.nav-cta):hover, .desktop-nav a:not(.nav-cta):focus-visible { color: var(--cream); }
.nav-cta { padding: .67rem 1rem; background: var(--terra); color: #fff9ef; border-radius: 4px; transition: transform .2s ease, filter .2s ease; }
.nav-cta:hover { transform: translateY(-2px); filter: brightness(1.08); }
.menu-button { display: none; width: 42px; height: 42px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.menu-button span { display: block; width: 21px; height: 1px; margin: 5px auto; background: var(--cream); transition: transform .25s ease, opacity .25s ease; }

/* Mobile menu */
.menu-backdrop { position: fixed; z-index: 58; inset: 0; visibility: hidden; background: rgba(4, 13, 9, .78); opacity: 0; transition: opacity .3s ease, visibility .3s ease; }
.mobile-menu { position: fixed; z-index: 60; top: 0; right: 0; width: min(82vw, 320px); height: 100svh; padding: 0 1.75rem 2rem; display: flex; flex-direction: column; background: #102018; border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .35s cubic-bezier(.22,.61,.36,1); }
.mobile-menu.is-open { transform: translateX(0); }
.menu-backdrop.is-open { visibility: visible; opacity: 1; }
.mobile-menu-top { height: 72px; display: flex; justify-content: space-between; align-items: center; color: var(--sand); font-size: .78rem; letter-spacing: .13em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.mobile-menu-top button { width: 36px; height: 36px; padding: 0; border: 0; color: var(--cream); background: transparent; font-size: 2rem; font-weight: 200; cursor: pointer; }
.mobile-menu nav { display: grid; margin-top: 2rem; }
.mobile-menu nav a { padding: .95rem 0; color: var(--cream); border-bottom: 1px solid rgba(245, 237, 214, .07); font-size: 1rem; }
.mobile-contact { margin-top: auto; justify-content: center; }
.mobile-menu > p { margin: 1.1rem 0 0; color: #849b8d; font-size: .72rem; text-align: center; }

/* Hero */
.hero { position: relative; min-height: max(680px, 100svh); display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero-image, .hero-scrim { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-image { z-index: -2; object-fit: cover; object-position: center 43%; }
.hero-scrim { z-index: -1; background: linear-gradient(90deg, rgba(10, 31, 21, .87) 0%, rgba(10, 31, 21, .6) 42%, rgba(10, 31, 21, .18) 100%), linear-gradient(0deg, #13251d 0%, transparent 48%); }
.hero-content { padding-bottom: clamp(7rem, 13vh, 10.5rem); }
.eyebrow { margin: 0 0 1rem; color: var(--terra); font-size: .69rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; }
h1 { max-width: 760px; margin-bottom: 1.35rem; color: #fffaf0; font-size: clamp(3rem, 7vw, 5.6rem); line-height: .98; letter-spacing: -.04em; }
h1 em { display: inline-block; color: var(--sand); font-style: italic; }
.hero-copy { max-width: 570px; margin-bottom: 2rem; color: #e8e3d2; font-size: clamp(1rem, 2.3vw, 1.12rem); line-height: 1.75; }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.button { display: inline-flex; align-items: center; min-height: 46px; padding: .75rem 1.25rem; border: 1px solid transparent; border-radius: 4px; font-size: .87rem; font-weight: 500; line-height: 1; transition: transform .22s ease, background .22s ease, border-color .22s ease, color .22s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #fff8eb; background: var(--terra); }
.button-primary:hover { background: #df8059; }
.button-outline { color: var(--cream); border-color: rgba(201, 162, 99, .65); background: rgba(19, 37, 29, .24); }
.button-outline:hover { border-color: var(--sand); background: rgba(201, 162, 99, .12); }
.button-large { min-height: 52px; padding-inline: 1.65rem; }
.scroll-cue { position: absolute; bottom: 1.3rem; left: 50%; display: grid; justify-items: center; gap: .55rem; color: rgba(245, 237, 214, .55); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; transform: translateX(-50%); }
.scroll-cue i { width: 1px; height: 24px; background: linear-gradient(var(--sand), transparent); }

/* Reusable sections */
.section { position: relative; padding: clamp(5.5rem, 10vw, 8.5rem) 0; }
.cause-section { background: #162c21; }
.split-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); align-items: center; gap: clamp(2.5rem, 7vw, 6rem); }
.image-frame { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 8px; box-shadow: var(--shadow); }
.image-frame::after { position: absolute; inset: 0; content: ""; background: linear-gradient(135deg, rgba(212, 113, 74, .19), transparent 55%); pointer-events: none; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; }
.section-copy h2, .section-heading h2, .participation-section h2, .license-section h2 { color: var(--cream); font-size: clamp(2.15rem, 4vw, 3.25rem); line-height: 1.08; letter-spacing: -.025em; }
.section-copy p { max-width: 590px; color: var(--text-muted); line-height: 1.8; }
.section-copy p + p { margin-top: 1.1rem; }
.text-link { display: inline-flex; gap: .55rem; margin-top: .9rem; color: var(--sand); font-size: .88rem; font-weight: 500; transition: gap .2s ease, color .2s ease; }
.text-link:hover { gap: .8rem; color: #e0bb7b; }
.section-heading { max-width: 680px; margin-bottom: 3rem; }
.section-heading.center { margin-inline: auto; text-align: center; }
.section-heading > p:last-child { max-width: 620px; color: var(--text-muted); font-size: 1rem; line-height: 1.75; }
.section-heading.center > p:last-child { margin-inline: auto; }

/* Library */
.library-section { background: var(--night); }
.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.resource-card { min-height: 315px; padding: 2rem; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: rgba(35, 61, 47, .58); transition: transform .3s ease, background .3s ease, border-color .3s ease; }
.resource-card:hover { background: rgba(41, 71, 55, .86); border-color: rgba(201, 162, 99, .3); transform: translateY(-5px); }
.resource-icon { width: 46px; height: 46px; margin-bottom: 1.35rem; display: grid; place-items: center; color: var(--sand); background: rgba(212, 113, 74, .13); border-radius: 8px; font: 1.55rem/1 var(--font-display); }
.resource-card h3 { margin-bottom: .75rem; font-size: 1.4rem; }
.resource-card p { margin-bottom: 1.5rem; color: var(--text-muted); font-size: .9rem; line-height: 1.75; }
.resource-card .text-link { margin-top: auto; }

/* Book */
.book-section { overflow: hidden; background: #14291f; isolation: isolate; }
.book-image-layer { position: absolute; z-index: -2; inset: 0; opacity: .12; }
.book-image-layer::after { position: absolute; inset: 0; content: ""; background: #14291f; opacity: .7; }
.book-image-layer img { width: 100%; height: 100%; object-fit: cover; }
.book-content { position: relative; }
.chapter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .85rem; }
.chapter-card { min-height: 195px; padding: 1.35rem; border: 1px solid rgba(245, 237, 214, .1); border-radius: 8px; background: rgba(27, 53, 39, .8); transition: transform .25s ease, background .25s ease; }
.chapter-card:hover { background: rgba(35, 67, 49, .96); transform: translateY(-3px); }
.chapter-card > span { display: inline-flex; margin-bottom: .85rem; padding: .19rem .45rem; color: var(--terra); background: rgba(212, 113, 74, .13); border-radius: 3px; font-size: .65rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.chapter-card h3 { margin-bottom: .47rem; color: #eee9d8; font-size: 1.08rem; line-height: 1.2; }
.chapter-card p { margin-bottom: 0; color: #b8b7a8; font-size: .79rem; line-height: 1.65; }
.epilogue-quote { max-width: 720px; margin: 2.8rem 0 0; padding: 1.55rem 1.7rem; border-left: 3px solid var(--terra); border-radius: 0 8px 8px 0; color: #dfdac9; background: rgba(44, 73, 54, .67); font: italic 1.1rem/1.8 var(--font-display); }
.epilogue-quote cite { display: block; margin-top: .7rem; color: #8d9c8a; font: .72rem/1.3 var(--font-body); font-style: normal; }

/* Voices */
.voices-section { overflow: hidden; background: var(--night); isolation: isolate; }
.voices-texture { position: absolute; z-index: -1; inset: 0; opacity: .065; }
.voices-texture img { width: 100%; height: 100%; object-fit: cover; }
.voices-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; }
.voice-card { min-height: 230px; padding: 1.35rem; border: 1px solid rgba(245, 237, 214, .09); border-radius: 10px; background: rgba(38, 66, 50, .63); transition: transform .3s ease, border-color .3s ease, background .3s ease; }
.voice-card:hover { background: rgba(47, 79, 59, .87); border-color: rgba(201, 162, 99, .28); transform: translateY(-4px); }
.voice-card b { width: 38px; height: 38px; margin-bottom: 1rem; display: grid; place-items: center; color: var(--sand); background: rgba(212, 113, 74, .18); border-radius: 50%; font: italic 1.1rem/1 var(--font-display); }
.voice-card h3 { margin-bottom: .15rem; color: #f0eadb; font-size: 1.1rem; }
.voice-card small { display: block; min-height: 32px; margin-bottom: .6rem; color: var(--terra); font-size: .7rem; line-height: 1.35; }
.voice-card p { margin-bottom: 0; color: #b8b9ac; font: italic .89rem/1.55 var(--font-display); }

/* Participation and license */
.participation-section { background: #14291f; }
.participation-section .narrow p { max-width: 660px; margin: 1.2rem auto 2rem; color: var(--text-muted); line-height: 1.8; }
.ornament { display: flex; align-items: center; gap: .85rem; color: rgba(201, 162, 99, .58); }
.ornament::before, .ornament::after { flex: 1; height: 1px; content: ""; background: linear-gradient(90deg, transparent, rgba(201, 162, 99, .45), transparent); }
.ornament span { font-size: .62rem; letter-spacing: .15em; text-transform: uppercase; }
.ornament i { font-style: normal; font-size: .55rem; }
.ornament-bottom { max-width: 280px; margin: 3.4rem auto 0; }
.license-section { padding: 4.8rem 0; background: #1d392b; }
.license-section h2 { margin-bottom: 1rem; font-size: clamp(1.75rem, 3vw, 2.25rem); }
.license-section p { margin: 0; color: #c4c6b9; font-size: .9rem; line-height: 1.85; }
.license-section a { color: var(--sand); text-decoration: underline; text-underline-offset: 3px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #102018; }
.footer-top { padding: 2.75rem 0; display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: center; gap: 1.2rem; }
.footer-contact { text-align: center; }
.footer-contact a { color: #bfc2b4; font-size: .83rem; }
.footer-contact p { margin: .25rem 0 0; color: #75877a; font-size: .71rem; }
.footer-links { display: flex; justify-content: flex-end; gap: 1rem; color: #8c9a8d; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.footer-links a:hover { color: var(--cream); }
.footer-bottom { padding: 1.55rem 0; border-top: 1px solid rgba(245, 237, 214, .06); }
.footer-bottom p { max-width: 760px; margin: 0 auto; color: #607468; font-size: .68rem; line-height: 1.7; text-align: center; }
.back-to-top { position: fixed; z-index: 20; right: 1.25rem; bottom: 1.25rem; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; color: var(--cream); background: rgba(31, 62, 46, .9); border: 1px solid rgba(201, 162, 99, .32); border-radius: 50%; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease, background .2s ease; }
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: var(--terra); }

/* Animation and responsive behavior */
.reveal, .reveal-stagger > * { opacity: 0; transform: translateY(22px); transition: opacity .65s ease, transform .65s cubic-bezier(.22,.61,.36,1); }
.reveal.is-visible, .reveal-stagger.is-visible > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: .08s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: .16s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: .24s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: .32s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: .4s; }
.reveal-stagger.is-visible > *:nth-child(7) { transition-delay: .48s; }
.reveal-stagger.is-visible > *:nth-child(n+8) { transition-delay: .56s; }

@media (max-width: 1020px) {
  .desktop-nav { gap: .9rem; font-size: .75rem; }
  .resource-grid { grid-template-columns: repeat(3, 1fr); }
  .voices-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .desktop-nav { display: none; }
  .menu-button { display: block; }
  .split-layout { grid-template-columns: 1fr; }
  .image-frame { max-width: 620px; }
  .section-copy { max-width: 640px; }
  .resource-grid { grid-template-columns: 1fr; max-width: 600px; margin-inline: auto; }
  .resource-card { min-height: 0; }
  .chapter-grid { grid-template-columns: repeat(2, 1fr); }
  .voices-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .container { width: min(100% - 2rem, 1180px); }
  .hero { min-height: 660px; }
  .hero-scrim { background: linear-gradient(90deg, rgba(10, 31, 21, .84), rgba(10, 31, 21, .58)), linear-gradient(0deg, #13251d, transparent 58%); }
  .hero-content { padding-bottom: 8rem; }
  h1 { font-size: clamp(2.8rem, 14vw, 4.1rem); }
  .button { justify-content: center; width: 100%; }
  .button-row { display: grid; grid-template-columns: 1fr; width: min(100%, 285px); }
  .section { padding: 5rem 0; }
  .section-heading { margin-bottom: 2.1rem; }
  .chapter-grid, .voices-grid { grid-template-columns: 1fr; }
  .chapter-card { min-height: 0; }
  .voice-card { min-height: 0; }
  .footer-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer-links { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; }
}
