/* ============================================================
   Yakthung · layout.css
   Site shell: top navigation, mobile menu, page heroes, section
   tags, buttons, next-chapter band, newsletter band, footer.
   ============================================================ */

/* ---------- top navigation ---------- */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 118;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: calc(env(safe-area-inset-top, 0px) + 13px) clamp(18px, 4vw, 44px) 13px;
  transition: background .35s ease, box-shadow .35s ease;
}
.topnav.is-scrolled {
  background: rgba(18, 12, 8, .84);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(200, 154, 62, .16), 0 14px 36px rgba(0, 0, 0, .35);
}
.topnav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ece1cd;
  flex: 0 0 auto;
}
.topnav__brand img {
  width: 30px; height: 30px; display: block;
  filter: drop-shadow(0 0 7px rgba(200, 154, 62, .38));
}
.topnav__word {
  font-family: 'Marcellus', serif;
  font-size: 15px;
  letter-spacing: .32em;
  padding-left: 2px;
  white-space: nowrap;
}
.topnav__links { display: flex; align-items: center; gap: clamp(12px, 2.1vw, 28px); }
.topnav__links a {
  position: relative;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: .17em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(236, 225, 205, .72);
  padding: 9px 2px;
  white-space: nowrap;
  transition: color .25s ease;
}
.topnav__links a:hover { color: #f1e3c8; }
.topnav__links a[aria-current="page"] { color: #e8c069; }
.topnav__links a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 0;
  width: 5px; height: 5px;
  background: #c89a3e;
  transform: translateX(-50%) rotate(45deg);
}

/* burger (shown under 1020px) */
.topnav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px; height: 44px;
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
}
.topnav__burger span {
  display: block;
  height: 2px;
  background: #ece1cd;
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}
.topnav__burger.is-open span:first-child { transform: translateY(4px) rotate(45deg); }
.topnav__burger.is-open span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* full-screen mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 117;
  display: flex;
  flex-direction: column;
  /* flex-start + auto margins on the first/last children centre the links when
     there is room, but keep the top reachable when the menu has to scroll
     (justify-content:center clips the start edge of a scroll container) */
  justify-content: flex-start;
  gap: 6px;
  padding: 110px clamp(26px, 9vw, 70px) 50px;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(177, 74, 48, .16), transparent 65%),
    #120c08;
  overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
/* while the menu is open, the nav bar keeps only the close button visible
   (visibility also removes the brand from the keyboard tab order) */
html.menu-open .topnav__brand { opacity: 0; visibility: hidden; pointer-events: none; }
html.menu-open .topnav.is-scrolled { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.mobile-menu a {
  font-family: 'Marcellus', serif;
  font-size: clamp(28px, 7.4vw, 42px);
  line-height: 1.35;
  color: #ece1cd;
  text-decoration: none;
  padding: 4px 0;
}
.mobile-menu a[aria-current="page"] { color: #e8c069; }
.mobile-menu a:active { opacity: .65; }
.mobile-menu__eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: #c89a3e;
  margin-top: auto;
  margin-bottom: 18px;
}
.mobile-menu__glyph {
  font-family: 'Noto Sans Limbu', serif;
  font-size: 40px;
  color: rgba(200, 154, 62, .4);
  margin-top: auto;
}
html.menu-open, html.menu-open body { overflow: hidden; }

@media (max-width: 1019px) {
  .topnav__links { display: none; }
  .topnav__burger { display: flex; }
}

/* mobile chapter caption — current section name, top-left (revealed under 720px) */
#chapter-caption {
  display: none;
  position: fixed;
  z-index: 116; /* under the topnav (118) and its mobile menu (117) */
  top: calc(env(safe-area-inset-top, 0px) + 74px); /* clears the fixed topnav */
  left: calc(env(safe-area-inset-left, 0px) + 14px);
  max-width: 62vw;
  padding: 5px 11px;
  border-radius: 20px;
  background: rgba(18,12,8,.74);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  color: rgba(243,232,210,.92);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}

/* Chapter-nav labels reveal on hover/focus; the always-on gold tick already
   marks the active chapter. This keeps the (light) active label from
   persistently overlapping section content on narrow-to-mid desktop widths. */
nav[data-chapnav] [data-navdot]:hover [data-navlabel],
nav[data-chapnav] [data-navdot]:focus-visible [data-navlabel] {
  opacity: 1 !important;
  transform: translateX(0) !important;
}
/* On very wide screens the centered content clears the rail, so restore the
   original behaviour: the active chapter's label stays visible. */
@media (min-width: 1600px) {
  nav[data-chapnav] [data-navdot][aria-current="true"] [data-navlabel] {
    opacity: 1 !important;
    transform: translateX(0) !important;
  }
}

