@font-face {
  font-family: "Moire W01";
  src: url("/assets/fonts/moire-w01-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  /* main background color.
   * Use it to create contrast with the background image and be able to create elements
   * on top of it. Like a container, card, etc.
   **/
  --bg-color: #EEEAEB;
  /* main baground color as well, but darker. */
  --bg-color-dark: #8A8987;
  /* color for error messages, warnings, etc. */
  --danger-color: #D67B74;
  /* main color for the app. Use it for buttons, links, etc. */
  --primary-color: #2B5BA1;
  /* color for success messages, confirmations, etc. */
  --confirm-color: #86CD83;
  /* color for secondary elements, like secondary buttons, links, etc. */
  --secondary-color: #D67B74;
  /* color for text. Use it for main text, headings, etc. over dark backgrounds, like danger, primary, secondary, bg-color-dark */
  --text-light: #F8F6FA;
  /* color for text. Use it for main text, headings, etc. over light backgrounds, like confirm or bg-color */
  --text-dark: #16233D;

  --panel-bg: rgba(238, 234, 235, 0.72);
  --panel-border: rgba(43, 91, 161, 0.18);
  --navbar-bg: rgba(238, 234, 235, 0.72);
  --navbar-border: rgba(43, 91, 161, 0.18);
  --shadow-soft: 0 18px 36px rgba(37, 15, 22, 0.28);
  --font-display: "Moire W01", "Baskerville", "Iowan Old Style", serif;
  --font-ui: "Moire W01", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Moire W01", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.site-bg {
  position: relative;
  min-height: 100vh;
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: clamp(1.02rem, 0.98rem + 0.22vw, 1.12rem);
  font-weight: 500;
  line-height: 1.66;
  background-image: url("/assets/bkgnd.avif");
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
}

.background-media {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.background-media::after {
  content: none;
}

.background-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 1.2rem clamp(1rem, 2.4vw, 2.4rem) 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.navbar,
.content-rail {
  width: min(800px, 62vw);
  margin-left: auto;
}

.navbar {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 21px;
  background:
    linear-gradient(145deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(238, 234, 235, 0.14) 34%,
      rgba(137, 174, 223, 0.12) 60%,
      rgba(67, 113, 182, 0.18) 100%);
  box-shadow:
    0 10px 32px rgba(17, 8, 16, 0.18),
    inset 1px 1px 0 rgba(255, 255, 255, 0.52),
    inset -1px -1px 0 rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(20px) saturate(142%);
  backdrop-filter: blur(20px) saturate(142%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 1rem;
  margin-bottom: 0.5rem;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.logo {
  width: auto;
  height: clamp(42px, 5.2vw, 56px);
}

.logo.main_page {
  height: clamp(96px, 13.2vw, 210px);
}

.hero-logo-shell {
  position: relative;
  display: inline-grid;
  place-items: center;
  isolation: isolate;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1);
  will-change: transform;
  cursor: pointer;
  z-index: 10;
}

.hero-logo-shell.is-hovering {
  transition: transform 0.1s ease-out;
}

.hero-logo-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0) 42%,
      rgba(255, 255, 255, 0.6) 50%,
      rgba(255, 255, 255, 0) 58%,
      rgba(255, 255, 255, 0) 100%);
  background-size: 300% 100%;
  -webkit-mask-image: url("/assets/kasamaro_logo.svg");
  mask-image: url("/assets/kasamaro_logo.svg");
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  transform: scale(1.01) translateZ(5px);
  z-index: 3;
  animation: logo-sweep 10s linear infinite;
  pointer-events: none;
}

.hero-logo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-image: url("/assets/kasamaro_logo.svg");
  mask-image: url("/assets/kasamaro_logo.svg");
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  transform: scale(1.01) translateZ(10px);
  transform-origin: center;
  z-index: 2;
}

