:root {
  --cream: #f3ece0;
  --ink: #25231f;
  --muted: #6c685f;
  --line: rgba(37, 35, 31, 0.14);
  --olive: #4a513a;
  --terracotta: #a45136;
  --gold: #d6a35c;
  --serif: "Cormorant Garamond", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; }

/* ===== Top bar ===== */
.dtopbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(18px, 4vw, 42px);
  background: rgba(243, 236, 224, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}

.dbrand img {
  height: 32px;
  width: auto;
  display: block;
}

.dphase {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* ===== Stage ===== */
.dstage {
  position: relative;
  min-height: 100vh;
  padding-top: 80px;
}

.dscreen {
  position: absolute;
  inset: 80px 0 0 0;
  min-height: calc(100vh - 80px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px clamp(18px, 4vw, 42px) 80px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.dscreen.is-active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.dscreen.is-leaving {
  display: flex;
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

/* ===== Wrap (centered) ===== */
.dwrap {
  width: min(820px, 100%);
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
  text-align: center;
}

.dwrap-narrow { width: min(440px, 100%); }
.dwrap-center { text-align: center; }

/* ===== Type ===== */
.deyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(48px, 9vw, 108px);
  line-height: 0.96;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}

h1 em {
  font-style: italic;
  color: var(--terracotta);
}

h2 {
  font-family: var(--serif);
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 1.02;
  font-weight: 500;
  letter-spacing: -0.012em;
  margin: 0;
}

.dlead {
  font-size: clamp(16px, 1.55vw, 19px);
  line-height: 1.55;
  color: var(--muted);
  max-width: 56ch;
  margin: 0 auto;
}

.dfine {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 12px 0 0;
}

/* ===== Buttons ===== */
.dprimary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 32px;
  background: var(--ink);
  color: var(--cream);
  border: 0;
  border-radius: 8px;
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
  margin-top: 8px;
}

.dprimary:hover:not(:disabled) {
  background: #161510;
  transform: translateY(-1px);
}

.dprimary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
}

/* ===== Chain grid (logos) ===== */
.dchain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 760px;
  margin-top: 8px;
}

.dchain {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.4 / 1;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.dchain:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 35, 31, 0.32);
  box-shadow: 0 14px 30px rgba(37, 35, 31, 0.08);
}

.dchain-img {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.dchain-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.dchain-other {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.dchain-other a {
  color: var(--terracotta);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dother {
  margin-top: 10px;
  display: none;
  flex-direction: column;
  gap: 14px;
  width: min(420px, 100%);
}

.dother.is-visible { display: flex; }

/* ===== Inputs / Form ===== */
.dother label,
.dform label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
}

.dother input,
.dform input {
  appearance: none;
  font: 400 16px/1.3 var(--sans);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.dother input:focus,
.dform input:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: 1px;
}

.dform {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
  margin: 0 auto;
}

.dform .dprimary {
  width: 100%;
  margin-top: 10px;
}

/* ===== Text choices ===== */
.dchoices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(560px, 100%);
  margin: 14px auto 0;
}

.dchoice {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 18px 28px;
  border-radius: 999px;
  font: 500 clamp(20px, 2.2vw, 26px)/1 var(--serif);
  letter-spacing: 0;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  transition: background 220ms ease, color 220ms ease, transform 200ms ease;
}

.dchoice:hover {
  background: var(--ink);
  color: var(--cream);
  transform: translateY(-2px);
}

/* ===== Loader ===== */
.dloader {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid rgba(37, 35, 31, 0.14);
  border-top-color: var(--terracotta);
  margin: 0 auto 18px;
  animation: dspin 0.9s linear infinite;
}

@keyframes dspin {
  to { transform: rotate(360deg); }
}

.dloader-msg {
  font-family: var(--serif);
  font-size: clamp(24px, 3.4vw, 38px);
  margin: 0;
  font-style: italic;
}

/* ===== Mobile tweaks ===== */
@media (max-width: 540px) {
  .dscreen { padding: 24px 18px 60px; }
  .dwrap { gap: 18px; }
  .dprimary { width: 100%; }
  .dchain-grid { grid-template-columns: repeat(2, 1fr); }
}
