:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #61706b;
  --paper: #f7f5ef;
  --paper-strong: #ebe7dc;
  --panel: #ffffff;
  --line: #ded9cd;
  --teal: #0f766e;
  --teal-dark: #0a4f4a;
  --amber: #b7791f;
  --clay: #8f4f35;
  --graphite: #25302c;
  --code: #111815;
  --shadow: 0 18px 50px rgba(23, 32, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

h1,
h2,
h3,
p,
li {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 1.02;
}

h2 {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.12;
}

h3 {
  font-size: 20px;
  line-height: 1.25;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
  padding: 0 clamp(18px, 4vw, 56px);
  background: rgba(10, 20, 18, 0.24);
  color: #ffffff;
  backdrop-filter: blur(10px);
  transition:
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.site-header[data-elevated="true"] {
  background: rgba(247, 245, 239, 0.94);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(23, 32, 29, 0.12);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 7px;
  font-size: 15px;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  font-size: 14px;
}

.nav a {
  text-decoration: none;
  opacity: 0.86;
}

.nav a:hover {
  opacity: 1;
}

.hero {
  position: relative;
  min-height: min(760px, 88vh);
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 116px clamp(20px, 6vw, 76px) 72px;
  color: #ffffff;
}

.hero-image,
.hero-scrim {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-scrim {
  background:
    linear-gradient(90deg, rgba(10, 20, 18, 0.9) 0%, rgba(10, 20, 18, 0.74) 40%, rgba(10, 20, 18, 0.2) 74%),
    linear-gradient(0deg, rgba(10, 20, 18, 0.78) 0%, rgba(10, 20, 18, 0.04) 48%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--amber);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: #f1b55d;
}

.hero-copy {
  max-width: 690px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(17px, 2vw, 22px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button,
.copy-button,
.mode-tab {
  appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 720;
  text-decoration: none;
}

.button:hover,
.copy-button:hover,
.mode-tab:hover {
  transform: translateY(-1px);
}

.button:active,
.copy-button:active,
.mode-tab:active {
  transform: translateY(0);
}

.button-primary {
  background: var(--teal);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--teal-dark);
}

.button-secondary {
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.section {
  padding: clamp(58px, 8vw, 104px) clamp(20px, 6vw, 76px);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.68fr) minmax(280px, 0.32fr);
  gap: 32px;
  align-items: end;
  max-width: 1180px;
  margin: 0 auto 34px;
}

.section-heading.compact {
  display: block;
}

.section-heading > p,
.section-heading.compact > p:not(.eyebrow) {
  margin: 16px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
}

.principles,
.definition-grid,
.problem-grid,
.user-grid,
.scenario-grid,
.rule-grid,
.prompt-workbench {
  max-width: 1180px;
  margin: 0 auto;
}

.principles,
.definition-grid,
.problem-grid,
.user-grid,
.scenario-grid,
.rule-grid {
  display: grid;
  gap: 16px;
}

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

.definition-grid {
  grid-template-columns: 1.25fr 0.875fr 0.875fr;
}

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

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

.principle,
.definition-card,
.problem-card,
.user-card,
.scenario-card,
.rule-grid article,
.prompt-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(23, 32, 29, 0.04);
}

.principle,
.definition-card,
.problem-card,
.user-card,
.scenario-card,
.rule-grid article {
  padding: 24px;
}

.number {
  display: block;
  margin-bottom: 28px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 820;
}

.principle p,
.definition-card p,
.problem-card p,
.user-card p,
.scenario-card p,
.rule-grid p {
  margin: 12px 0 0;
  color: var(--muted);
}

.product {
  background: #f4f1e8;
}

.definition-card.featured {
  background: var(--graphite);
  color: #ffffff;
}

.definition-card.featured p {
  color: rgba(255, 255, 255, 0.78);
}

.definition-card.featured .eyebrow {
  color: #f1b55d;
}

.problem-card {
  min-height: 196px;
}

.problem-card h3 {
  color: var(--graphite);
}

.users {
  background: #ffffff;
}

.bootstrap,
.conflicts {
  background: var(--paper-strong);
}

.prompt-workbench {
  display: grid;
  gap: 18px;
}

.mode-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px;
  width: min(100%, 520px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.mode-tab {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 6px;
  background: transparent;
  color: var(--graphite);
  font-weight: 760;
}

.mode-tab.is-active {
  background: var(--teal);
  color: #ffffff;
}

.prompt-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.36fr) minmax(0, 0.64fr);
  gap: 24px;
  align-items: start;
}

.prompt-summary {
  padding-top: 10px;
}

.panel-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 14px;
  padding: 0 10px;
  border-radius: 6px;
  background: #f3ead7;
  color: var(--clay);
  font-size: 13px;
  font-weight: 760;
}

.prompt-summary h3 {
  font-size: clamp(26px, 3.4vw, 42px);
}

.prompt-summary p:not(.panel-kicker) {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.prompt-box {
  overflow: hidden;
  box-shadow: var(--shadow);
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.prompt-label {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.copy-button {
  min-width: 76px;
  min-height: 38px;
  border-radius: 7px;
  background: var(--graphite);
  color: #ffffff;
  font-size: 14px;
  font-weight: 720;
}

.copy-button.is-done {
  background: var(--amber);
}

pre {
  min-height: 520px;
  max-height: 620px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  background: var(--code);
  color: #e8efe9;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

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

.scenario-card ul {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding-left: 20px;
  color: var(--graphite);
}

.scenario-card li::marker {
  color: var(--teal);
  font-weight: 800;
}

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

.rule-grid code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #ece6d8;
  color: var(--graphite);
  font-size: 0.92em;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(20px, 6vw, 76px);
  background: var(--code);
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.footer p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.55);
  outline-offset: 3px;
}

@media (max-width: 1040px) {
  .site-header {
    position: absolute;
  }

  .nav {
    display: none;
  }

  .hero {
    min-height: 760px;
    padding-top: 104px;
  }

  .hero-scrim {
    background:
      linear-gradient(90deg, rgba(10, 20, 18, 0.9) 0%, rgba(10, 20, 18, 0.66) 100%),
      linear-gradient(0deg, rgba(10, 20, 18, 0.75) 0%, rgba(10, 20, 18, 0.08) 56%);
  }

  .section-heading,
  .principles,
  .definition-grid,
  .problem-grid,
  .user-grid,
  .prompt-panel,
  .scenario-grid,
  .rule-grid {
    grid-template-columns: 1fr;
  }

  .prompt-summary {
    padding-top: 0;
  }
}

@media (max-width: 560px) {
  .site-header {
    height: 60px;
    padding-inline: 16px;
  }

  .hero {
    min-height: 720px;
    padding: 92px 18px 48px;
  }

  h1 {
    font-size: 39px;
  }

  h2 {
    font-size: 29px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .section {
    padding-inline: 18px;
  }

  .mode-tabs {
    grid-template-columns: 1fr;
  }

  .prompt-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .copy-button {
    width: 100%;
  }

  pre {
    min-height: 460px;
    max-height: 560px;
  }

  .footer {
    display: grid;
  }
}
