/* Ambi site chrome — shared header/footer for subpages (early-access,
 * policies). The visual source of truth is the 713 homepage design
 * (css/styles.css): header/footer rules below are copied from it so subpages
 * stay pixel-consistent with the homepage. The homepage itself keeps its own
 * self-contained markup (its header has a scroll-driven state machine).
 * Markup is injected by assets/site-chrome.js.
 */

/* ---------- 713 design fonts ---------- */
@font-face {
  font-family: 'Medium LL';
  src: url('MediumLLWeb-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Medium LL';
  src: url('MediumLLWeb-Italic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Optima Web';
  src: url('Optima-Regular-01.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* legacy weights still used by the early-access flow body */
@font-face {
  font-family: "MediumLLWeb-Light";
  src: url("fonts/medium-ll/MediumLLWeb-Light.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "MediumLLWeb-LightItalic";
  src: url("fonts/medium-ll/MediumLLWeb-LightItalic.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "MediumLLWeb-Book";
  src: url("fonts/medium-ll/MediumLLWeb-Book.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "MediumLLWeb-SemiBold";
  src: url("fonts/medium-ll/MediumLLWeb-SemiBold.woff2") format("woff2");
  font-display: swap;
}

:root {
  /* 713 design tokens (mirror css/styles.css) */
  --font-title: 'Optima Web', Optima, 'Gill Sans', 'Gill Sans MT', Seravek, Candara, Calibri, sans-serif;
  --font-body: 'Medium LL', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --c-text: #3b3b3b;
  --c-header-dark: #152B2D;
  --header-h: 72px;
  --fs-nav: clamp(14px, 0.926vw, 17px);
  --fs-eyebrow: clamp(12px, 0.81vw, 15px);
  --pad-x: clamp(20px, 4.72vw, 82px);

  /* legacy tokens still used by the early-access flow */
  --paper: #fffbfb;
  --ink: #2c3831;
  --body: #6a736d;
  --mark: #20302a;
  --muted: #545454;
  --accent: #777474;
  --line: #cbcbcb;
  --wash: #f3f5ee;
  --sage: #d7e9d6;
  --sage-underline: #a3b59a;
  --forest: #496d4a;
  --error: #8f3f2f;
  --error-bg: #fff1ee;
  --max: 1200px;
  --col: 760px;
  --serif: "Optima Web", "Optima", "Optima Nova", Candara, "Gill Sans", "Gill Sans MT", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --copy: "MediumLLWeb-Light", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --copy-italic: "MediumLLWeb-LightItalic", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --copy-book: "MediumLLWeb-Book", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --copy-strong: "MediumLLWeb-SemiBold", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --button: "MediumLLWeb-Light", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Source Code Pro", ui-monospace, Menlo, "PingFang SC", "Hiragino Sans GB", monospace;
}

* { box-sizing: border-box; }

/* ---------- Document scrollbar: removed entirely ----------
   Classic scrollbars paint their strip with the scroller's background-color
   no matter what scrollbar-color says; no scrollbar also means the viewport
   width never changes, so nothing can shift layout sideways. */
html { scrollbar-width: none; }
::-webkit-scrollbar { width: 0; height: 0; display: none; }

a { color: inherit; text-decoration: none; }

.wrap { width: min(var(--max), calc(100% - 2 * var(--pad-x))); margin: 0 auto; }

/* ---------- Header (713 design, fixed dark form for light subpages) ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  padding-top: 3.9svh;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--pad-x);
  color: var(--c-header-dark);
  transition: color 0.5s ease;
  pointer-events: auto;
}
/* subpages scroll text behind the fixed header — a soft frosted scrim keeps
   it readable; kept on a leaf pseudo-element (never animated) so the
   backdrop-filter can't snap */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 251, 251, 0.9), rgba(255, 251, 251, 0.55));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
  mask-image: linear-gradient(180deg, #000 70%, transparent);
  pointer-events: none;
}
.header__wordmark { color: inherit; display: inline-flex; align-items: center; }
.header__wordmark-img { height: 21px; width: auto; display: block; }
.header__logomark {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.header__logomark-img { height: clamp(30px, 4.4svh, 42px); width: auto; display: block; }
.header__nav {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3.8vw, 66px);
}
.header__link,
.header__btn {
  font-family: var(--font-body);
  font-size: var(--fs-nav);
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: inherit;
  text-decoration: none;
}
.header__btn {
  padding: 9px 15px;
  border: 1px solid currentColor;
  border-radius: 5px;
  transition: background 0.3s ease, color 0.3s ease;
}
.header__btn:hover { background: rgba(0, 0, 0, 0.06); }

@media (max-width: 720px) {
  .header__wordmark-img { height: 18px; }
  .header__logomark { display: none; }
  .header__link { display: none; }
}

/* ---------- Signed-in account (header avatar + menu) ---------- */
.nav-account {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.nav-account[hidden] { display: none; }
.nav-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(21, 43, 45, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--c-header-dark);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(10, 18, 14, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}
.nav-avatar:hover {
  background: #fff;
  border-color: rgba(21, 43, 45, 0.34);
  box-shadow: 0 8px 20px rgba(10, 18, 14, 0.12);
  transform: translateY(-1px);
}
.nav-avatar:focus-visible {
  outline: 2px solid rgba(21, 43, 45, 0.4);
  outline-offset: 3px;
}
.nav-avatar-picture {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 251, 251, 0.96), transparent 42%),
    linear-gradient(145deg, rgba(215, 233, 214, 0.96), rgba(163, 181, 154, 0.42));
  color: var(--c-header-dark);
}
.nav-avatar-picture img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.nav-avatar-icon {
  width: 18px;
  height: 18px;
  opacity: 0.82;
}
.nav-avatar-caret {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  background: var(--c-header-dark);
}
.nav-avatar-caret::after {
  content: "";
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-right: 1.4px solid #fff;
  border-bottom: 1.4px solid #fff;
  transform: rotate(45deg);
}
.nav-account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: min(260px, calc(100vw - 40px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(21, 43, 45, 0.14);
  box-shadow: 0 18px 42px rgba(10, 18, 14, 0.17), 0 5px 14px rgba(10, 18, 14, 0.10);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}
.nav-account.is-open .nav-account-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-account-label {
  color: var(--accent);
  font: 10px/1 var(--mono);
  letter-spacing: 0.72px;
  text-transform: uppercase;
}
.nav-account-menu strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--c-header-dark);
}
.nav-account-menu button {
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--wash);
  color: var(--c-header-dark);
  font: 13px/1 var(--font-body);
  text-align: left;
  cursor: pointer;
}
.nav-account-menu button:hover { background: rgba(215, 233, 214, 0.62); }

/* ---------- Footer (713 design: text links + rule + legal line) ---------- */
.site-footer {
  padding: 48px var(--pad-x) 40px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.sf-social {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(24px, 3vw, 48px);
  width: 100%;
}
.sf-social-left,
.sf-social-right {
  display: flex;
  align-items: center;
  gap: clamp(28px, 3.2vw, 56px);
}
.sf-social a {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  color: var(--c-text);
  text-decoration: none;
}
.sf-social a:hover { opacity: 0.6; }
.sf-rule {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid rgba(59, 59, 59, 0.28);
}
.sf-legal {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  color: var(--c-text);
  opacity: 0.72;
  line-height: 1.3;
}
@media (max-width: 720px) {
  .sf-social-left,
  .sf-social-right { gap: 18px; }
}
