:root {
  --page-bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f0f2f6;
  --line: #dfe5ee;
  --line-strong: #cfd7e3;
  --ink: #31465c;
  --ink-soft: #5e7084;
  --ink-quiet: #8593a4;
  --brand-blue: #295f96;
  --brand-red: #bc2a2f;
  --brand-charcoal: #4d535b;
  --hero-shadow: 0 24px 70px rgba(33, 47, 67, 0.12);
  --panel-shadow: 0 16px 36px rgba(34, 49, 69, 0.08);
  --pending: #f4cf88;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(236, 240, 245, 0.72), rgba(247, 248, 251, 0.96) 32%, #ffffff 100%);
}

a {
  color: inherit;
}

.site-header,
.hero-strip,
.page-shell {
  width: min(1680px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem 2rem;
  padding: 1.1rem 0 0.8rem;
}

.brandmark {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.2rem;
  text-decoration: none;
}

.brandmark-word {
  font-family: "Aptos Narrow", "Arial Narrow", "Bahnschrift SemiCondensed", sans-serif;
  font-size: clamp(1.2rem, 3.4vw, 3.15rem);
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.brandmark-muted {
  color: var(--brand-charcoal);
}

.brandmark-theist {
  display: inline-flex;
}

.brand-red {
  color: var(--brand-red);
}

.brand-blue {
  color: var(--brand-blue);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.35rem;
  margin-top: 0;
}

.site-nav a {
  padding: 0.8rem 1.15rem;
  border: 1px solid rgba(207, 215, 227, 0.84);
  background: linear-gradient(180deg, #f6f7fa, #eceff4);
  text-decoration: none;
  font-size: 0.92rem;
  color: #3f5163;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.site-nav a:hover {
  transform: translateY(-1px);
  border-color: rgba(41, 95, 150, 0.32);
  color: var(--brand-blue);
}

.hero-strip {
  position: relative;
  min-height: 8.25rem;
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: var(--hero-shadow);
  background:
    linear-gradient(90deg, rgba(20, 25, 33, 0.42), rgba(20, 25, 33, 0.05) 52%, rgba(255, 248, 235, 0.08)),
    radial-gradient(circle at 20% 18%, rgba(242, 227, 198, 0.92), transparent 16%),
    radial-gradient(circle at 39% 28%, rgba(196, 186, 176, 0.92), transparent 16%),
    radial-gradient(circle at 62% 24%, rgba(233, 221, 203, 0.96), transparent 18%),
    radial-gradient(circle at 79% 42%, rgba(253, 241, 211, 0.9), transparent 14%),
    radial-gradient(circle at 54% 65%, rgba(176, 170, 168, 0.78), transparent 22%),
    radial-gradient(circle at 16% 70%, rgba(131, 136, 152, 0.82), transparent 28%),
    radial-gradient(circle at 80% 74%, rgba(173, 167, 170, 0.82), transparent 22%),
    linear-gradient(180deg, #b5ada1 0%, #a59a90 26%, #8b898f 54%, #d8cab7 100%);
}

.hero-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 32%),
    linear-gradient(0deg, rgba(255, 247, 227, 0.22), transparent 40%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 8.25rem;
  max-width: 42rem;
  padding: 1.4rem 1.75rem;
  color: #f7f9fc;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.78;
}

h1,
h2 {
  margin: 0;
  font-family: "Aptos Narrow", "Arial Narrow", "Bahnschrift SemiCondensed", sans-serif;
  line-height: 1.06;
}

h1 {
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.35rem);
  color: #2b4056;
}

.intro,
.subtle,
.steps,
.message-body,
.auth-message {
  line-height: 1.7;
}

.intro {
  margin: 1rem 0 0;
  max-width: 34rem;
  color: rgba(247, 249, 252, 0.92);
}

.page-shell {
  display: block;
  padding-bottom: 2rem;
}

.hero-tag {
  margin: 0.45rem 0 0;
  font-size: 0.96rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247, 249, 252, 0.84);
}

.panel-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 251, 0.92));
  box-shadow: var(--panel-shadow);
}

.chat-panel {
  border-radius: 24px;
}

.label {
  display: block;
  margin-bottom: 0.24rem;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

.auth-panel,
.message-list,
.composer,
.status-pill {
  border-radius: 18px;
}

.auth-panel {
  margin-bottom: 1.2rem;
  padding: 1.15rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 243, 248, 0.88));
}

.auth-gate {
  max-width: 38rem;
}

.auth-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
}

.auth-form input,
.composer textarea {
  width: 100%;
  resize: vertical;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  font: inherit;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

.auth-form input:focus,
.composer textarea:focus {
  border-color: rgba(41, 95, 150, 0.56);
  box-shadow: 0 0 0 4px rgba(41, 95, 150, 0.1);
}

.auth-form button,
.composer button {
  align-self: end;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.5rem;
  font: inherit;
  font-weight: 700;
  color: #f7f9fc;
  background: linear-gradient(135deg, #24486f, #2f679f);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(41, 95, 150, 0.22);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.auth-form button:hover,
.composer button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(41, 95, 150, 0.26);
}

.auth-form button:disabled,
.composer button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.auth-message {
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  min-height: 74vh;
  padding: 1.35rem;
}

.chat-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
}

.chat-header .eyebrow {
  color: var(--ink-quiet);
  opacity: 1;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: start;
  gap: 0.7rem;
}

.status-pill {
  min-width: 7.5rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(246, 248, 251, 0.94);
  text-align: left;
}

.status-label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

.status-pill strong {
  color: #24384b;
}

.message-list {
  flex: 1;
  min-height: 62vh;
  overflow: auto;
  padding: 1.1rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(247, 249, 252, 0.9), rgba(239, 243, 248, 0.94));
}

.message {
  width: fit-content;
  max-width: min(64rem, 88%);
  margin: 0 0 1rem;
  padding: 1rem 1rem 0.95rem;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 22px rgba(39, 54, 77, 0.05);
}

.message.user {
  margin-left: auto;
  border-left-color: var(--brand-blue);
  background: rgba(41, 95, 150, 0.08);
}

.message.assistant {
  margin-right: auto;
  border-left-color: var(--brand-charcoal);
}

.message.pending {
  margin-left: auto;
  border-left-color: #ca9329;
  background: linear-gradient(135deg, var(--pending), #f8e4b7);
}

.message-meta {
  margin-bottom: 0.5rem;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}

.message-body {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  color: #26384a;
}

.message-error {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(49, 70, 92, 0.12);
  font-size: 0.88rem;
  color: var(--brand-red);
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.composer textarea {
  min-height: 6rem;
  max-height: 14rem;
}

.empty-state {
  padding: 1.2rem;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .site-nav {
    justify-content: start;
  }

  .chat-header,
  .auth-form,
  .composer {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header,
  .hero-strip,
  .page-shell {
    width: min(100% - 1rem, 1240px);
  }

  .site-header {
    padding-top: 0.9rem;
  }

  .brandmark {
    gap: 0.25rem 0.7rem;
  }

  .brandmark-word {
    letter-spacing: 0.24em;
  }

  .hero-strip {
    min-height: 7rem;
  }

  .hero-copy,
  .chat-panel {
    padding: 1.2rem;
  }

  .hero-copy {
    min-height: 7rem;
  }

  .site-nav a,
  .auth-form button,
  .composer button {
    width: 100%;
  }
}
