:root {
  color-scheme: dark;
  --bg: #07090f;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f8fbff;
  --muted: #a7b0c0;
  --soft: #d7deea;
  --cyan: #38d6ff;
  --pink: #ff4da6;
  --lime: #d3ff4f;
  --orange: #ff9f43;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  --radius: 26px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(56, 214, 255, 0.20), transparent 28rem),
    radial-gradient(circle at 86% 4%, rgba(255, 77, 166, 0.20), transparent 30rem),
    linear-gradient(135deg, #07090f 0%, #111827 52%, #06070b 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  overflow: hidden;
}

.hero {
  position: relative;
  min-height: 94vh;
  display: grid;
  align-items: center;
  padding: 34px 18px 46px;
}

.hero__ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 84%);
}

.hero__content,
.examples-section,
.chart-section,
.method-section {
  position: relative;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.kicker {
  margin: 0 0 14px;
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 960px;
  margin-bottom: 18px;
  font-size: clamp(2.55rem, 8.8vw, 6.4rem);
  line-height: 0.95;
  font-weight: 900;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 4.7rem);
  line-height: 0.94;
  font-weight: 900;
}

.hero__lead {
  max-width: 720px;
  margin-bottom: 30px;
  color: var(--soft);
  font-size: clamp(1.05rem, 3.2vw, 1.45rem);
  line-height: 1.5;
}

.calculator,
.method-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.calculator {
  padding: clamp(18px, 4vw, 34px);
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field-label--spaced {
  margin-top: 22px;
}

.amount-wrap {
  position: relative;
}

.amount-input,
.title-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  color: var(--text);
  background: rgba(3, 6, 13, 0.58);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.amount-input {
  min-height: 88px;
  padding: 18px clamp(18px, 4vw, 30px);
  font-size: clamp(2.05rem, 8vw, 5.8rem);
  font-weight: 900;
  line-height: 1;
}

.title-input {
  min-height: 62px;
  padding: 0 20px;
  font-size: 1.1rem;
  font-weight: 700;
}

.amount-input:focus,
.title-input:focus,
.result-card:focus {
  border-color: rgba(56, 214, 255, 0.74);
  box-shadow: 0 0 0 4px rgba(56, 214, 255, 0.16);
}

.result-card {
  margin-top: 24px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(56, 214, 255, 0.22), transparent 22rem),
    linear-gradient(135deg, rgba(255, 77, 166, 0.15), rgba(255, 255, 255, 0.06));
  transform: translateZ(0);
}

.result-card.is-pulsing {
  animation: resultPop 360ms ease both;
}

.result-title,
.result-detail {
  display: block;
  color: var(--soft);
  font-weight: 700;
}

.result-title {
  margin-bottom: 10px;
  font-size: clamp(1rem, 3vw, 1.35rem);
}

.result-main {
  display: block;
  margin-bottom: 10px;
  font-size: clamp(2.6rem, 13vw, 8.4rem);
  line-height: 0.92;
  font-weight: 900;
}

.result-detail {
  font-size: clamp(1rem, 3vw, 1.35rem);
}

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

.button {
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  color: var(--text);
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  box-shadow: 0 16px 36px rgba(56, 214, 255, 0.2);
}

.button--ghost {
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.10);
}

.feedback {
  min-height: 1.3em;
  margin: 12px 0 0;
  color: var(--lime);
  font-weight: 800;
}

.examples-section,
.chart-section,
.method-section {
  padding: 56px 18px;
}

.section-heading {
  margin-bottom: 24px;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.example-card {
  min-height: 176px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055)),
    var(--panel);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.24);
  text-align: left;
}

.example-card:hover {
  border-color: rgba(56, 214, 255, 0.42);
}

.example-card__title {
  font-size: 1.08rem;
  font-weight: 900;
}

.example-card__amount {
  color: var(--muted);
  font-weight: 800;
}

.example-card__days {
  color: var(--lime);
  font-size: 2rem;
  font-weight: 900;
}

.chart {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(16px);
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 220px) 1fr auto;
  align-items: center;
  gap: 12px;
}

.bar-label,
.bar-value {
  font-weight: 900;
}

.bar-label {
  color: var(--soft);
}

.bar-value {
  color: var(--text);
  white-space: nowrap;
}

.bar-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
}

.bar-fill {
  display: block;
  height: 100%;
  min-width: 10px;
  width: var(--bar-width);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--pink), var(--lime));
  transform-origin: left center;
  animation: growBar 900ms ease both;
}

.bar-row--reference .bar-fill {
  background: linear-gradient(90deg, var(--orange), var(--lime));
}

.method-panel {
  padding: clamp(24px, 5vw, 42px);
}

.method-panel p:last-child {
  margin-bottom: 0;
  color: var(--soft);
  font-size: clamp(1.05rem, 2.6vw, 1.32rem);
  line-height: 1.65;
}

.sources-panel {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sources-panel h3 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  line-height: 1.1;
}

.sources-panel ul {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sources-panel li {
  color: var(--soft);
  font-size: 1rem;
  line-height: 1.55;
}

.sources-panel strong {
  color: var(--text);
}

.sources-panel a {
  display: inline-block;
  margin-left: 6px;
  color: var(--lime);
  font-weight: 800;
  text-decoration: none;
}

.sources-panel a:hover {
  color: var(--text);
}

.sources-note {
  margin: 18px 0 0;
  padding: 16px 18px;
  border: 1px solid rgba(211, 255, 79, 0.18);
  border-radius: 18px;
  background: rgba(211, 255, 79, 0.055);
  color: var(--soft);
  font-size: 0.98rem;
  line-height: 1.6;
}

.sources-note a {
  margin-left: 0;
}

.site-footer {
  width: min(1120px, calc(100% - 36px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 10px auto 0;
  padding: 24px 0 38px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.footer-brand img {
  flex: 0 0 auto;
}

.footer-brand__dot {
  margin-left: -7px;
  color: #ffa726;
}

.footer-link {
  font-weight: 400;
}

.site-footer a:hover {
  color: var(--text);
}

.legal-page {
  min-height: 100vh;
}

.legal-hero {
  position: relative;
  min-height: calc(100vh - 86px);
  padding: 54px 18px 46px;
}

.legal-content {
  position: relative;
  width: min(900px, 100%);
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--lime);
  font-weight: 800;
  text-decoration: none;
}

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

.legal-panel {
  display: grid;
  gap: 24px;
  margin-top: 28px;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.legal-panel section {
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.legal-panel section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.legal-panel h2 {
  margin-bottom: 12px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.05;
}

.legal-panel p {
  max-width: 720px;
  margin-bottom: 8px;
  color: var(--soft);
  font-size: 1.05rem;
  line-height: 1.65;
}

@keyframes resultPop {
  0% {
    transform: scale(0.985);
  }
  60% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes growBar {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@media (max-width: 680px) {
  .hero {
    min-height: auto;
    padding-top: 28px;
  }

  .actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

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

  .bar-track {
    grid-column: 1 / -1;
    order: 3;
  }
}

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