/* ==========================================================================
   layout.css - containers, header, navigation, footer, section rhythm
   Mobile first: the nav becomes a horizontal bar from 960px upwards.
   ========================================================================== */

main { overflow-x: clip; }
.container { width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: clamp(56px, 9vw, 110px); }
.section--tint { background: var(--surf-2); }
.section--navy { background: var(--navy); color: var(--on-dark); }
.section--navy .lead, .section--navy p { color: var(--on-dark-mut); }
.section-head { max-width: 760px; margin-bottom: clamp(28px, 5vw, 56px); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(2, 20, 24, 0.92);
  border-bottom: 1px solid rgba(79, 237, 240, 0.16);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--on-dark);
  transition: box-shadow 0.3s;
}
.site-header.is-scrolled { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); }
.header-inner { display: flex; align-items: center; gap: 10px; min-height: var(--header-h); }

.brand {
  display: inline-flex; align-items: center; gap: 10px; margin-right: auto;
  color: #fff; text-decoration: none; font: 800 1.2rem var(--font-head); letter-spacing: 0.08em;
}
/* Drop the official logo in as images/logo.svg - any shape: the height is fixed
   and the width follows, so a square mark or a wide wordmark both fit. */
.brand img { height: 42px; width: auto; max-width: 190px; object-fit: contain; }

.site-nav {
  position: absolute; top: 100%; left: 0; right: 0;
  display: none; flex-direction: column; gap: 4px;
  padding: 12px var(--gutter) 22px;
  background: var(--navy); border-top: 1px solid rgba(255, 255, 255, 0.12);
  max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
}
.site-nav.is-open { display: flex; animation: dropIn 0.3s ease; }
.site-nav a {
  display: flex; align-items: center; min-height: 48px; padding: 0 14px;
  color: #fff; text-decoration: none; font-weight: 600; border-radius: 10px;
}
@media (hover: hover) and (pointer: fine) { .site-nav a:hover { background: rgba(255, 255, 255, 0.08); } }
.site-nav a[aria-current="page"] { color: var(--cyan); background: rgba(79, 237, 240, 0.1); }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  background: transparent; color: #fff; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 12px;
  transition: background 0.2s, transform 0.2s;
}
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: rgba(255, 255, 255, 0.12); } }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.nav-toggle .bar { transition: transform 0.25s, opacity 0.25s; transform-box: fill-box; transform-origin: center; }
.nav-toggle[aria-expanded="true"] .bar-1 { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar-2 { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar-3 { transform: translateY(-6px) rotate(-45deg); }

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .site-nav {
    position: static; display: flex; flex-direction: row; align-items: center; gap: 2px;
    padding: 0; background: none; border: 0; max-height: none; overflow: visible; margin-left: auto;
  }
  .site-nav a { min-height: 44px; font-size: 0.95rem; position: relative; }
  .site-nav a::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px;
    background: var(--cyan); transform: scaleX(0); transition: transform 0.25s;
  }
  .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .site-nav a:hover::after { transform: scaleX(1); } }
  .site-nav a[aria-current="page"] { background: none; }
  .brand { margin-right: 0; }
}

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: var(--on-dark-mut); padding: clamp(40px, 6vw, 72px) 0 32px; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
.footer-grid { display: grid; gap: 32px; }
.site-footer h3 { color: #fff; font-size: 1rem; }
.site-footer a { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }

/* ---------- floating utilities ---------- */
.progress {
  position: fixed; left: 0; top: 0; right: 0; height: 3px; z-index: 70;
  background: var(--cyan); transform: scaleX(0); transform-origin: 0 50%;
}
.to-top {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 55;
  width: 52px; height: 52px; border: 0; border-radius: 50%; cursor: pointer;
  background: conic-gradient(var(--cyan) calc(var(--sp, 0) * 1turn), rgba(120, 140, 170, 0.35) 0);
  opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity 0.3s, transform 0.3s;
}
.to-top::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--navy); }
.to-top svg { position: relative; width: 22px; height: 22px; margin: auto; stroke: #fff; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.to-top.is-shown { opacity: 1; transform: none; pointer-events: auto; }
