/* ============================================================
   Safe Flight — styles
   Desktop: two rounded blue panels (wordmark | content).
   Mobile: full-bleed blue, with the wordmark above the content.
   ============================================================ */

@font-face {
  font-family: "Feijoa";
  src: url("../fonts/feijoa-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #003ace;        /* panel fill */
  --frame: #1a4ed3;       /* 1px lighter-blue frame + divider between panels */
  --white: #ffffff;
  --page-bg: #1a4ed3;     /* full-bleed field = the lighter-blue frame color */

  --rule: rgba(255, 255, 255, 0.22); /* horizontal hairlines between sections */
  --numeral-opacity: 0.4;

  --radius: 24px;
  --margin: 0px;                      /* full-bleed: field runs to every edge */
  --pad: clamp(24px, 2vw, 40px);      /* inner padding of a panel */

  --font: "Feijoa", Georgia, "Times New Roman", serif;
  --fs-body: 13px;
  --lh-body: 1.5;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ambient-loop: ambient-blue-loop 12s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--margin);
  background: var(--page-bg);
  color: var(--white);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: -0.01em;
  /* no discretionary ligatures — keeps the swashy "st"/"ct" joins off */
  font-feature-settings: normal;
  font-variant-ligatures: common-ligatures no-discretionary-ligatures no-contextual;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   THE CARD  — full-bleed lighter-blue field; two #003ace panels
   flush to the edges with 24px rounded corners. The field shows
   through the corner arcs + the 1px gap, giving the rounded
   "valley" where the two panels meet and the corner crescents.
   ============================================================ */
.card {
  width: 100%;
  height: 100svh;
  display: flex;
  gap: 1px;
  background: var(--frame);
  overflow: hidden;
}

.panel {
  background: var(--blue);
  border-radius: var(--radius);
  position: relative;
  min-width: 0;
  overflow: hidden;
}

/* A quiet, even blue field, based on the original site's header loop.
   Start after the original content reveal has completed. */
.site-ready .panel {
  animation: var(--ambient-loop);
}
@keyframes ambient-blue-loop {
  0%, 100% { background-color: var(--blue); }
  33.333% { background-color: #043fd1; }
  66.666% { background-color: #0034bf; }
}

/* left / brand panel — big centered wordmark */
.panel--brand {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
}
.wordmark {
  display: block;
  width: min(56%, 460px);
  height: auto;
  user-select: none;
  pointer-events: none;
}
.wordmark img {
  display: block;
  width: 100%;
  height: auto;
}

/* right / content panel */
.panel--content {
  flex: 0 0 min(454px, 40vw);
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  overflow-y: auto;
}

/* Keep the copy and dividers on the same measure at every viewport width. */
.sections {
  width: 100%;
  max-width: 44ch;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sec p {
  max-width: 44ch;
}
.approach-list {
  list-style: none;
  padding-left: 1em;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.approach-list li {
  position: relative;
}
.approach-list li::before {
  content: "–";
  position: absolute;
  left: -1em;
}

/* The contact line sits at the bottom, with room to scroll on short screens. */
.contact {
  width: 100%;
  max-width: 44ch;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 40px;
}
.contact-link {
  color: inherit;
  text-underline-offset: 0.18em;
  white-space: nowrap;
}
.numeral {
  opacity: var(--numeral-opacity);
}

.rule {
  border: 0;
  height: 1px;
  background: var(--rule);
}

/* ============================================================
   MOBILE (full-bleed blue, wordmark followed by the content)
   ============================================================ */
@media (max-width: 860px) {
  :root {
    --pad: 20px;
    --margin: 0px; /* full-bleed */
    --page-bg: var(--blue);
    background: var(--blue);
  }

  /* Keep the viewport, overscroll field and content in the same colour cycle. */
  .site-ready,
  .site-ready body,
  .site-ready .card {
    animation: var(--ambient-loop);
  }

  body {
    display: block; /* normal flow so the card can grow taller than the
                       viewport and the page scrolls (no flex stretch cap) */
  }

  .card {
    width: 100%;
    height: auto;
    min-height: 100svh;
    flex-direction: column;
    padding: 0;
    gap: 0;
    background: var(--blue);
    border-radius: 0;    /* sharp corners at the screen edge */
    overflow: visible;   /* let tall content grow the page instead of clipping */
  }

  .panel {
    border-radius: 0;
  }

  .panel--brand {
    flex: 0 0 auto;
    justify-content: flex-start;
    padding: var(--pad) var(--pad) 0;
  }

  .wordmark {
    width: min(140px, 100%);
  }

  /* Keep the content in normal flow below the mobile wordmark. */
  .panel--content {
    flex: 1 1 auto;
    padding-top: 32px;
    overflow: visible;
  }

  @supports (height: 100dvh) {
    .card {
      min-height: 100dvh;
    }
  }
}

/* ============================================================
   ORIGINAL LOAD-IN CASCADE — wordmark, then sections.
   Content stays readable if JavaScript is unavailable.
   ============================================================ */
.reveal-pending [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
}
.reveal-pending [data-reveal="logo"] {
  transform: translateY(0) scale(0.985);
}
.reveal-pending [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.75s var(--ease-out-expo),
    transform 0.85s var(--ease-out-expo);
}
.reveal-pending [data-reveal="logo"].is-in {
  transition: opacity 0.95s var(--ease-out-expo),
    transform 1.1s var(--ease-out-expo);
}

@media (prefers-reduced-motion: reduce) {
  .site-ready,
  .site-ready body,
  .site-ready .card,
  .site-ready .panel { animation: none; }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
