/* Public-site chrome: header, footer and buttons. Loaded by the marketing pages
   (with site.css) and by logged-out app pages such as login and the calculator,
   where it sits beside Bootstrap and app.css -- so every rule here is namespaced
   and sets its own type and colour rather than inheriting them. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static/fonts/manrope-variable.woff2") format("woff2");
}

:root {
  --site-page: #111312;
  --site-surface: #181b19;
  --site-raised: #202321;
  --site-ink: #f3f2ee;
  --site-muted: #a9ada7;
  --site-faint: #8a8f89;
  --site-line: rgba(243, 242, 238, .12);
  --site-line-strong: rgba(243, 242, 238, .26);
  --site-coral: #ef8b69;
  --site-flame: #f0703f;
  --site-flame-hover: #f5844f;
  --site-on-flame: #170c07;
  --site-ease: cubic-bezier(.16, 1, .3, 1);
  --site-max: 1240px;
  --site-gutter: clamp(20px, 4vw, 40px);
  --site-header-h: 68px;
  --site-font: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Buttons: every action on the public site is a pill. */
.site-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .7rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--site-font);
  font-size: .9375rem;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .25s var(--site-ease);
}

.site-btn:active {
  transform: translateY(1px) scale(.98);
}

.site-btn-lg {
  min-height: 52px;
  padding: .9rem 1.6rem;
  font-size: 1rem;
}

.site-btn-primary,
.site-btn-primary:visited {
  background: var(--site-flame);
  color: var(--site-on-flame);
}

.site-btn-primary:hover {
  background: var(--site-flame-hover);
  color: var(--site-on-flame);
}

.site-btn-outline,
.site-btn-outline:visited {
  border-color: var(--site-line-strong);
  background: transparent;
  color: var(--site-ink);
}

.site-btn-outline:hover {
  border-color: var(--site-ink);
  color: var(--site-ink);
}

.site-btn:focus-visible,
.site-header a:focus-visible,
.site-header summary:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid var(--site-coral);
  outline-offset: 3px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1040;
  height: var(--site-header-h);
  border-bottom: 1px solid var(--site-line);
  background: rgba(17, 19, 18, .86);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  color: var(--site-ink);
  font-family: var(--site-font);
  line-height: 1.4;
}

.site-header *,
.site-footer * {
  box-sizing: border-box;
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  height: 100%;
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 var(--site-gutter);
}

.site-brand {
  flex: none;
  color: var(--site-ink);
  font-size: 1.55rem;
  font-weight: 780;
  letter-spacing: -.065em;
  line-height: 1;
  text-decoration: none;
}

.site-brand:hover {
  color: var(--site-ink);
}

.site-brand span {
  color: var(--site-coral);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  min-width: 0;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .5rem .75rem;
  border-radius: 999px;
  color: var(--site-muted);
  font-size: .9375rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}

.site-nav a:hover {
  background: rgba(243, 242, 238, .06);
  color: var(--site-ink);
}

.site-nav a[aria-current="page"] {
  color: var(--site-ink);
}

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: .75rem;
  right: .75rem;
  bottom: -13px;
  height: 2px;
  border-radius: 2px;
  background: var(--site-coral);
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
}

.site-menu {
  display: none;
  position: relative;
}

.site-menu summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--site-line-strong);
  border-radius: 999px;
  color: var(--site-ink);
  list-style: none;
  cursor: pointer;
}

.site-menu summary::-webkit-details-marker {
  display: none;
}

.site-menu summary svg {
  width: 20px;
  height: 20px;
}

.site-menu .site-menu-close,
.site-menu[open] .site-menu-open {
  display: none;
}

.site-menu[open] .site-menu-close {
  display: block;
}

.site-menu-panel {
  position: fixed;
  top: var(--site-header-h);
  left: 0;
  right: 0;
  display: grid;
  gap: .25rem;
  padding: 1rem var(--site-gutter) 1.5rem;
  border-bottom: 1px solid var(--site-line);
  background: var(--site-page);
  box-shadow: 0 24px 40px rgba(0, 0, 0, .45);
}

