@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");

:root {
  color-scheme: light;
  --ink: #171a2e;
  --muted: #6f7487;
  --muted-strong: #555b70;
  --primary: #5965d8;
  --primary-dark: #4652c4;
  --primary-soft: #eef0ff;
  --line: #e8e9f1;
  --surface: #ffffff;
  --page: #f7f8fc;
  --result: #f1f3ff;
  --shadow: 0 24px 70px rgba(45, 51, 94, 0.1), 0 4px 16px rgba(45, 51, 94, 0.04);
  --radius-xl: 30px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(89, 101, 216, 0.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89, 101, 216, 0.027) 1px, transparent 1px),
    var(--page);
  background-size: 40px 40px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(89, 101, 216, 0.24);
  outline-offset: 3px;
}

svg {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-glow {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.page-glow--left {
  top: 185px;
  left: -320px;
  background: rgba(202, 207, 255, 0.32);
}

.page-glow--right {
  top: 80px;
  right: -285px;
  background: rgba(223, 225, 255, 0.46);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: "Manrope", "DM Sans", sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--primary);
  box-shadow: 0 8px 20px rgba(89, 101, 216, 0.22);
}

.brand__mark svg {
  width: 25px;
  height: 25px;
  fill: #fff;
}

.brand__mark .brand__star {
  fill: #cdd2ff;
}

.header-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.header-note__dot {
  width: 7px;
  height: 7px;
  border: 2px solid #afb6f5;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px #eceeff;
}

.page-shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  max-width: 730px;
  margin: 65px auto 45px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 17px;
  padding: 7px 12px;
  border: 1px solid #dfe2fa;
  border-radius: 999px;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 3px 10px rgba(68, 77, 151, 0.04);
}