/* Mid-range (721px–1100px): the centered content sits close to the left edge,
   so keep the chapter-nav ticks but drop the expanding labels — otherwise the
   active section's label overlaps the heading/body text. */
@media (max-width: 1100px) {
  nav[data-chapnav] [data-navlabel] { display: none !important; }
}

@media (max-width: 720px) {
  /* chapter nav rail eats horizontal space on phones — hide it; the caption
     takes over as the mobile affordance. */
  nav[data-chapnav] { display: none !important; }
  #chapter-caption { display: block; }
}

/* ---------- page hero (chapter pages) ----------
   Full-viewport opening scene. The background glows dissipate well above the
   section edge and a feather gradient lands exactly on the body colour, so
   the hero flows into the first section with no visible seam. */
.page-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(120px, 16vh, 180px) clamp(26px, 7vw, 150px) clamp(120px, 18vh, 210px);
  overflow: hidden;
}
.page-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(90% 62% at 78% -8%, rgba(177, 74, 48, .2), transparent 58%),
    radial-gradient(64% 50% at 8% 40%, rgba(200, 154, 62, .08), transparent 60%),
    linear-gradient(180deg, #16100b 0%, #19120c 46%, #1c140f 74%);
}
/* feather the whole scene into the page colour — kills the hard band that
   used to show where the hero's glow was clipped by the section edge */
.page-hero__bg::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(28, 20, 15, 0) 0%, #1c140f 96%);
}
.page-hero__glyph {
  position: absolute;
  right: clamp(10px, 6vw, 110px);
  top: 50%;
  transform: translateY(-46%);
  font-family: 'Noto Sans Limbu', serif;
  font-size: clamp(120px, 24vw, 300px);
  line-height: 1;
  color: rgba(200, 154, 62, .12);
  pointer-events: none;
  user-select: none;
}
/* ember / dust layer, filled by JS (main.js setupParticles) */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.page-hero__inner { position: relative; z-index: 2; max-width: 1140px; width: 100%; margin: 0 auto; }
.page-hero__eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: #c89a3e;
  margin: 0 0 20px;
}
.page-hero h1 {
  font-family: 'Marcellus', serif;
  font-weight: 400;
  font-size: clamp(36px, 6.2vw, 80px);
  line-height: 1.05;
  margin: 0;
  max-width: 17ch;
  color: #ece1cd;
  text-wrap: balance;
}
.page-hero__lede {
  max-width: 58ch;
  margin: 22px 0 0;
  font-size: clamp(15px, 1.7vw, 18px);
  line-height: 1.75;
  color: rgba(236, 225, 205, .76);
  text-wrap: pretty;
}
/* the whisper — one italic line that sets the mood of the chapter */
.page-hero__whisper {
  margin: 30px 0 0;
  font-family: 'Marcellus', serif;
  font-style: italic;
  font-size: clamp(15px, 1.9vw, 20px);
  line-height: 1.6;
  color: rgba(232, 192, 105, .72);
  max-width: 46ch;
  text-wrap: pretty;
}

