:root {
  --bg: #ffffff;
  --surface: #f7f9fc;
  --text: #202833;
  --muted: #687586;
  --border: #e0e5ec;
  --accent: #173B5B;
  --accent-hover: #1c5b92;
  --success: #26734d;
  --danger: #b33b3b;
  --radius: 10px;
  --container: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #b7cff2;
  outline-offset: 3px;
}

.container {
  width: min(var(--container), calc(100% - clamp(40px, 9vw, 144px)));
  margin-inline: auto;
}

.section {
  padding: 84px 0;
  scroll-margin-top: 76px;
}

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

h1,
h2,
h3,
h4 {
  color: var(--text);
  line-height: 1.25;
}

h1 {
  font-size: clamp(38px, 5.2vw, 62px);
  font-weight: 650;
  letter-spacing: -2.4px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(28px, 3.5vw, 39px);
  font-weight: 620;
  letter-spacing: -1.2px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.25px;
}

h4 {
  margin-bottom: 15px;
  font-size: 14px;
  font-weight: 600;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.35px;
  line-height: 1.5;
}

/* Header */

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 40px;
    color: #173B5B;
    letter-spacing: -1px;
    margin: 0;
    line-height: 1;
}

.rotor {
    font-weight: 400; /* Normal */
}

.bear {
    font-weight: 700; /* Bold */
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

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

.brand {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.8px;
  white-space: nowrap;
}

.brand span {
  color: var(--accent);
}

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

.nav-links a {
  color: #505c6b;
  font-size: 13px;
  transition: color 0.18s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

/* Homepage */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: min(760px, calc(100svh - 68px));
  padding: 100px 0 112px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.hero-background {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: -40%;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, #000 12%, transparent 72%);
  animation: grid-drift 32s linear infinite;
}

.hero-orb {
  position: absolute;
  display: block;
  width: 300px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(3px);
  opacity: 0.7;
}

.hero-orb-one {
  top: 5%;
  left: 10%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
  animation: float-one 13s ease-in-out infinite alternate;
}

.hero-orb-two {
  top: 24%;
  right: 8%;
  width: 360px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.13), transparent 70%);
  animation: float-two 17s ease-in-out infinite alternate;
}

.hero-orb-three {
  bottom: -12%;
  left: 42%;
  width: 270px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1), transparent 70%);
  animation: float-one 19s ease-in-out infinite alternate-reverse;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(850px, calc(100% - clamp(40px, 9vw, 144px)));
  margin-inline: auto;
  text-align: center;
  animation: hero-enter 0.75s ease both;
}

.hero-inner .eyebrow {
  margin-bottom: 22px;
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto 20px;
}

.hero h1 span {
  color: var(--accent);
}

