/* Tales of Luxury · Folio v3 — shiny land gradients, metallic foil, icons, mega menu v3.
   Tokens per land (set in base.html from tales/content.py):
   --grad  ground gradient (dark, three stops)        --foil  metallic accent gradient (light → mid → deep)
   House defaults below are used where no data-land applies. */

:root {
  --grad: linear-gradient(135deg, #0B211E 0%, #163A35 55%, #24524A 100%);
  --foil: linear-gradient(115deg, #F7E7B6 0%, #D7B26A 42%, #9C7432 78%, #D7B26A 100%);
  --foil-deep: #9C7432;
  --sheen: radial-gradient(120% 70% at 88% -10%, rgba(255, 255, 255, .16), transparent 55%);
}

/* ---------- gradient grounds ---------- */
.dark, .foot, .mast--dark, .sheet, .buybar, .midcta, .nudge, .dock, .mpromise {
  background: var(--sheen), var(--grad);
}
.panel--dark, .btn--dark, .fab__toggle, .chip--on, .atlas__legend span, .wizard__bar span,
.checks--lands label:has(input:checked), .mland {
  background: var(--grad);
}
.btn--dark { border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 8px 20px rgba(0, 0, 0, .16); }
.btn--dark:hover { background: var(--sheen), var(--grad); filter: brightness(1.12); }
.letter { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); }
.panel--dark { box-shadow: 0 20px 40px rgba(0, 0, 0, .12); }

/* ---------- metallic foil buttons with a moving shine ---------- */
.btn--brass, .fab__main, .dock .dock__main, .finder .btn {
  background: var(--foil); background-size: 220% 100%; background-position: 0 0;
  color: var(--malachite); border: 0; position: relative; overflow: hidden; isolation: isolate;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 8px 22px rgba(0, 0, 0, .18);
  transition: background-position .6s var(--ease), transform .3s var(--ease), box-shadow .3s;
}
.btn--brass:hover, .fab__main:hover, .finder .btn:hover { background: var(--foil); background-size: 220% 100%; background-position: 100% 0; color: var(--malachite); }
.btn--brass::after, .fab__main::after, .dock .dock__main::after, .finder .btn::after {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: 0; width: 38%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
  transform: translateX(-160%) skewX(-22deg);
}
.btn--brass:hover::after, .finder .btn:hover::after { animation: sheen .9s var(--ease); }
.fab__main::after, .dock .dock__main::after { animation: sheen-loop 6s ease-in-out 1.5s infinite; }
@keyframes sheen { to { transform: translateX(380%) skewX(-22deg); } }
@keyframes sheen-loop { 0% { transform: translateX(-160%) skewX(-22deg); } 16%, 100% { transform: translateX(380%) skewX(-22deg); } }

/* ---------- foil text ---------- */
.accent {
  background-image: linear-gradient(115deg, var(--brass-ink) 0%, color-mix(in srgb, var(--brass-ink) 62%, #000) 60%, var(--brass-ink) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 0 .08em; margin: 0 -.08em;
}
.dark .accent, .panel--dark .accent, .foot .accent, .mpromise .accent, .midcta .accent, .fan .accent,
.dark .eyebrow, .panel--dark .h-s, .foot__cols h3, .wordmark i, .mast--dark .wordmark i, .foot__big i {
  background-image: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wordmark i { padding: 0 .1em; }
.foot__big i { padding: 0 .06em; }

/* ---------- icon badges ---------- */
.icon { width: 1em; height: 1em; flex-shrink: 0; }
.lbadge {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--sheen), var(--grad); color: var(--brass); vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 6px 14px rgba(0, 0, 0, .15); flex-shrink: 0;
}
.lbadge .icon { width: 58%; height: 58%; }
.lbadge--foil { background: var(--foil); color: var(--malachite); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 14px rgba(0, 0, 0, .18); }
.lbadge--lg { width: 64px; height: 64px; }
.lbadge--sm { width: 26px; height: 26px; box-shadow: none; }
h2 .lbadge, .h-l .lbadge { margin-right: 10px; transform: translateY(-4px); }
.toc__row .lbadge { width: 46px; height: 46px; }
.chip--land { display: inline-flex; align-items: center; gap: 8px; background: var(--sheen), var(--grad); color: #fff; }
.chip--land:hover { color: #fff; filter: brightness(1.1); }
.chip--land .icon { width: 15px; height: 15px; color: var(--brass); }
.eyebrow--icon { display: inline-flex; align-items: center; gap: 10px; }
.eyebrow--icon .icon { width: 20px; height: 20px; color: var(--brass-ink); }
.h-icon { display: flex; align-items: center; gap: 18px; }
.h-icon .icon { width: .8em; height: .8em; color: var(--brass-ink); stroke-width: 1.2; }
.spine__icon { position: absolute; right: 0; top: -20px; width: clamp(160px, 22vw, 320px); height: clamp(160px, 22vw, 320px); color: var(--brass-ink); opacity: .14; pointer-events: none; }
.spine__icon .icon { width: 100%; height: 100%; stroke-width: .7; }
@media (max-width: 900px) { .spine__icon { display: none; } }
.fan__cap .lbadge { width: 44px; height: 44px; }
.hl .lbadge { margin-bottom: 4px; }

/* ---------- top nav ---------- */
.nav > .nav__drop > button, .nav > .nav__link { position: relative; }
.nav > .nav__drop > button::after, .nav > .nav__link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px; border-radius: 2px;
  background: var(--foil); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav > .nav__drop > button:hover::after, .nav__drop.is-open > button::after, .nav > .nav__link:hover::after { transform: none; }
.nav > .nav__drop > button:hover, .nav > .nav__link:hover { background: transparent; }
.nav__drop .chev { width: 12px; height: 12px; transition: transform .3s; }
.nav__drop.is-open .chev { transform: rotate(180deg); }

/* ---------- mega v3 ---------- */
.mega { border-top: 0; padding: 34px 0 34px; background: linear-gradient(180deg, #FBFAF6, var(--paper)); }
.mega::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--foil); }
/* invisible bridge over the gap between the menu button and the panel, so moving down never "leaves" the menu */
.mega::after { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 40px; }
.nav__drop:not(.is-open) .mega::after { display: none; }
.mega__wrap { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 36px; align-items: stretch; }
.mega__intro { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding-right: 12px; border-right: 1px solid var(--line); }
.mega__title { margin: 0; font-family: var(--display); font-size: 34px; line-height: 1.05; letter-spacing: -.02em; }
.mega__lede { margin: 0; font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.mega__links { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.mega__links a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mega__links a:hover { color: var(--brass-ink); }
.mega__links .icon { width: 18px; height: 18px; color: var(--brass-ink); }

.mlands { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.mcard {
  position: relative; min-height: 380px; border-radius: 999px 999px 12px 12px; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 16px 14px 16px; color: #fff;
  background: var(--grad); box-shadow: 0 14px 30px rgba(0, 0, 0, .14); transition: transform .45s var(--ease), box-shadow .45s;
}
.mcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.2s var(--ease); }
.mcard__veil { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 8%, color-mix(in srgb, var(--malachite) 55%, transparent) 42%, var(--malachite) 78%); }
.mcard::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent); transform: translateX(-180%) skewX(-18deg);
}
.mcard:hover { transform: translateY(-6px); box-shadow: 0 24px 44px rgba(0, 0, 0, .22); }
.mcard:hover img { transform: scale(1.07); }
.mcard:hover::after { animation: sheen 1.1s var(--ease); }
.mcard .lbadge { width: 46px; height: 46px; margin-bottom: 4px; }
.mcard__name { font-family: var(--display); font-weight: 500; font-size: 23px; line-height: 1.02; color: #fff; text-decoration: none; }
.mcard__name::before { content: ""; position: absolute; inset: 0; z-index: 1; }
.mcard__name:hover { color: #fff; }
.mcard__palette { font-size: 11.5px; line-height: 1.35; color: rgba(255, 255, 255, .78); }
.mcard__places { list-style: none; margin: 6px 0 0; padding: 8px 0 0; border-top: 1px solid rgba(255, 255, 255, .22); display: flex; flex-direction: column; gap: 3px; font-size: 13px; position: relative; z-index: 2; }
.mcard__places a { color: rgba(255, 255, 255, .92); text-decoration: none; }
.mcard__places a:hover { color: var(--brass); }
.mcard__go { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; margin-top: 4px; background-image: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mcard__go .icon { width: 14px; height: 14px; color: var(--brass); }

.mega__cols { display: grid; grid-template-columns: 1.25fr 1fr 1.15fr; gap: 44px; }
.mega__cols--exp { grid-template-columns: 1.7fr 1fr; }
.mega__cols--plan { grid-template-columns: 1fr 1fr 1fr 1.25fr; }
.mlist { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.mlist--2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.mlist a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin-left: -8px; border-radius: 8px; text-decoration: none; color: var(--ink); transition: background .25s, color .25s; }
.mlist a:hover { background: var(--tint); color: var(--ink); }
.mlist .icon { width: 18px; height: 18px; color: var(--brass-ink); }
.mlist__dot { width: 8px; height: 8px; transform: rotate(45deg); background: var(--foil); flex-shrink: 0; border-radius: 1px; }
.mpace { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.mpace a { display: flex; flex-direction: column; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); transition: border-color .3s, background .3s, transform .3s var(--ease); }
.mpace a:hover { border-color: var(--brass-ink); background: var(--tint); transform: translateX(4px); color: var(--ink); }
.mpace b { font-family: var(--display); font-weight: 500; font-size: 20px; }
.mpace span { font-size: 13px; color: var(--muted); }
.mfeatured { display: flex; flex-direction: column; gap: 10px; }
.mfeat small { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--brass-ink); font-weight: 600; letter-spacing: .02em; }
.mfeat small .icon { width: 14px; height: 14px; }
.mkinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.mkinds a { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); transition: border-color .3s, background .3s, transform .3s var(--ease); }
.mkinds a:hover { border-color: var(--brass-ink); background: var(--tint); transform: translateY(-2px); color: var(--ink); }
.mkinds b { font-weight: 600; font-size: 15px; }
.mpromise { border-radius: 16px; padding: 26px; color: var(--mist); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.mpromise .mega__title { color: #fff; font-size: 30px; }
.mpromise .mega__lede { color: rgba(255, 255, 255, .78); }
@media (max-width: 1240px) { .mlands { grid-template-columns: repeat(4, minmax(0, 1fr)); } .mcard { min-height: 300px; } .mega__wrap { grid-template-columns: 1fr; } .mega__intro { border-right: 0; padding-right: 0; } }

/* ---------- mobile sheet ---------- */
.sheet__lands a { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.sheet__lands b { font-size: 24px; display: block; }
.sheet__lands small { display: block; font-size: 12px; color: var(--mist-3); }
.sheet__lands .lbadge { width: 40px; height: 40px; }

/* ---------- footer ---------- */
.foot__land { gap: 10px; }
.foot { padding-top: clamp(48px, 6vw, 80px); }
.foot__top { align-items: center; gap: clamp(28px, 4vw, 56px); }
.foot__big { font-size: clamp(38px, 4.6vw, 76px); line-height: .98; letter-spacing: -.03em; }
.foot__cols h3 { display: inline-block; }

/* ---------- hero and home touches ---------- */
.fan__item { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.fan__item.is-active { box-shadow: 0 0 0 1px rgba(255, 255, 255, .3), 0 30px 60px rgba(0, 0, 0, .35); }
.fan__item::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent); width: 45%; transform: translateX(-180%) skewX(-18deg); }
.fan__item:hover::before { animation: sheen 1.2s var(--ease); }
.trustband { background: linear-gradient(180deg, var(--paper), #fff); }
.finder { grid-template-columns: 1fr 1fr; }
.finder .btn { grid-column: 1 / -1; min-height: 52px; }
.trust svg { color: var(--foil-deep); }

/* ---------- grids with fixed columns: rows are always complete ----------
   4-up → 2-up → 1-up; 3-up → 1-up; 2-up → 1-up. Gaps in the last row are filled by .card-fill (see folio.js). */
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1024px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .grid--4 { grid-template-columns: minmax(0, 1fr); } }
.split__main .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .split__main .grid--4 { grid-template-columns: minmax(0, 1fr); } }

.card-fill {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end;
  gap: 12px; min-height: 340px; padding: 28px 24px; border-radius: 999px 999px 12px 12px; text-decoration: none; color: #fff;
  background: var(--sheen), var(--grad); box-shadow: 0 16px 34px rgba(0, 0, 0, .14); transition: transform .4s var(--ease), box-shadow .4s;
}
.card-fill::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; z-index: -1; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent); transform: translateX(-180%) skewX(-18deg); }
.card-fill:hover { transform: translateY(-4px); box-shadow: 0 24px 44px rgba(0, 0, 0, .2); color: #fff; }
.card-fill:hover::after { animation: sheen 1.1s var(--ease); }
.card-fill__title { font-family: var(--display); font-size: clamp(24px, 2.2vw, 30px); line-height: 1.08; }
.card-fill__text { font-size: 14.5px; line-height: 1.55; color: rgba(255, 255, 255, .8); }
.card-fill__go { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; background-image: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card-fill__go .icon { width: 16px; height: 16px; color: var(--brass); }
.card--wide ~ .card-fill, .grid:has(> .card--wide) > .card-fill { border-radius: 14px; min-height: 260px; }

@media (prefers-reduced-motion: reduce) {
  .fab__main::after, .dock .dock__main::after { animation: none; }
}
