/* Tokens match the digital business card (dave-wilson-card.vercel.app) */
:root {
  --navy: #14304e;
  --navy-deep: #0c2138;
  --navy-soft: #2a4a6d;
  --cream: #faf6ee;
  --cream-dark: #f1e9db;
  --gold: #c2a15c;
  --gold-soft: #e3d3ae;
  --white: #ffffff;
  --text: #0c2138;
  --muted: #4a5b70;
  --border-input: #7b8794;
  --error: #b42318;
  --success-bg: #dcfce7;
  --success: #15803d;

  /* Cream at reduced opacity, for text and lines on the navy band and footer */
  --on-navy: rgb(250 246 238 / 0.85);
  --on-navy-muted: rgb(250 246 238 / 0.7);
  --on-navy-line: rgb(250 246 238 / 0.15);
  --on-navy-border: rgb(250 246 238 / 0.6);
  --on-navy-hover: rgb(250 246 238 / 0.08);

  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;

  --radius: 12px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 6px -1px rgb(20 48 78 / 0.1), 0 2px 4px -2px rgb(20 48 78 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(20 48 78 / 0.15), 0 8px 10px -6px rgb(20 48 78 / 0.15);

}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Navy canvas so iOS overscroll (pulling past the top or bottom) shows navy, not white */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--navy-deep);
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--navy);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 32px;
  }
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  padding: 12px 16px;
  background: var(--white);
  border-radius: var(--radius);
  z-index: 10;
}

.skip-link:focus {
  top: 16px;
}

/* Navy band */

.band {
  background: linear-gradient(to bottom, var(--navy-deep), var(--navy));
  color: var(--cream);
}

/* On desktop the band fills the first screen, so the form sits fully on navy */
@media (min-width: 900px) {
  .band {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
  }

  .band .hero {
    flex: 1;
  }
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--cream);
  text-decoration: none;
}

.header-call {
  color: var(--gold-soft);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.header-call:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.call-short {
  display: none;
}

@media (max-width: 479px) {
  .header-call {
    font-size: 14px;
  }
}

@media (max-width: 399px) {
  .call-long {
    display: none;
  }

  .call-short {
    display: inline;
  }
}

.hero {
  display: grid;
  gap: 32px;
  padding-block: 32px 48px;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 36px;
  line-height: 1.15;
  color: var(--white);
  max-width: 16ch;
}

.lede {
  margin-top: 16px;
  font-size: 18px;
  color: var(--on-navy);
  max-width: 36ch;
}

@media (max-width: 399px) {
  .hero-copy h1 {
    font-size: 32px;
  }

  .hero .form-card {
    padding: 20px;
  }
}

@media (max-width: 479px) {
  .hero-actions .btn {
    flex: 1;
  }
}

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

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 520px;
    align-items: center;
    gap: 64px;
    padding-block: 0 48px;
  }

  .hero-copy h1 {
    font-size: 48px;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn-block {
  width: 100%;
}

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

.btn-primary:hover {
  background: var(--navy-soft);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-light {
  background: var(--cream);
  color: var(--navy-deep);
}

.btn-light:hover {
  background: var(--white);
}

.btn-outline-light {
  border-color: var(--on-navy-border);
  color: var(--cream);
}

.btn-outline-light:hover {
  border-color: var(--cream);
  background: var(--on-navy-hover);
}

/* Quote form */

.form-card {
  position: relative;
  background: var(--white);
  color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  scroll-margin-top: 16px;
}

@media (min-width: 640px) {
  .form-card {
    padding: 28px;
  }
}

.form-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  margin: 0;
  line-height: 1.2;
  color: var(--navy-deep);
}

.field {
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field-row {
  display: grid;
  column-gap: 12px;
}

.field-row-age {
  grid-template-columns: 96px 1fr;
}

@media (min-width: 480px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }

  .field-row-age {
    grid-template-columns: 96px 1fr;
  }

  /* Side by side, both questions get two lines of room so their text and buttons line up */
  .field-row-yn legend {
    min-height: calc(2 * 1.4em);
  }
}

.field label,
.field legend {
  display: block;
  padding: 0;
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--navy-deep);
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.field input:not([type="radio"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 2px solid var(--border-input);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.15s;
}

/* Starts one line tall and grows as they type (browsers without field-sizing just show one line) */
.field textarea {
  resize: vertical;
  field-sizing: content;
  max-height: 160px;
}

.field input:not([type="radio"]):focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
}

.field [aria-invalid="true"],
.field[aria-invalid="true"] .radio {
  border-color: var(--error) !important;
}

.field-error {
  margin-top: 4px;
  font-size: 14px;
  color: var(--error);
}

.radio-row {
  display: flex;
  gap: 12px;
}

.field .radio {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 2px solid var(--border-input);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s;
}

.radio:has(input:checked) {
  border-color: var(--navy);
}

.radio input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--navy);
}

.hp {
  position: absolute;
  left: -9999px;
}

.btn-block[type="submit"] {
  margin-top: 20px;
  min-height: 48px;
}

.form-error {
  margin-top: 12px;
  font-size: 14px;
  color: var(--error);
}

.form-error a {
  color: inherit;
  font-weight: 600;
}

