:root {
  --ink: #20242c;
  --muted: #667085;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --line: #d8ded7;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --berry: #b4234d;
  --amber: #d88a1d;
  --mint: #e7f3f0;
  --rose: #fae9ee;
  --sand: #f3eee2;
  --shadow: 0 18px 42px rgba(32, 36, 44, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7fbf8 0%, var(--paper) 46%, #f7f3ea 100%);
  font-family: Arial, Helvetica, sans-serif;
}

a,
button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 70px;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(216, 222, 215, 0.82);
  background: rgba(251, 250, 247, 0.91);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  letter-spacing: 0;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topnav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.topnav a:hover {
  color: var(--teal-dark);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: clamp(26px, 5vw, 76px);
  align-items: center;
  padding: clamp(42px, 7vw, 82px) 0 30px;
}

.hero h1 {
  max-width: 790px;
  margin: 0;
  font-size: clamp(38px, 5.7vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--berry);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-kicker {
  margin-bottom: 6px;
}

.lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.58;
}

.hero-actions,
.actions,
.button-row,
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 24px;
}

.trust-row {
  margin-top: 20px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #44505f;
  font-size: 13px;
  font-weight: 800;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-button {
  border: 1px solid var(--teal);
  color: #fff;
  background: var(--teal);
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
}

.primary-button:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid #bec8c2;
  color: var(--ink);
  background: #fff;
}

.secondary-button:hover {
  border-color: var(--teal);
}

.ghost-button {
  border: 1px solid transparent;
  color: var(--teal-dark);
  background: var(--mint);
}

.ghost-button:hover {
  background: #d9ebe7;
}

.hero-preview {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  min-height: 238px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.book-cover {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 2 / 3;
  width: 140px;
  padding: 18px 14px;
  color: #fff;
  border-radius: 6px;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.95), rgba(180, 35, 77, 0.88)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 10px);
  box-shadow: 0 16px 28px rgba(32, 36, 44, 0.16);
}

.book-cover span {
  display: block;
  overflow-wrap: anywhere;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.12;
}

.book-cover small {
  font-weight: 700;
}

.preview-copy strong {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
}

.preview-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.mini-meter {
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 8px;
  background: #e6ebe6;
}

.mini-meter span {
  display: block;
  width: 76%;
  height: 100%;
  background: var(--teal);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.94fr) minmax(360px, 1.06fr);
  gap: 22px;
  align-items: start;
  padding: 30px 0 56px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 28px rgba(32, 36, 44, 0.07);
}

.form-panel,
.result-panel {
  padding: clamp(18px, 3vw, 26px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

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

h2 {
  font-size: 25px;
}

h3 {
  font-size: 17px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-grid.compact {
  align-items: end;
}

label,
.control-group {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
}

label span,
legend {
  color: #3b414c;
  font-size: 13px;
  font-weight: 800;
}

fieldset {
  padding: 0;
  border: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd3cd;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 112px;
  padding: 12px;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid #cbd3cd;
  border-radius: 8px;
  background: #f2f5f1;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.segmented input:checked + label {
  color: #fff;
  background: var(--teal);
}

.meter {
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.meter.is-warn {
  color: var(--berry);
}

.score-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.score-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-size: 22px;
  font-weight: 900;
}

.score-label {
  color: var(--muted);
  font-weight: 800;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.tab.is-active {
  color: var(--teal-dark);
  border-color: var(--teal);
}

.tab-view {
  display: none;
}

.tab-view.is-active {
  display: block;
}

.output-box,
.code-box {
  min-height: 430px;
  margin: 0 0 14px;
  padding: 18px;
  border: 1px solid #dce1db;
  border-radius: 8px;
  background: #fffdf9;
  line-height: 1.62;
  white-space: pre-wrap;
}

.code-box {
  overflow: auto;
  color: #283041;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.check-list {
  display: grid;
  gap: 10px;
  min-height: 430px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: #fff;
  line-height: 1.45;
}

.check-list li.warn {
  border-left-color: var(--berry);
  background: var(--rose);
}

.check-list li.note {
  border-left-color: var(--amber);
}

.examples-band,
.tip-band,
.pro-band {
  display: grid;
  gap: 24px;
  padding: clamp(34px, 5vw, 58px) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 780px;
}

.section-head p,
.pro-band p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

.example-grid,
.tip-grid,
.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.example-grid article,
.tip-grid article,
.price-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.example-grid span {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--berry);
  font-weight: 900;
}

.example-grid p,
.tip-grid p,
.price-grid span {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.52;
}

.pro-band {
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  align-items: center;
}

.price-grid article {
  display: grid;
  gap: 6px;
}

.price-grid strong {
  font-size: 25px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .hero,
  .workspace,
  .pro-band {
    grid-template-columns: 1fr;
  }

  .hero-preview {
    max-width: 560px;
  }

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

@media (max-width: 680px) {
  .topbar,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    gap: 10px;
    justify-content: space-between;
    overflow-x: auto;
  }

  .field-grid,
  .example-grid,
  .tip-grid,
  .price-grid {
    grid-template-columns: 1fr;
  }

  .hero-preview {
    grid-template-columns: 96px minmax(0, 1fr);
    padding: 16px;
  }

  .book-cover {
    width: 96px;
    padding: 12px 10px;
  }

  .book-cover span {
    font-size: 14px;
  }

  .output-box,
  .code-box,
  .check-list {
    min-height: 340px;
  }
}
