:root {
  color-scheme: light;
  --ink: #14212f;
  --muted: #667085;
  --line: #d9e1ea;
  --panel: rgba(255, 255, 255, 0.88);
  --blue: #1f6f8b;
  --red: #d1495b;
  --gold: #f7b267;
  --space: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(247, 178, 103, 0.34), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(31, 111, 139, 0.18), transparent 26rem),
    linear-gradient(135deg, #fffaf2 0%, #eef5f7 52%, #f8fbff 100%);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.language-switcher {
  display: flex;
  width: max-content;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.language-option {
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  background: transparent;
  box-shadow: none;
  opacity: 0.52;
  filter: saturate(0.7);
  transition: 0.18s ease;
}

.language-option:hover,
.language-option:focus-visible {
  opacity: 0.85;
}

.language-option.is-active {
  opacity: 1;
  background: rgba(31, 111, 139, 0.12);
  box-shadow: 0 0 0 1px rgba(31, 111, 139, 0.24);
  filter: none;
}

.language-flag {
  display: block;
  width: 21px;
  height: 14px;
  margin: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(20, 33, 47, 0.16);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  gap: 42px;
  align-items: center;
  min-height: 330px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 4vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: 0;
  color: var(--space);
}

h1 > span {
  display: block;
}

.title-line,
.subtitle-line {
  white-space: nowrap;
}

.title-line {
  display: flex;
  align-items: center;
  gap: 0.28em;
}

.title-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.14em;
  transform: translateY(0.03em);
}

.antenna-emoji {
  display: inline-flex;
  width: 0.58em;
  height: 0.58em;
  line-height: 1;
}

.antenna-emoji img {
  display: block;
  width: 100%;
  height: 100%;
}

.title-icons img {
  display: block;
  width: 0.58em;
  height: 0.58em;
  object-fit: contain;
}

.title-icons img:first-child {
  width: 0.82em;
}

.subtitle-line {
  max-width: 720px;
  margin-top: 4px;
  font-size: 0.38em;
  line-height: 1.28;
  white-space: normal;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.lead {
  max-width: 780px;
  color: var(--space);
  font-size: 1rem;
  line-height: 1.68;
}

.lead-secondary {
  color: var(--space);
}

.instructions {
  max-width: 780px;
  color: var(--muted);
  line-height: 1.7;
}

.sun-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  width: min(100%, 400px);
  min-height: 260px;
  border: 1px solid rgba(217, 225, 234, 0.85);
  border-radius: 8px;
  overflow: hidden;
  background: #080604;
  box-shadow: 0 24px 70px rgba(20, 33, 47, 0.16);
}

.sun-panel img {
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
  object-fit: contain;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: stretch;
  margin-top: 22px;
}

.control-panel,
.status-panel,
.alert,
.chart-card {
  border: 1px solid rgba(217, 225, 234, 0.9);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(20, 33, 47, 0.08);
}

.control-panel {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 18px;
  align-items: end;
  padding: 22px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #344054;
  font-size: 0.88rem;
  font-weight: 700;
}

input[type="text"] {
  width: 100%;
  height: 48px;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

input[type="text"]:focus,
button:focus-visible {
  outline: 3px solid rgba(31, 111, 139, 0.22);
  border-color: var(--blue);
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 62px;
  gap: 12px;
  align-items: center;
  min-height: 48px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

output {
  color: var(--space);
  font-weight: 800;
}

button {
  height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  color: #fff;
  font: inherit;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), #174e64);
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(31, 111, 139, 0.25);
}

button:hover {
  filter: brightness(1.05);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.52;
  box-shadow: none;
}

a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.status-panel {
  padding: 26px;
}

.status-label {
  margin-bottom: 10px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-panel h2 {
  margin-bottom: 10px;
  color: var(--space);
  font-size: 1.18rem;
}

.status-panel p:not(.status-label) {
  color: #475467;
  font-size: 0.84rem;
  line-height: 1.62;
}

dl {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
  color: var(--space);
  font-weight: 700;
}

.alert {
  margin-top: 18px;
  padding: 16px 18px;
  color: #8a1538;
  background: #fff2f4;
  border-color: #ffc9d2;
}

.chart-section {
  margin-top: 28px;
}

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

.section-heading h2 {
  color: var(--space);
  font-size: 1.12rem;
  font-weight: 800;
}

.chart-card {
  padding: 16px;
  overflow: hidden;
}

.chart-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.plotly-card {
  min-height: 560px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 18px;
}

.inline-action {
  margin: 0;
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid rgba(31, 111, 139, 0.32);
  border-radius: 8px;
  padding: 0 18px;
  color: var(--blue);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.78);
}

.deferred-action,
.tt-predict-action,
.report-action {
  height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  color: #fff;
  font: inherit;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), #174e64);
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(31, 111, 139, 0.25);
}

