:root {
  --bg: #e9e7e2;
  --surface: #f7f6f3;
  --text: #1f2937;
  --muted: #5d6672;
  --line: #d2cec7;
  --accent: #ff8a00;
  --accent-dark: #d96f00;
  --soft: #f1e4d5;
  --shadow: 0 18px 55px rgba(31, 41, 55, .10);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

body::before,
body::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

body::before {
  width: 420px;
  height: 420px;
  right: -120px;
  top: 70px;
  background: radial-gradient(circle at 45% 45%, rgba(255,138,0,.18), rgba(255,138,0,.05) 54%, transparent 72%);
  animation: xlplain-float-a 13s ease-in-out infinite alternate;
}

body::after {
  width: 360px;
  height: 360px;
  left: 34px;
  top: 330px;
  background: radial-gradient(circle at 55% 45%, rgba(108,117,128,.14), rgba(108,117,128,.04) 58%, transparent 74%);
  animation: xlplain-float-b 16s ease-in-out infinite alternate;
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

a { color: var(--accent-dark); }

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(210,206,199,.94);
  background: rgba(233,231,226,.95);
  backdrop-filter: blur(14px);
}

.nav {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: block;
  width: 138px;
  height: 40px;
  flex: 0 0 138px;
  overflow: hidden;
  text-indent: -9999px;
  text-decoration: none;
  background: url("assets/xlplain-logo-compact.svg?v=1") left center / contain no-repeat;
}

.brand::before { content: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color .18s ease, transform .18s ease;
}

.nav-links a:hover {
  color: var(--accent-dark);
  transform: translateY(-1px);
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: visible;
  padding: 86px 0 64px;
}

.hero::before,
.hero::after {
  display: none;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 54px;
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid #dfc8ad;
  background: var(--soft);
  border-radius: 999px;
  color: #75400b;
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 20px 0 18px;
  font-size: clamp(44px, 7vw, 78px);
  line-height: .98;
  letter-spacing: -.055em;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 13px;
  text-decoration: none;
  font-weight: 750;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(31,41,55,.10);
}

.button.primary {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}

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

.button:disabled,
.button[disabled] {
  cursor: not-allowed;
  opacity: .52;
}

.hero-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 64px rgba(31,41,55,.13);
  border-color: #c5beb4;
}

.price {
  font-size: 42px;
  font-weight: 850;
  letter-spacing: -.045em;
}

.small { color: var(--muted); font-size: 14px; }

.meta {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.meta-row span:first-child { color: var(--muted); }

section {
  padding: 70px 0;
}

.section-title {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: -.04em;
}

.section-lead {
  max-width: 760px;
  color: var(--muted);
  margin: 0 0 32px;
}

#features .section-lead,
#license .section-lead {
  max-width: none;
}

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

.card {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 38px rgba(31,41,55,.10);
  border-color: #c4beb5;
}

.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }

.buy-section {
  padding-top: 34px;
  padding-bottom: 78px;
}

.purchase-shell {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(380px, .75fr);
  gap: 54px;
  align-items: start;
}

.purchase-copy {
  padding-top: 10px;
}

.purchase-copy .kicker {
  margin-bottom: 34px;
}

.purchase-copy .section-title {
  margin: 0 0 18px;
}

.purchase-copy .section-lead {
  margin-bottom: 28px;
}

.purchase-benefits {
  display: grid;
  gap: 12px;
}

.purchase-benefit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247,246,243,.72);
  transition: transform .18s ease, background .18s ease;
}

.purchase-benefit:hover {
  transform: translateX(3px);
  background: rgba(247,246,243,.94);
}

.purchase-benefit strong,
.purchase-benefit span {
  display: block;
  width: 100%;
}

.purchase-benefit strong {
  line-height: 1.35;
  font-size: 16px;
}

.purchase-benefit span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.purchase-card {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}

.purchase-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 64px rgba(31,41,55,.13);
}

.purchase-card h3 {
  margin: 16px 0 8px;
  font-size: 26px;
  letter-spacing: -.02em;
}

.purchase-intro {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.status-badge {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f5e7c9;
  border: 1px solid #ddc58f;
  color: #66521e;
  font-size: 13px;
  font-weight: 700;
}

.purchase-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fdfcf9;
  color: var(--text);
  font: inherit;
}

.field input:focus {
  outline: 2px solid rgba(255,138,0,.18);
  border-color: var(--accent);
}

.agreement-box {
  display: grid;
  gap: 10px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f2f1ee;
}

.check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.check-row input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
}

.purchase-submit {
  width: 100%;
  margin-top: 2px;
}

.purchase-fallback {
  display: block;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.purchase-fallback a {
  display: inline;
  margin-left: 4px;
  font-weight: 700;
}

.steps {
  display: grid;
  gap: 12px;
  counter-reset: step;
}

.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  align-items: start;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  transition: transform .18s ease, border-color .18s ease;
}

.step:hover {
  transform: translateX(3px);
  border-color: #c4beb5;
}

.step::before {
  content: counter(step);
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--soft);
  color: #75400b;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.notice {
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--soft);
  border: 1px solid #dfc8ad;
}

.result-page {
  min-height: calc(100vh - 170px);
  display: grid;
  place-items: center;
  padding: 70px 0;
}

.result-card {
  width: min(720px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.result-card h1 {
  margin: 14px 0 16px;
  font-size: clamp(36px, 6vw, 58px);
}

.result-card p {
  color: var(--muted);
}

.result-card .actions {
  margin-top: 24px;
}

.legal {
  max-width: 860px;
  padding: 52px 0 80px;
}

.legal h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
}

.legal h2 {
  margin-top: 36px;
  font-size: 24px;
  letter-spacing: -.025em;
}

.legal h3 { margin-top: 28px; }

.legal p, .legal li { color: #3f4650; }

.legal table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.legal td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.legal tr:last-child td { border-bottom: 0; }
.legal td:first-child { width: 34%; color: var(--muted); }

footer {
  padding: 36px 0 50px;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.footer-brand {
  display: inline-block;
  text-decoration: none;
  margin-bottom: 10px;
}

.footer-brand img,
footer img[alt^="XLPlain"] {
  display: block;
  width: 300px !important;
  max-width: min(72vw, 300px) !important;
  height: auto !important;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.footer-links a {
  color: var(--muted);
  font-size: 14px;
}

@keyframes xlplain-float-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-28px, 34px, 0) scale(1.08); }
}

@keyframes xlplain-float-b {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(34px, -22px, 0) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 900px) {
  .purchase-shell { grid-template-columns: 1fr; gap: 30px; }
  .purchase-card { max-width: 680px; }
}

@media (max-width: 820px) {
  .hero-grid, .grid, .footer-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 58px; }
  .nav-links { display: none; }
  .footer-links {
    align-items: flex-start;
    justify-content: flex-start;
  }
  .footer-brand img,
  footer img[alt^="XLPlain"] { width: 260px !important; }
}

@media (max-width: 520px) {
  .container { width: min(100% - 26px, 1120px); }
  .hero { padding: 44px 0 40px; }
  section { padding: 52px 0; }
  .meta-row { flex-direction: column; gap: 2px; }
  .result-card { padding: 26px 22px; }
  .purchase-card { padding: 22px; }
  body::before { right: -210px; }
  body::after { left: -120px; top: 360px; }
}
