:root {
  --cream: #fff8e7;
  --paper: #fffdf7;
  --yellow: #ffcf48;
  --yellow-soft: #ffe99a;
  --coral: #ff7868;
  --coral-dark: #d94f44;
  --blue: #69c5e8;
  --blue-soft: #d8f2fb;
  --navy: #102d42;
  --navy-soft: #29485d;
  --green: #2f7d62;
  --border: #b8ad96;
  --shadow: 0 18px 55px rgb(16 45 66 / 12%);
  --radius: 26px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--navy);
  background: var(--cream);
  font-family: Inter, ui-rounded, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid #16658b;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.site-header {
  width: min(calc(100% - 32px), var(--max));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  font-weight: 900;
  font-size: 1.08rem;
  text-decoration: none;
  letter-spacing: -0.035em;
}

.brand-sun {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  background: var(--yellow);
  border: 2px solid var(--navy);
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--cream), 0 0 0 7px var(--navy);
}

.site-header nav {
  display: none;
  gap: 28px;
}

.site-header nav a {
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.site-header nav a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 38px 16px 68px;
  background:
    radial-gradient(circle at 80% 10%, rgb(255 255 255 / 42%) 0 7%, transparent 7.2%),
    var(--yellow);
  border-block: 2px solid var(--navy);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border: 2px solid rgb(16 45 66 / 28%);
  border-radius: 50%;
}

.hero::before {
  width: 310px;
  height: 310px;
  left: -230px;
  top: 80px;
}

.hero::after {
  width: 480px;
  height: 480px;
  right: -390px;
  top: 22%;
}

.hero-intro,
.calculator-card {
  position: relative;
  z-index: 1;
}

.hero-intro {
  width: min(100%, 520px);
  margin: 0 auto 30px;
  padding-top: 96px;
}

.kicker,
.eyebrow {
  margin: 0 0 10px;
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.protection-checklist h2,
.method-intro h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.91;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(3.25rem, 15vw, 7.3rem);
}

.hero h1 span {
  color: var(--coral-dark);
  font-style: italic;
}

.hero-lede {
  max-width: 490px;
  margin: 24px 0 0;
  font-size: 1.08rem;
  font-weight: 600;
}

.sun-orbit {
  position: absolute;
  right: -8px;
  top: -18px;
  width: 110px;
  height: 110px;
  border: 2px dashed rgb(16 45 66 / 44%);
  border-radius: 50%;
  animation: spin 24s linear infinite;
}

.sun-face {
  position: absolute;
  inset: 22px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--coral);
}

.sun-face::before {
  content: "•  •";
  position: absolute;
  inset: 10px 0 auto;
  text-align: center;
  font-size: 1.15rem;
  letter-spacing: 0.2em;
}

.sun-face::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 9px;
  left: 50%;
  bottom: 13px;
  border-bottom: 2px solid var(--navy);
  border-radius: 50%;
  transform: translateX(-50%);
}

.orbit-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  left: 4px;
  top: 10px;
  background: var(--navy);
  border-radius: 50%;
}

.calculator-card {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 22px;
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: 9px 9px 0 var(--navy);
}

.field-group {
  min-width: 0;
  padding: 0 0 26px;
  margin: 0 0 26px;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.field-group legend {
  width: 100%;
  padding: 0;
  margin-bottom: 5px;
  font-size: 1.1rem;
  font-weight: 900;
}

.step-number {
  display: inline-grid;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  place-items: center;
  color: var(--paper);
  background: var(--navy);
  border-radius: 50%;
  font-size: 0.78rem;
}

.field-help {
  margin: 0 0 14px 38px;
  color: var(--navy-soft);
  font-size: 0.88rem;
}

.skin-grid {
  display: grid;
  gap: 9px;
}

.skin-option {
  position: relative;
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 13px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 160ms, background 160ms, transform 160ms;
}

.skin-option:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
}

.skin-option:has(input:checked) {
  border-color: var(--navy);
  background: var(--yellow-soft);
  box-shadow: inset 0 0 0 1px var(--navy);
}

.skin-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.skin-option:has(input:focus-visible) {
  outline: 3px solid #16658b;
  outline-offset: 3px;
}

.skin-swatch {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  background: var(--swatch);
  border: 1.5px solid rgb(16 45 66 / 48%);
  border-radius: 50%;
}

.skin-copy {
  display: grid;
}

.skin-copy strong {
  font-size: 0.9rem;
}

