:root {
  color-scheme: dark;
  --surface: #17120e;
  --surface-raised: #211a14;
  --line: #3a2f26;
  --line-strong: #66503a;
  --text: #f4efe8;
  --muted: #b8a895;
  --signal: #c08e3a;
  --sans: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --display: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--surface);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--surface);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
}

button,
input,
a {
  font: inherit;
}

a {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.page-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 0 6vw;
}

.topbar {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--text);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.08em;
  text-decoration: none;
}

.wordmark span {
  color: var(--signal);
}

.topbar-label,
.eyebrow,
.footer {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
}

.topbar-label {
  letter-spacing: .02em;
}

.layout {
  display: grid;
  width: min(1120px, 100%);
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  align-items: center;
  gap: clamp(48px, 9vw, 144px);
  margin: 0 auto;
  padding: 72px 0;
}

.intro {
  max-width: 580px;
}

.eyebrow {
  margin: 0 0 18px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 26px;
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 500;
  letter-spacing: -.1em;
  line-height: 1.06;
}

h1 span {
  color: var(--signal);
}

.intro-copy,
.auth-copy {
  max-width: 480px;
  color: var(--muted);
  line-height: 1.8;
}

.version-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 56px;
  color: var(--muted);
  font-size: 12px;
}

.version-mark {
  width: 7px;
  height: 7px;
  background: var(--signal);
}

.account-panel {
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.database-check,
.auth-panel {
  padding: 28px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading .eyebrow {
  margin-bottom: 7px;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -.055em;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border: 1px solid var(--line-strong);
}

.status-indicator[data-state="checking"] {
  border-color: var(--signal);
  animation: pulse 900ms ease-in-out infinite alternate;
}

.status-indicator[data-state="connected"] {
  border-color: var(--signal);
  background: var(--signal);
}

.database-status {
  min-height: 46px;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.database-status[data-state="connected"] {
  color: var(--signal);
}

.database-status[data-state="error"] {
  color: var(--text);
}

.text-button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}

.text-button:hover {
  border-color: var(--signal);
  color: var(--signal);
}

.text-button:disabled {
  cursor: wait;
  opacity: .65;
}

.panel-divider {
  height: 1px;
  background: var(--line);
}

.flash-message {
  margin: 0 0 22px;
  padding: 12px;
  border-left: 2px solid var(--signal);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 12px;
}

.flash-message.is-error {
  border-color: var(--line-strong);
}

.flash-message[hidden] {
  display: none;
}

.auth-view h2 {
  margin-bottom: 10px;
}

.auth-view .eyebrow {
  margin-bottom: 10px;
}

.auth-copy {
  margin-bottom: 24px;
  font-size: 12px;
}

.primary-button,
.secondary-button {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 16px;
  border: 1px solid var(--signal);
  background: var(--signal);
  color: #080a05;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease;
}

.primary-button:hover {
  background: transparent;
  color: var(--signal);
}

.primary-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-width: 1.4;
}

.auth-view form {
  display: grid;
  gap: 10px;
}

.auth-view label {
  color: var(--muted);
  font-size: 11px;
}

.auth-view input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface-raised);
  color: var(--text);
}

.auth-view input:focus {
  border-color: var(--signal);
}

.auth-view form .primary-button {
  margin-top: 8px;
}

.secondary-button {
  justify-content: center;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--signal);
  color: var(--signal);
}

.account-details {
  display: grid;
  gap: 0;
  margin: 22px 0;
}

.account-details div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.account-details dt {
  color: var(--muted);
  font-size: 11px;
}

.account-details dd {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 12px;
}

.inline-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}

[hidden] {
  display: none !important;
}

.footer {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0;
}

