:root {
  --ink: #17321f;
  --deep: #123722;
  --forest: #1f6b42;
  --moss: #4d9b57;
  --leaf: #84c96c;
  --sky: #79d4e5;
  --sky-deep: #35a9c4;
  --cream: #fff8df;
  --paper: #fffdf4;
  --coral: #f46d57;
  --rose: #ffc0ad;
  --gold: #f5b72b;
  --line: rgba(23, 50, 31, 0.16);
  --shadow: rgba(18, 55, 34, 0.22);
  --pixel: 4px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(244, 109, 87, 0.22), transparent 18rem),
    radial-gradient(circle at 84% 18%, rgba(121, 212, 229, 0.48), transparent 22rem),
    radial-gradient(circle at 76% 86%, rgba(132, 201, 108, 0.46), transparent 24rem),
    linear-gradient(145deg, var(--cream), #e7f9e7 58%, #d7f3f6);
  background-size: 18px 18px, 18px 18px, auto, auto, auto, auto;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: "Cooper Black", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

h2 {
  margin-bottom: 0.35rem;
}

.home-shell,
.auth-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
  margin-bottom: clamp(1rem, 3vw, 2rem);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  width: min(260px, 48vw);
  text-decoration: none;
}

.brand-mark img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 12px rgba(23, 50, 31, 0.14));
}

.nav-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav-link,
.nav-button,
.big-cta,
button,
.back-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  color: var(--ink);
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    inset 0 -3px 0 rgba(18, 55, 34, 0.12),
    0 6px 0 rgba(31, 107, 66, 0.18),
    0 14px 28px rgba(31, 107, 66, 0.12);
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.nav-link,
.back-link {
  padding: 0.65rem 0.95rem;
  background: rgba(255, 253, 244, 0.72);
}

.nav-button,
.big-cta.primary,
button {
  padding: 0.75rem 1rem;
  background:
    radial-gradient(circle at 18% 25%, rgba(255, 255, 255, 0.86) 0 0.13rem, transparent 0.16rem),
    linear-gradient(135deg, var(--leaf), var(--sky));
}

.big-cta.secondary {
  padding: 0.75rem 1rem;
  background:
    radial-gradient(circle at 18% 25%, rgba(255, 255, 255, 0.78) 0 0.13rem, transparent 0.16rem),
    linear-gradient(135deg, var(--gold), var(--rose));
}

.nav-link:hover,
.nav-button:hover,
.big-cta:hover,
button:hover,
.back-link:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.nav-link:active,
.nav-button:active,
.big-cta:active,
button:active,
.back-link:active {
  transform: translateY(0);
  box-shadow:
    inset 0 -2px 0 rgba(18, 55, 34, 0.1),
    0 3px 0 rgba(31, 107, 66, 0.18),
    0 8px 18px rgba(31, 107, 66, 0.1);
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(420px, 1.02fr);
  gap: clamp(1rem, 4vw, 2.4rem);
  align-items: center;
}

.hero-copy {
  position: relative;
  padding: clamp(1.2rem, 4vw, 2.4rem);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.94), transparent 16rem),
    linear-gradient(160deg, rgba(255, 253, 244, 0.9), rgba(255, 248, 223, 0.7));
  box-shadow: 0 24px 70px rgba(31, 107, 66, 0.16);
  backdrop-filter: blur(18px);
}

.hero-copy::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent 0 46%, rgba(31, 107, 66, 0.06) 46% 54%, transparent 54%),
    linear-gradient(transparent 0 46%, rgba(31, 107, 66, 0.05) 46% 54%, transparent 54%);
  background-size: 38px 38px;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.hero-copy > * {
  position: relative;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 720px;
  font-size: clamp(2.55rem, 6.4vw, 5.5rem);
}

.lede,
.auth-hero p,
.auth-card p,
.login-art p,
.feature-row p {
  color: #486c4b;
  line-height: 1.6;
}