.skin-copy small {
  color: var(--navy-soft);
  font-size: 0.74rem;
}

.location-actions {
  display: grid;
  gap: 10px;
}

.button {
  min-height: 49px;
  padding: 11px 17px;
  border: 2px solid var(--navy);
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button-primary {
  color: white;
  background: var(--navy);
}

.button-primary:hover:not(:disabled) {
  background: #1d4b68;
}

.button-secondary {
  background: var(--yellow);
}

.or-label {
  align-self: center;
  color: var(--navy-soft);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.search-wrap {
  position: relative;
}

.search-wrap input,
.manual-row input {
  width: 100%;
  min-height: 49px;
  padding: 11px 16px;
  color: var(--navy);
  background: white;
  border: 2px solid var(--navy);
  border-radius: 999px;
}

.search-results {
  position: absolute;
  z-index: 10;
  width: 100%;
  max-height: 280px;
  padding: 5px;
  margin: 6px 0 0;
  overflow-y: auto;
  list-style: none;
  background: white;
  border: 2px solid var(--navy);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.search-results button {
  display: grid;
  width: 100%;
  gap: 1px;
  padding: 11px 12px;
  color: var(--navy);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.search-results button:hover,
.search-results button:focus {
  background: var(--blue-soft);
}

.search-results span,
.search-empty {
  color: var(--navy-soft);
  font-size: 0.78rem;
}

.search-empty {
  padding: 12px;
}

.manual-entry {
  margin-top: 14px;
  color: var(--navy-soft);
  font-size: 0.84rem;
}

.manual-entry summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.manual-row {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.manual-row label {
  color: var(--navy);
  font-weight: 800;
}

.status {
  min-height: 24px;
  color: var(--navy-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.status.is-loading::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 8px;
  border: 2px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.status.is-error {
  color: #a12f29;
}

.results {
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.conditions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.updated {
  margin: 3px 0 0;
  color: var(--navy-soft);
  font-size: 0.78rem;
}

.uv-badge {
  display: grid;
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  place-content: center;
  color: var(--navy);
  text-align: center;
  background: var(--yellow);
  border: 2px solid var(--navy);
  border-radius: 50%;
}

.uv-badge span,
.uv-badge small {
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.uv-badge strong {
  font-size: 1.65rem;
  line-height: 1;
}

.uv-badge[data-level="moderate"] { background: #ffe24e; }
.uv-badge[data-level="high"] { background: #ffac51; }
.uv-badge[data-level="very-high"] { color: white; background: #e5554f; }
.uv-badge[data-level="extreme"] { color: white; background: #984bc2; }

.primary-result {
  padding: 34px 0 26px;
}

.primary-result h2 {
  margin: 0;
  color: var(--coral-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 11vw, 5.3rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.burn-by,
.action {
  margin: 10px 0 0;
}

.burn-by {
  color: var(--navy-soft);
}

.action {
  padding: 12px 14px;
  background: var(--blue-soft);
  border-left: 5px solid var(--blue);
  border-radius: 7px;
  font-weight: 800;
}

.reapply-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--navy);
  color: white;
  border-radius: 18px;
}

.reapply-banner p {
  margin: 0;
  font-size: 0.82rem;
}

.timer-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--navy);
  background: var(--yellow);
  border-radius: 50%;
  font-weight: 900;
}

.spf-heading {
  display: grid;
  gap: 5px;
  padding: 34px 0 16px;
}

.spf-heading h2 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.spf-heading > p {
  margin: 0;
  color: var(--navy-soft);
  font-size: 0.82rem;
}

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

.spf-card {
  min-width: 0;
  padding: 13px 10px;
  background: var(--cream);
  border: 1.5px solid var(--navy);
  border-radius: 15px;
}

.spf-card .eyebrow {
  display: none;
}

.spf-card h3 {
  margin: 0;
  font-size: 0.9rem;
}

.spf-time {
  margin: 8px 0 4px;
  color: var(--coral-dark);
  font-size: clamp(1rem, 4vw, 1.45rem);
  font-weight: 900;
  line-height: 1.05;
}

.spf-card.is-unlikely {
  background: #dff3e7;
  border-color: var(--green);
}

.spf-card.is-unlikely .spf-time {
  color: var(--green);
  font-size: clamp(0.9rem, 3.3vw, 1.2rem);
}

.spf-forecast {
  margin: 0;
  color: var(--navy-soft);
  font-size: 0.66rem;
  line-height: 1.25;
}

.timeline-section,
.learn,
.methodology {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 76px 0;
}

.timeline-section {
  display: grid;
  gap: 30px;
}

.section-heading h2,
.protection-checklist h2,
.method-intro h2 {
  font-size: clamp(2.6rem, 10vw, 5.5rem);
}

.section-heading > p:last-child {
  max-width: 520px;
  margin: 22px 0 0;
  color: var(--navy-soft);
  font-size: 1rem;
}

.timeline-card {
  min-width: 0;
  padding: 22px 16px;
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.72rem;
  font-weight: 900;
}

.timeline-toolbar {
  display: grid;
  gap: 16px;
}

.date-control {
  display: grid;
  width: fit-content;
  gap: 5px;
  color: var(--navy-soft);
  font-size: 0.7rem;
  font-weight: 900;
}

.date-control input {
  min-height: 44px;
  padding: 8px 12px;
  color: var(--navy);
  background: var(--cream);
  border: 2px solid var(--navy);
  border-radius: 10px;
  font: inherit;
  font-size: 0.86rem;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  background: var(--coral);
  border: 1px solid var(--navy);
  border-radius: 50%;
}

.uv-chart {
  display: flex;
  min-height: 240px;
  align-items: stretch;
  gap: 4px;
  padding: 28px 0 6px;
  overflow-x: auto;
}

.chart-column {
  display: grid;
  min-width: 52px;
  flex: 1 0 52px;
  grid-template-rows: 23px 18px 1fr 22px;
  align-items: end;
  text-align: center;
}

.chart-burn-time {
  align-self: start;
  color: #a53a2f;
  font-size: 0.68rem;
  font-weight: 950;
  white-space: nowrap;
}

.chart-value {
  align-self: start;
  color: var(--navy-soft);
  font-size: 0.61rem;
  font-weight: 900;
}

.chart-bar {
  width: 72%;
  height: var(--height);
  min-height: 5px;
  margin: 0 auto;
  background: linear-gradient(to top, var(--yellow), var(--coral));
  border: 1.5px solid var(--navy);
  border-radius: 8px 8px 2px 2px;
}

.chart-time {
  padding-top: 6px;
  color: var(--navy-soft);
  font-size: 0.62rem;
  font-weight: 800;
}

.chart-note {
  color: var(--navy-soft);
  font-size: 0.76rem;
}

.chart-insight {
  padding: 13px 15px;
  margin: 10px 0;
  color: #17523f;
  background: #dff3e7;
  border-left: 5px solid var(--green);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 800;
}

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

.section-heading.centered {
  text-align: center;
}

.lesson-grid {
  display: grid;
  gap: 16px;
  margin-top: 42px;
}

.lesson {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  padding: 24px;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
}

.lesson-yellow {
  padding-bottom: 170px;
  background: var(--yellow-soft);
}
.lesson-blue { background: var(--blue-soft); }
.lesson-coral { background: #ffd3cc; }

.lesson-number {
  position: absolute;
  right: 22px;
  top: 16px;
  color: rgb(16 45 66 / 24%);
  font-family: Georgia, serif;
  font-size: 3.8rem;
  font-style: italic;
}

.lesson h3 {
  margin: 40px 0 18px;
  font-family: Georgia, serif;
  font-size: 2.25rem;
  line-height: 0.97;
  letter-spacing: -0.055em;
}

.lesson > p:not(.eyebrow) {
  max-width: 430px;
  font-size: 0.92rem;
}

.filter-demo {
  position: absolute;
  right: 20px;
  bottom: 20px;
  left: 20px;
  height: 120px;
}

.shield {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 78px;
  height: 88px;
  padding-top: 16px;
  text-align: center;
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: 38px 38px 20px 20px;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 900;
}

.shield strong {
  font-size: 1.6rem;
}

.skin-line {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 13px;
  background: #c98058;
  border: 2px solid var(--navy);
  border-radius: 10px;
}

.ray {
  position: absolute;
  top: 0;
  width: 5px;
  height: 72px;
  background: var(--coral);
  border: 1px solid var(--navy);
  transform: rotate(15deg);
}

.ray-one { left: 17%; }
.ray-two { left: 29%; }
.ray-three { right: 18%; }

.spectrum {
  position: absolute;
  right: 24px;
  bottom: 34px;
  left: 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.spectrum i {
  height: 26px;
  background: linear-gradient(90deg, #7361c8, #69c5e8, #ffcf48, #ff7868);
  border: 2px solid var(--navy);
  border-radius: 999px;
}

.molecule-demo {
  position: absolute;
  right: 24px;
  bottom: 32px;
  left: 24px;
  display: flex;
  justify-content: space-around;
}

.molecule-demo i {
  width: 45px;
  height: 45px;
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: 50%;
  box-shadow: 28px -18px 0 -10px var(--coral), 28px -18px 0 -8px var(--navy);
}

.protection-checklist {
  display: grid;
  gap: 34px;
  padding: 34px 24px;
  margin-top: 18px;
  color: white;
  background: var(--navy);
  border-radius: var(--radius);
}

.protection-checklist ol {
  padding: 0;
  margin: 0;
  list-style: none;
}

.protection-checklist li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgb(255 255 255 / 20%);
}

.protection-checklist li > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--navy);
  background: var(--yellow);
  border-radius: 50%;
  font-weight: 900;
}

.protection-checklist li p {
  display: grid;
  margin: 0;
  color: #d7e3e9;
  font-size: 0.82rem;
}

.protection-checklist li strong {
  color: white;
  font-size: 0.95rem;
}

.methodology {
  display: grid;
  gap: 28px;
  border-top: 1px solid var(--border);
}

.method-intro > p:last-child {
  max-width: 590px;
  color: var(--navy-soft);
}

.formula-card,
.source-list,
.medical-note {
  padding: 22px;
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: 20px;
}

.formula-card code {
  display: block;
  padding: 15px;
  overflow-x: auto;
  color: var(--navy);
  background: var(--yellow-soft);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 900;
}

.formula-card p:last-child {
  margin-bottom: 0;
  color: var(--navy-soft);
  font-size: 0.85rem;
}

.source-list h3 {
  margin-top: 0;
}

.source-list ul {
  padding-left: 20px;
  margin-bottom: 0;
}

.source-list li + li {
  margin-top: 8px;
}

.source-list a {
  font-weight: 800;
  text-underline-offset: 3px;
}

.medical-note {
  background: #ffd9d3;
}

.medical-note p {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.site-footer {
  position: relative;
  overflow: hidden;
  padding: 70px 24px 34px;
  color: white;
  text-align: center;
  background: var(--navy);
  border-top: 2px solid var(--navy);
}

.footer-sun {
  width: 90px;
  height: 90px;
  margin: 0 auto 28px;
  background: var(--yellow);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 13px var(--navy), 0 0 0 15px var(--yellow);
}

.footer-brand {
  color: white;
  font-size: 1.8rem;
}

.site-footer > p {
  margin: 9px auto 0;
}

.privacy {
  max-width: 540px;
  color: #bcd0db;
  font-size: 0.82rem;
}

.credits {
  padding-top: 30px;
  color: #8fb0c1;
  font-size: 0.72rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 620px) {
  .site-header nav {
    display: flex;
  }

  .hero {
    padding-inline: 28px;
  }

  .calculator-card {
    padding: 30px;
  }

  .skin-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .location-actions {
    grid-template-columns: auto auto 1fr;
  }

  .manual-row {
    grid-template-columns: minmax(120px, 1fr) minmax(120px, 180px) auto;
    align-items: center;
  }

  .spf-heading {
    grid-template-columns: 1fr 1fr;
  }

  .spf-card {
    padding: 18px;
  }

  .spf-card .eyebrow {
    display: block;
  }

  .lesson {
    padding: 30px;
  }
}

@media (min-width: 900px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(540px, 1fr);
    gap: 56px;
    align-items: start;
    padding: 72px max(32px, calc((100vw - var(--max)) / 2)) 90px;
  }

  .hero-intro {
    position: sticky;
    top: 30px;
    margin: 0;
    padding-top: 0;
  }

  .calculator-card {
    margin: 0;
  }

  .sun-orbit {
    display: none;
  }

  .timeline-section {
    grid-template-columns: 0.7fr 1.3fr;
    align-items: center;
    padding-block: 110px;
  }

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

  .lesson {
    min-height: 520px;
  }

  .lesson h3 {
    font-size: 2.45rem;
  }

  .protection-checklist {
    grid-template-columns: 0.8fr 1.2fr;
    padding: 52px;
  }

  .methodology {
    grid-template-columns: 1.15fr 0.85fr;
    padding-block: 110px;
  }

  .method-intro,
  .medical-note {
    grid-column: 1;
  }

  .formula-card,
  .source-list {
    grid-column: 2;
  }

  .formula-card {
    grid-row: 1 / span 2;
    align-self: end;
  }
}

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

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