.consent {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.form-success {
  text-align: center;
  padding-block: 32px;
}

.form-success:focus {
  outline: none;
}

.form-success svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  padding: 14px;
  border-radius: 50%;
  background: var(--success-bg);
  fill: none;
  stroke: var(--success);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-success p {
  margin-top: 12px;
  color: var(--muted);
}

.form-success a {
  font-weight: 600;
}

/* Sections */

h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy-deep);
  text-wrap: balance;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 28px;
  margin: 0;
}

h4 {
  margin: 24px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy-deep);
}

p {
  text-wrap: pretty;
}

/* The point the page builds to: carriers judge the same person differently */

.peak {
  padding-block: 48px;
}

@media (min-width: 640px) {
  .peak {
    padding-block: 64px;
  }

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

.peak-title {
  font-size: 36px;
  line-height: 1.1;
  max-width: 18ch;
}

.peak-lede {
  margin-top: 24px;
  font-size: 18px;
  max-width: 60ch;
}

.factors {
  display: grid;
  gap: 32px;
  margin-top: 48px;
}

.factors > div {
  padding-top: 16px;
  border-top: 2px solid var(--gold);
}

.factors dt {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--navy-deep);
}

.factors dd {
  margin-top: 8px;
}

@media (min-width: 900px) {
  .peak {
    padding-block: 96px;
  }

  .peak-title {
    font-size: 48px;
  }

}

/* One quiet motion on the page: the peak settles into place as it scrolls in */
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }
  }
}

/* Products */

.products {
  background: var(--white);
  border-block: 1px solid var(--cream-dark);
  padding-block: 48px;
}

@media (min-width: 640px) {
  .products {
    padding-block: 64px;
  }
}

.products-layout {
  display: grid;
  gap: 32px;
}

.side-note {
  margin-top: 16px;
  color: var(--muted);
}

@media (max-width: 899px) {
  .product-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
  }

  .product-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--navy-deep);
    text-decoration: none;
  }
}

.product + .product {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--cream-dark);
}

.product {
  scroll-margin-top: 32px;
}

.product-lede {
  margin-top: 12px;
  font-size: 18px;
  max-width: 60ch;
}

.facts {
  display: grid;
  gap: 16px;
  margin: 24px 0 0;
  padding: 16px;
  background: var(--cream);
  border-radius: var(--radius);
}

.facts dt {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.facts dd {
  margin-top: 4px;
  font-weight: 500;
  color: var(--navy-deep);
}

.fit {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.fit li {
  position: relative;
  padding-left: 20px;
  margin-top: 8px;
  max-width: 60ch;
}

.fit li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.product-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 16px;
  font-weight: 600;
  text-underline-offset: 4px;
}

.product-cta:hover {
  color: var(--navy-soft);
}

@media (min-width: 640px) {
  .facts {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .products {
    padding-block: 96px;
  }

  .products-layout {
    grid-template-columns: 280px 1fr;
    gap: 64px;
  }

  /* The left column follows you down and marks which product you're reading */
  .products-side {
    position: sticky;
    top: 32px;
    align-self: start;
  }

  .product-nav {
    display: flex;
    flex-direction: column;
    margin-top: 24px;
    border-left: 2px solid var(--cream-dark);
  }

  .product-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin-left: -2px;
    padding-left: 16px;
    border-left: 2px solid transparent;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
  }

  .product-nav a:hover {
    color: var(--navy-deep);
  }

  .product-nav a[aria-current="true"] {
    border-left-color: var(--gold);
    color: var(--navy-deep);
    font-weight: 600;
  }

  .side-note {
    margin-top: 24px;
  }
}

/* About */

.about {
  display: grid;
  gap: 32px;
  padding-block: 48px;
}

@media (min-width: 640px) {
  .about {
    padding-block: 64px;
  }
}

.about p {
  margin-top: 16px;
  max-width: 60ch;
}

.about-photo {
  margin: 0;
}

.headshot {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--gold-soft);
  box-shadow: var(--shadow-sm);
}

.about-photo figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

@media (min-width: 900px) {
  .about {
    grid-template-columns: 1fr 280px;
    gap: 64px;
    align-items: center;
    padding-block: 96px;
  }

  .headshot {
    width: 280px;
    height: 280px;
  }
}

/* Footer: the closing call to action, then contact details */

.site-footer {
  background: var(--navy-deep);
  color: var(--on-navy);
  font-size: 14px;
  padding-block: 64px 32px;
}

.close {
  text-align: center;
  font-size: 18px;
}

.close-title {
  font-size: 36px;
  color: var(--white);
}

.close p {
  margin-top: 12px;
}

@media (max-width: 639px) {
  .site-footer {
    padding-top: 48px;
  }

  .close-title {
    font-size: 32px;
  }

  .close-actions .btn {
    flex: 1 1 100%;
  }

  .footer-inner {
    margin-top: 64px;
  }
}

.close-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  margin-top: 96px;
}

.nowrap {
  white-space: nowrap;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 4px;
}

.footer-contact {
  display: flex;
  flex-direction: column;
}

.footer-contact a {
  color: var(--gold-soft);
  overflow-wrap: anywhere;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.disclaimer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--on-navy-line);
  color: var(--on-navy-muted);
}

@media (min-width: 900px) {
  .site-footer {
    padding-top: 96px;
  }

  .close-title {
    font-size: 48px;
  }
}
