* { box-sizing: border-box; }

:root {
  --bg-overlay: linear-gradient(
    90deg,
    rgba(5, 8, 16, 0.72) 0%,
    rgba(7, 12, 24, 0.54) 26%,
    rgba(7, 12, 24, 0.30) 52%,
    rgba(8, 10, 16, 0.62) 100%
  );
  --header-bar-height: 40px;
  --menu-font-size: 0.92rem;
  --header-logo-width: 132px;
  --header-logo-height: 20px;
  --header-logo-left-padding: 0px;
  --header-logo-mobile-width: 110px;
  --portal-button-height: calc(var(--header-bar-height) - 8px);
  --logo-frame-height: var(--header-logo-height);
}

body {
  margin: 0;
  min-height: 100vh;
  color: #f8efe5;
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: #050505;
  background-image: var(--bg-overlay), var(--page-bg-image);
  background-size: cover;
  background-position: 74% center;
  background-repeat: no-repeat;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: rgba(3, 6, 14, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner,
.footer-inner {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
}

.topbar-inner {
  height: var(--header-bar-height);
  min-height: var(--header-bar-height);
  padding: 0;
  display: grid;
  grid-template-columns:
    minmax(110px, calc(var(--header-logo-width) + var(--header-logo-left-padding)))
    minmax(0, 1fr)
    auto;
  align-items: center;
  gap: 1.15rem;
}

.topbar-zone {
  min-width: 0;
}

.topbar-zone-left {
  justify-self: start;
  width: calc(var(--header-logo-width) + var(--header-logo-left-padding));
  padding-left: var(--header-logo-left-padding);
}

.topbar-zone-center {
  justify-self: stretch;
  display: flex;
  justify-content: center;
}

.topbar-zone-right {
  justify-self: end;
}

.brand {
  width: var(--header-logo-width);
  height: var(--header-logo-height);
  max-height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.brand-frame {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.brand img {
  width: var(--header-logo-width);
  height: var(--header-logo-height);
  max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: left center;
  image-rendering: -webkit-optimize-contrast;
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(1rem, 2vw, 2.4rem);
}

nav a {
  display: inline-flex;
  align-items: center;
  color: #f3e9de;
  text-decoration: none;
  font-size: var(--menu-font-size);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  height: var(--portal-button-height);
}

nav a:hover,
nav a:focus-visible,
.portal-login:hover,
.portal-login:focus-visible {
  color: #ffffff;
}

.portal-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  color: #f3e9de;
  text-decoration: none;
  font-size: var(--menu-font-size);
  font-weight: 600;
  line-height: 1;
  border: 1px solid #f08a3f;
  height: var(--portal-button-height);
  padding: 0 1rem;
  border-radius: 2px;
  white-space: nowrap;
}

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 4.2rem 0 5.8rem;
}

.overlay {
  max-width: 640px;
}

h1 {
  font-size: clamp(2.4rem, 4.9vw, 3.45rem);
  margin: 0 0 1rem;
  line-height: 1.13;
  letter-spacing: 0.01em;
}

p {
  font-size: clamp(1.1rem, 2vw, 2rem);
  color: #e2dfde;
  margin: 0;
  line-height: 1.45;
  max-width: 760px;
}

.hero-cta {
  margin-top: 2rem;
  display: inline-block;
  background: #ef8039;
  color: #fff;
  text-decoration: none;
  font-size: 1.8rem;
  font-weight: 700;
  padding: 0.86rem 2rem;
  border-radius: 4px;
  min-width: 178px;
  text-align: center;
}

.inner-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 3rem 0 3.5rem;
  gap: 1rem;
  overflow-x: hidden;
}

.inner-page > .content-card,
.inner-page > .page-grid-canvas,
.inner-page > .page-free-canvas {
  width: 100%;
}

.content-card {
  max-width: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.content-card h1 {
  margin: 0;
}

.page-grid-canvas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.page-free-canvas {
  position: relative;
  min-height: 40px;
  max-width: 100%;
  overflow-x: hidden;
}

.page-block {
  --layout-max-width: 1020px;
  --width-scale: 1;
  width: 100%;
  max-width: calc(var(--layout-max-width) * var(--width-scale));
  box-sizing: border-box;
  margin: 0;
  background: rgba(6, 6, 6, 0.58);
  border: 1px solid rgba(243, 163, 84, 0.24);
  border-radius: 14px;
  padding: 1.5rem;
}

.page-block.align-left { justify-self: start; }
.page-block.align-center { justify-self: center; }
.page-block.align-right { justify-self: end; }
.page-block.align-stretch { justify-self: stretch; }

.page-grid-canvas .page-block { order: var(--block-order, 0); }
.page-grid-canvas .page-block.col-start-1 { grid-column-start: 1; }
.page-grid-canvas .page-block.col-start-2 { grid-column-start: 2; }
.page-grid-canvas .page-block.col-start-auto { grid-column-start: auto; }
.page-grid-canvas .page-block.col-span-1 { grid-column-end: span 1; }
.page-grid-canvas .page-block.col-span-2 { grid-column: 1 / span 2; }

.page-free-canvas .page-block.position-free {
  position: absolute;
  left: clamp(0px, var(--free-x, 0px), calc(100% - min(100%, var(--free-width, 420px))));
  top: var(--free-y, 0px);
  width: min(100%, var(--free-width, 420px));
  max-width: 100%;
  z-index: var(--free-z, 1);
}

.page-block.outline-on { border: 1px solid rgba(243, 163, 84, 0.24); }
.page-block.outline-off { border-color: transparent; }
.page-block.fill-filled { background: rgba(6, 6, 6, 0.58); }
.page-block.fill-transparent { background: transparent; }

.page-block .rich-text p,
.page-block .rich-text li {
  font-size: 1.1rem;
}

.page-block .block-title {
  margin: 0 0 0.75rem;
  color: #f4ddc6;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.page-block .block-title.title-small { font-size: 1rem; }
.page-block .block-title.title-medium { font-size: 1.2rem; }
.page-block .block-title.title-large { font-size: 1.45rem; }
.page-block .block-title.title-xlarge { font-size: clamp(1.55rem, 3.1vw, 1.9rem); }
.page-block .block-title.is-bold { font-weight: 700; }
.page-block .block-title.is-italic { font-style: italic; }

.page-block figure { margin: 0; }

.page-block img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.page-block figcaption {
  color: #c6b5a3;
  font-size: 0.92rem;
  margin-top: 0.55rem;
}

.page-block.type-text_media.layout-two-column,
.page-block.type-text_media.layout-text-left-image-right,
.page-block.type-text_media.layout-image-left-text-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: center;
}

.page-block.layout-left {
  --layout-max-width: 760px;
  margin-right: auto;
  margin-left: 0;
}

.page-block.layout-right {
  --layout-max-width: 760px;
  margin-left: auto;
  margin-right: 0;
}

.page-block.layout-center {
  --layout-max-width: 760px;
}

.page-block.layout-two-column,
.page-block.layout-text-left-image-right,
.page-block.layout-image-left-text-right,
.page-block.layout-full {
  --layout-max-width: 1020px;
}

.page-block.width-narrow { --width-scale: 0.4; }
.page-block.width-medium { --width-scale: 0.6; }
.page-block.width-wide { --width-scale: 0.8; }
.page-block.width-full { --width-scale: 1; }

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-inner {
  padding: 1rem 0;
  color: #c6b5a3;
  font-size: 0.9rem;
}

.home-page footer {
  border-top: 0;
}

@media (max-width: 900px) {
  :root {
    --header-bar-height: auto;
    --portal-button-height: 32px;
    --logo-frame-height: 22px;
  }

  body {
    background-position: 66% center;
  }

  .topbar-inner {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem 0;
    height: auto;
    justify-items: center;
  }

  .topbar-zone-left,
  .topbar-zone-center,
  .topbar-zone-right {
    justify-self: center;
  }

  .topbar-zone-left {
    width: var(--header-logo-mobile-width, var(--header-logo-width));
    padding-left: 0;
  }

  .brand {
    width: var(--header-logo-mobile-width, var(--header-logo-width));
    justify-content: center;
  }

  .brand-frame {
    justify-content: center;
  }

  .brand img {
    width: var(--header-logo-mobile-width, var(--header-logo-width));
  }

  nav {
    flex-wrap: wrap;
    gap: 1.1rem 1.8rem;
  }

  .hero,
  .inner-page,
  .topbar-inner,
  .footer-inner {
    width: min(1180px, calc(100% - 34px));
  }

  .hero {
    padding: 3rem 0 4rem;
  }

  h1 {
    font-size: clamp(2rem, 7vw, 2.9rem);
  }

  .hero-cta {
    font-size: 1.25rem;
  }

  .page-block.type-text_media.layout-two-column,
  .page-block.type-text_media.layout-text-left-image-right,
  .page-block.type-text_media.layout-image-left-text-right {
    grid-template-columns: 1fr;
  }

  .page-block {
    max-width: 100%;
  }

  .page-grid-canvas {
    grid-template-columns: 1fr;
  }

  .page-grid-canvas .page-block {
    grid-column: 1 / span 1 !important;
    justify-self: stretch;
  }

  .page-free-canvas .page-block.position-free {
    position: static;
    width: 100%;
    left: auto;
    top: auto;
    z-index: auto;
    margin-bottom: 1rem;
  }
}
