/*
 * Global entrance and campaign-selection theme.
 *
 * This follows original Intaverna's visual grammar: one branded application
 * shell, a separate account strip, dark-wood workspace surfaces, restrained
 * typography, and compact campaign choices. Every selector is scoped to
 * .landing-theme so campaign themes remain authoritative after entry.
 */
body.landing-theme {
  --entry-width: 1280px;
  --entry-rail-width: 232px;
  --entry-page-inset: 1rem;
  --entry-inset: clamp(1rem, 2.5vw, 2rem);
  --landing-text: #e8dcc3;
  --landing-parchment: #f5e5bd;
  --landing-muted: #b9a786;
  --landing-gold: #e0b85c;
  --landing-gold-soft: rgba(224, 184, 92, .34);
  --landing-copper: #a57950;
  --landing-panel: rgba(8, 7, 6, .88);
  --landing-line: rgba(224, 184, 92, .23);
  --landing-shadow: rgba(0, 0, 0, .48);
  min-height: 100vh;
  margin: 0;
  color: var(--landing-text);
  background-color: #050403;
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, .16), rgba(0, 0, 0, .42)),
    image-set(
      url("../images/bg_new.854d01332c09.webp") type("image/webp"),
      url("../images/bg_new.60a02b39e03c.jpg") type("image/jpeg")
    );
  background-position: center top, center top;
  background-size: cover, cover;
  background-attachment: fixed, fixed;
  background-repeat: no-repeat, no-repeat;
  font-family: Lato, Inter, ui-sans-serif, system-ui, sans-serif;
}

body.landing-theme::before,
body.landing-theme::after {
  display: none;
}

/* The brand and account controls share the same contained workspace edge. */
body.landing-theme .topbar {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: min(var(--entry-width), calc(100% - 2rem));
  min-height: 0;
  height: auto;
  margin: 0 0 0 var(--entry-page-inset);
  padding: 0;
  align-items: stretch;
  border: 1px solid var(--landing-line);
  color: var(--landing-parchment);
  background: #050505;
  box-shadow: none;
}

body.landing-theme .topbar > .landing-brand {
  width: min(100%, 420px);
  min-height: 112px;
}

body.landing-theme .landing-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  min-height: 0;
  padding: .5rem 1rem;
  overflow: hidden;
  background: #050505;
  text-decoration: none;
}

body.landing-theme .landing-brand picture {
  display: flex;
  width: 100%;
  height: 100%;
  max-width: 100%;
  align-items: center;
  justify-content: flex-start;
}

body.landing-theme .landing-brand img {
  display: block;
  width: min(388px, 100%);
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
}

body.landing-theme .topbar > .user-menu {
  box-sizing: border-box;
  width: auto;
  height: auto;
  min-height: 0;
  padding: .6rem 1rem;
  justify-self: end;
  justify-content: flex-end;
  gap: .35rem;
  background: transparent;
}

body.landing-theme .user-menu > span {
  display: inline;
  margin-right: .35rem;
  color: var(--landing-muted);
  font-size: .82rem;
}

body.landing-theme .user-menu .button.ghost {
  padding: .45rem .7rem;
  border-color: transparent;
  color: var(--landing-parchment);
  background: transparent;
}

body.landing-theme .user-menu .button.ghost:hover,
body.landing-theme .user-menu .button.ghost:focus-visible {
  border-color: var(--landing-line);
  color: #fff8df;
  background: rgba(232, 214, 170, .09);
}

/* One workspace, rather than translucent boxes floating over the art. */
body.landing-theme .app-shell {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: var(--entry-rail-width) minmax(0, 1fr);
  width: min(var(--entry-width), calc(100% - 2rem));
  min-height: 0;
  margin: 0 0 0 var(--entry-page-inset);
  border: 1px solid var(--landing-line);
  border-top: 0;
  background:
    linear-gradient(to bottom, rgba(20, 15, 10, .48), rgba(20, 15, 10, .78)),
    url("../images/darkwood.3de655b6fc0e.png");
  box-shadow: 0 12px 32px rgba(0, 0, 0, .42);
}

