:root {
  color-scheme: dark;
  --bg: #080807;
  --panel: rgba(18, 17, 15, 0.86);
  --panel-strong: rgba(28, 25, 21, 0.96);
  --line: rgba(242, 207, 131, 0.2);
  --line-strong: rgba(242, 207, 131, 0.42);
  --text: #f7f0df;
  --muted: #b7ad99;
  --gold: #f2cf83;
  --ember: #ff8a4c;
  --cyan: #56eaff;
  --green: #70ff9a;
  --red: #ff5b6f;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
* { min-width: 0; }

html { overflow-x: hidden; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 138, 76, 0.16), transparent 28rem),
    radial-gradient(circle at 85% 8%, rgba(86, 234, 255, 0.10), transparent 30rem),
    linear-gradient(180deg, #11100e 0%, #070706 54%, #030303 100%);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(242, 207, 131, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 207, 131, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.2));
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, input, select { max-width: 100%; }

.forge-header,
main,
.forge-footer {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

.forge-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(242, 207, 131, 0.46);
  border-radius: 6px;
  color: #ffeab5;
  background: rgba(242, 207, 131, 0.08);
  box-shadow: inset 0 0 18px rgba(242, 207, 131, 0.1);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--gold);
  letter-spacing: 0.08em;
}

.brand small {
  color: var(--muted);
  font-size: 0.76rem;
}

.forge-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.forge-nav a,
.status-card span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.82rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 26px 0;
}

.kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 14px;
  max-width: 920px;
  font-size: clamp(2.9rem, 7vw, 5.7rem);
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow:
    0 0 22px rgba(255, 138, 76, 0.3),
    0 0 60px rgba(242, 207, 131, 0.17);
}

h1 small {
  display: block;
  margin-top: 0.18em;
  color: #ffeab5;
  font-size: 0.34em;
  line-height: 1.25;
}

.lead {
  max-width: 760px;
  color: #d8cfbc;
  font-size: clamp(0.98rem, 1.6vw, 1.13rem);
  line-height: 1.62;
}

.lead span { display: block; }
.lead span + span { margin-top: 0.12em; }

.status-card {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.forge-layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel,
.recipe-section,
.notes {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(16px);
}

.controls,
.preview {
  padding: 18px;
}

.panel-head h2,
.section-head h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

input[type="text"],
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(5, 5, 5, 0.78);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--ember);
}

.preset-grid,
.control-grid,
.button-grid {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.preset-grid,
.button-grid {
  grid-template-columns: 1fr 1fr;
}

.control-grid {
  grid-template-columns: 1fr;
}

button {
  min-height: 44px;
  border: 1px solid rgba(242, 207, 131, 0.24);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(242, 207, 131, 0.1), rgba(242, 207, 131, 0.02)),
    rgba(6, 6, 6, 0.76);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  cursor: pointer;
}

button:hover,
button.is-active {
  border-color: rgba(255, 138, 76, 0.68);
  box-shadow: 0 0 18px rgba(255, 138, 76, 0.2);
}

button.primary {
  border-color: rgba(255, 138, 76, 0.55);
  color: #fff1dd;
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.swatch {
  position: relative;
  min-height: 40px;
  padding-left: 31px;
}

.swatch::before {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: 0 0 12px var(--swatch);
  transform: translateY(-50%);
  content: "";
}

.slider-stack {
  display: grid;
  gap: 13px;
  margin-top: 16px;
}

.slider-stack label {
  display: grid;
  gap: 6px;
}

.slider-stack b {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.canvas-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(242, 207, 131, 0.16);
  border-radius: 7px;
  background: #050505;
}

#logoCanvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: 260px;
  aspect-ratio: 1200 / 630;
}

.corner-tag {
  position: absolute;
  left: 14px;
  bottom: 14px;
  border: 1px solid rgba(242, 207, 131, 0.22);
  border-radius: 4px;
  padding: 6px 9px;
  color: rgba(255, 234, 181, 0.78);
  background: rgba(0, 0, 0, 0.5);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.recipe-section,
.notes {
  margin-top: 18px;
  padding: 22px;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.recipe-grid article {
  min-height: 116px;
  border: 1px solid rgba(242, 207, 131, 0.14);
  border-radius: 6px;
  padding: 13px;
  background: rgba(0, 0, 0, 0.25);
}

.recipe-grid strong,
.recipe-grid span {
  display: block;
}

.recipe-grid strong {
  color: var(--gold);
  font-size: 0.86rem;
}

.recipe-grid span,
.notes p {
  color: #d2c7b2;
  line-height: 1.65;
}

.recipe-grid span {
  margin-top: 8px;
  font-size: 0.9rem;
}

.forge-footer {
  padding: 32px 0 44px;
  color: var(--muted);
  line-height: 1.7;
}

.forge-footer a {
  color: var(--gold);
  font-weight: 900;
}

@media (max-width: 1120px) {
  .hero,
  .forge-layout,
  .recipe-grid {
    grid-template-columns: 1fr;
  }

  .status-card {
    justify-items: start;
  }
}

@media (max-width: 720px) {
  .forge-header,
  main,
  .forge-footer {
    width: min(100% - 24px, 1440px);
  }

  .forge-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0 8px;
  }

  .forge-nav {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 20px;
  }

  h1 {
    font-size: clamp(2.45rem, 14vw, 4rem);
    line-height: 0.96;
  }

  .lead span {
    width: min(100%, 34ch);
  }

  .status-card {
    display: none;
  }

  .preset-grid,
  .control-grid,
  .button-grid {
    grid-template-columns: 1fr;
  }

  .controls,
  .preview,
  .recipe-section,
  .notes {
    width: 100%;
    padding: 16px;
  }

  .canvas-frame {
    width: 100%;
  }

  .swatch-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .swatch {
    width: 100%;
  }
}
