/* Palette: petrol, saffron, pale slate, ink. Four colours only. */
:root {
  --canvas: #F2F5F5;
  --alt: #E5ECED;
  --elev: #FFFFFF;
  --mist: #DCE7E9;
  --deep: #0D3342;
  --tx: #0B1E27;
  --tx2: #3C525C;
  --tx3: #5E727B;
  --bd: #B9CACF;
  --cta: #E8A33D;
  --ctat: #0B1E27;
  --neg: #A32F2F;
}

body {
  font-family: 'Figtree', system-ui, sans-serif;
  background: var(--canvas);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Newsreader', Georgia, serif;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

:focus-visible {
  outline: 3px solid var(--cta);
  outline-offset: 3px;
}

@keyframes settle {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.settle { animation: settle .8s cubic-bezier(.2, .7, .2, 1) both; }
.settle-2 { animation-delay: .12s; }
.settle-3 { animation-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .settle { animation: none; }
}

.hero-shade {
  background: rgba(8, 30, 40, .72);
}

/* Fixed header overlaps hero — align content from the top (not flex center). */
.hero-section {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: calc(4.75rem + 0.35rem);
  padding-bottom: 2rem;
  min-height: 0;
}

.hero-section--home {
  padding-top: calc(4.75rem + 0.65rem);
  padding-bottom: 2.75rem;
  min-height: 20rem;
}

@media (min-width: 768px) {
  .hero-section {
    padding-bottom: 2.25rem;
  }

  .hero-section--home {
    padding-top: calc(4.75rem + 0.85rem);
    padding-bottom: 3rem;
    min-height: 24rem;
  }
}

.btn-primary {
  background: var(--cta);
  color: var(--ctat);
  border-radius: 8px;
  font-weight: 700;
}

.btn-ghost {
  border: 1.5px solid rgba(255, 255, 255, .55);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
}

.link-u {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  text-decoration-color: var(--cta);
}

#pv-fields label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--tx);
}
#pv-fields input,
#pv-fields select {
  display: block;
  width: 100%;
  margin-top: .4rem;
  min-height: 2.9rem;
  padding: .6rem .85rem;
  background: var(--canvas);
  color: var(--tx);
  border: 1.5px solid var(--bd);
  border-radius: 8px;
  font: inherit;
}
#pv-fields input:focus,
#pv-fields select:focus {
  border-color: var(--deep);
  outline: 3px solid var(--cta);
  outline-offset: 1px;
}
#pv-out:not(:empty) {
  padding: 1.1rem 1.25rem;
  background: var(--mist);
  border-left: 4px solid var(--cta);
  border-radius: 0 8px 8px 0;
}

.risk-table thead th {
  background: var(--canvas) !important;
  color: var(--tx) !important;
  border-bottom: 2px solid var(--deep);
}

/* Contact + tool forms */
.form-panel label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--tx);
  margin-bottom: .25rem;
}
.form-panel input,
.form-panel select,
.form-panel textarea {
  display: block;
  width: 100%;
  min-height: 2.9rem;
  padding: .6rem .85rem;
  background: var(--canvas);
  color: var(--tx);
  border: 1.5px solid var(--bd);
  border-radius: 8px;
  font: inherit;
}
.form-panel textarea {
  min-height: auto;
}
.form-panel input:focus,
.form-panel select:focus,
.form-panel textarea:focus {
  border-color: var(--deep);
  outline: 3px solid var(--cta);
  outline-offset: 1px;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.contact-modal.hidden {
  display: none;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(11, 30, 39, 0.58);
  cursor: pointer;
}

.contact-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
  background: var(--elev);
  border: 1.5px solid var(--bd);
  border-radius: 12px;
  box-shadow: 0 28px 70px -28px rgba(0, 0, 0, 0.35);
}

.contact-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  color: var(--tx3);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.contact-modal-close:focus-visible {
  outline: 3px solid var(--cta);
  outline-offset: 2px;
}

.contact-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  background: var(--mist);
  border-radius: 999px;
}

body.contact-modal-open {
  overflow: hidden;
}

/* Fixed header: reserve space and anchor offset */
#site-header {
  min-height: 4.75rem;
}

html {
  scroll-padding-top: 4.75rem;
}

.calc-panel-scroll {
  max-height: min(36rem, 70vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html,
body {
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

.guide {
  scroll-margin-top: 5.4rem;
}

@media (min-width: 1024px) {
  .guide-ref-sidebar {
    position: sticky;
    top: 5.4rem;
    align-self: start;
  }
}

.guide-card {
  min-height: 100%;
}

.guide-card-link {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.guide-topics-grid .guide-card:target {
  outline: 2px solid var(--deep);
  outline-offset: 2px;
}
