@layer components, pages;

@layer components {
  .celestar-shell {
    width: min(100% - clamp(1.5rem, 4vw, 3rem), 76rem);
    margin-inline: auto;
  }

  .celestar-eyebrow {
    margin-bottom: 0.85rem;
    color: #1f64aa;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .celestar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
  }

  .celestar-button {
    display: inline-flex;
    min-height: 3.25rem;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.4rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
  }

  .celestar-button--primary {
    background: #062d65;
    box-shadow: 0 0.8rem 2rem rgb(6 45 101 / 20%);
    color: #fff;
  }

  .celestar-button--primary:hover { background: #0d478e; }
  .celestar-button--ghost { border-color: #6d8fb4; color: #062d65; }
  .celestar-button--ghost:hover { background: rgb(255 255 255 / 72%); }
  .celestar-button--light { background: #fff; color: #062d65; }

  .celestar-heading {
    max-width: 43rem;
    margin-bottom: clamp(2rem, 5vw, 3.5rem);
  }

  .celestar-heading h2 {
    max-width: 20ch;
    color: #071d3b;
    font-size: clamp(1.9rem, 3vw, 2.85rem);
  }

  .celestar-heading > p:last-child {
    margin-top: 1rem;
    color: #5a6675;
  }

  .celestar-heading--center { margin-inline: auto; text-align: center; }
  .celestar-heading--center h2 { margin-inline: auto; }
}

@layer pages {
  .celestar-hero {
    overflow: hidden;
    padding-block: clamp(2.5rem, 5vw, 4.5rem);
    background:
      radial-gradient(circle at 82% 20%, rgb(80 174 255 / 27%), transparent 22rem),
      radial-gradient(circle at 12% 92%, rgb(214 178 99 / 16%), transparent 18rem),
      linear-gradient(145deg, #f8fbff, #eaf3ff 60%, #f8fbff);
  }

  .celestar-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 30rem);
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: start;
  }

  .celestar-hero h1 {
    max-width: 17ch;
    color: #061c3a;
    font-size: clamp(2.6rem, 4.2vw, 4.5rem);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.12;
  }

  .celestar-hero__lede {
    max-width: 42rem;
    margin-top: 1.5rem;
    color: #526174;
    font-size: clamp(1rem, 1.35vw, 1.15rem);
  }

  .celestar-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 2.25rem;
  }

  .celestar-facts > div {
    padding: 1rem;
    border: 1px solid rgb(36 87 143 / 18%);
    border-radius: 1rem;
    background: rgb(255 255 255 / 64%);
  }

  .celestar-facts dt { color: #6b7582; font-size: 0.75rem; }
  .celestar-facts dd { margin-top: 0.2rem; color: #062d65; font-weight: 700; }

  .celestar-hero__visual {
    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 30rem;
    min-width: 0;
    justify-self: end;
  }

  .celestar-hero__visual::before {
    position: absolute;
    z-index: -2;
    inset: 10% -10% 5%;
    border-radius: 49% 51% 44% 56% / 43% 44% 56% 57%;
    background: linear-gradient(155deg, rgb(255 255 255 / 94%), rgb(164 211 255 / 38%));
    content: "";
    filter: drop-shadow(0 2rem 3rem rgb(23 78 137 / 17%));
  }

  .celestar-hero__visual picture {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    border-radius: 49% 51% 45% 55% / 43% 45% 55% 57%;
  }

  .celestar-hero__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .celestar-hero__note {
    position: absolute;
    right: -1rem;
    bottom: 1.25rem;
    max-width: 16rem;
    padding: 0.8rem 1rem;
    border: 1px solid rgb(255 255 255 / 76%);
    border-radius: 999px;
    background: rgb(255 255 255 / 88%);
    box-shadow: 0 1rem 2.5rem rgb(6 45 101 / 16%);
    color: #062d65;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    backdrop-filter: blur(0.65rem);
  }

  .celestar-orbit {
    position: absolute;
    z-index: -1;
    border: 1px solid rgb(28 103 178 / 23%);
    border-radius: 50%;
  }

  .celestar-orbit--one { width: 5rem; height: 5rem; top: -1rem; left: -1.5rem; }
  .celestar-orbit--two { width: 2.5rem; height: 2.5rem; right: -0.75rem; top: 20%; background: rgb(89 182 255 / 18%); }

  .celestar-assurance {
    border-block: 1px solid #d6e3f1;
    background: #fff;
  }

  .celestar-assurance__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .celestar-assurance p {
    display: flex;
    min-height: 4.75rem;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 1rem;
    color: #233d5d;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
  }

  .celestar-assurance p + p { border-left: 1px solid #d6e3f1; }
  .celestar-assurance span { color: #1f79c9; }

  .celestar-section {
    padding-block: clamp(3.75rem, 8vw, 6rem);
    scroll-margin-top: 4.5rem;
  }

  .celestar-care-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .celestar-care-card {
    min-height: 16rem;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border: 1px solid #dce5ef;
    border-radius: 1.5rem;
    background: linear-gradient(155deg, #fff, #f5f9ff);
    box-shadow: 0 1rem 3rem rgb(6 45 101 / 7%);
  }

  .celestar-care-card > span { color: #c99b3d; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; }
  .celestar-care-card h3 { max-width: 16ch; margin-top: 3.5rem; color: #071d3b; font-size: 1.35rem; }
  .celestar-care-card p { margin-top: 0.85rem; color: #5d6875; }

  .celestar-section--ink {
    background:
      radial-gradient(circle at 20% 10%, rgb(40 124 211 / 20%), transparent 18rem),
      linear-gradient(145deg, #04162f, #082c5d);
    color: #fff;
  }

  .celestar-feature {
    display: grid;
    grid-template-columns: minmax(18rem, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(2.5rem, 8vw, 7rem);
    align-items: center;
  }

  .celestar-feature__visual {
    width: 100%;
    max-width: 31rem;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: 2rem;
    box-shadow: 0 2rem 5rem rgb(0 0 0 / 30%);
  }

  .celestar-feature__visual picture,
  .celestar-service__visual picture { width: 100%; height: 100%; }
  .celestar-feature__visual img { width: 100%; height: 100%; object-fit: cover; }
  .celestar-feature__copy .celestar-eyebrow { color: #7ec6ff; }
  .celestar-feature__copy h2 { max-width: 18ch; color: #fff; font-size: clamp(2rem, 3.5vw, 3.3rem); }

  .celestar-check-list {
    display: grid;
    gap: 1rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
  }

  .celestar-check-list li { display: grid; grid-template-columns: 2rem 1fr; gap: 0.75rem; align-items: start; color: rgb(255 255 255 / 84%); }
  .celestar-check-list span { display: grid; width: 1.8rem; height: 1.8rem; place-items: center; border: 1px solid rgb(126 198 255 / 40%); border-radius: 50%; color: #7ec6ff; font-weight: 700; }
  .celestar-caveat { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid rgb(255 255 255 / 17%); color: rgb(255 255 255 / 62%); font-size: 0.86rem; }

  .celestar-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .celestar-steps li { position: relative; padding: 1.5rem; border-top: 2px solid #1f79c9; }
  .celestar-steps li > span { display: grid; width: 2.6rem; height: 2.6rem; place-items: center; border-radius: 50%; background: #e8f4ff; color: #0a4e91; font-weight: 700; }
  .celestar-steps h3 { margin-top: 2rem; color: #071d3b; font-size: 1.1rem; }
  .celestar-steps p { margin-top: 0.55rem; color: #66717d; font-size: 0.92rem; }

  .celestar-section--soft { background: #eef5fb; }
  .celestar-service { display: grid; grid-template-columns: minmax(18rem, 0.75fr) minmax(0, 1.25fr); gap: clamp(2.5rem, 8vw, 7rem); align-items: center; }
  .celestar-service__visual { overflow: hidden; aspect-ratio: 2 / 3; border-radius: 2rem; background: #fff; box-shadow: 0 2rem 4rem rgb(6 45 101 / 12%); }
  .celestar-service__visual img { width: 100%; height: 100%; object-fit: cover; }
  .celestar-service__copy h2 { max-width: 18ch; color: #071d3b; font-size: clamp(2rem, 3.5vw, 3.3rem); }
  .celestar-service__copy > p:not(.celestar-eyebrow) { max-width: 43rem; margin-top: 1.25rem; color: #5e6b79; }
  .celestar-service__copy ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1.5rem; margin: 2rem 0 0; padding: 0; list-style: none; }
  .celestar-service__copy li { padding-top: 0.75rem; border-top: 1px solid #cbd9e6; color: #223b5a; font-weight: 700; }
  .celestar-text-link { display: inline-flex; gap: 0.5rem; margin-top: 2rem; color: #075da9; font-weight: 700; text-underline-offset: 0.25em; }

  .celestar-faq-grid { display: grid; grid-template-columns: minmax(16rem, 0.75fr) minmax(0, 1.25fr); gap: clamp(2rem, 7vw, 6rem); }
  .celestar-faq-list details { border-bottom: 1px solid #d2dce6; }
  .celestar-faq-list summary { cursor: pointer; padding-block: 1.3rem; color: #0a294f; font-weight: 700; }
  .celestar-faq-list p { padding: 0 1.5rem 1.3rem 0; color: #5f6b77; }

  .celestar-closing { padding-top: 0; }
  .celestar-closing__card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(2rem, 6vw, 4rem);
    border-radius: 2rem;
    background:
      radial-gradient(circle at 100% 0, rgb(95 183 255 / 22%), transparent 18rem),
      #061d3d;
    color: #fff;
  }

  .celestar-closing__card .celestar-eyebrow { color: #82c8ff; }
  .celestar-closing__card h2 { max-width: 21ch; color: #fff; font-size: clamp(1.9rem, 4vw, 3.3rem); }
  .celestar-closing__card p:not(.celestar-eyebrow) { max-width: 45rem; margin-top: 1rem; color: rgb(255 255 255 / 68%); }
  .celestar-support-actions { display: grid; flex: 0 0 min(100%, 17rem); gap: 0.75rem; }

  .celestar-disclaimer { padding-block: 1.5rem; border-top: 1px solid #d4dde6; background: #f4f6f8; color: #5f6872; font-size: 0.78rem; }
  .celestar-mobile-cta { display: none; }
}

@media (min-width: 60.0625rem) and (max-height: 44rem) {
  .site-header__inner { min-height: 3.75rem; }
  .brand__logo { width: 10.5rem; }

  .celestar-hero { padding-block: 1.5rem; }
  .celestar-hero__grid { gap: 3rem; align-items: center; }
  .celestar-hero h1 { max-width: 18ch; font-size: clamp(2.4rem, 3.5vw, 3rem); line-height: 1.12; }
  .celestar-hero__lede { margin-top: 0.75rem; font-size: 0.95rem; }
  .celestar-actions { margin-top: 0.85rem; }
  .celestar-button { min-height: 2.75rem; padding: 0.6rem 1.2rem; }
  .celestar-facts { gap: 0.5rem; margin-top: 0.85rem; }
  .celestar-facts > div { padding: 0.65rem 0.8rem; border-radius: 0.8rem; }
  .celestar-hero__visual { max-width: min(24rem, calc((100svh - 7rem) * 0.8)); justify-self: center; }
  .celestar-hero__note { right: -0.5rem; bottom: 0.75rem; padding: 0.6rem 0.8rem; }
  .celestar-assurance p { min-height: 3.5rem; padding: 0.75rem; }

  .celestar-section { padding-block: 2.5rem; }
  .celestar-heading { margin-bottom: 2rem; }
  .celestar-heading h2 { font-size: clamp(1.9rem, 2.5vw, 2.5rem); }
  .celestar-care-card { min-height: 12rem; padding: 1.5rem; }
  .celestar-care-card h3 { margin-top: 2rem; }

  .celestar-feature,
  .celestar-service { gap: 3rem; }
  .celestar-feature__visual { max-width: min(23rem, calc((100svh - 5rem) * 0.8)); }
  .celestar-feature__copy h2,
  .celestar-service__copy h2 { font-size: clamp(2rem, 3vw, 2.65rem); }
  .celestar-check-list { gap: 0.65rem; margin-top: 1.25rem; }
  .celestar-caveat { margin-top: 1.25rem; padding-top: 0.85rem; }

  .celestar-steps li { padding: 1rem; }
  .celestar-steps h3 { margin-top: 1.25rem; }
  .celestar-service__visual { width: min(100%, 19rem); justify-self: center; }
  .celestar-service__copy > p:not(.celestar-eyebrow) { margin-top: 0.85rem; }
  .celestar-service__copy ul { gap: 0.5rem 1rem; margin-top: 1.25rem; }
  .celestar-text-link { margin-top: 1.25rem; }
  .celestar-faq-list summary { padding-block: 1rem; }
  .celestar-closing__card { padding: 2rem; }
}

@media (max-width: 60rem) {
  .desktop-nav { display: none; }
  .mobile-nav { display: block; position: relative; }
  .mobile-nav summary { cursor: pointer; padding: 0.75rem; font-weight: 700; list-style: none; }
  .mobile-nav summary::-webkit-details-marker { display: none; }
  .mobile-nav nav {
    position: absolute;
    right: 0;
    display: grid;
    width: min(15rem, calc(100vw - 2rem));
    padding: 0.75rem;
    border: 1px solid #d8d8cf;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 1rem 3rem rgb(32 35 31 / 12%);
  }

  .celestar-hero__grid,
  .celestar-feature,
  .celestar-service,
  .celestar-faq-grid { grid-template-columns: 1fr; }

  .celestar-hero__copy { max-width: 44rem; }
  .celestar-hero__visual { order: 2; width: min(100%, 28rem); margin-inline: auto; justify-self: center; }
  .celestar-feature__copy,
  .celestar-service__copy { order: 1; }
  .celestar-feature__visual,
  .celestar-service__visual { order: 2; margin-inline: auto; }
  .celestar-feature__visual { aspect-ratio: 1 / 1; }
  .celestar-feature__visual img { object-position: center 35%; }
  .celestar-care-card { min-height: 15rem; }
  .celestar-care-card h3 { margin-top: 2.5rem; }
  .celestar-steps { grid-template-columns: 1fr 1fr; }
  .celestar-service__visual { width: min(100%, 28rem); }
  .celestar-service__visual { aspect-ratio: 4 / 5; }
  .celestar-service__visual img { object-position: center 38%; }
  .celestar-closing__card { align-items: flex-start; flex-direction: column; }
  .celestar-support-actions { width: 100%; }
}

@media (max-width: 44rem) {
  .celestar-care-grid { grid-template-columns: 1fr 1fr; }
  .celestar-care-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 38rem) {
  html { scroll-padding-bottom: 5.5rem; }
  body { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
  .celestar-shell { width: min(100% - 1.5rem, 76rem); }
  .celestar-hero { padding-block: 1.75rem 3rem; }
  .celestar-hero h1 { max-width: none; font-size: clamp(2rem, 8.5vw, 2.5rem); letter-spacing: 0; line-height: 1.15; }
  .celestar-hero__lede { margin-top: 1rem; }
  .celestar-actions { margin-top: 1.5rem; }
  .celestar-hero__visual { width: min(100%, 21rem); }
  .celestar-hero__note { right: 0; bottom: 0.5rem; max-width: 14rem; }
  .celestar-actions .celestar-button { width: 100%; }
  .celestar-facts { grid-template-columns: 1fr 1fr; gap: 0.45rem; margin-top: 1.5rem; }
  .celestar-facts > div:last-child { grid-column: 1 / -1; }
  .celestar-facts > div { min-width: 0; padding: 0.75rem 0.6rem; }
  .celestar-facts dt { font-size: 0.68rem; }
  .celestar-facts dd { font-size: 0.88rem; line-height: 1.35; overflow-wrap: anywhere; }
  .celestar-assurance__grid { grid-template-columns: 1fr 1fr; }
  .celestar-assurance p { min-height: 4.25rem; padding: 0.75rem; }
  .celestar-assurance p:nth-child(3) { border-left: 0; border-top: 1px solid #d6e3f1; }
  .celestar-assurance p:nth-child(4) { border-top: 1px solid #d6e3f1; }
  .celestar-section { padding-block: 3rem; }
  .celestar-heading { margin-bottom: 2rem; }
  .celestar-heading h2,
  .celestar-feature__copy h2,
  .celestar-service__copy h2 { max-width: none; font-size: clamp(1.8rem, 8vw, 2.15rem); }
  .celestar-care-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .celestar-care-card,
  .celestar-care-card:last-child { grid-column: auto; min-height: auto; padding: 1.25rem; border-radius: 1.15rem; }
  .celestar-care-card h3 { margin-top: 1.25rem; font-size: 1.18rem; }
  .celestar-feature { gap: 2rem; }
  .celestar-feature__visual,
  .celestar-service__visual { border-radius: 1.25rem; }
  .celestar-steps { grid-template-columns: 1fr; }
  .celestar-steps li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 1rem; padding: 1rem 0; }
  .celestar-steps h3 { margin-top: 0; }
  .celestar-service { gap: 2rem; }
  .celestar-service__copy ul { grid-template-columns: 1fr; }
  .celestar-closing__card { gap: 1.5rem; padding: 1.5rem; border-radius: 1.5rem; }
  .celestar-closing__card h2 { max-width: none; font-size: 1.9rem; }
  .footer-nav { flex-wrap: wrap; gap: 0.75rem 1.5rem; }
  .celestar-mobile-cta {
    position: fixed;
    z-index: 8;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgb(255 255 255 / 18%);
    background: rgb(4 22 47 / 94%);
    backdrop-filter: blur(1rem);
  }
  .celestar-mobile-cta a { display: flex; min-height: 3rem; align-items: center; justify-content: center; border-radius: 999px; background: #0fc765; color: #fff; font-weight: 700; text-decoration: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .celestar-button,
  .celestar-care-card { transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease; }
  .celestar-button:hover { transform: translateY(-0.12rem); }
  .celestar-care-card:hover { transform: translateY(-0.2rem); box-shadow: 0 1.4rem 3.5rem rgb(6 45 101 / 12%); }
}

@media (prefers-reduced-motion: reduce) {
  .celestar-button,
  .celestar-care-card { transition: none; }
}
