/* B&a — holding page */

@font-face {
  font-family: "BnA Sans";
  src: url("fonts/BnASans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ─── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --pad: 16px;
  --pad-t: max(var(--pad), env(safe-area-inset-top));
  --pad-r: max(var(--pad), env(safe-area-inset-right));
  --pad-b: max(var(--pad), env(safe-area-inset-bottom));
  --pad-l: max(var(--pad), env(safe-area-inset-left));

  /* Text: 16px on phones and normal screens (up to ~1440px wide),
     then grows with the screen: ~20px at 1920px, 24px at 2560px and up. */
  --fs: clamp(1rem, 0.714vw + 0.357rem, 1.5rem);

  /* Tagline on phones/tablets (3 lines): 20px → 28px with the screen width */
  --fs-lead: clamp(1.25rem, 5.65vw, 1.75rem);

  --lh: 1.2;
  --mark: 0.9;            /* logo letters are 0.9 × the text size tall */
  --ink: #000;

  /* Contact details: spacing measured from the design (in em of the text size) */
  --c-gap: 2.175em;       /* between the details and the "Contact" button */
  --c-icons: 0.16em;      /* nudge of the icon row */
}

/* Desktop / landscape: tagline is 1.5 × the text size (24px → 36px) */
@media (min-width: 640px) and (min-aspect-ratio: 1/1) {
  :root { --fs-lead: calc(var(--fs) * 1.5); }
}

/* ─── Base ────────────────────────────────────────────────────────────────── */
html, body { margin: 0; height: 100%; }
html {
  background: #E7FE5F;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  overflow: hidden;
  overscroll-behavior: none;
  font: 500 var(--fs) / var(--lh) "BnA Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
@media (hover: hover) {           /* real hover only: no underline stuck after a tap */
  a:hover { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.18em; }
}
a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ─── Background ──────────────────────────────────────────────────────────── */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
/* plain-CSS version, visible until the animated one has drawn */
.bg-fallback {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #E7FE5F 12%, #FFFF5A 37%, #E7FE5F 62%, #FFFF5A 87%);
}
.bg-fallback::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, #D1FDFC 12%, #FFFFFF 37%, #D1FDFC 62%, #FFFFFF 87%);
  -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 72%);
  mask-image: linear-gradient(180deg, #000 20%, transparent 72%);
}

/* ─── Stage ───────────────────────────────────────────────────────────────── */
.stage { position: fixed; inset: 0; z-index: 1; }

.mark, .tagline, .contact, .newsite { position: absolute; margin: 0; }

.mark { display: block; line-height: 0; }
.mark svg {
  display: block;
  height: calc(var(--fs) * var(--mark) * var(--h) / 28);
  width: auto;
  fill: currentColor;
}

.tagline { font-size: var(--fs-lead); white-space: nowrap; }
.tagline span { display: block; }               /* phones: three lines */

.newsite { white-space: nowrap; text-align: right; }
.newsite > span, .newsite time { display: block; }

/* Camera button — drawn at the same size as the logo letters */
.cam {
  position: absolute; display: none; margin: 0; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; line-height: 0; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.has-cam .cam { display: block; }
.cam::before { content: ""; position: absolute; inset: -14px; }      /* comfortable tap target */
.cam svg { display: block; height: calc(var(--fs) * var(--mark) * var(--h) / 28); width: auto; overflow: visible; transform-origin: 50% 50%; }
/* camera on: the shutter turns slowly */
@keyframes bna-shutter { to { transform: rotate(360deg); } }
.cam[aria-pressed="true"] svg { animation: bna-shutter 6s linear infinite; }
.cam:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; border-radius: 3px; }

/* baseline probes used by the layout script */
.bl { display: inline-block; width: 0; height: 0; vertical-align: baseline; }

/* Phones & tablets in portrait: footer stays put at the bottom */
.foot {
  position: absolute;
  left: var(--pad-l); right: var(--pad-r);
  bottom: calc(var(--pad-b) - 0.3em);   /* last baseline sits on the padding line */
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1em;
}
.foot .newsite { position: static; }
.foot .contact { position: relative; }

/* Contact: a button; when open it dims to 25% and the details appear above it */
.contact-btn {
  display: block; margin: 0; padding: 0; border: 0; background: none;
  font: inherit; letter-spacing: inherit; color: inherit; text-align: left;
  cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: opacity 0.3s ease;
}
@media (hover: hover) {
  .contact-btn:hover { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.18em; }
  .socials a:hover { opacity: 0.55; text-decoration: none; }
}
.contact-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
.contact.is-open .contact-btn { opacity: 0.25; }
.contact-panel {
  position: absolute; left: 0; bottom: calc(100% + var(--c-gap));
  display: flex; flex-direction: column; align-items: flex-start; row-gap: 0.36em;
  white-space: nowrap;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.contact.is-open .contact-panel { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
.contact.to-right .contact-panel { left: auto; right: 0; align-items: flex-end; }
.contact-panel > a { display: block; }
/* social icons: text size, optically matched (round marks a touch larger, the wordmark smaller) */
.socials { display: flex; align-items: center; column-gap: 1em; height: 1.2em; margin-top: var(--c-icons); }
.socials a { display: block; line-height: 0; transition: opacity 0.2s ease; }
.ico { display: block; fill: currentColor; }
.ico-fb { width: 1.08em; height: 1.08em; }
.ico-ig { width: 1.01em; height: 1.01em; }
.ico-be { width: 1.154em; height: 0.75em; }
.ico-in { width: 0.84em; height: 0.88em; }
/* without JavaScript the details simply stay visible */
html:not(.js) .contact-panel { opacity: 1; visibility: visible; }
html:not(.js) .contact-btn { opacity: 0.25; }

/* Default arrangement (used before the script runs, or if it can't) */
.mark[data-mark="b"]   { left: var(--pad-l); top: var(--pad-t); }
.mark[data-mark="amp"] { left: 50%; top: var(--pad-t); }
.mark[data-mark="a"]   { right: var(--pad-r); top: var(--pad-t); }
.tagline { left: var(--pad-l); top: 44%; }

/* ─── Desktop / landscape ─────────────────────────────────────────────────── */
@media (min-width: 640px) and (min-aspect-ratio: 1/1) {
  .tagline span { display: inline; }        /* one line */
  .tagline { left: 50%; top: 50%; transform: translate(-50%, -50%); }

  .foot { display: contents; }
  .foot .contact, .foot .newsite { position: absolute; }
  .foot .contact { left: var(--pad-l); bottom: calc(var(--pad-b) - 0.3em); }
  .foot .newsite { right: var(--pad-r); bottom: calc(var(--pad-b) - 0.3em); }
}

/* ─── Reveal once the layout script has placed everything ─────────────────── */
.js .mark, .js .tagline, .js .contact, .js .newsite, .js .cam { opacity: 0; }
.is-ready .mark, .is-ready .tagline, .is-ready .contact, .is-ready .newsite, .is-ready .cam {
  opacity: 1;
  transition: opacity 0.7s ease;
}
/* safety net: if the script never finishes, show the default arrangement */
@keyframes bna-reveal { to { opacity: 1; } }
.js:not(.is-ready) .mark, .js:not(.is-ready) .tagline,
.js:not(.is-ready) .contact, .js:not(.is-ready) .newsite, .js:not(.is-ready) .cam {
  animation: bna-reveal 0.6s ease 3s forwards;
}

.is-ready .cam[data-state="busy"] { opacity: 0.5; }
.is-ready .cam[data-state="blocked"] { opacity: 0.3; }

@media (prefers-reduced-motion: reduce) {
  .is-ready .mark, .is-ready .tagline, .is-ready .contact, .is-ready .newsite, .is-ready .cam { transition: none; }
  .cam[aria-pressed="true"] svg { animation: none; transform: rotate(30deg); }
}
