@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Cinzel+Decorative:wght@400;500&family=Crimson+Text:ital,wght@0,400;0,600&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #080808;
  --night: #111214;
  --paper: #ead6ad;
  --brass: #b98a4d;
  --brass-bright: #e0b879;
  --brass-soft: rgba(185, 138, 77, .42);
  --smoke: #aaa49a;
  --wine: #461713;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background: #070707 url("/assets/portal/portal-map-background-v1.webp") center top / cover fixed no-repeat;
  font-family: Inter, Arial, sans-serif;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(4,4,4,.58), rgba(5,5,5,.28) 24% 76%, rgba(4,4,4,.58)),
    radial-gradient(ellipse at 50% 35%, transparent 0 27%, rgba(0,0,0,.56) 100%);
}

.portal-reference-frame {
  position: fixed;
  inset: 8px;
  z-index: 50;
  pointer-events: none;
  border: 2px solid rgba(191,151,94,.64);
  box-shadow: inset 0 0 0 3px #171514, inset 0 0 0 5px rgba(142,106,63,.62), 0 0 28px #000;
}
.portal-reference-frame::before,
.portal-reference-frame::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(202,164,105,.28);
}
.portal-reference-frame::after { inset: 12px; border-color: rgba(63,49,36,.9); }
.frame-corner {
  position: absolute;
  width: 48px;
  height: 48px;
  border-color: var(--brass-bright);
  filter: drop-shadow(0 2px 3px #000);
}
.frame-corner::after {
  content: "◆";
  position: absolute;
  color: var(--brass);
  font-size: 13px;
}
.frame-corner--tl { left: 5px; top: 5px; border-left: 4px double; border-top: 4px double; }
.frame-corner--tr { right: 5px; top: 5px; border-right: 4px double; border-top: 4px double; }
.frame-corner--bl { left: 5px; bottom: 5px; border-left: 4px double; border-bottom: 4px double; }
.frame-corner--br { right: 5px; bottom: 5px; border-right: 4px double; border-bottom: 4px double; }
.frame-corner--tl::after { left: 9px; top: 8px; }
.frame-corner--tr::after { right: 9px; top: 8px; }
.frame-corner--bl::after { left: 9px; bottom: 8px; }
.frame-corner--br::after { right: 9px; bottom: 8px; }

.portal-shell { position: relative; width: min(1920px, calc(100% - 80px)); margin: 0 auto; padding: 0 0 12px; }
.portal-header { padding: 34px clamp(18px, 4vw, 76px) 0; text-align: center; }
.portal-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  color: var(--paper);
  text-decoration: none;
  text-shadow: 0 3px 2px #000, 0 0 20px rgba(224,184,121,.14);
}
.portal-logo__title {
  font: 500 clamp(42px, 5.4vw, 88px)/.98 "Cinzel Decorative", Cinzel, Georgia, serif;
  letter-spacing: -.055em;
  text-transform: uppercase;
}
.portal-logo__title::first-letter { font-size: 1.15em; }
.portal-logo__subtitle {
  margin-top: 13px;
  color: #d8bc91;
  font: 500 clamp(13px, 1.35vw, 22px)/1.3 "Crimson Text", Georgia, serif;
  letter-spacing: .035em;
}

