:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080b10;
  color: #f4f4ef;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 4%, rgba(113, 255, 177, .13), transparent 29rem),
    radial-gradient(circle at 91% 15%, rgba(255, 107, 74, .11), transparent 25rem),
    linear-gradient(145deg, #080b10 0%, #111720 100%);
}

main {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 72px;
}

.hero { max-width: 980px; padding: 34px 0 56px; }
.eyebrow { color: #71ffb1; text-decoration: none; text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 750; }
h1 { margin: 18px 0; font-size: clamp(3.3rem, 7vw, 7rem); line-height: .9; letter-spacing: -.065em; font-weight: 720; }
h1 em { color: #71ffb1; font-style: normal; }
.hero > p { max-width: 760px; color: #aab4c0; line-height: 1.7; font-size: 1.08rem; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.hero-chips span { border: 1px solid #2b3945; border-radius: 999px; color: #b9c3cd; padding: 7px 12px; font: 650 .72rem ui-monospace, monospace; }

.editor-card, .deck-card, .status {
  border: 1px solid #27313c;
  background: rgba(16, 21, 28, .82);
  border-radius: 20px;
  backdrop-filter: blur(14px);
}

.editor-card { padding: 28px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading > p { max-width: 520px; margin: 0; color: #8995a3; font-size: .86rem; line-height: 1.5; text-align: right; }
.step { display: flex; align-items: center; gap: 12px; }
.step span { color: #71ffb1; font: 700 .72rem ui-monospace, monospace; border: 1px solid #315841; border-radius: 999px; padding: 5px 8px; }
h2 { margin: 0; font-size: 1.15rem; }

.bindings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 8px; }
.field label { color: #cbd3dc; font-size: .8rem; font-weight: 680; }
.field small { color: #687481; }
input[type="text"] {
  width: 100%;
  border: 1px solid #303b47;
  background: #0b1016;
  color: #f4f4ef;
  border-radius: 11px;
  padding: 13px 14px;
  font: inherit;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input[type="text"]:focus { border-color: #71ffb1; box-shadow: 0 0 0 3px rgba(113, 255, 177, .1); outline: 0; }
.muted { grid-column: 1 / -1; color: #8995a3; font-size: .86rem; }

.garden { margin-top: 54px; }
.garden-heading { padding: 0 2px; }
.deck-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.deck-card { min-width: 0; padding: 22px; overflow: hidden; }
.deck-card-accent { border-color: #4a342f; background: linear-gradient(180deg, rgba(31, 24, 25, .9), rgba(16, 21, 28, .84)); }
.deck-header { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.deck-number { color: #71ffb1; text-transform: uppercase; letter-spacing: .12em; font: 750 .64rem ui-monospace, monospace; }
.deck-card-accent .deck-number { color: #ff876c; }
h3 { margin: 7px 0 4px; font-size: 1.35rem; }
.deck-header p { margin: 0; color: #778492; font-size: .8rem; }

.download-button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  padding: 10px 13px;
  background: #71ffb1;
  color: #07120c;
  font-size: .76rem;
  font-weight: 760;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .18s ease, transform .18s ease;
}
.deck-card-accent .download-button { background: #ff876c; color: #1a0d09; }
.download-button:not(.is-disabled):hover { transform: translateY(-1px); }
.download-button.is-disabled { opacity: .3; cursor: not-allowed; }

.deck-preview { display: grid; gap: 18px; min-height: 260px; }
.deck-preview figure { min-width: 0; margin: 0; }
.deck-preview canvas { display: block; width: 100%; height: auto; background: #fff; border-radius: 9px; box-shadow: 0 14px 40px rgba(0, 0, 0, .38); }
.deck-preview figcaption { margin-top: 8px; color: #687481; font-size: .7rem; text-align: center; }
.preview-placeholder { place-self: center; color: #687481; }

.deck-stats { margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.deck-stats div { border-left: 1px solid #303b47; padding-left: 11px; min-width: 0; }
dt { color: #687481; font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; }
dd { margin: 4px 0 0; overflow: hidden; color: #cbd3dc; font: .72rem ui-monospace, monospace; text-overflow: ellipsis; }
.deck-status { min-height: 2.6em; margin: 16px 0 0; color: #778492; font-size: .7rem; line-height: 1.4; }

.status { margin-top: 20px; padding: 20px 24px; display: grid; gap: 12px; }
.status-line { display: flex; align-items: center; gap: 10px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: #71ffb1; box-shadow: 0 0 18px #71ffb1; }
.is-busy .pulse { animation: pulse 1s ease-in-out infinite alternate; }
pre { margin: 0; white-space: pre-wrap; color: #ffbd7a; font-size: .72rem; }
@keyframes pulse { to { opacity: .45; transform: scale(.75); } }

@media (max-width: 900px) {
  main { width: min(100% - 28px, 760px); padding-top: 30px; }
  .hero { padding-bottom: 40px; }
  h1 { font-size: clamp(3rem, 15vw, 5.2rem); }
  .section-heading { align-items: start; flex-direction: column; gap: 10px; }
  .section-heading > p { text-align: left; }
  .bindings, .deck-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  main { width: min(100% - 20px, 480px); }
  .editor-card, .deck-card { padding: 18px; border-radius: 16px; }
  .deck-header { align-items: stretch; flex-direction: column; }
  .download-button { text-align: center; }
  .deck-stats { grid-template-columns: 1fr; }
}