.eyebrow svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.hero h1 {
  margin: 0;
  color: #171a2f;
  font-family: "Manrope", "DM Sans", sans-serif;
  font-size: clamp(42px, 5.4vw, 67px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.06;
}

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

.hero__copy {
  max-width: 585px;
  margin: 21px auto 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  overflow: hidden;
  border: 1px solid rgba(224, 226, 238, 0.9);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calculator__form {
  min-width: 0;
  padding: 44px 48px 46px;
}

.form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
}

.section-kicker {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-heading h2 {
  margin: 0;
  font-family: "Manrope", "DM Sans", sans-serif;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.step-badge {
  flex: none;
  margin-top: 3px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #747991;
  background: #f4f5f9;
  font-size: 11px;
  font-weight: 700;
}

.form-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-group legend,
.field-label {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  color: #25293c;
  font-size: 14px;
  font-weight: 700;
}

.field-number {
  display: inline-grid;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 800;
}

.field-hint {
  margin: 7px 0 15px 36px;
  color: #888d9e;
  font-size: 12px;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 12px 36px;
}

.preset,
.latency-options button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #696e81;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.preset:hover,
.latency-options button:hover {
  border-color: #cbd0f4;
  color: var(--primary-dark);
  background: #fafaff;
}

.preset:active,
.latency-options button:active {
  transform: scale(0.97);
}

.preset.is-active,
.latency-options button.is-active {
  border-color: #c8cdf8;
  color: var(--primary-dark);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(89, 101, 216, 0.03);
}

.duration-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-left: 36px;
}

.number-field {
  display: block;
  min-width: 0;
}

.number-field__control {
  display: flex;
  align-items: center;
  min-height: 49px;
  padding: 0 13px 0 15px;
  border: 1px solid #dfe1eb;
  border-radius: 12px;
  background: #fafbfe;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.number-field__control:focus-within {
  border-color: #aeb5ee;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(89, 101, 216, 0.09);
}

.number-field input {
  width: 100%;
  min-width: 35px;
  padding: 0;
  border: 0;
  outline: none;
  color: #292d42;
  background: transparent;
  font-size: 17px;
  font-weight: 700;
  -moz-appearance: textfield;
}

.number-field input::-webkit-outer-spin-button,
.number-field input::-webkit-inner-spin-button,
.latency-field input::-webkit-outer-spin-button,
.latency-field input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.number-field__unit {
  color: #8a8fa0;
  font-size: 11px;
  font-weight: 600;
}

.duration-separator {
  color: #a2a6b5;
  font-size: 18px;
  font-weight: 700;
}

.form-divider {
  height: 1px;
  margin: 26px 0;
  background: var(--line);
}

.time-field,
.latency-field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 53px;
  margin-left: 36px;
  border: 1px solid #dfe1eb;
  border-radius: 13px;
  background: #fafbfe;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.time-field:focus-within,
.latency-field:focus-within {
  border-color: #aeb5ee;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(89, 101, 216, 0.09);
}

.latency-field > svg {
  width: 19px;
  height: 19px;
  margin-left: 16px;
  color: #7d85d9;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.time-field input {
  min-width: 122px;
  height: 51px;
  margin-left: 16px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #292d42;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.time-field input::-webkit-calendar-picker-indicator {
  width: 18px;
  height: 18px;
  margin-left: 4px;
  opacity: 0.42;
  cursor: pointer;
}

.time-field__label {
  margin: 0 16px 0 auto;
  color: #979baa;
  font-size: 11px;
  font-weight: 600;
}

.latency-row {
  display: grid;
  grid-template-columns: minmax(175px, 1fr) auto;
  gap: 9px;
  margin-left: 36px;
}

.latency-field {
  min-width: 0;
  margin-left: 0;
}

.latency-field input {
  width: 52px;
  min-width: 0;
  margin-left: 11px;
  padding: 0;
  border: 0;
  outline: none;
  color: #292d42;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  -moz-appearance: textfield;
}

.latency-field span {
  margin-left: 2px;
  color: #858a9b;
  font-size: 11px;
  font-weight: 600;
}

.latency-options {
  display: grid;
  grid-template-columns: repeat(3, 43px);
  gap: 6px;
}

.latency-options button {
  min-height: 53px;
}

.form-error {
  margin: 18px 0 -5px 36px;
  color: #b33c51;
  font-size: 12px;
  font-weight: 600;
}

.calculate-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 36px);
  min-height: 55px;
  margin: 30px 0 0 36px;
  padding: 0 19px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 11px 25px rgba(89, 101, 216, 0.23);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.calculate-button:hover {
  background: var(--primary-dark);
  box-shadow: 0 13px 29px rgba(70, 82, 196, 0.28);
  transform: translateY(-1px);
}

.calculate-button:active {
  transform: translateY(1px);
}

.calculate-button svg {
  width: 19px;
  height: 19px;
  margin-left: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.calculate-button:hover svg {
  transform: translateX(3px);
}

.result-panel {
  position: relative;
  display: flex;
  min-width: 0;
  margin: 10px;
  padding: 54px 42px 38px;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #e0e3fb;
  border-radius: 23px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 35%),
    var(--result);
  text-align: center;
}

.result-panel::before,
.result-panel::after {
  position: absolute;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(133, 143, 224, 0.09);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.result-panel::before {
  top: -113px;
  right: -72px;
}

.result-panel::after {
  right: -110px;
  bottom: -108px;
  width: 250px;
  height: 250px;
}

.result-panel__dots {
  position: absolute;
  top: 30px;
  right: 29px;
  display: flex;
  gap: 5px;
}

.result-panel__dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b9bef1;
}

.result-panel__dots span:nth-child(2) {
  opacity: 0.7;
}

.result-panel__dots span:nth-child(3) {
  opacity: 0.4;
}

.result-icon {
  display: grid;
  width: 69px;
  height: 69px;
  margin-bottom: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(75, 86, 175, 0.11);
}

.result-icon svg {
  width: 42px;
  height: 42px;
  fill: var(--primary);
}

.result-icon .result-icon__star {
  fill: #aeb5f1;
}

.result-kicker {
  margin: 0 0 4px;
  color: #777e9a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-panel h2 {
  margin: 0;
  font-family: "Manrope", "DM Sans", sans-serif;
  font-size: clamp(48px, 5vw, 64px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1.1;
}

.result-panel h2 time {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.result-panel h2 span {
  margin-left: 7px;
  color: #515aaf;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.day-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 5px 9px 5px 7px;
  border: 1px solid #dfe3fb;
  border-radius: 999px;
  color: #646ba6;
  background: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 700;
}

.day-badge svg {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  color: #fff;
  background: #7d86dc;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-summary {
  max-width: 355px;
  margin: 19px auto 0;
  color: #6e748e;
  font-size: 13px;
  line-height: 1.7;
}

.timeline {
  z-index: 1;
  width: 100%;
  margin-top: 34px;
  padding: 20px 19px 17px;
  border: 1px solid rgba(218, 222, 248, 0.9);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.58);
}

.timeline__track {
  position: relative;
  height: 10px;
  margin: 0 7px 13px;
}

.timeline__track::before {
  position: absolute;
  top: 4px;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 99px;
  background: #d9ddf6;
  content: "";
}

.timeline__progress {
  position: absolute;
  z-index: 1;
  top: 4px;
  left: 0;
  width: 50%;
  height: 2px;
  background: #7983dc;
}

.timeline__point {
  position: absolute;
  z-index: 2;
  top: 1px;
  width: 8px;
  height: 8px;
  border: 2px solid #7c85dc;
  border-radius: 50%;
  background: #fff;
}

.timeline__point--start {
  left: 0;
}

.timeline__point--middle {
  left: 50%;
  transform: translateX(-50%);
  background: #7c85dc;
}

.timeline__point--end {
  right: 0;
  border-color: #aeb4de;
}

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

.timeline__labels div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.timeline__labels div:nth-child(2) {
  align-items: center;
}

.timeline__labels div:last-child {
  align-items: flex-end;
}

.timeline__labels span {
  color: #9196aa;
  font-size: 9px;
  font-weight: 600;
}

.timeline__labels strong {
  margin-top: 2px;
  color: #444960;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.result-note {
  z-index: 1;
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 10px;
  margin-top: 13px;
  padding: 13px 15px;
  border-radius: 13px;
  background: rgba(219, 223, 250, 0.6);
  text-align: left;
}

.result-note svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: #777fd1;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-note p {
  display: flex;
  margin: 0;
  flex-direction: column;
  color: #6e748f;
  font-size: 10px;
  line-height: 1.5;
}

.result-note strong {
  margin-bottom: 2px;
  color: #4f5574;
  font-size: 10px;
}

.result-panel.is-updated .result-icon {
  animation: result-pop 500ms cubic-bezier(0.2, 0.85, 0.35, 1.2);
}

.result-panel.is-updated h2 {
  animation: result-rise 420ms ease-out;
}

@keyframes result-pop {
  0% { transform: scale(0.88) rotate(-5deg); }
  65% { transform: scale(1.05) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes result-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.reassurance article {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
  padding: 17px 18px;
  border: 1px solid #e8e9f1;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
}

.reassurance__icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #6e77d3;
  background: #edefff;
}

.reassurance__icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reassurance h3 {
  margin: 0 0 2px;
  color: #3d4155;
  font-size: 11px;
  font-weight: 700;
}

.reassurance p {
  margin: 0;
  color: #888d9d;
  font-size: 9px;
  line-height: 1.45;
}

footer {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 37px 0 42px;
  color: #999dab;
  font-size: 11px;
  text-align: center;
}

footer p {
  margin: 0;
}

@media (max-width: 960px) {
  .hero {
    margin-top: 48px;
  }

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

  .calculator__form {
    padding: 42px 56px 44px;
  }

  .result-panel {
    min-height: 590px;
    padding-right: min(12vw, 90px);
    padding-left: min(12vw, 90px);
  }

  .result-summary {
    max-width: 430px;
  }

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

  .reassurance h3 {
    font-size: 12px;
  }

  .reassurance p {
    font-size: 10px;
  }
}

@media (max-width: 640px) {
  .site-header,
  .page-shell,
  footer {
    width: min(100% - 28px, 1120px);
  }

  .site-header {
    padding: 18px 0;
  }

  .brand__mark {
    width: 35px;
    height: 35px;
  }

  .header-note {
    display: none;
  }

  .hero {
    margin: 39px auto 31px;
  }

  .eyebrow {
    margin-bottom: 14px;
  }

  .hero h1 {
    font-size: clamp(39px, 12.5vw, 54px);
    line-height: 1.08;
  }

  .hero__copy {
    margin-top: 17px;
    font-size: 14px;
    line-height: 1.65;
  }

  .calculator {
    border-radius: 22px;
  }

  .calculator__form {
    padding: 30px 20px 28px;
  }

  .form-heading {
    margin-bottom: 29px;
  }

  .form-heading h2 {
    font-size: 22px;
  }

  .field-hint,
  .preset-row,
  .duration-inputs,
  .time-field,
  .latency-row,
  .form-error,
  .calculate-button {
    margin-left: 0;
  }

  .field-hint {
    margin-top: 8px;
  }

  .preset-row {
    gap: 6px;
  }

  .duration-inputs {
    gap: 6px;
  }

  .number-field__control {
    padding-right: 10px;
    padding-left: 12px;
  }

  .latency-row {
    grid-template-columns: 1fr;
  }

  .latency-options {
    grid-template-columns: repeat(3, 1fr);
  }

  .latency-options button {
    min-height: 39px;
  }

  .calculate-button {
    width: 100%;
  }

  .result-panel {
    min-height: 570px;
    margin: 7px;
    padding: 47px 18px 26px;
    border-radius: 18px;
  }

  .result-panel h2 {
    font-size: clamp(46px, 15vw, 59px);
  }

  .result-summary {
    max-width: 330px;
    font-size: 12px;
  }

  .timeline {
    padding-right: 13px;
    padding-left: 13px;
  }

  .timeline__labels strong {
    font-size: 9px;
  }

  .reassurance {
    gap: 9px;
    margin-top: 13px;
  }

  footer {
    padding-top: 29px;
  }
}

@media (max-width: 370px) {
  .preset {
    min-height: 35px;
    padding: 0 4px;
    font-size: 11px;
  }

  .field-label,
  .form-group legend {
    font-size: 13px;
  }

  .result-panel h2 span {
    margin-left: 4px;
    font-size: 16px;
  }

  .timeline__labels strong {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