/* The chooser lives entirely in the campaign rail; leave the tavern art open. */
body.landing-theme-campaigns .app-shell {
  grid-template-columns: var(--entry-rail-width);
  width: calc(var(--entry-rail-width) + 2px);
}

body.landing-theme-campaigns .main-content {
  display: none;
}

body.landing-theme .sidebar {
  padding: .95rem .85rem;
  border-right: 1px solid var(--landing-line);
  background: rgba(10, 8, 6, .72);
}

body.landing-theme .sidebar-heading {
  margin-bottom: .65rem;
  color: var(--landing-muted);
  font-size: .72rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}

body.landing-theme .sidebar-heading a {
  color: var(--landing-gold);
}

body.landing-theme .campaign-link {
  border: 1px solid transparent;
  border-radius: 0;
  color: var(--landing-parchment);
}

body.landing-theme .campaign-link:hover,
body.landing-theme .campaign-link:focus-visible {
  border-color: var(--landing-line);
  color: #fff8df;
  background: rgba(224, 184, 92, .07);
}

body.landing-theme .muted {
  color: var(--landing-muted);
}

body.landing-theme .main-content {
  max-width: none;
  min-width: 0;
  padding: var(--entry-inset);
  background: rgba(8, 7, 5, .22);
}

/* Account pages use the same left alignment without a campaign rail. */
body.landing-theme-auth .app-shell {
  display: block;
  min-height: 0;
}

body.landing-theme-auth .sidebar {
  display: none;
}

body.landing-theme-auth .main-content.centered {
  display: block;
  min-height: 0;
}

body.landing-theme .landing-panel {
  border: 1px solid var(--landing-line);
  border-radius: 0;
  color: var(--landing-text);
  background: var(--landing-panel);
  box-shadow: 0 8px 22px var(--landing-shadow);
}

body.landing-theme .landing-campaign-panel {
  max-width: 800px;
  margin: 0;
  padding: 1rem 1.2rem;
}

body.landing-theme .landing-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

body.landing-theme h1,
body.landing-theme h2 {
  color: var(--landing-parchment);
  text-shadow: 0 2px 7px rgba(0, 0, 0, .72);
}

body.landing-theme h1 {
  margin: .15rem 0 0;
  font-family: Lato, Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: .025em;
  text-transform: uppercase;
}