.site-menu-panel a:not(.site-btn) {
  display: flex;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid var(--site-line);
  color: var(--site-ink);
  font-size: 1.125rem;
  font-weight: 700;
  text-decoration: none;
}

.site-menu-panel .site-btn {
  margin-top: 1rem;
}

@media (max-width: 960px) {
  .site-nav,
  .site-header-actions .site-btn-outline {
    display: none;
  }

  .site-menu {
    display: block;
  }

  .site-header-inner {
    gap: .75rem;
  }
}

@media (max-width: 380px) {
  .site-header-actions .site-btn-primary {
    padding: .7rem 1rem;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--site-line);
  background: var(--site-page);
  color: var(--site-muted);
  font-family: var(--site-font);
  font-size: .9375rem;
  line-height: 1.6;
}

.site-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 4.5rem var(--site-gutter) 3rem;
}

.site-footer-brand .site-brand {
  display: inline-block;
  margin-bottom: 1rem;
}

.site-footer-brand p {
  max-width: 30ch;
  margin: 0 0 1.5rem;
}

.site-footer h2 {
  margin: 0 0 1rem;
  color: var(--site-ink);
  font-family: var(--site-font);
  font-size: .9375rem;
  font-weight: 750;
  letter-spacing: 0;
}

.site-footer ul {
  display: grid;
  gap: .6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer ul a {
  color: var(--site-muted);
  text-decoration: none;
  transition: color .2s ease;
}

.site-footer ul a:hover {
  color: var(--site-ink);
}

.site-footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 2rem;
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 1.5rem var(--site-gutter) 2.5rem;
  border-top: 1px solid var(--site-line);
  color: var(--site-faint);
  font-size: .8125rem;
}

.site-footer-base p {
  margin: 0;
}

@media (max-width: 860px) {
  .site-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer-brand {
    grid-column: 1 / -1;
  }
}

/* Logged-out app pages (login, calculator, guide, legal) wear the site chrome in a
   browser. Inside the iOS app the native-app class, set before first paint, keeps the
   app's own top bar instead. */
html:not(.native-app) body.has-site-chrome > .app-topbar,
html:not(.native-app) body.has-site-chrome > .app-tabbar {
  display: none !important;
}

html:not(.native-app) body.has-site-chrome > .app-shell {
  padding-top: clamp(1.5rem, 4vw, 3rem) !important;
  padding-bottom: 4rem !important;
}

html.native-app .site-header,
html.native-app .site-footer {
  display: none !important;
}

/* Their buttons join the site's pill system, so a page never shows two button styles. */
html:not(.native-app) body.has-site-chrome .app-shell .btn {
  border-radius: 999px;
  font-family: var(--site-font);
  font-weight: 750;
}

html:not(.native-app) body.has-site-chrome .app-shell .btn-primary {
  --bs-btn-hover-bg: var(--site-flame-hover);
  --bs-btn-hover-border-color: var(--site-flame-hover);
  border-color: var(--site-flame);
  background: var(--site-flame);
  color: var(--site-on-flame);
}

html:not(.native-app) body.has-site-chrome .app-shell .btn-primary:hover {
  border-color: var(--site-flame-hover);
  background: var(--site-flame-hover);
  color: var(--site-on-flame);
}

html:not(.native-app) body.has-site-chrome .app-shell .btn-outline-primary,
html:not(.native-app) body.has-site-chrome .app-shell .btn-outline-secondary {
  border-color: var(--site-line-strong);
  background: transparent;
  color: var(--site-ink);
}

html:not(.native-app) body.has-site-chrome .app-shell .btn-outline-primary:hover,
html:not(.native-app) body.has-site-chrome .app-shell .btn-outline-secondary:hover {
  border-color: var(--site-ink);
  color: var(--site-ink);
}

@media (prefers-reduced-motion: reduce) {
  .site-btn,
  .site-nav a {
    transition: none;
  }
}