.lede {
  max-width: 660px;
  margin: 1.1rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.22rem);
}

.hero-actions {
  margin-top: 1.35rem;
}

.big-cta {
  min-width: 172px;
  min-height: 58px;
  font-size: 1.08rem;
}

.session-chip {
  display: inline-flex;
  align-items: center;
  margin-top: 1.1rem;
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: #f7ffe9;
  font-weight: 900;
  background: rgba(18, 55, 34, 0.92);
  box-shadow: 0 10px 22px rgba(18, 55, 34, 0.16);
}

.world-preview {
  position: relative;
  min-height: min(570px, 70dvh);
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.82);
  border-radius: 36px;
  background:
    linear-gradient(180deg, #99e4f0 0 42%, #b6e78c 42% 65%, #7fc469 65% 100%);
  box-shadow:
    inset 0 0 0 4px rgba(18, 55, 34, 0.1),
    0 26px 70px rgba(31, 107, 66, 0.24);
  image-rendering: pixelated;
}

.world-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.14) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 2px, transparent 2px);
  background-size: 28px 28px;
  pointer-events: none;
}

.sun,
.cloud,
.mountains,
.town,
.path,
.avatar,
.caption-card {
  position: absolute;
}

.sun {
  top: 48px;
  right: 66px;
  width: 76px;
  height: 76px;
  background: var(--gold);
  border: 5px solid #fff3b3;
  box-shadow: 0 0 0 5px rgba(245, 183, 43, 0.28);
}

.cloud {
  width: 112px;
  height: 34px;
  background: #fff8df;
  box-shadow: 34px -14px 0 #fff8df, 72px 0 0 #fff8df;
  opacity: 0.9;
}

.cloud-a {
  top: 92px;
  left: 72px;
}

.cloud-b {
  top: 155px;
  right: 170px;
  transform: scale(0.7);
}