.hero-logo-image {
  position: relative;
  z-index: 1;
  display: block;
  pointer-events: none;
  filter:
    drop-shadow(0 0 8px rgba(177, 217, 255, 0.8)) drop-shadow(0 0 16px rgba(125, 137, 189, 0.4));
  animation: logo-border-glow 4s ease-in-out infinite alternate;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-tab {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.84rem;
  border: 1px solid rgba(43, 91, 161, 0.22);
  border-radius: 999px;
  padding: 0.36rem 0.72rem;
  background: rgba(255, 255, 255, 0.22);
}

.nav-tab:hover {
  border-color: rgba(43, 91, 161, 0.5);
  background: rgba(255, 255, 255, 0.36);
}

.panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  border-radius: 21px;
  background:
    linear-gradient(145deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(238, 234, 235, 0.14) 34%,
      rgba(137, 174, 223, 0.12) 60%,
      rgba(67, 113, 182, 0.18) 100%);
  box-shadow:
    0 22px 46px rgba(17, 8, 16, 0.28),
    inset 1px 1px 0 rgba(255, 255, 255, 0.52),
    inset -1px -1px 0 rgba(255, 255, 255, 0.1),
    inset 14px 14px 24px rgba(255, 255, 255, 0.07),
    inset -18px -16px 28px rgba(43, 91, 161, 0.16);
  -webkit-backdrop-filter: blur(15px) saturate(142%);
  backdrop-filter: blur(15px) saturate(142%);
  padding: clamp(0.96rem, 1.8vw, 1.35rem);
}

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}

.panel::before {
  inset: 1px;
  background:
    linear-gradient(155deg,
      rgba(255, 255, 255, 0.48) 0%,
      rgba(255, 255, 255, 0.16) 24%,
      rgba(255, 255, 255, 0.03) 42%,
      rgba(134, 205, 131, 0.08) 58%,
      rgba(43, 91, 161, 0.16) 100%);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.55),
    inset -10px -12px 24px rgba(55, 86, 146, 0.12);
  opacity: 0.92;
}

.panel::after {
  inset: -24% -10%;
  border-radius: 38%;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.12) 16%, rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 82% 88%, rgba(43, 91, 161, 0.16) 0%, rgba(43, 91, 161, 0) 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.22) 12%, rgba(255, 255, 255, 0) 42%);
  filter: blur(14px);
  opacity: 0.58;
  transform: translate3d(-2%, 0, 0) rotate(-5deg);
  animation: panel-drift 20s ease-in-out infinite alternate;
}

.panel>* {
  position: relative;
  z-index: 1;
}

.home-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.15rem;
  perspective: 1200px;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.8vw, 3.55rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0.03em;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.32);
}

.lead {
  margin-top: 0.45rem;
  margin-bottom: 0;
  font-size: clamp(1.04rem, 0.99rem + 0.24vw, 1.18rem);
  line-height: 1.62;
  max-width: 50ch;
  color: rgba(22, 35, 61, 0.88);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.34),
    0 -1px 0 rgba(22, 35, 61, 0.12);
  text-wrap: pretty;
}

.muted {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0.92rem 0 0;
  opacity: 0.86;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3),
    0 -1px 0 rgba(22, 35, 61, 0.1);
}

code {
  font-family: "Victor Mono", monospace;
  font-weight: 500;
  font-style: italic;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.72rem;
  margin-top: 1.05rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 3.2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.8rem 1.8rem;
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: clamp(0.92rem, 0.9rem + 0.1vw, 1.08rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  backdrop-filter: blur(40px) saturate(200%);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  transition:
    transform 220ms cubic-bezier(0.2, 1, 0.3, 1),
    filter 220ms ease,
    box-shadow 220ms ease;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom,
      rgba(255, 255, 255, 0.35) 0%,
      rgba(255, 255, 255, 0.05) 100%);
  z-index: 1;
  pointer-events: none;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(110deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0) 40%,
      rgba(255, 255, 255, 0.22) 50%,
      rgba(255, 255, 255, 0) 60%,
      rgba(255, 255, 255, 0) 100%);
  background-size: 200% 100%;
  background-position: 150% 0;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.btn:hover::after,
.btn:focus-visible::after {
  opacity: 1;
  animation: btn-sweep 1.4s linear forwards;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.12),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  color: #FFFFFF;
  background: linear-gradient(150deg, rgba(43, 91, 161, 0.35) 0%, rgba(26, 66, 108, 0.5) 100%);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
  color: var(--text-dark);
  background: linear-gradient(150deg, rgba(134, 205, 131, 0.35) 0%, rgba(93, 149, 89, 0.5) 100%);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
}

.btn-sm {
  min-height: 2.45rem;
  padding: 0.62rem 0.92rem;
  font-size: 0.8rem;
}

.instruction-list {
  margin: 0.62rem 0 0;
  padding-left: 1.3rem;
  font-size: 0.96rem;
  line-height: 1.62;
  max-width: 50ch;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.32),
    0 -1px 0 rgba(22, 35, 61, 0.1);
}

.form-grid {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28),
    0 -1px 0 rgba(22, 35, 61, 0.1);
}

