:root {
  --text: #171322;
  --muted: #6d6879;
  --line: rgba(28, 20, 47, 0.10);
  --primary: #6d28d9;
  --pink: #ec4899;
  --orange: #f97316;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --shadow-sm: 0 12px 38px rgba(55, 37, 92, 0.08);
  --shadow-lg: 0 30px 90px rgba(66, 40, 116, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  background:
    radial-gradient(circle at 8% 6%, rgba(196, 181, 253, 0.42), transparent 28rem),
    radial-gradient(circle at 92% 10%, rgba(253, 186, 116, 0.35), transparent 30rem),
    linear-gradient(180deg, #fcfbff 0%, #f8f7ff 58%, #fff 100%);
}

h1, h2, h3, .eyebrow, .result-value, .metric strong { font-family: "Manrope", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.nav { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-logo { display: inline-flex; align-items: center; line-height: 1; }
.brand-logo picture, .brand-logo img { display: block; }
.brand-logo img { width: auto; height: 50px; max-width: 228px; object-fit: contain; }
.navlinks { display: flex; align-items: center; gap: 24px; color: var(--muted); font-weight: 700; }
.navlinks a:hover { color: var(--primary); }
.nav-cta { padding: 11px 17px; border-radius: 999px; color: #fff !important; background: #171322; }

.hero { padding: 44px 0 20px; }
.crumbs { margin-bottom: 18px; color: var(--muted); font-size: 0.88rem; font-weight: 700; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid rgba(109, 40, 217, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.13); }
.hero h1 { max-width: 1000px; margin: 18px 0 14px; font-size: clamp(2.7rem, 6vw, 5rem); line-height: 0.98; letter-spacing: -0.058em; }
.gradient { background: linear-gradient(90deg, var(--primary), var(--pink), var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { max-width: 930px; margin: 0; color: var(--muted); font-size: 1.06rem; line-height: 1.7; }
.benefits { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.benefits span { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.84); color: var(--muted); font-size: 0.84rem; font-weight: 800; }

.workspace { padding: 0 0 80px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.calculator { overflow: hidden; border: 1px solid rgba(109, 40, 217, 0.15); border-radius: 30px; background: #fff; box-shadow: var(--shadow-lg); }
.calculator-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 22px 24px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, #fbfaff); }
.calculator-header h2 { margin: 0; font-size: 1.24rem; }
.calculator-header p { margin: 5px 0 0; color: var(--muted); font-size: 0.9rem; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; color: var(--green); background: #ecfdf3; font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.status::before { content: "●"; font-size: 0.56rem; }
.calculator-body { padding: 22px; }

.tool-head { display: none; }
.panel { padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.field { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #faf9ff; }
.field label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); outline: 0; }
.field textarea { min-height: 170px; padding: 13px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(109, 40, 217, 0.5); box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.08); }
.toggle-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.toggle { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: #faf9ff; color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.toggle input { accent-color: var(--primary); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: #f7f5fb; color: var(--text); font-weight: 800; }
.btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--primary), var(--pink)); box-shadow: 0 12px 28px rgba(109, 40, 217, 0.2); }
.message { display: none; margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 0.84rem; font-weight: 700; }
.message.show, .message.success, .message.error { display: block; }
.message.success { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.message.error { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; }

.result { margin-top: 20px; overflow: hidden; border: 1px solid rgba(109, 40, 217, 0.15); border-radius: 22px; background: #fff; }
.result-hero { padding: 22px; background: linear-gradient(135deg, #f6f0ff, #fff4f8); }
.result-hero small { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.result-hero strong { display: block; margin-top: 7px; color: var(--primary); font-family: "Manrope", sans-serif; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.05em; overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 18px; }
.metric { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #faf9ff; }
.metric strong { display: block; font-size: 1.05rem; overflow-wrap: anywhere; }
.metric span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.72rem; }
.output { padding: 18px; border-top: 1px solid var(--line); }
.output pre { margin: 0; padding: 16px; overflow: auto; border-radius: 14px; background: #171322; color: #f5f3ff; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview { display: block; max-width: 100%; height: auto; margin-inline: auto; border-radius: 16px; }
.canvas-wrap { display: grid; place-items: center; padding: 18px; border: 1px dashed rgba(109, 40, 217, 0.25); border-radius: 18px; background: #faf9ff; }
.dropzone { padding: 28px; border: 1px dashed rgba(109, 40, 217, 0.3); border-radius: 18px; background: #faf9ff; text-align: center; }
.dropzone input { max-width: 100%; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.data-table th, .data-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.data-table th { background: #faf9ff; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; }
.brand-result { display: flex; justify-content: space-between; gap: 16px; padding: 15px 18px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 0.75rem; }
.brand-result strong { color: var(--primary); }

.aside { position: sticky; top: 94px; display: grid; gap: 16px; }
.info-card { padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, 0.9); box-shadow: var(--shadow-sm); }
.info-card h2, .info-card h3 { margin: 0 0 12px; }
.info-card p, .info-card li { color: var(--muted); line-height: 1.65; font-size: 0.92rem; }
.info-card ul { margin: 0; padding-left: 20px; }

.content { padding: 82px 0; background: #171322; color: #fff; }
.content-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; }
.content-card { padding: 30px; border: 1px solid rgba(255, 255, 255, 0.10); border-radius: 26px; background: rgba(255, 255, 255, 0.055); }
.content-card h2 { margin: 18px 0 16px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.08; letter-spacing: -0.05em; }
.content-card h3 { margin: 26px 0 10px; }
.content-card p, .content-card li { color: #c9c3d3; line-height: 1.75; }

.faq { padding: 80px 0; }
.faq-grid { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 44px; }
.faq h2 { margin: 10px 0; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.05em; }
details { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
summary { cursor: pointer; padding: 20px; font-weight: 800; }
details p { margin: 0; padding: 0 20px 20px; color: var(--muted); line-height: 1.7; }

.footer { padding: 34px 0; background: #0f0c17; color: #b8b1c4; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.footer-brand img { width: auto; height: 54px; max-width: 245px; object-fit: contain; }
.footer-copy { text-align: right; }
.footer-copy strong { display: block; margin-bottom: 6px; color: #fff; }

@media (max-width: 1000px) {
  .workspace-grid, .content-grid, .faq-grid { grid-template-columns: 1fr; }
  .aside { position: static; grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .navlinks a:not(.nav-cta) { display: none; }
  .brand-logo img { height: 42px; max-width: 188px; }
  .brand-logo picture img { width: 42px; height: 42px; max-width: 42px; }
  .calculator-header { align-items: flex-start; flex-direction: column; }
  .grid, .grid.two { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .aside { grid-template-columns: 1fr; }
  .footer-row { flex-direction: column; align-items: flex-start; }
  .footer-copy { text-align: left; }
}
@media (max-width: 480px) {
  .shell { width: min(100% - 20px, 1180px); }
  .calculator-body { padding: 14px; }
  .panel { padding: 14px; }
  .metrics { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 100%; }
  .brand-result { flex-direction: column; }
}