body.landing-theme .eyebrow {
  margin: 0;
  color: var(--landing-gold);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.landing-theme .lede {
  color: var(--landing-muted);
}

body.landing-theme .button {
  border-radius: 2px;
  font-family: Lato, Inter, ui-sans-serif, system-ui, sans-serif;
}

body.landing-theme .button.primary {
  border: 2px solid var(--landing-copper);
  color: #fdf6e3;
  background: linear-gradient(to bottom, #4e392e 0%, #2f211a 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .3);
}

body.landing-theme .button.primary:hover,
body.landing-theme .button.primary:focus-visible {
  border-color: var(--landing-gold);
  color: #fffbe0;
  background: linear-gradient(to bottom, #5c4336 0%, #3b2a22 100%);
  box-shadow: 0 0 8px rgba(236, 179, 100, .4);
}

body.landing-theme .button.ghost {
  border-color: var(--landing-line);
  color: var(--landing-parchment);
  background: rgba(232, 214, 170, .06);
}

body.landing-theme .button.ghost:hover,
body.landing-theme .button.ghost:focus-visible {
  border-color: var(--landing-gold);
  color: #fff8df;
  background: rgba(232, 214, 170, .12);
}

body.landing-theme .card-grid {
  grid-template-columns: 1fr;
  gap: .65rem;
}

body.landing-theme .campaign-card,
body.landing-theme .empty-state {
  border: 1px solid var(--landing-gold-soft);
  border-radius: 0;
  color: var(--landing-parchment);
  background: rgba(17, 13, 10, .74);
  box-shadow: none;
}

body.landing-theme .campaign-card {
  min-height: 0;
  padding: .8rem .9rem;
}

body.landing-theme .campaign-card:hover,
body.landing-theme .campaign-card:focus-visible {
  border-color: rgba(236, 197, 107, .78);
  color: #fff5d8;
  background: rgba(33, 24, 17, .84);
}

body.landing-theme .card-icon {
  display: none;
}

body.landing-theme .campaign-card h2,
body.landing-theme .empty-state h2 {
  margin: 0 0 .25rem;
  font-family: Vollkorn, Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.2;
}

body.landing-theme .campaign-card p {
  margin: 0 0 .4rem;
  color: var(--landing-muted);
  line-height: 1.45;
}

body.landing-theme .card-action {
  color: var(--landing-gold);
  font-size: .88rem;
}

body.landing-theme .empty-state {
  grid-column: 1 / -1;
}

body.landing-theme-auth .auth-card {
  box-sizing: border-box;
  width: min(440px, 100%);
  margin: 0;
  padding: 1.25rem;
  text-align: left;
}

body.landing-theme-auth .auth-card h1 {
  margin-top: .25rem;
  font-size: 1.2rem;
}

body.landing-theme-auth .auth-card h1,
body.landing-theme-auth .auth-card .eyebrow {
  text-align: left;
}

body.landing-theme-auth .stacked-form {
  margin-top: 1.2rem;
}

body.landing-theme input,
body.landing-theme select,
body.landing-theme textarea {
  border-color: rgba(224, 184, 92, .28);
  border-radius: 2px;
  color: var(--landing-parchment);
  background: rgba(5, 4, 3, .58);
}

body.landing-theme input::placeholder {
  color: var(--landing-muted);
}

body.landing-theme label {
  color: var(--landing-parchment);
}

body.landing-theme .form-error {
  margin-top: .8rem;
  padding: .7rem .8rem;
  border: 1px solid rgba(198, 86, 76, .6);
  color: #ffd8c9;
  background: rgba(45, 13, 10, .58);
}

body.landing-theme :is(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--landing-gold);
  outline-offset: 3px;
}

@media (max-width: 850px) {
  body.landing-theme {
    --entry-page-inset: .5rem;
  }

  body.landing-theme .topbar,
  body.landing-theme .app-shell {
    width: calc(100% - 1rem);
  }

  body.landing-theme .app-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  body.landing-theme-campaigns .app-shell {
    width: calc(100% - 1rem);
  }

  body.landing-theme .sidebar {
    display: block;
    padding: .75rem;
    border-right: 0;
    border-bottom: 1px solid var(--landing-line);
  }

  body.landing-theme .sidebar-heading {
    margin-bottom: .4rem;
  }

  body.landing-theme .sidebar-heading + .campaign-link {
    margin-left: 0;
  }

  body.landing-theme .campaign-link {
    display: inline-block;
    margin: .1rem;
    padding: .45rem .55rem;
  }

  body.landing-theme .main-content,
  body.landing-theme-auth .main-content {
    min-height: 0;
  }

  body.landing-theme .landing-campaign-panel {
    max-width: none;
  }
}

@media (max-width: 760px) {
  body.landing-theme .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  body.landing-theme .topbar > .landing-brand {
    width: min(100%, 360px);
    height: auto;
    min-height: 0;
    padding: .35rem .6rem;
  }

  body.landing-theme .landing-brand picture {
    height: auto;
  }

  body.landing-theme .landing-brand img {
    width: 100%;
    max-height: none;
  }

  body.landing-theme .topbar > .user-menu {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: .45rem .6rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    justify-self: stretch;
    border-top: 1px solid var(--landing-line);
  }
}

@media (max-width: 600px) {
  body.landing-theme {
    background-attachment: scroll, scroll;
  }

  body.landing-theme .user-menu > span {
    display: block;
    width: 100%;
  }

  body.landing-theme .main-content,
  body.landing-theme-auth .main-content {
    padding: .75rem;
  }

  body.landing-theme .app-shell,
  body.landing-theme-auth .app-shell {
    min-height: 0;
  }

  body.landing-theme .landing-heading {
    align-items: stretch;
    flex-direction: column;
  }

  body.landing-theme .landing-heading .button {
    width: 100%;
  }

  body.landing-theme .landing-campaign-panel,
  body.landing-theme-auth .auth-card {
    padding: 1rem;
  }

  body.landing-theme h1 {
    font-size: 1.05rem;
  }

  body.landing-theme .campaign-card h2,
  body.landing-theme .empty-state h2 {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.landing-theme *,
  body.landing-theme *::before,
  body.landing-theme *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