.input,
.select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(37, 15, 22, 0.25);
  background: rgba(247, 243, 248, 0.56);
  color: var(--text-dark);
  font: inherit;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.4;
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  backdrop-filter: blur(10px) saturate(130%);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.36),
    inset -1px -1px 0 rgba(255, 255, 255, 0.08);
  padding: 0.8rem 0.92rem;
}

.notice {
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 0.84rem 0.98rem;
  margin-top: 1rem;
  font-family: var(--font-ui);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.24),
    0 -1px 0 rgba(22, 35, 61, 0.1);
}

.notice-error {
  background: rgba(214, 123, 116, 0.28);
  border-color: rgba(22, 35, 61, 0.24);
  color: var(--text-dark);
}

.notice-success {
  background: rgba(134, 205, 131, 0.28);
  border-color: rgba(22, 35, 61, 0.18);
  color: var(--text-dark);
}

.kv-list {
  margin: 1.1rem 0 0;
  display: grid;
  gap: 0.7rem;
}

.kv-row {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.62rem 0.72rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.kv-key {
  font-weight: 700;
}

.kv-value {
  margin: 0;
  word-break: break-word;
}

.email-value-wrap.hidden {
  display: none;
}

.email-value-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.email-edit-toggle {
  min-height: 2rem;
  padding: 0.5rem 0.7rem;
}

.email-edit-form.hidden {
  display: none;
}

.email-edit-form {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.section-title {
  margin: 1.25rem 0 0;
  font-family: var(--font-ui);
  font-size: 1.06rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.character-list {
  list-style: none;
  margin: 0.72rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.72rem;
}

.character-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.72rem;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.character-name-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.62rem;
  min-width: 0;
}

.status-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  margin-top: 0.36rem;
  flex: 0 0 auto;
}

.status-online {
  background: #5abf74;
  box-shadow: 0 0 0 2px rgba(90, 191, 116, 0.24);
}

.status-offline {
  background: #9d9fa4;
  box-shadow: 0 0 0 2px rgba(157, 159, 164, 0.24);
}

.character-name {
  margin: 0;
  font-weight: 700;
  word-break: break-word;
}

.character-meta {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
  opacity: 0.88;
}

.character-action {
  flex: 0 0 auto;
}

.character-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tool-list {
  list-style: none;
  padding: 0;
  margin: 0.85rem 0 0;
}

.calc-group {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.12);
}

.calc-group legend {
  padding: 0 0.45rem;
  font-weight: 700;
}

.result-box {
  margin-top: 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.78rem;
  background: rgba(255, 255, 255, 0.12);
}

@keyframes panel-drift {
  from {
    transform: translate3d(-2%, 0, 0) rotate(-5deg);
    filter: blur(12px);
    opacity: 0.46;
  }

  50% {
    transform: translate3d(0.5%, -1.2%, 0) rotate(-3deg);
    filter: blur(14px);
    opacity: 0.56;
  }

  to {
    transform: translate3d(2.5%, 0.8%, 0) rotate(-1deg);
    filter: blur(16px);
    opacity: 0.64;
  }
}

@keyframes logo-border-glow {
  0% {
    filter:
      drop-shadow(0 0 6px rgba(177, 217, 255, 0.6)) drop-shadow(0 0 12px rgba(125, 137, 189, 0.3));
  }

  100% {
    filter:
      drop-shadow(0 0 12px rgba(177, 217, 255, 0.9)) drop-shadow(0 0 24px rgba(125, 137, 189, 0.6));
  }
}

@keyframes logo-sweep {
  0% {
    background-position: 150% 0;
  }

  100% {
    background-position: -150% 0;
  }
}

@keyframes btn-sweep {
  0% {
    background-position: 150% 0;
  }

  100% {
    background-position: -150% 0;
  }
}

@media (prefers-reduced-motion: reduce) {

  .panel::after,
  .hero-logo-shell::before,
  .hero-logo-shell::after {
    animation: none;
  }
}

@media (max-width: 960px) {

  .navbar,
  .content-rail {
    width: min(720px, 76vw);
  }
}

@media (max-width: 720px) {
  body.site-bg {
    background-position: 25% center;
    background-attachment: scroll;
  }

  .content-rail {
    width: 100%;
  }

  .kv-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .page-shell {
    display: block;
  }

  .panel {
    border-radius: 20px;
    padding: 1.15rem;
  }

  .lead,
  .instruction-list {
    max-width: none;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .character-row {
    flex-direction: column;
    align-items: stretch;
  }

  .character-action .btn {
    width: 100%;
  }

  .character-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .navbar {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: center;
  }

  .nav-tabs,
  .nav-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
}
