:root {
  --ink: #12232b;
  --ink-soft: #35515c;
  --muted: #6a818c;
  --paper: #eef3f5;
  --paper-deep: #dce6eb;
  --brand: #0b4f5c;
  --brand-deep: #083943;
  --accent: #1f8a7a;
  --accent-soft: #c9ebe4;
  --fog: #b7cdd6;
  --line: rgba(18, 35, 43, 0.12);
  --shadow: 0 20px 48px rgba(8, 57, 67, 0.12);
  --radius: 3px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", "Segoe UI", sans-serif;
  --header-h: 4.25rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 45% at 0% 0%, rgba(31, 138, 122, 0.12), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 10%, rgba(183, 205, 214, 0.55), transparent 50%),
    linear-gradient(180deg, #f5f8fa 0%, var(--paper) 45%, #e5eef1 100%);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--brand-deep);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(245, 248, 250, 0.84);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
  text-decoration: none;
}

.brand__mark {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 2px;
  background: linear-gradient(145deg, var(--accent), var(--brand-deep));
}

.brand--footer {
  font-size: 1.1rem;
}

.nav {
  display: flex;
  gap: 1.25rem;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--brand);
}

.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(8, 57, 67, 0.82) 0%, rgba(8, 57, 67, 0.4) 48%, rgba(8, 57, 67, 0.18) 100%),
    linear-gradient(0deg, rgba(8, 57, 67, 0.55), transparent 42%),
    url("https://images.unsplash.com/photo-1600596542815-ffad4c1539a9?auto=format&fit=crop&w=2000&q=80")
      center / cover no-repeat;
  transform: scale(1.04);
  animation: hero-drift 18s var(--ease-out) infinite alternate;
}

@keyframes hero-drift {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(-1.5%, -1%, 0);
  }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 4.5rem 1.25rem 3.5rem;
  color: #f5f8fa;
}

.hero__brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.25rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.05;
  animation: rise 0.9s var(--ease-out) both;
}

.hero__title {
  margin: 0 0 0.85rem;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  font-weight: 500;
  line-height: 1.2;
  color: rgba(245, 248, 250, 0.92);
  animation: rise 0.9s var(--ease-out) 0.12s both;
}

.hero__lede {
  margin: 0 0 1.75rem;
  max-width: 34ch;
  font-size: 1.08rem;
  color: rgba(245, 248, 250, 0.84);
  animation: rise 0.9s var(--ease-out) 0.22s both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: rise 0.9s var(--ease-out) 0.32s both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), background 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--accent-soft);
  color: var(--brand-deep);
}

.btn--primary:hover {
  background: #dff4ef;
  color: var(--brand-deep);
}

.btn--ghost {
  background: transparent;
  color: #f5f8fa;
  border-color: rgba(245, 248, 250, 0.45);
}

.btn--ghost:hover {
  background: rgba(245, 248, 250, 0.1);
  color: #fff;
  border-color: rgba(245, 248, 250, 0.7);
}

.btn--block {
  width: 100%;
}

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 4.5rem 1.25rem;
}

.section__intro {
  max-width: 38rem;
  margin-bottom: 2.25rem;
}

.section__intro h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.4rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
}

.section__intro p {
  margin: 0;
  color: var(--ink-soft);
}

.calc {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: start;
}

.calc__controls,
.calc__results,
.apply-form {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 5px);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.calc__results {
  background: linear-gradient(165deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #eef3f5;
  border-color: transparent;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.calc__results-title {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 650;
}

.calc__rate {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.field {
  margin-bottom: 1.25rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.field__label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.45rem;
}

.field__label-row label {
  margin-bottom: 0;
}

.field__value {
  font-weight: 600;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.field__hints {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.field__error {
  margin: 0.4rem 0 0;
  color: #9b2c2c;
  font-size: 0.85rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
input[type="range"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 138, 122, 0.2);
}

input.is-invalid,
select.is-invalid {
  border-color: #c53030;
}

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--paper-deep);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(8, 57, 67, 0.35);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(8, 57, 67, 0.35);
  cursor: pointer;
}

.results {
  margin: 0 0 1.5rem;
}

.results__item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(238, 243, 245, 0.15);
}

.results__item:last-of-type {
  border-bottom: none;
}

.results__item dt {
  margin: 0;
  color: rgba(238, 243, 245, 0.72);
  font-size: 0.95rem;
}

.results__item dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.results__item--hero {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding-bottom: 1.1rem;
  margin-bottom: 0.25rem;
}

.results__item--hero dd {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  text-align: left;
}

.calc__results .btn--primary {
  background: #eef3f5;
  color: var(--brand-deep);
}

.calc__results .btn--primary:hover {
  background: #fff;
}

.section--apply {
  padding-bottom: 5rem;
}

.apply-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
}

.field--full {
  grid-column: 1 / -1;
}

.apply-form__note {
  margin: 0.25rem 0 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.form-status {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
}

.form-status.is-success {
  background: var(--accent-soft);
  color: var(--brand-deep);
}

.form-status.is-error {
  background: #fde8e8;
  color: #9b2c2c;
}

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.site-footer p {
  margin: 0 0 0.4rem;
}

.site-footer__meta {
  font-size: 0.88rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .calc {
    grid-template-columns: 1fr;
  }

  .calc__results {
    position: static;
  }
}

@media (max-width: 640px) {
  .hero__content {
    padding-top: 3.5rem;
  }

  .apply-form__grid {
    grid-template-columns: 1fr;
  }

  .nav {
    gap: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero__media,
  .hero__brand,
  .hero__title,
  .hero__lede,
  .hero__actions,
  .btn {
    animation: none !important;
    transition: none !important;
  }

  .hero__media {
    transform: none;
  }
}