.mountains {
  left: -30px;
  right: -30px;
  bottom: 35%;
  height: 130px;
  background:
    linear-gradient(135deg, transparent 0 38%, #5da96b 38% 58%, transparent 58%) 0 0 / 240px 130px repeat-x,
    linear-gradient(135deg, transparent 0 42%, #3f8754 42% 62%, transparent 62%) 90px 18px / 280px 130px repeat-x;
}

.town {
  left: 8%;
  right: 8%;
  bottom: 28%;
  height: 190px;
}

.house,
.tavern {
  position: absolute;
  bottom: 0;
  border: 5px solid var(--deep);
  box-shadow: 8px 8px 0 rgba(18, 55, 34, 0.2);
}

.house::before,
.tavern::before {
  content: '';
  position: absolute;
  left: -12px;
  right: -12px;
  top: -46px;
  height: 46px;
  background: var(--coral);
  border: 5px solid var(--deep);
  transform: skewX(-18deg);
}

.house span,
.tavern span {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 34px;
  height: 52px;
  transform: translateX(-50%);
  background: #794f35;
  border: 4px solid var(--deep);
}

.house-a {
  left: 0;
  width: 124px;
  height: 110px;
  background: #fff0a7;
}

.tavern {
  left: 50%;
  width: 170px;
  height: 142px;
  transform: translateX(-50%);
  background: #ffd98f;
}

.tavern::after {
  content: 'TAVERN';
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.2rem 0.42rem;
  color: #fff8df;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  background: var(--forest);
  border: 3px solid var(--deep);
}

.house-b {
  right: 0;
  width: 126px;
  height: 112px;
  background: #c6f4ff;
}

.house-b::before {
  background: var(--sky-deep);
}

.path {
  left: 50%;
  bottom: -20%;
  width: 190px;
  height: 48%;
  transform: translateX(-50%) perspective(140px) rotateX(26deg);
  background:
    repeating-linear-gradient(90deg, rgba(18, 55, 34, 0.14) 0 8px, transparent 8px 24px),
    #f4d995;
  border-left: 5px solid rgba(18, 55, 34, 0.16);
  border-right: 5px solid rgba(18, 55, 34, 0.16);
}

.avatar {
  bottom: 64px;
  width: 36px;
  height: 48px;
  border: 4px solid var(--deep);
  box-shadow: 5px 5px 0 rgba(18, 55, 34, 0.18);
}

.avatar::before {
  content: '';
  position: absolute;
  top: -24px;
  left: 4px;
  width: 20px;
  height: 20px;
  border: 4px solid var(--deep);
  background: #ffd7b0;
}

.human-avatar {
  left: calc(50% - 64px);
  background: var(--coral);
}

.ai-avatar {
  left: calc(50% + 32px);
  background: var(--sky);
}

.ai-avatar::before {
  border-radius: 50%;
  background: #d9fbff;
}

.caption-card {
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  color: #f7ffe9;
  background: rgba(18, 55, 34, 0.92);
  box-shadow: 0 10px 22px rgba(18, 55, 34, 0.18);
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.feature-row article,
.auth-card,
.auth-hero,
.login-art {
  border: 2px solid rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.94), transparent 17rem),
    rgba(255, 253, 244, 0.74);
  box-shadow: 0 20px 55px rgba(31, 107, 66, 0.15);
  backdrop-filter: blur(18px);
}

.feature-row article {
  min-height: 168px;
  padding: 1.2rem;
  border-radius: 26px;
}

.feature-row span {
  display: inline-flex;
  margin-bottom: 0.9rem;
  color: var(--coral);
  font-weight: 950;
  letter-spacing: 0.16em;
}

.feature-row h2 {
  margin-bottom: 0.45rem;
  font-size: 1.25rem;
}

.feature-row p {
  margin-bottom: 0;
}

.auth-shell {
  padding-top: 1.2rem;
}

.back-link {
  margin-bottom: 1rem;
}

.auth-hero {
  margin-bottom: 1rem;
  padding: clamp(1.2rem, 4vw, 2.1rem);
  border-radius: 32px;
  text-align: center;
}

.auth-hero img {
  width: min(460px, 100%);
  height: auto;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 10px 14px rgba(23, 50, 31, 0.12));
}

.auth-hero h1 {
  max-width: 820px;
  margin: 0 auto;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.auth-hero p {
  max-width: 740px;
  margin: 0.9rem auto 0;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.auth-card,
.login-art {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
}

.auth-card::before,
.login-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(31, 107, 66, 0.045) 2px, transparent 2px),
    linear-gradient(90deg, rgba(31, 107, 66, 0.04) 2px, transparent 2px);
  background-size: 28px 28px;
  pointer-events: none;
}

.auth-card > *,
.login-art > * {
  position: relative;
}

.human-card {
  background:
    radial-gradient(circle at 10% 0%, rgba(245, 183, 43, 0.34), transparent 16rem),
    rgba(255, 253, 244, 0.78);
}

.ai-card {
  background:
    radial-gradient(circle at 90% 0%, rgba(121, 212, 229, 0.42), transparent 16rem),
    rgba(255, 253, 244, 0.78);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.2rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 0 rgba(31, 107, 66, 0.16);
}

