:root {
  --bg: #0f1110;
  --panel: #211f1a;
  --panel-2: #171816;
  --text: #ece4d6;
  --muted: #a79d8d;
  --accent: #c48a3a;
  --danger: #a04a38;
  --success: #879a64;
  --border: #3b3931;
  --iron: #78807c;
  --steel: #9aa19a;
  --shadow: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 4%, rgba(196, 138, 58, 0.14), transparent 30rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(180deg, #131512 0%, #0f1110 42rem),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  background: rgba(15, 17, 16, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.brand,
.site-nav,
.hero-actions,
.hero-proof,
.tool-actions,
.result-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.75rem;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  color: #17120b;
  background: var(--accent);
  border: 1px solid #e1b56b;
  border-radius: 6px;
  box-shadow: 0 0 0 4px rgba(196, 138, 58, 0.12);
}

.site-nav {
  gap: clamp(0.75rem, 2vw, 1.5rem);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(360px, 1.18fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
  max-width: 1360px;
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1rem, 4vw, 3rem);
  min-height: min(940px, calc(100vh - 64px));
}

.hero-copy {
  width: 100%;
  min-width: 0;
  max-width: 760px;
  padding-top: clamp(0rem, 4vw, 2rem);
}

.eyebrow,
.panel-label {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 1rem;
  max-width: 680px;
  font-size: clamp(3rem, 6.8vw, 5.65rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0.65rem;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.subtitle {
  margin-bottom: 1rem;
  color: #f2c980;
  font-size: clamp(1.18rem, 1.65vw, 1.45rem);
  font-weight: 750;
  line-height: 1.3;
}

.lead,
.section-copy p,
.known-copy p,
.faq-grid p,
.mechanic-grid p,
.keyword-grid p,
.question-grid p,
.outcome-grid p,
.preset-card p,
.note-card p,
.result-box p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.lead {
  max-width: 680px;
  font-size: 1.07rem;
}

.hero-actions,
.tool-actions,
.result-actions {
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.button {
  min-height: 2.75rem;
  padding: 0.72rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #2a241d;
  cursor: pointer;
}

.button.primary {
  color: #15100a;
  background: var(--accent);
  border-color: #e0b46d;
  font-weight: 800;
}

.button.secondary {
  color: var(--text);
  background: #342a1d;
  border-color: rgba(196, 138, 58, 0.55);
}

.button.ghost {
  background: transparent;
}

.button:hover {
  transform: translateY(-1px);
}

.hero-proof {
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.4rem;
}

.hero-proof span {
  padding: 0.45rem 0.65rem;
  color: var(--muted);
  background: rgba(33, 31, 26, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
}

.tool-panel,
.mechanic-grid article,
.faq-grid article,
.keyword-grid article {
  background: linear-gradient(180deg, rgba(36, 31, 25, 0.98), rgba(26, 23, 18, 0.98));
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 70px var(--shadow);
}

.tool-panel {
  width: 100%;
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.35rem);
  border-color: rgba(196, 138, 58, 0.34);
}

.tool-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.tool-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.lock-visual {
  display: grid;
  grid-template-columns: repeat(3, 0.7rem);
  gap: 0.35rem;
  align-items: end;
  width: 4.5rem;
  height: 3.25rem;
  padding: 0.7rem;
  border: 1px solid var(--iron);
  border-radius: 6px;
  background: #151310;
}

.lock-visual span {
  display: block;
  min-height: 1rem;
  border-radius: 2px;
  background: var(--accent);
}

.step-title span,
.solve-title span,
.summary-number {
  display: grid;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  color: #15100a;
  background: var(--accent);
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 900;
}

.lock-visual span:nth-child(2) {
  min-height: 1.7rem;
  background: var(--iron);
}

.lock-visual span:nth-child(3) {
  min-height: 2.2rem;
}

.control-group {
  padding: 0.95rem 0;
  border-top: 1px solid var(--border);
}

.step-block {
  display: grid;
  gap: 0.8rem;
}

.step-title,
.solve-title {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.step-title p,
.link-builder small {
  display: block;
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.control-group label,
.control-row label {
  display: block;
  margin-bottom: 0.55rem;
  font-weight: 800;
}

.step-title label,
.solve-title strong {
  margin-bottom: 0;
  color: var(--text);
  font-weight: 900;
}

.control-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.hint {
  color: var(--muted);
  font-size: 0.86rem;
}

select {
  min-height: 2.55rem;
  width: 100%;
  padding: 0.55rem;
  color: var(--text);
  background: #151310;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.plate-count-row {
  display: grid;
  grid-template-columns: minmax(11rem, 0.8fr) minmax(0, 1.2fr);
  gap: 0.75rem;
  align-items: center;
}

.plate-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.plate-control {
  padding: 0.7rem;
  background: rgba(17, 16, 13, 0.6);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.plate-control span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.relation-wrap {
  max-width: 100%;
  margin-top: 0.85rem;
  overflow-x: auto;
}

.relation-grid {
  display: grid;
  grid-template-columns: minmax(5.2rem, 1.3fr) repeat(var(--plate-count, 4), minmax(5.8rem, 1fr));
  gap: 0.45rem;
  min-width: 610px;
}

.relation-header,
.relation-self {
  display: grid;
  min-height: 2.45rem;
  place-items: center;
  padding: 0.5rem;
  color: var(--muted);
  background: rgba(17, 16, 13, 0.72);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.85rem;
}

.relation-header.row {
  justify-content: start;
  font-weight: 800;
}

.relation-self {
  color: #15100a;
  background: var(--accent);
  border-color: #e0b46d;
  font-weight: 800;
}

.link-builder {
  border-top: 1px solid var(--border);
}

.link-builder summary {
  position: relative;
  display: grid;
  grid-template-columns: 1.8rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.8rem 0.8rem 0;
  background: rgba(196, 138, 58, 0.08);
  border: 1px solid rgba(196, 138, 58, 0.34);
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
}

.link-builder summary::-webkit-details-marker {
  display: none;
}

.link-builder strong {
  color: var(--text);
  font-weight: 900;
}

.link-builder summary > div {
  min-width: 0;
}

.link-builder summary:hover {
  background: rgba(196, 138, 58, 0.13);
  border-color: rgba(196, 138, 58, 0.62);
}

.link-toggle {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 0.4rem;
  color: #f2c980;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.link-toggle::after {
  content: "v";
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  color: #15100a;
  background: var(--accent);
  border-radius: 5px;
  font-size: 0.75rem;
}

.link-builder[open] .link-toggle {
  font-size: 0;
}

.link-builder[open] .link-toggle::before {
  content: "Collapse";
  font-size: 0.82rem;
}

.link-builder[open] .link-toggle::after {
  content: "^";
}

.link-builder:not([open]) .relation-wrap {
  display: none;
}

.solve-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.solve-title {
  align-items: center;
}

.solve-strip .tool-actions {
  margin-top: 0;
}

.result-box {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(17, 16, 13, 0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.result-box.success {
  border-color: rgba(127, 154, 97, 0.7);
}

.result-box.warning {
  border-color: rgba(158, 61, 47, 0.75);
}

.result-title {
  margin-bottom: 0.3rem;
  color: var(--text);
  font-weight: 900;
}

.move-list {
  display: grid;
  gap: 0.4rem;
  padding: 0;
  list-style: none;
}

.move-list li {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  color: var(--text);
}

.move-list span {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  color: #15100a;
  background: var(--accent);
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 900;
}

.content-band {
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--border);
}

.section-heading,
.section-copy,
.known-layout,
.mechanic-grid,
.faq-grid,
.keyword-grid,
.question-grid,
.outcome-grid,
.preset-list {
  max-width: 1180px;
  margin-inline: auto;
}

.section-heading {
  margin-bottom: 1.2rem;
}

.section-copy {
  max-width: 940px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
}

.known-layout {
  display: block;
}

.known-copy {
  max-width: 940px;
}

.preset-list,
.note-list,
.faq-grid,
.mechanic-grid,
.keyword-grid,
.question-grid,
.outcome-grid {
  display: grid;
  gap: 0.8rem;
}

.preset-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.2rem;
}

.preset-card,
.note-card {
  padding: 0.9rem;
  background: rgba(17, 16, 13, 0.66);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.preset-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.preset-card h4,
.note-card h4 {
  margin-bottom: 0.35rem;
}

.preset-card span,
.note-card span {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mechanic-grid,
.faq-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.keyword-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.question-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.outcome-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mechanic-grid article,
.faq-grid article,
.keyword-grid article,
.question-grid article,
.outcome-grid article {
  padding: 1.1rem;
}

.question-grid article,
.outcome-grid article {
  background: linear-gradient(180deg, rgba(36, 31, 25, 0.98), rgba(26, 23, 18, 0.98));
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 70px var(--shadow);
}

.step-number {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  margin-bottom: 0.8rem;
  color: #15100a;
  background: var(--accent);
  border-radius: 5px;
  font-weight: 900;
}

.site-footer {
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: #0c0b09;
  font-size: 0.86rem;
}

.site-footer p {
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 920px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .known-layout,
  .two-column {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .tool-panel {
    order: 2;
  }

  .mechanic-grid,
  .faq-grid,
  .keyword-grid,
  .question-grid,
  .outcome-grid {
    grid-template-columns: 1fr;
  }

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

  .plate-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-header {
    gap: 0.65rem;
    padding-block: 0.7rem;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    gap: 0.55rem 0.75rem;
    font-size: 0.88rem;
  }

  .hero {
    gap: 1rem;
    padding-top: 1.25rem;
    padding-bottom: 1.5rem;
  }

  .hero-copy {
    padding-top: 0;
  }

  h1 {
    margin-bottom: 0.75rem;
    font-size: 2.65rem;
  }

  .subtitle {
    margin-bottom: 0.75rem;
    font-size: 1.08rem;
  }

  .lead {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .hero-actions {
    margin-top: 1rem;
  }

  .hero-proof {
    display: none;
  }

  .control-row,
  .preset-card {
    align-items: stretch;
    flex-direction: column;
  }

  .plate-count-row {
    grid-template-columns: 1fr;
  }

  .plate-grid {
    gap: 0.45rem;
  }

  .plate-control {
    padding: 0.55rem 0.45rem;
  }

  .plate-control span {
    font-size: 0.76rem;
  }

  .solve-strip {
    align-items: stretch;
    flex-direction: column;
  }
}