@keyframes pulse {
  from { opacity: .35; }
  to { opacity: 1; }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 0 22px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 42px;
    padding: 54px 0;
  }

  .version-line {
    margin-top: 28px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 12px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

.page-shell {
  display: block;
  min-height: 100vh;
  padding: 0;
}

.topbar {
  position: absolute;
  z-index: 5;
  inset: 0 0 auto;
  min-height: 88px;
  padding: 0 clamp(24px, 6vw, 88px);
  border: 0;
  background: linear-gradient(180deg, rgba(20, 14, 11, .48), transparent);
}

.wordmark {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.065em;
}

.wordmark span { color: #d29a51; }

.topbar-navigation {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 42px);
}

.topbar-link,
.topbar-account {
  color: rgba(248, 238, 224, .86);
  font-size: 13px;
  text-decoration: none;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.topbar-link:hover { color: #f0c17f; }

.topbar-account {
  padding: 10px 19px;
  border: 1px solid rgba(246, 223, 194, .42);
  border-radius: 999px;
}

.topbar-account:hover {
  border-color: #e2b16d;
  background: rgba(226, 177, 109, .12);
  color: #fff0dc;
}

.hero {
  position: relative;
  display: grid;
  min-height: 640px;
  height: 100svh;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: #28170f;
}

.hero-layer {
  position: absolute;
  z-index: -2;
  inset: -5%;
  width: 110%;
  height: 110%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}

.hero-background {
  transform: translate3d(var(--background-x, 0px), var(--background-y, 0px), 0) scale(1.02);
}

.hero-character {
  z-index: -1;
  filter: drop-shadow(0 26px 34px rgba(20, 12, 8, .26));
  transform: translate3d(var(--character-x, 0px), var(--character-y, 0px), 0) scale(1.02);
}

.hero-shade {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(24, 15, 11, .18), transparent 49%),
    linear-gradient(180deg, rgba(21, 14, 11, .36) 0%, rgba(22, 14, 10, .12) 34%, rgba(22, 14, 10, .24) 68%, rgba(19, 13, 10, .74) 100%);
  pointer-events: none;
}

.hero::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='.34'/%3E%3C/svg%3E");
  content: "";
  opacity: .09;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(940px, calc(100% - 40px));
  padding: 82px 0 40px;
  text-align: center;
  animation: hero-arrive .9s cubic-bezier(.2, .75, .2, 1) both;
}

.hero-kicker,
.about-section .eyebrow,
.account-section-heading .eyebrow {
  margin-bottom: 20px;
  color: #e0ad68;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  color: #fff6eb;
  font-family: var(--display);
  font-size: clamp(50px, 7.4vw, 104px);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .99;
  text-shadow: 0 3px 28px rgba(24, 13, 8, .45);
  text-wrap: balance;
}

.hero-copy h1 span {
  color: #f0c17f;
  font-style: italic;
  font-weight: 500;
}

.hero-description {
  margin: 22px 0 0;
  color: rgba(255, 242, 226, .86);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.6;
  text-shadow: 0 2px 16px rgba(24, 13, 8, .45);
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.hero-button {
  display: inline-flex;
  min-width: 154px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 23px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: transform .24s ease, background-color .24s ease, border-color .24s ease, color .24s ease;
}

.hero-button:hover { transform: translateY(-2px); }

.hero-button svg,
.about-link svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.hero-button-primary {
  border-color: #d49b56;
  background: #d49b56;
  color: #20150e;
  box-shadow: 0 8px 26px rgba(13, 9, 6, .22);
}

.hero-button-primary:hover {
  border-color: #e4b675;
  background: #e4b675;
}

.hero-button-secondary {
  border-color: rgba(255, 239, 218, .5);
  background: rgba(26, 18, 14, .2);
  color: #fff4e5;
  backdrop-filter: blur(7px);
}

.hero-button-secondary:hover {
  border-color: rgba(255, 239, 218, .82);
  background: rgba(26, 18, 14, .42);
}

.hero-scroll-cue {
  position: absolute;
  z-index: 1;
  bottom: 24px;
  left: 50%;
  display: grid;
  width: 34px;
  height: 48px;
  place-items: start center;
  padding-top: 9px;
  border: 1px solid rgba(255, 238, 216, .38);
  border-radius: 999px;
  transform: translateX(-50%);
}

.hero-scroll-cue span {
  width: 4px;
  height: 9px;
  border-radius: 999px;
  background: #f1c17e;
  animation: scroll-cue 1.8s ease-in-out infinite;
}

.about-section {
  position: relative;
  display: flex;
  min-height: 430px;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
  overflow: hidden;
  padding: clamp(72px, 10vw, 132px) max(24px, calc((100% - 1120px) / 2));
  background:
    radial-gradient(ellipse at 84% 38%, rgba(151, 92, 48, .13), transparent 32%),
    #1b1510;
}

.about-section::after {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='.3'/%3E%3C/svg%3E");
  content: "";
  opacity: .035;
  pointer-events: none;
}

.about-copy {
  position: relative;
  z-index: 1;
  width: min(610px, 100%);
}

.about-section .eyebrow,
.account-section-heading .eyebrow { margin-bottom: 14px; }

.about-section h2,
.account-section-heading h2 {
  margin: 0;
  color: #f1e7da;
  font-family: var(--display);
  font-size: clamp(34px, 4.5vw, 58px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.1;
}

.about-section h2 span { color: #d2a266; }

.about-copy > p:not(.eyebrow) {
  max-width: 550px;
  margin: 19px 0 0;
  color: #bcae9e;
  font-size: 15px;
  line-height: 1.8;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 25px;
  color: #e2b16d;
  font-size: 14px;
  text-decoration: none;
}

.about-link:hover { color: #f5d6a9; }
.about-link svg { transition: transform .2s ease; }
.about-link:hover svg { transform: translateX(4px); }

.about-mark {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: rgba(231, 204, 172, .13);
  font-family: var(--display);
  font-size: clamp(58px, 10vw, 138px);
  letter-spacing: -.09em;
  line-height: .88;
  user-select: none;
}

.about-mark span:last-child {
  color: rgba(231, 204, 172, .22);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.account-section {
  display: grid;
  width: min(1080px, calc(100% - 48px));
  grid-template-columns: minmax(200px, .7fr) minmax(0, 1.3fr);
  align-items: start;
  gap: 52px;
  margin: 0 auto;
  padding: 100px 0 112px;
  scroll-margin-top: 30px;
}

.account-section-heading h2 { font-size: clamp(32px, 4vw, 48px); }

.account-section-heading > p:last-child {
  max-width: 260px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.account-panel {
  display: grid;
  grid-template-columns: minmax(0, .9fr) 1px minmax(0, 1.1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(33, 26, 20, .84);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .16);
}

.database-check,
.auth-panel { padding: clamp(20px, 3vw, 30px); }

.panel-heading { align-items: center; }
.panel-heading .eyebrow { margin-bottom: 7px; }
.panel-heading h2,
.auth-view h2 { font-family: var(--display); font-size: 22px; }
.panel-divider { width: 1px; height: auto; }
.database-status { min-height: 54px; }
.database-status[data-state="connected"] { color: #a9bd8f; }
.status-indicator[data-state="checking"] { border-color: #d49b56; }
.status-indicator[data-state="connected"] { border-color: #a9bd8f; background: #a9bd8f; }
.text-button:hover { border-color: #d49b56; color: #e3bd89; }

.flash-message {
  border-color: #d49b56;
  border-radius: 4px;
  background: #2b2118;
}

.flash-message.is-error { border-color: #bd7762; }
.auth-view .eyebrow { margin-bottom: 10px; }
.auth-copy { font-size: 13px; }

.primary-button,
.secondary-button {
  min-height: 48px;
  border-radius: 999px;
  font-size: 13px;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.primary-button {
  border-color: #d49b56;
  background: #d49b56;
  color: #20150e;
}

.primary-button:hover {
  border-color: #e4b675;
  background: #e4b675;
  color: #20150e;
}

.secondary-button {
  border-color: var(--line-strong);
  color: var(--text);
}

.secondary-button:hover { border-color: #d49b56; color: #e3bd89; }

.auth-view input {
  border-radius: 10px;
  background: #17120e;
  font-family: var(--sans);
}

.auth-view input:focus { border-color: #d49b56; }
.account-details div { border-color: var(--line); }
.account-details dt,
.footer { color: #a89885; }

.footer {
  min-height: 64px;
  padding: 12px max(24px, calc((100% - 1080px) / 2));
  border-color: var(--line);
  font-size: 11px;
  letter-spacing: 0;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline-color: #e1b46f;
}

@keyframes hero-arrive {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scroll-cue {
  0%, 100% { opacity: .5; transform: translateY(0); }
  55% { opacity: 1; transform: translateY(10px); }
}

@media (max-width: 760px) {
  .topbar { min-height: 72px; padding: 0 22px; }
  .wordmark { font-size: 22px; }
  .topbar-navigation { gap: 16px; }
  .topbar-link { font-size: 12px; }
  .topbar-account { padding: 8px 14px; font-size: 12px; }
  .hero { min-height: 660px; height: 100svh; }
  .hero-layer { inset: -3%; width: 106%; height: 106%; }
  .hero-background { object-position: 48% center; }
  .hero-character { object-position: 48% center; }
  .hero-shade {
    background:
      radial-gradient(ellipse at 50% 45%, rgba(24, 15, 11, .28), transparent 58%),
      linear-gradient(180deg, rgba(21, 14, 11, .38), rgba(22, 14, 10, .2) 45%, rgba(19, 13, 10, .72));
  }
  .hero-copy { width: calc(100% - 36px); padding-top: 56px; }
  .hero-copy h1 { font-size: clamp(46px, 12vw, 72px); }
  .hero-description { max-width: 320px; margin: 18px auto 0; }
  .hero-actions { gap: 10px; margin-top: 27px; }
  .hero-button { min-width: 142px; min-height: 49px; padding: 0 18px; }
  .hero-scroll-cue { bottom: 18px; }
  .about-section { min-height: 0; padding: 78px 24px; }
  .about-mark { display: none; }
  .about-copy > p:not(.eyebrow) { font-size: 14px; }
  .account-section {
    width: calc(100% - 40px);
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 72px 0 80px;
  }
  .account-section-heading > p:last-child { max-width: 420px; }
  .account-panel { grid-template-columns: 1fr; }
  .panel-divider { width: auto; height: 1px; }
  .database-check,
  .auth-panel { padding: 22px; }
  .database-status { min-height: 0; }
  .footer { align-items: flex-start; gap: 8px; padding: 18px 22px; }
}

@media (max-width: 420px) {
  .topbar-link { display: none; }
  .hero-copy h1 { font-size: clamp(38px, 10.5vw, 56px); }
  .hero-copy h1 span { display: block; }
  .hero-button { min-width: 132px; }
}