.portal-mobile-preview {
  position: absolute;
  z-index: 3;
  top: 218px;
  right: 8px;
  width: 320px;
  min-height: 820px;
  padding: 30px 9px 10px;
  color: #ddc8a0;
  border: 3px solid #6e6254;
  border-radius: 28px;
  background: #111316;
  box-shadow: 0 0 0 5px #1b1815, 0 18px 42px rgba(0,0,0,.72), inset 0 0 0 2px #b29770;
  overflow: hidden;
}
.mobile-preview__speaker {
  position: absolute;
  left: 50%;
  top: 10px;
  width: 74px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 9px;
  background: #020202;
}
.mobile-preview__topbar {
  height: 46px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ead5ad;
  background: linear-gradient(180deg, #4d1713, #210b0a);
  border: 1px solid #806246;
  font: 600 12px/1 Cinzel, serif;
}
.mobile-preview__topbar b {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: #17120d;
  border: 2px solid #c9a46c;
  border-radius: 50%;
  background: #c8a36b;
  font-size: 16px;
}
.mobile-preview__body { padding: 14px 8px 20px; }
.mobile-preview__campaign {
  padding-bottom: 15px;
  border: 1px solid #70563e;
  background: #11161c;
  box-shadow: inset 0 0 0 4px rgba(0,0,0,.55);
}
.mobile-preview__image {
  height: 222px;
  background: linear-gradient(0deg, rgba(8,10,13,.62), transparent 50%), url("/assets/portal/corvamar-cover-v2.webp") 27% center / cover no-repeat;
}
.mobile-preview__campaign p {
  margin: -68px 12px 24px;
  position: relative;
  color: #f0d3a1;
  text-align: center;
  font: 500 25px/.95 "Crimson Text", Georgia, serif;
  text-shadow: 0 2px 3px #000;
}
.mobile-preview__button {
  display: block;
  margin: 0 17px;
  padding: 12px 7px;
  color: #f2d7ab;
  text-align: center;
  border: 1px solid #c29760;
  background: linear-gradient(105deg, #4b241a, #723c27 50%, #3f1c18);
  font: 500 10px/1 Cinzel, serif;
}
.mobile-preview__tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}
.mobile-preview__tiles span {
  min-height: 86px;
  border: 1px solid #78664f;
  background: linear-gradient(145deg, rgba(67,64,59,.8), rgba(19,21,24,.94)), url("/assets/portal/corvamar-cover-v2.webp") center / cover no-repeat;
}
.mobile-preview__tiles .is-locked {
  display: grid;
  place-items: center;
  color: #b8996d;
  font-size: 29px;
  background: repeating-linear-gradient(35deg, transparent 0 14px, rgba(180,154,112,.5) 15px 17px, transparent 18px 30px), #17191c;
}
.mobile-preview__footer {
  min-height: 62px;
  margin: 0 -9px -10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #d2b07d;
  border-top: 2px solid #745238;
  background: linear-gradient(180deg, #481813, #220b0a);
  font: 600 14px/1 Inter, sans-serif;
}
.mobile-preview__footer b { font-size: 26px; }

.portal-main-nav {
  position: relative;
  width: min(1500px, calc(100% - 40px));
  min-height: 76px;
  margin: 28px auto 42px;
  padding: 0 58px 0 24px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  border: 2px solid #7d654a;
  background: linear-gradient(180deg, #571e19, #2a0e0c 47%, #190a09);
  box-shadow: inset 0 0 0 3px #160b09, inset 0 0 18px rgba(224,184,121,.16), 0 9px 18px rgba(0,0,0,.7);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 18px 100%, 0 50%);
}
.portal-main-nav::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-top: 1px solid rgba(238,196,129,.3);
  border-bottom: 1px solid rgba(0,0,0,.78);
  pointer-events: none;
}
.portal-main-nav a {
  position: relative;
  z-index: 1;
  min-width: 160px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #d9bf91;
  text-decoration: none;
  text-transform: uppercase;
  font: 600 14px/1 Cinzel, serif;
  text-shadow: 0 2px 2px #000;
  border-right: 1px solid rgba(218,179,112,.16);
  transition: color .2s ease, background .2s ease;
}
.portal-main-nav a:first-child { border-left: 1px solid rgba(218,179,112,.16); }
.portal-main-nav a:hover,
.portal-main-nav a:focus-visible { color: #fff0c7; background: rgba(232,190,117,.08); outline: none; }
.portal-main-nav a span { color: var(--brass-bright); font-size: 19px; }
.nav-medallion {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  color: #15110d;
  background: radial-gradient(circle at 38% 32%, #e0bb7a, #9b713d 50%, #332219 52%, #17100c 72%);
  border: 3px double #d2aa6b;
  border-radius: 50%;
  box-shadow: 0 0 0 5px #18110d, 0 4px 10px #000;
  font: 700 30px/1 Cinzel, serif;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--brass);
  font: 500 11px/1.4 Cinzel, serif;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.campaigns { max-width: 1140px; margin: 0 auto; padding: 0 0 38px; }
.portal-featured {
  position: relative;
  display: block;
  min-height: 430px;
  border: 3px double #90704e;
  outline: 1px solid rgba(225,184,116,.72);
  outline-offset: 7px;
  background: rgba(12,16,20,.88);
  box-shadow: 0 28px 75px rgba(0,0,0,.6), inset 0 0 0 6px rgba(0,0,0,.45);
  overflow: visible;
}
.portal-featured::before {
  content: "⛓  ⛓  ⛓  ⛓  ⛓  ⛓  ⛓  ⛓  ⛓  ⛓  ⛓  ⛓";
  position: absolute;
  z-index: 4;
  left: 8%;
  right: 8%;
  top: -21px;
  color: #977553;
  font-size: 19px;
  letter-spacing: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-shadow: 0 2px 2px #000;
  pointer-events: none;
}
.portal-featured::after {
  content: "☠";
  position: absolute;
  z-index: 5;
  left: 50%;
  top: -36px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  color: #e6c38b;
  background: radial-gradient(circle, #4d3829 0 52%, #171311 55% 100%);
  border: 2px double #b08a5d;
  border-radius: 50%;
  font-size: 23px;
  text-shadow: 0 2px 2px #000;
  pointer-events: none;
}
.campaign-ornament,
.campaign-skull,
.campaign-side-chain {
  position: absolute;
  z-index: 8;
  color: #c7a36e;
  text-shadow: 0 2px 3px #000, 0 0 8px rgba(218,176,108,.25);
  pointer-events: none;
}
.campaign-ornament {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #d6b47a;
  border: 2px double rgba(206,167,103,.82);
  background: radial-gradient(circle, rgba(121,88,51,.62), rgba(18,14,11,.86) 68%);
  font-size: 21px;
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.45), 0 2px 5px #000;
}
.campaign-ornament--tl { left: -17px; top: -17px; transform: rotate(-24deg); }
.campaign-ornament--tr { right: -17px; top: -17px; transform: rotate(24deg); }
.campaign-ornament--bl { left: -17px; bottom: -17px; transform: rotate(24deg); }
.campaign-ornament--br { right: -17px; bottom: -17px; transform: rotate(-24deg); }
.campaign-skull {
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #e5c58e;
  background: radial-gradient(circle, #4d3829 0 52%, #171311 55% 100%);
  border: 2px double #b08a5d;
  border-radius: 50%;
  font-size: 21px;
}
.campaign-skull--top { top: -24px; }
.campaign-skull--bottom { bottom: -24px; }
.campaign-side-chain {
  top: 26px;
  bottom: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  font-size: 27px;
  line-height: 1;
  color: #aa8760;
}
.campaign-side-chain--left { left: -28px; }
.campaign-side-chain--right { right: -28px; }
.portal-featured__cover {
  min-height: 430px;
  position: relative;
  background: url("/assets/portal/corvamar-cover-v2.webp") 22% center / cover no-repeat;
}
.portal-featured__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 45%, rgba(9,11,14,.97) 100%), linear-gradient(0deg, rgba(6,8,10,.32), transparent 48%);
}
.portal-featured__content {
  position: absolute;
  inset: 0 0 0 48%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 72px 70px;
  background: linear-gradient(90deg, rgba(16,20,25,0), rgba(16,20,25,.86) 25%, #101419 52%), radial-gradient(circle at 70% 30%, rgba(144,112,70,.12), transparent 36%);
}
.portal-featured__content::before,
.portal-featured__content::after { content: "✦"; position: absolute; color: var(--brass); font-size: 20px; opacity: .8; }
.portal-featured__content::before { left: 20px; top: 18px; }
.portal-featured__content::after { right: 20px; bottom: 18px; }
.portal-featured h2 { margin: 0; font: 500 clamp(46px, 3.6vw, 68px)/.98 "Crimson Text", Georgia, serif; }
.campaign-divider { width: min(280px, 80%); height: 1px; margin: 30px 0; background: linear-gradient(90deg, transparent, var(--brass), transparent); }
.campaign-meta { margin: 0 0 40px; color: #cbc4b6; font: 400 20px/1.4 "Crimson Text", Georgia, serif; }
.campaign-meta span { color: var(--brass); padding: 0 7px; }
.button-primary {
  display: inline-flex;
  min-width: 300px;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 18px 30px;
  color: #fff0d0;
  text-decoration: none;
  border: 1px solid #d2a15e;
  background: linear-gradient(105deg, #492417, #79472b 51%, #3f1f19);
  box-shadow: inset 0 0 0 3px rgba(255,218,151,.09), 0 8px 24px rgba(0,0,0,.3);
  font: 500 14px/1 Cinzel, serif;
  transition: transform .2s ease, filter .2s ease;
}
.button-primary:hover,
.button-primary:focus-visible { transform: translateY(-2px); filter: brightness(1.15); }
.button-primary b { font: 400 23px/1 "Crimson Text", Georgia, serif; }
.future-chronicles { text-align: center; padding: 15px 0 26px; color: var(--smoke); }
.future-chronicles__intro { margin: 0 0 18px; font: 400 20px/1.3 "Crimson Text", Georgia, serif; }
.future-grid { max-width: 1140px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.future-card {
  position: relative;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px 14px 16px;
  color: #d4c9b7;
  border: 2px solid #78644f;
  outline: 1px solid rgba(192,153,101,.55);
  outline-offset: 5px;
  background: linear-gradient(145deg, rgba(63,56,49,.84), rgba(22,24,27,.94)), url("/assets/portal/corvamar-cover-v2.webp") center / cover no-repeat;
  box-shadow: inset 0 0 0 5px rgba(0,0,0,.5), 0 13px 22px rgba(0,0,0,.38);
  overflow: hidden;
}
.future-card::before,
.future-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 150%;
  height: 3px;
  background: repeating-linear-gradient(90deg, #8e795d 0 7px, transparent 7px 15px);
  opacity: .78;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55);
}
.future-card::before { left: -25%; top: 50%; transform: rotate(33deg); }
.future-card::after { right: -25%; top: 50%; transform: rotate(-33deg); }
.future-card__lock,
.future-card strong,
.future-card small { position: relative; z-index: 1; }
.future-card__lock { color: #d1b17b; font-size: 31px; text-shadow: 0 2px 2px #000; }
.future-card strong { color: #ded2c1; font: 600 clamp(18px, 1.55vw, 26px)/1 Cinzel, serif; text-shadow: 0 2px 2px #000; }
.future-card small { color: #c3ad92; font: 400 15px/1.15 "Crimson Text", Georgia, serif; }
.future-card--reserved { filter: saturate(.72); }
.future-card--blocked { filter: grayscale(.7); opacity: .82; }
.future-chronicles::after { content: "✦"; display: block; margin-top: 12px; color: var(--brass); font-size: 15px; }
.how-it-works { display: none; }
.how-it-works { border-top: 1px solid var(--brass-soft); padding: 72px 0 110px; }
.how-it-works__inner { max-width: 780px; margin: 0 auto; text-align: center; }
.how-it-works h2 { margin: 0 0 14px; font: 500 clamp(31px, 4vw, 49px)/1 "Crimson Text", Georgia, serif; }
.how-it-works p { margin: 0; color: #bdb8ad; font: 400 18px/1.5 "Crimson Text", Georgia, serif; }
.portal-footer {
  max-width: 1140px;
  min-height: 68px;
  margin: 14px auto 0;
  padding: 16px 34px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  color: #c8ad84;
  border: 2px solid #735238;
  background: linear-gradient(180deg, #471713, #210b0a);
  box-shadow: inset 0 0 0 4px rgba(9,5,4,.72), 0 8px 18px rgba(0,0,0,.45);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 18px 100%, 0 50%);
  font: 11px/1.3 Cinzel, serif;
}
.footer-social { display: flex; gap: 14px; justify-content: flex-start; }
.footer-social a,
.footer-links a { color: #d1b17d; text-decoration: none; }
.footer-social a { font: 600 20px/1 Inter, sans-serif; }
.footer-social a:hover,
.footer-links a:hover { color: #fff0c7; }
.footer-links { display: flex; gap: 10px; align-items: center; justify-content: center; white-space: nowrap; }
.footer-copy { text-align: right; color: #9d8567; }

/* Reference refinement — stage 11 */
.portal-reference-frame {
  inset: 0 auto auto 0;
  width: 100vw;
  height: 100vh;
  border: 0;
  box-shadow: none;
  background: url("/assets/portal/outer-frame-v11.webp") center / 100vw 100vh no-repeat;
}
.portal-reference-frame::before,
.portal-reference-frame::after,
.frame-corner { display: none; }

.portal-header { padding-top: 72px; }
.portal-logo__title {
  font-size: clamp(50px, 5.8vw, 98px);
  letter-spacing: -.045em;
  text-shadow: 0 4px 2px #000, 0 0 24px rgba(224,184,121,.18);
}
.portal-logo__subtitle { margin-top: 14px; font-size: clamp(15px, 1.45vw, 24px); }
.portal-main-nav {
  min-height: 78px;
  margin: 36px auto 54px;
  box-shadow: inset 0 0 0 3px #160b09, inset 0 0 22px rgba(224,184,121,.2), 0 10px 22px rgba(0,0,0,.78);
}

.campaigns { max-width: 1140px; padding-bottom: 44px; }
.portal-featured {
  min-height: 470px;
  border: 0;
  outline: 0;
  background: #0b1015;
  box-shadow: 0 32px 80px rgba(0,0,0,.72);
  overflow: visible;
}
.portal-featured::before {
  content: "";
  position: absolute;
  z-index: 10;
  inset: -45px -54px;
  background: url("/assets/portal/campaign-frame-v11.webp") center / 100% 100% no-repeat;
  pointer-events: none;
}
.portal-featured::after { content: none; }
.portal-featured__cover {
  min-height: 470px;
  border: 1px solid rgba(196,157,99,.58);
  background-position: 24% center;
}
.portal-featured__cover::after {
  background: linear-gradient(90deg, transparent 42%, rgba(9,11,14,.96) 91%), linear-gradient(0deg, rgba(6,8,10,.25), transparent 45%);
}
.portal-featured__content {
  z-index: 2;
  inset: 0 0 0 52%;
  gap: 38px;
  padding: 66px 52px;
  background: linear-gradient(90deg, rgba(13,17,21,0), rgba(13,17,21,.68) 18%, rgba(13,17,21,.96) 58%);
}
.portal-featured__content::before,
.portal-featured__content::after,
.campaign-ornament,
.campaign-skull,
.campaign-side-chain { display: none; }
.portal-featured h2 {
  max-width: 520px;
  color: #f0d4a4;
  font: 600 clamp(48px, 4.1vw, 74px)/.91 Cinzel, Georgia, serif;
  letter-spacing: -.035em;
  text-transform: uppercase;
  text-shadow: 0 3px 2px #000, 0 0 10px rgba(192,139,75,.2);
}
.button-primary {
  min-width: 330px;
  padding: 18px 34px;
  border: 2px double #d0a367;
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 18px 100%, 0 50%);
  font-size: 15px;
  letter-spacing: .02em;
}

.portal-mobile-preview {
  top: 196px;
  right: calc((100vw - 100%) / -2 + 24px);
  width: 420px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.portal-mobile-preview img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 28px rgba(0,0,0,.78));
}

.future-chronicles { padding: 18px 0 74px; }
.future-chronicles__intro { display: none; }
.future-grid { max-width: 1240px; gap: 22px; }
.future-card {
  min-height: 184px;
  padding: 24px 16px;
  border: 0;
  outline: 0;
  background: url("/assets/portal/locked-plaque-v11.webp") center / 100% 100% no-repeat;
  box-shadow: none;
  overflow: visible;
}
.future-card::before,
.future-card::after,
.future-card__lock { display: none; }
.future-card strong {
  position: relative;
  z-index: 2;
  transform: translateY(13px);
  color: #eee2d0;
  font: 600 clamp(19px, 1.65vw, 28px)/1 Cinzel, serif;
  text-shadow: 0 3px 3px #000, 0 0 8px #000;
}
.future-card small {
  position: absolute;
  z-index: 2;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  color: #d6bc94;
  font: 400 16px/1.2 "Crimson Text", Georgia, serif;
}
.future-card--reserved { filter: saturate(.78); }
.future-card--blocked { filter: grayscale(.65); opacity: .9; }
.future-chronicles::after { display: none; }

.portal-footer {
  max-width: 1240px;
  min-height: 70px;
  margin-top: 14px;
  border-color: #896346;
  box-shadow: inset 0 0 0 4px rgba(9,5,4,.72), 0 10px 24px rgba(0,0,0,.55);
  font-size: 12px;
}

/* Compact desktop: wide screens with little vertical room */
@media (min-width: 1601px) and (max-height: 1050px) {
  .portal-shell { width: min(1780px, calc(100% - 104px)); padding-bottom: 8px; }
  .portal-header { padding-top: 68px; }
  .portal-logo__title { font-size: 74px; line-height: .92; }
  .portal-logo__subtitle { margin-top: 8px; font-size: 17px; }
  .portal-main-nav {
    width: min(1180px, calc(100% - 120px));
    min-height: 60px;
    margin: 14px auto 26px;
  }
  .portal-main-nav a { min-width: 132px; padding: 0 16px; font-size: 12px; }
  .portal-main-nav a span { font-size: 16px; }
  .nav-medallion { width: 58px; height: 58px; font-size: 25px; }

  .campaigns { max-width: 1000px; padding-bottom: 22px; }
  .portal-featured,
  .portal-featured__cover { min-height: 360px; }
  .portal-featured::before { inset: -34px -42px; }
  .portal-featured__content {
    inset: 0 0 0 51%;
    gap: 25px;
    padding: 42px 38px;
  }
  .portal-featured h2 {
    width: 100%;
    max-width: 430px;
    font-size: 54px;
    line-height: .93;
  }
  .button-primary { min-width: 280px; padding: 14px 26px; font-size: 12px; }

  .portal-mobile-preview {
    top: 194px;
    right: calc((100vw - 100%) / -2 + 110px);
    width: 330px;
  }

  .future-chronicles { padding: 8px 0 30px; }
  .future-grid { max-width: 1120px; gap: 18px; }
  .future-card { min-height: 140px; padding: 18px 14px; }
  .future-card strong { transform: translateY(10px); font-size: 21px; }
  .future-card small { top: calc(100% + 6px); font-size: 14px; }

  .portal-footer {
    max-width: 1120px;
    min-height: 52px;
    margin-top: 4px;
    padding: 10px 28px;
    font-size: 10px;
  }
  .footer-social a { font-size: 16px; }
}

@media (max-width: 1600px) {
  .portal-mobile-preview { display: none; }
}

@media (max-width: 1080px) {
  .portal-main-nav { width: 100%; padding-right: 48px; }
  .portal-main-nav a { min-width: auto; flex: 1; padding: 0 10px; font-size: 11px; }
  .portal-main-nav a span { font-size: 16px; }
}

@media (max-width: 760px) {
  body { background-attachment: scroll; background-position: center top; }
  .portal-reference-frame { inset: 4px; }
  .portal-shell { width: min(100% - 32px, 650px); }
  .portal-header { padding: 36px 0 0; }
  .portal-logo__title { font-size: clamp(34px, 10.6vw, 54px); line-height: 1; }
  .portal-logo__subtitle { max-width: 310px; font-size: 13px; }
  .portal-main-nav {
    min-height: 55px;
    margin: 25px auto 38px;
    padding: 0 62px 0 12px;
    justify-content: flex-start;
    overflow: hidden;
  }
  .portal-main-nav a { display: none; }
  .portal-main-nav a:first-child,
  .portal-main-nav .nav-login { display: inline-flex; flex: 0 1 auto; min-width: 116px; border: 0; }
  .portal-main-nav .nav-login { margin-left: auto; }
  .nav-medallion { right: 1px; width: 52px; height: 52px; font-size: 23px; }
  .portal-featured {
    grid-template-columns: 1fr;
    border: 3px double #90704e;
    outline: 1px solid rgba(225,184,116,.55);
    outline-offset: 4px;
  }
  .portal-featured::before { display: none; }
  .campaign-side-chain { display: none; }
  .campaign-ornament { font-size: 22px; }
  .portal-featured__cover { min-height: 250px; background-position: 28% center; }
  .portal-featured__cover::after { background: linear-gradient(0deg, rgba(9,11,14,.95), transparent 70%); }
  .portal-featured__content { position: relative; inset: auto; min-height: 330px; padding: 42px 24px 48px; }
  .portal-featured h2 { font-size: 44px; }
  .campaign-meta { margin-bottom: 30px; font-size: 17px; }
  .button-primary { min-width: min(100%, 285px); }
  .future-chronicles { padding-bottom: 67px; }
  .future-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; row-gap: 42px; padding: 0 7px; }
  .future-card { min-height: 132px; }
  .future-card strong { font-size: 16px; }
  .future-card small { top: calc(100% + 8px); font-size: 14px; }
  .portal-footer { grid-template-columns: 1fr; gap: 13px; padding: 18px 26px; text-align: center; clip-path: none; }
  .footer-social, .footer-links { justify-content: center; }
  .footer-copy { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Stage 18 — desktop guiado pelas coordenadas da referência Canva 1410×778 */
@media (min-width: 1601px) {
  body { position: relative; min-height: 55.1773vw; background-attachment: scroll; }
  .portal-reference-frame {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 55.1773vw;
    background-size: 100% 100%;
  }
  .portal-shell {
    position: relative;
    width: 100%;
    min-height: 55.1773vw;
    margin: 0;
    padding: 0;
  }
  .portal-header {
    position: absolute;
    inset: 0;
    padding: 0;
    text-align: center;
  }
  .portal-logo {
    position: absolute;
    top: 3.09vw;
    left: 50%;
    width: 39.1vw;
    transform: translateX(-50%);
  }
  .portal-logo__title {
    font-size: 5.25vw;
    line-height: .94;
    letter-spacing: -.045em;
    text-transform: none;
    color: #ead0a4;
    -webkit-text-stroke: .025vw rgba(74,45,25,.68);
    text-shadow: 0 .07vw 0 #7f5633, 0 .13vw 0 #2a180e, 0 .22vw .22vw #000, 0 0 .55vw rgba(224,184,121,.18);
  }
  .portal-logo__subtitle {
    margin-top: .62vw;
    font-size: 1.02vw;
    line-height: 1.15;
    white-space: nowrap;
  }
  .portal-main-nav {
    position: absolute;
    top: 11.49vw;
    left: 19.01vw;
    width: 61.99vw;
    height: 5.82vw;
    min-height: 0;
    margin: 0;
    padding: 0 4.8vw 0 2vw;
  }
  .portal-main-nav a {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 .85vw;
    gap: .55vw;
    font-size: .92vw;
  }
  .portal-main-nav a span { font-size: 1.22vw; }
  .nav-medallion {
    right: .32vw;
    width: 4.82vw;
    height: 4.82vw;
    font-size: 2vw;
    border-width: .16vw;
    box-shadow: 0 0 0 .28vw #18110d, 0 .25vw .55vw #000;
  }
  .campaigns {
    position: absolute;
    top: 19.50vw;
    left: 28.51vw;
    width: 39.36vw;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .portal-featured,
  .portal-featured__cover {
    min-height: 17.30vw;
    height: 17.30vw;
  }
  .portal-featured::before { inset: -3.48vw -3.55vw; }
  .portal-featured__content {
    inset: 0 0 0 52%;
    gap: 2.2vw;
    padding: 2.8vw 1.9vw;
  }
  .portal-featured h2 {
    width: 100%;
    max-width: 19vw;
    font-size: 2.75vw;
    line-height: .91;
  }
  .button-primary {
    min-width: 16.74vw;
    padding: 1.08vw 1.7vw;
    gap: 1.1vw;
    font-size: .88vw;
  }
  .button-primary b { font-size: 1.42vw; }
  .portal-mobile-preview {
    top: 12.65vw;
    right: 1.65vw;
    width: 17.15vw;
  }
  .future-chronicles {
    position: absolute;
    top: 39.08vw;
    left: 0;
    width: 100%;
    padding: 0;
  }
  .future-grid {
    width: 51.3vw;
    max-width: none;
    margin: 0 auto;
    gap: 1.05vw;
  }
  .future-card { min-height: 9.22vw; padding: 1.2vw .8vw; }
  .future-card strong { transform: translateY(.55vw); font-size: 1.48vw; }
  .future-card small { top: calc(100% + .62vw); font-size: .78vw; }
  .portal-footer {
    position: absolute;
    top: 50.57vw;
    left: 20.21vw;
    width: 59.57vw;
    max-width: none;
    min-height: 4.61vw;
    margin: 0;
    padding: .72vw 2.15vw;
    gap: 1vw;
    font-size: .62vw;
  }
  .footer-social { gap: .82vw; }
  .footer-social a { font-size: 1.12vw; }
  .footer-links { gap: .62vw; }
}

@media (min-width: 1601px) {
  body {
    background:
      linear-gradient(90deg, rgba(4,4,4,.28), rgba(5,5,5,.08) 24% 76%, rgba(4,4,4,.28)),
      radial-gradient(ellipse at 50% 35%, transparent 0 34%, rgba(0,0,0,.28) 100%),
      #070707 url("/assets/portal/portal-map-background-v1.webp") center top / 100% 55.1773vw no-repeat;
  }
  body::before { display: none; }
  .portal-reference-frame { filter: saturate(.58) brightness(.88); }
  .portal-featured__cover { filter: saturate(.62) brightness(.92) contrast(.94); }
  .portal-mobile-preview img { filter: saturate(.72) brightness(.92) drop-shadow(0 1.35vw 1.65vw rgba(0,0,0,.78)); }
}

/* Stage 19 — reference skin: composição exata do Canva + hotspots reais */
@media (min-width: 1601px) {
  html, body { min-height: 54.541015625vw; }
  body {
    background: #050505;
    overflow-x: hidden;
  }
  body::before,
  .portal-reference-frame { display: none !important; }
  .portal-shell {
    width: 100vw;
    min-height: 54.541015625vw;
    margin: 0;
    padding: 0;
    background-image:
      url("/assets/portal/hero-reference-v18.webp"),
      url("/assets/portal/nav-reference-v18.webp"),
      url("/assets/portal/portal-reference-canva-v19.png");
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position:
      24.4140625vw 16.6015625vw,
      19.04296875vw 11.474609375vw,
      0 0;
    background-size:
      50.78125vw 21.97265625vw,
      60.791015625vw 5.859375vw,
      100vw 54.541015625vw;
  }
  .portal-header { position: absolute; inset: 0; padding: 0; }
  .portal-logo {
    position: absolute;
    left: 27.34375vw;
    top: 1.953125vw;
    width: 45.8984375vw;
    height: 8.30078125vw;
    transform: none;
    opacity: 0;
  }
  .portal-main-nav {
    position: absolute;
    left: 19.04296875vw;
    top: 11.474609375vw;
    width: 60.791015625vw;
    height: 5.859375vw;
    min-height: 0;
    margin: 0;
    padding: 0 4.2vw 0 1.7vw;
    border: 0;
    background: transparent;
    box-shadow: none;
    clip-path: none;
  }
  .portal-main-nav::before,
  .nav-medallion { display: none !important; }
  .portal-main-nav a,
  .portal-main-nav a:hover,
  .portal-main-nav a:focus-visible {
    min-width: 0;
    padding: 0 .45vw;
    border: 0;
    background: transparent;
    color: transparent;
    text-shadow: none;
    outline-offset: -.25vw;
  }
  .portal-main-nav a span { opacity: 0; }
  .portal-mobile-preview { display: none; }
  .campaigns {
    position: absolute;
    left: 24.4140625vw;
    top: 16.6015625vw;
    width: 50.78125vw;
    height: 21.97265625vw;
    margin: 0;
    padding: 0;
  }
  .portal-featured,
  .portal-featured__cover {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    filter: none;
  }
  .portal-featured::before,
  .portal-featured::after,
  .portal-featured__cover::after { display: none !important; }
  .portal-featured__content {
    inset: 0;
    display: block;
    padding: 0;
    background: transparent;
  }
  .portal-featured h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
  }
  .button-primary {
    position: absolute;
    left: 58.4%;
    top: 61.2%;
    width: 30.5%;
    height: 12.8%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    clip-path: none;
    color: transparent;
    opacity: 0;
  }
  .future-chronicles {
    position: absolute;
    left: 23.92578125vw;
    top: 38.330078125vw;
    width: 51.513671875vw;
    height: 11.23046875vw;
    padding: 0;
    opacity: 0;
  }
  .future-grid { width: 100%; height: 100%; max-width: none; margin: 0; }
  .portal-footer {
    position: absolute;
    left: 21.97265625vw;
    top: 48.828125vw;
    width: 55.17578125vw;
    height: 5.37109375vw;
    min-height: 0;
    max-width: none;
    margin: 0;
    padding: 0 2vw;
    opacity: 0;
  }
}

/* Stage 20 - full reference render with semantic hotspots */
@media (min-width: 1601px) {
  html, body {
    width: 100%;
    min-height: 54.541015625vw;
    margin: 0;
    background: #050505;
  }
  .portal-shell {
    position: relative;
    width: 100vw;
    height: 54.541015625vw;
    min-height: 54.541015625vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #050505 url("/assets/portal/portal-reference-target-v20.webp") 0 0 / 100% 100% no-repeat;
  }
  .portal-header,
  .campaigns,
  .future-chronicles,
  .portal-footer { z-index: 2; }
}

/* Stage 26 - desktop optical scale correction (70% anti-zoom) */
@media (min-width: 1601px) {
  html, body { min-height: 100vh; }
  body { overflow-x: hidden; }
  .portal-shell {
    transform: translateY(.65vw) scale(.70);
    transform-origin: top center;
    margin-top: 0;
    margin-bottom: -16.3623046875vw;
  }
}

/* Stage 28 - fixed full-page background behind the 70% composition */
@media (min-width: 1601px) {
  html { background: #050505; }
  body {
    position: relative;
    overflow-x: hidden;
    background-color: #050505;
    background-image:
      linear-gradient(to right, rgba(5,5,5,.72) 0%, rgba(5,5,5,.10) 18%, rgba(5,5,5,.10) 82%, rgba(5,5,5,.72) 100%),
      linear-gradient(to bottom, rgba(5,5,5,.22) 0%, rgba(5,5,5,.08) 45%, rgba(5,5,5,.30) 100%),
      url("/assets/portal/portal-map-background-v1.webp");
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: center top, center top, center top;
    background-size: cover, cover, cover;
  }
  body::after { content: none !important; display: none !important; }
  .portal-shell {
    position: relative;
    z-index: 1;
  }
}

/* Stage 29 - medium-desktop perimeter frame follows document, not viewport */
@media (min-width: 761px) and (max-width: 1600px) {
  body { position: relative; }
  .portal-reference-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    background-size: 100% 100%;
  }
  .portal-shell { padding-bottom: clamp(46px, 3vw, 58px); }
}

/* Stage 30 - restore fixed perimeter while keeping content clear of the frame */
@media (min-width: 761px) and (max-width: 1600px) {
  .portal-reference-frame {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    min-height: 0;
    background-size: 100vw 100vh;
    z-index: 1;
  }
  .portal-shell {
    position: relative;
    z-index: 2;
    padding-bottom: 92px;
  }
}

/* Stage 31 - restore the perimeter at every desktop width and bind it to the document */
@media (min-width: 761px) {
  body { position: relative; }

  .portal-reference-frame {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    background: url("/assets/portal/outer-frame-v11.webp") center / 100% 100% no-repeat !important;
    z-index: 30 !important;
    pointer-events: none !important;
  }

  .portal-shell {
    position: relative;
    z-index: 2;
  }
}

@media (min-width: 761px) and (max-width: 1600px) {
  .portal-shell {
    padding-top: clamp(64px, 5vw, 82px);
    padding-bottom: clamp(96px, 8vw, 128px);
  }
}

/* Stage 32 - proportional perimeter: 80% frame around the approved 70% portal */
@media (min-width: 1601px) {
  .portal-reference-frame {
    display: block !important;
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    width: 100vw !important;
    height: 54.541015625vw !important;
    min-height: 0 !important;
    transform: translateY(.25vw) scale(.80) !important;
    transform-origin: top center !important;
    background: url("/assets/portal/outer-frame-v11.webp") center / 100% 100% no-repeat !important;
    z-index: 3 !important;
    pointer-events: none !important;
  }

  .portal-shell {
    transform: translateY(2.1vw) scale(.70);
  }
}

/* Stage 33 - remove only the baked thin inner perimeter */
@media (min-width: 1601px) {
  .portal-shell {
    clip-path: inset(27px);
  }
}