.hero-description {
  max-width: 590px;
  margin: 0 auto 29px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

/* Buttons */

.button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(28, 61, 105, 0.1);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

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

.button-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button-secondary {
  color: var(--text);
  background: #fff;
  border-color: var(--border);
}

.button-secondary:hover:not(:disabled) {
  background: var(--surface);
  border-color: #c5d0df;
}

.button-quiet {
  color: var(--muted);
  background: transparent;
}

.button-quiet:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-hero {
  min-height: 47px;
  padding-inline: 20px;
}

.text-link {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.text-link:hover {
  color: var(--accent);
}

/* Section headings */

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-description {
  max-width: 455px;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

/* Products */

.products-section {
  border-bottom: 1px solid var(--border);
}

.product-list {
  border-top: 1px solid var(--border);
}

.product-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 23px;
  padding: 25px 16px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.product-item.premium-product {
  cursor: pointer;
}

.product-item.premium-product:hover {
  background: #f8faff;
}

.product-thumbnail {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(145deg, #f8fbff, #eef4fb);
}

.product-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-info h3 {
  margin-bottom: 7px;
}

.product-info p {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.product-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
}

.tag {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.tag-demo {
  color: var(--success);
  background: #f4faf6;
  border-color: #d7e9dc;
}

.tag-premium {
  color: #755b20;
  background: #fbf8ef;
  border-color: #e9dfbf;
}

.product-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.product-action a,
.product-link a {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.product-action a:hover,
.product-link a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.premium-button {
  min-height: 39px;
  padding: 8px 12px;
  white-space: nowrap;
  font-size: 12px;
}

/* Solver */

.solver-section {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.solver-intro {
  align-items: flex-start;
}

.solver-intro .section-description {
  padding-top: 23px;
}

.demo-notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 15px;
  margin-bottom: 24px;
  padding: 13px 15px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  font-size: 12px;
}

.demo-notice strong {
  font-size: 12px;
}

.demo-notice span {
  color: var(--muted);
}

.demo-notice a {
  margin-left: auto;
  color: var(--accent);
  font-weight: 600;
}

.demo-notice a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.message {
  display: none;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.message:not(:empty) {
  display: block;
}

.message.success {
  color: #205f3f;
  background: #f2faf5;
  border-color: #cde6d6;
}

.message.error {
  color: #8e2f2f;
  background: #fff6f6;
  border-color: #eccdcd;
}

.message.info {
  color: #294f7c;
  background: #f3f7fc;
  border-color: #d3e0f0;
}

.solver-panel {
  margin-bottom: 18px;
  padding: 25px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}

.panel-number {
  padding-top: 2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.panel-heading h3 {
  margin-bottom: 5px;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

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

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  color: #48525e;
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 41px;
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid #d5dbe2;
  border-radius: 7px;
  outline: none;
  font-size: 13px;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.solver-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 5px 0 34px;
}

/* Results */

.results-section {
  padding-top: 15px;
}

.results-heading {
  margin-bottom: 20px;
}

.results-heading h3 {
  margin-bottom: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 20px;
  border-right: 1px solid var(--border);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.7px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 35px;
}

.chart-panel {
  min-width: 0;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.chart-panel-wide {
  grid-column: 1 / -1;
}

.chart {
  width: 100%;
  min-height: 310px;
}

.table-heading {
  margin-bottom: 16px;
}

.table-heading h3 {
  margin-bottom: 6px;
}

.table-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 10px;
}

.table-tools label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.table-tools select {
  min-height: 36px;
  padding: 6px 30px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.table-hint {
  color: var(--muted);
  font-size: 11px;
}

.table-wrap {
  --visible-result-rows: 15;
  max-height: calc(44px * var(--visible-result-rows) + 48px);
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.results-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  font-size: 12px;
}

.results-table th,
.results-table td {
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid #e8ebef;
}

.results-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #46515e;
  background: #f5f7f9;
  font-size: 11px;
  font-weight: 700;
}

.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.results-table tbody tr:hover {
  background: #fafbfd;
}

.empty-state {
  padding: 25px !important;
  color: var(--muted);
  text-align: center !important;
}

.status-success {
  color: var(--success);
  font-weight: 600;
}

.status-failed {
  color: var(--danger);
  font-weight: 600;
}

/* About */

.about-section {
  border-bottom: 1px solid var(--border);
}

.about-intro {
  max-width: 790px;
  margin-bottom: 38px;
}

.about-intro h2 {
  max-width: 690px;
}

.about-intro > p:last-child {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

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

.capability-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.capability-number {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.capability-card h3 {
  margin-bottom: 12px;
  font-size: 20px;
}

.capability-card > p {
  margin-bottom: 23px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.capability-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.capability-tags span {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: #526174;
  background: #fafbfd;
  font-size: 10px;
  font-weight: 600;
}

/* Contact and footer */

.contact-section {
  background: var(--surface);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 70px;
}

.contact-layout h2 {
  max-width: 500px;
}

.contact-layout .section-description {
  max-width: 510px;
}

.contact-links {
  display: grid;
  border-top: 1px solid var(--border);
}

.contact-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 17px 0;
  border-bottom: 1px solid var(--border);
}

.contact-link-label {
  color: var(--muted);
  font-size: 12px;
}

.contact-link-value {
  color: var(--accent);
  font-size: 15px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.contact-link:hover .contact-link-value {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer {
  padding: 22px 0;
  background: #fff;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-inner .brand {
  font-size: 18px;
}

.footer-inner p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

/* Premium dialog */

.premium-dialog {
  width: min(480px, calc(100% - 32px));
  max-width: 480px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 24px 90px rgba(15, 31, 55, 0.24);
}

.premium-dialog::backdrop {
  background: rgba(14, 25, 42, 0.48);
  backdrop-filter: blur(3px);
}

.premium-dialog-inner {
  position: relative;
  padding: 34px;
}

.premium-dialog-inner h2 {
  padding-right: 20px;
  font-size: 27px;
}

.premium-dialog-inner p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.8;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 13px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
}

/* Animation */

@keyframes grid-drift {
  to {
    transform: translate3d(42px, 42px, 0);
  }
}

@keyframes float-one {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(28px, -24px, 0);
  }
}

@keyframes float-two {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-25px, 22px, 0);
  }
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive layout */

@media (max-width: 900px) {
  .container {
    width: calc(100% - 64px);
  }

  .hero-inner {
    width: calc(100% - 64px);
  }

  .section {
    padding: 68px 0;
  }

  .section-heading {
    display: block;
  }

  .section-description {
    margin-top: 17px;
  }

  .product-item {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 15px;
    padding-inline: 8px;
  }

  .product-thumbnail {
    width: 72px;
    height: 72px;
  }

  .product-link {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
  }

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

  .about-layout,
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .solver-intro .section-description {
    padding-top: 0;
  }

  .demo-notice a {
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .container,
  .hero-inner {
    width: calc(100% - 40px);
  }

  .section {
    padding: 58px 0;
  }

  .nav {
    min-height: 62px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
  }

  .brand {
    font-size: 19px;
  }

  .nav-links {
    width: 100%;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-links a {
    font-size: 12px;
    white-space: nowrap;
  }

  .hero {
    min-height: 560px;
    min-height: calc(100svh - 62px);
    padding: 64px 0 76px;
  }

  h1 {
    font-size: clamp(36px, 9vw, 44px);
    letter-spacing: -1.7px;
  }

  h2 {
    font-size: 30px;
    letter-spacing: -0.9px;
  }

  .hero-description {
    font-size: 15px;
  }

  .hero-actions {
    flex-direction: column;
    gap: 17px;
  }

  .button-hero {
    width: min(280px, 100%);
  }

  .product-item {
    padding: 21px 5px;
  }

  .product-thumbnail {
    width: 64px;
    height: 64px;
  }

  .product-title-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .solver-panel {
    padding: 18px 14px;
  }

  .form-grid,
  .form-grid-three {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .solver-actions .button {
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel-wide {
    grid-column: auto;
  }

  .chart {
    min-height: 270px;
  }

  .demo-notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .capability-grid {
    grid-template-columns: 1fr;
  }

  .capability-card {
    padding: 23px;
  }

  .premium-dialog-inner {
    padding: 28px 22px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

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

.product-link .button.button-primary {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 14px !important;
  opacity: 1 !important;
  visibility: visible !important;
}