.report-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.secondary-button {
  border: 1px solid rgba(31, 111, 139, 0.32);
  color: var(--blue);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.vp-card {
  padding: 16px;
}

.vp-guide {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(31, 111, 139, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.vp-step-label {
  margin: 0;
  color: var(--space);
  font-size: 0.96rem;
  font-weight: 800;
}

.vp-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vp-points span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(31, 111, 139, 0.18);
  border-left: 4px solid var(--point-color);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--space);
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.82);
}

.vp-controls {
  margin-top: 12px;
}

.vp-result-card {
  padding: 24px;
}

.result-kicker {
  margin-bottom: 8px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.vp-result-card h2 {
  margin-bottom: 16px;
  color: var(--space);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.vp-result-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.movie-card {
  background: #0b0f18;
}

.movie-card img {
  display: block;
  width: min(100%, 560px);
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
}

.pending-feature-card {
  padding: 22px;
}

.pending-feature-card p {
  margin: 0;
  color: var(--space);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.6;
}

.site-footer {
  display: grid;
  gap: 14px;
  margin-top: 34px;
  padding: 0;
  border-top: 1px solid rgba(20, 33, 47, 0.14);
  color: #475467;
  font-size: 0.82rem;
  line-height: 1.6;
}

.site-footer span {
  color: var(--space);
  font-weight: 800;
}

.methodology-note {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(20, 33, 47, 0.12);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 32px rgba(20, 33, 47, 0.06);
  color: #344054;
}

.methodology-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(20, 33, 47, 0.1);
}

.methodology-header span {
  color: var(--space);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.reference-group {
  display: grid;
  gap: 8px;
}

.reference-group p {
  margin: 0;
  color: var(--space);
  font-weight: 700;
}

.methodology-note ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.reference-citation {
  padding-top: 10px;
  border-top: 1px solid rgba(20, 33, 47, 0.08);
}

.methodology-note li {
  padding-left: 4px;
}

.methodology-note cite {
  font-style: italic;
}

.footer-meta {
  display: grid;
  gap: 4px;
  padding: 0 20px 18px;
}

.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 40, 0.62);
  backdrop-filter: blur(4px);
}

.processing-overlay.is-visible {
  display: grid;
}

.processing-panel {
  width: min(100%, 460px);
  border: 1px solid rgba(247, 178, 103, 0.28);
  border-radius: 8px;
  padding: 28px;
  color: #f8fafc;
  text-align: center;
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.96), rgba(28, 37, 52, 0.96));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.processing-sun {
  width: 64px;
  aspect-ratio: 1;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7bf 0 16%, #f7b267 42%, #e76f51 76%, #9f2f25 100%);
  box-shadow: 0 0 28px rgba(247, 178, 103, 0.78);
}

.processing-panel p {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.loading-dots::after {
  content: ".";
  display: block;
  margin-top: 10px;
  letter-spacing: 0.16em;
  animation: loadingDots 2s steps(10, end) infinite;
}

@keyframes loadingDots {
  0% {
    content: ".";
  }
  10% {
    content: "..";
  }
  20% {
    content: "...";
  }
  30% {
    content: "....";
  }
  40% {
    content: ".....";
  }
  50% {
    content: "......";
  }
  60% {
    content: ".......";
  }
  70% {
    content: "........";
  }
  80% {
    content: ".........";
  }
  90%,
  100% {
    content: "..........";
  }
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .subtitle-line {
    max-width: 760px;
  }

  .sun-panel {
    justify-self: start;
    width: min(100%, 440px);
    min-height: 0;
  }

  .sun-panel img {
    max-width: 440px;
  }
}

@media (max-width: 920px) {
  .hero,
  .analysis-grid,
  .control-panel {
    grid-template-columns: 1fr;
  }

  .sun-panel {
    min-height: 240px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  h1 {
    font-size: 2.3rem;
    line-height: 1.05;
  }

  .title-line {
    white-space: normal;
  }

  .subtitle-line {
    font-size: 0.48em;
    line-height: 1.3;
  }

  .control-panel,
  .status-panel,
  .chart-card {
    padding: 14px;
  }

  .vp-result-grid {
    grid-template-columns: 1fr;
  }

  .result-actions {
    justify-content: center;
  }

  .result-actions > *,
  .inline-action,
  .inline-action button {
    width: 100%;
  }

  .result-actions > *,
  .result-actions .inline-action,
  .result-actions .inline-action button,
  .result-actions .deferred-action,
  .result-actions .tt-predict-action,
  .result-actions .report-action {
    width: auto;
  }
}