/* ---------- section number badge (the "01 — The homeland" eyebrow) ---------- */
.section-tag { display: flex; align-items: center; gap: 18px; margin-bottom: 40px; }
.section-tag--center { justify-content: center; }
.section-tag__num {
  font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: .3em; color: #c89a3e;
}
.section-tag__rule { width: 52px; height: 1px; background: rgba(200,154,62,.5); }
.section-tag__label {
  font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: .3em;
  text-transform: uppercase; color: rgba(236,225,205,.6);
}
.section-tag--cream .section-tag__num { color: #a14227; }
.section-tag--cream .section-tag__rule { background: rgba(161,66,39,.5); }
.section-tag--cream .section-tag__label { color: rgba(36,24,17,.74); }

/* ---------- buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn-row--center { justify-content: center; }
.btn {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 15px 24px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .3s, border-color .3s, color .3s, transform .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn--gold { background: #c89a3e; color: #241811; border: 1px solid #c89a3e; }
.btn--gold:hover { background: #e8c069; border-color: #e8c069; }
.btn--ghost { background: transparent; color: #ece1cd; border: 1px solid rgba(236, 225, 205, .32); }
.btn--ghost:hover { border-color: rgba(200, 154, 62, .7); color: #f1e3c8; }

/* ---------- next-chapter band ----------
   Chains the chapters into one continuous journey: every page hands the
   reader to the next one with a single line and a big doorway link. */
.nextband {
  position: relative;
  padding: clamp(90px, 14vh, 170px) clamp(26px, 7vw, 150px);
  text-align: center;
  overflow: hidden;
  border-top: 1px solid rgba(200, 154, 62, .12);
  background:
    radial-gradient(90% 110% at 50% 118%, rgba(177, 74, 48, .17), transparent 62%),
    linear-gradient(180deg, #1c140f 0%, #191009 100%);
}
.nextband__eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: #c89a3e;
  margin: 0 0 22px;
}
.nextband__link {
  display: inline-block;
  font-family: 'Marcellus', serif;
  font-size: clamp(30px, 5.2vw, 60px);
  line-height: 1.1;
  color: #f1e3c8;
  text-decoration: none;
  text-wrap: balance;
  transition: color .3s ease;
}
.nextband__link .nextband__arrow {
  display: inline-block;
  transition: transform .35s cubic-bezier(.16, .85, .3, 1);
  color: #c89a3e;
}
.nextband__link:hover { color: #e8c069; }
.nextband__link:hover .nextband__arrow { transform: translateX(10px); }
.nextband__whisper {
  margin: 20px auto 0;
  max-width: 52ch;
  font-family: 'Marcellus', serif;
  font-style: italic;
  font-size: clamp(15px, 1.8vw, 19px);
  line-height: 1.6;
  color: rgba(236, 225, 205, .58);
  text-wrap: pretty;
}

/* ---------- newsletter band ---------- */
.newsband {
  position: relative;
  padding: clamp(84px, 12vh, 140px) clamp(26px, 7vw, 150px);
  background:
    radial-gradient(80% 90% at 50% 110%, rgba(177, 74, 48, .16), transparent 65%),
    linear-gradient(180deg, #1c140f 0%, #191009 100%);
  border-top: 1px solid rgba(200, 154, 62, .14);
}
/* when the newsband directly follows the nextband they share the same dark
   ramp — drop the doubled glow/border so the seam disappears */
.nextband + .newsband {
  border-top: 0;
  background: linear-gradient(180deg, #191009 0%, #170e08 100%);
}
.newsband__inner { max-width: 720px; margin: 0 auto; text-align: center; }
.newsband__eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: #c89a3e;
  margin-bottom: 20px;
}
.newsband h2 {
  font-family: 'Marcellus', serif;
  font-weight: 400;
  font-size: clamp(26px, 4.2vw, 44px);
  line-height: 1.15;
  margin: 0 0 16px;
  color: #f1e3c8;
  text-wrap: balance;
}
.newsband__copy {
  margin: 0 auto;
  max-width: 52ch;
  font-size: clamp(14.5px, 1.6vw, 17px);
  line-height: 1.7;
  color: rgba(236, 225, 205, .74);
}
.newsletter {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin: 32px auto 0;
}
.newsletter input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  font: 15px/1.4 'Hanken Grotesk', system-ui, sans-serif;
  color: #f1e3c8;
  background: rgba(18, 12, 8, .65);
  border: 1px solid rgba(236, 225, 205, .22);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color .3s;
}
.newsletter input[type="email"]::placeholder { color: rgba(236, 225, 205, .38); }
.newsletter input[type="email"]:focus { outline: none; border-color: rgba(200, 154, 62, .75); }
.newsletter__msg {
  min-height: 22px;
  margin: 14px 0 0;
  font-family: 'Space Mono', monospace;
  font-size: 11.5px;
  letter-spacing: .06em;
  color: #e8c069;
  opacity: 0;
  transition: opacity .4s ease;
}
@media (max-width: 540px) {
  .newsletter { flex-direction: column; }
  .newsletter .btn { width: 100%; }
}

/* ---------- footer ---------- */
.site-footer {
  background: #120c08;
  border-top: 1px solid rgba(236, 225, 205, .08);
  padding: clamp(50px, 7vh, 84px) clamp(26px, 7vw, 150px) 30px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: clamp(30px, 5vw, 72px);
  max-width: 1140px;
  margin: 0 auto;
}
.site-footer__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.site-footer__brand img { width: 26px; height: 26px; }
.site-footer__brand span {
  font-family: 'Marcellus', serif;
  font-size: 14px;
  letter-spacing: .3em;
  color: #ece1cd;
}
.site-footer__mission {
  margin: 0;
  max-width: 34ch;
  font-size: 13.5px;
  line-height: 1.7;
  color: rgba(236, 225, 205, .62);
}
.site-footer h3 {
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: #c89a3e;
  margin: 4px 0 16px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 10px; }
.site-footer a {
  font-size: 14px;
  color: rgba(236, 225, 205, .78);
  text-decoration: none;
  transition: color .25s;
}
.site-footer a:hover { color: #e8c069; }
.site-footer__bottom {
  max-width: 1140px;
  margin: clamp(40px, 6vh, 64px) auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(236, 225, 205, .08);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  justify-content: space-between;
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(236, 225, 205, .45);
}
@media (max-width: 760px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}