.badge.human {
  background: linear-gradient(135deg, var(--gold), #ffe5a0);
}

.badge.login {
  background: linear-gradient(135deg, var(--sky), #cdf7ff);
}

.badge.ai {
  background: linear-gradient(135deg, var(--leaf), var(--sky));
}

.badge.api {
  background: linear-gradient(135deg, var(--coral), #ffc0ad);
}

.mini-note {
  color: #5f805f;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

label {
  display: grid;
  gap: 0.34rem;
  color: var(--deep);
  font-weight: 950;
}

input,
textarea {
  width: 100%;
  border: 2px solid rgba(31, 107, 66, 0.18);
  border-radius: 18px;
  padding: 0.82rem 0.9rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  outline: none;
  box-shadow: inset 0 -2px 0 rgba(31, 107, 66, 0.06);
}

input:focus,
textarea:focus {
  border-color: rgba(31, 107, 66, 0.48);
  box-shadow:
    0 0 0 4px rgba(121, 212, 229, 0.24),
    inset 0 -2px 0 rgba(31, 107, 66, 0.06);
}

textarea {
  min-height: 6.4rem;
  resize: vertical;
}

.ghost-button {
  width: 100%;
  margin-top: 0.85rem;
  background: rgba(255, 255, 255, 0.62);
}

.secret-box,
.code {
  margin-top: 1rem;
  border-radius: 20px;
  border: 2px dashed rgba(255, 255, 255, 0.38);
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 2px, transparent 2px),
    rgba(18, 55, 34, 0.96);
  background-size: 18px 18px;
  color: #f5ffe9;
}

.secret-box {
  padding: 1rem;
}

.secret-box strong {
  color: #ffdf75;
}

pre {
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.secret-box pre,
.code {
  padding: 1rem;
  margin-bottom: 0;
}

.code.compact {
  font-size: 0.86rem;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
  align-items: stretch;
}

.login-art {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 640px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(121, 212, 229, 0.5), transparent 15rem),
    linear-gradient(180deg, rgba(255, 253, 244, 0.84), rgba(232, 249, 231, 0.76));
}

.login-art img {
  width: min(360px, 100%);
  margin: 0 auto 1rem;
}

.login-art h1 {
  font-size: clamp(2.15rem, 4.6vw, 3.8rem);
}

.pixel-door {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 0.8rem auto 1.2rem;
}

.door-glow {
  position: absolute;
  inset: 8px;
  background: radial-gradient(circle, rgba(245, 183, 43, 0.58), transparent 70%);
}

.door {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 120px;
  height: 150px;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 12px, transparent 12px),
    #7a5136;
  border: 6px solid var(--deep);
  border-radius: 58px 58px 10px 10px;
  box-shadow: 10px 10px 0 rgba(18, 55, 34, 0.2);
}

.door::after {
  content: '';
  position: absolute;
  right: 22px;
  top: 78px;
  width: 13px;
  height: 13px;
  background: var(--gold);
  border: 3px solid var(--deep);
}

.lantern {
  position: absolute;
  bottom: 52px;
  width: 34px;
  height: 46px;
  background: var(--gold);
  border: 5px solid var(--deep);
  box-shadow: 0 0 0 5px rgba(245, 183, 43, 0.24);
}

.lantern-left {
  left: 0;
}

.lantern-right {
  right: 0;
}

.login-stack {
  display: grid;
  gap: 1rem;
}

.auth-footer {
  margin: 1rem 0 0;
  text-align: center;
  color: #4b704f;
  font-weight: 900;
}

.auth-footer a {
  color: var(--forest);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 2rem));
  padding: 0.9rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  color: #f5ffe9;
  background: rgba(18, 55, 34, 0.96);
  box-shadow: 0 18px 40px rgba(18, 55, 34, 0.28);
  z-index: 10;
}

@media (max-width: 980px) {
  .hero-split,
  .auth-grid,
  .login-layout,
  .feature-row {
    grid-template-columns: 1fr;
  }

  .world-preview {
    min-height: 520px;
  }

  .login-art {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .top-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions,
  .hero-actions {
    width: 100%;
  }

  .nav-link,
  .nav-button,
  .big-cta {
    flex: 1 1 auto;
  }

  .hero-copy h1 {
    font-size: clamp(2.35rem, 13vw, 3.6rem);
  }

  .world-preview {
    min-height: 430px;
    border-radius: 26px;
  }

  .town {
    left: 2%;
    right: 2%;
    transform: scale(0.82);
    transform-origin: bottom center;
  }

  .caption-card {
    flex-direction: column;
  }

  .card-topline {
    align-items: flex-start;
    flex-direction: column;
  }
}
