/* One site navigation, in the home page's design: a fixed 64px bar whose glass surface has a
   curved lower edge (nav-edge.svg), the primary links centred, and "Sign in" plus a pill call to
   action on the right. The glass only shows once the page scrolls or the menu opens, so a hero
   can run up behind it. landing.js drives --menu-expansion so the glass grows with the menu.
   Colours follow the theme through light-dark(); the home page pins color-scheme: light. */
@property --menu-expansion { syntax: "<length>"; inherits: true; initial-value: 0px; }

.landing-shell:not(.landing-shell--home), body.product-page { padding-top: var(--header-height); }
/* Text size (RFC 0018) keeps the bar close to its normal height, 64px to 80px, and enlarges what is
   in it; links fold into the menu sooner instead (text-size.js scales the breakpoints). */
body:is(.landing-page, .product-page) { --header-height: calc(48px + 16px * var(--page-scale, 1)); }
/* The glass shows once this point, just under the bar, has scrolled away (landing.js). */
.landing-header-threshold { position: absolute; top: 30px; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.landing-header {
  --header-ink: var(--color-ink);
  --header-glass: linear-gradient(115deg, light-dark(rgb(255 253 247 / .52), rgb(48 34 24 / .82)), light-dark(rgb(251 247 239 / .38), rgb(33 20 14 / .78)));
  --header-glass-solid: var(--color-paper);
  --header-edge: light-dark(rgb(255 255 255 / .7), rgb(255 255 255 / .16));
  --header-gutter: clamp(24px, 6.5vw, 100px);
  --menu-expansion: 0px;
  position: fixed; z-index: var(--landing-z-menu); inset: 0 0 auto; height: var(--header-height);
  border: 0; background: transparent; color: var(--header-ink); line-height: 1.5;
}
.landing-header::before {
  content: ""; position: absolute; inset: 0 0 auto; height: calc(var(--header-height) + 16px + var(--menu-expansion)); pointer-events: none;
  -webkit-mask: linear-gradient(#000, #000) top / 100% calc(100% - var(--header-height) - 15px) no-repeat, url("/images/listening/nav-edge.svg") bottom / 100% calc(var(--header-height) + 16px) no-repeat;
  mask: linear-gradient(#000, #000) top / 100% calc(100% - var(--header-height) - 15px) no-repeat, url("/images/listening/nav-edge.svg") bottom / 100% calc(var(--header-height) + 16px) no-repeat;
  background: var(--header-glass);
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .55);
  transition: opacity 200ms ease;
}
.listening-header__edge { position: absolute; inset: 0 0 auto; width: 100%; height: calc(var(--header-height) + 16px); pointer-events: none; overflow: visible; fill: none; stroke: var(--header-edge); stroke-width: 1; transform: translateY(var(--menu-expansion)); transition: opacity 200ms ease; }
.landing-header:not([data-scrolled]):not([data-menu-open])::before,
.landing-header:not([data-scrolled]):not([data-menu-open]) .listening-header__edge { opacity: 0; }
/* Hovering the bar shows the glass at the top of the page too, so the links stay readable over the hero. */
@media (hover: hover) and (pointer: fine) {
  .landing-header:not([data-scrolled]):not([data-menu-open]):hover::before,
  .landing-header:not([data-scrolled]):not([data-menu-open]):hover .listening-header__edge { opacity: 1; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .landing-header::before { background: var(--header-glass-solid); } }
@media (prefers-reduced-transparency: reduce) { .landing-header::before { background: var(--header-glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* The widest bar grows with Text size, like the page content and the breakpoints below, so a larger Text size
   lays the bar out as a narrower window would. */
.landing-header__inner { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; width: min(calc(100% - 2 * var(--header-gutter)), calc(1320px * var(--page-scale, 1))); height: var(--header-height); margin-inline: auto; padding: 0; }
.landing-header__inner:has(> .processing-tasks:not([hidden])) { grid-template-columns: 1fr auto auto auto; }
/* The logo's column is a container: when the links and buttons leave it too little room (a large
   text size on a phone), the full logo gives way to the mark. */
.landing-wordmark-slot { container: wordmark / inline-size; display: flex; min-width: 0; }
.landing-wordmark { display: inline-flex; align-items: center; min-height: 44px; color: var(--header-ink); text-decoration: none; white-space: nowrap; }
@container wordmark (max-width: 130px) {
  .landing-header .ragafied-brand-logo { display: none; }
  .landing-header .ragafied-brand-compact { display: block; width: min(2rem, 40px); height: min(2rem, 40px); }
}
.landing-header .ragafied-brand-logo { width: calc(124px + 16px * var(--page-scale, 1)); }
.landing-header__nav, .landing-header__account { display: flex; align-items: center; }
.landing-header__nav { gap: clamp(24px, 3.4vw, 55px); }
.landing-header__account { justify-self: end; gap: 24px; }
.landing-header__nav a, .listening-header__sign-in, .landing-sign-out { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--header-ink); font: 400 .75rem/1.25 var(--font-body); text-decoration: none; white-space: nowrap; cursor: pointer; }
.landing-header__nav a[aria-current="page"] { color: var(--color-accent); }
.landing-header :is(.theme-toggle, .text-size__toggle) { width: min(2.75rem, 52px); height: min(2.75rem, 52px); flex-basis: min(2.75rem, 52px); color: var(--header-ink); }
/* The tasks button stays within the bar too, so every item in it shares the bar's centre line. */
.landing-header .processing-tasks__trigger { min-width: min(2.75rem, 52px); height: min(2.75rem, 52px); }
.landing-header :is(.theme-toggle__icon, .text-size__toggle svg, .processing-tasks__trigger svg) { width: min(1.25rem, 28px); height: min(1.25rem, 28px); }
.landing-header .button_to { margin: 0; }
.landing-header .listening-button { min-height: 42px; padding: 10px 22px; font-size: .75rem; }
.landing-mobile-actions { display: none; }
.landing-header :is(a, summary, button):focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .landing-header__nav a:hover, .listening-header__sign-in:hover, .landing-sign-out:hover { text-decoration: underline; text-underline-offset: 4px; }
}

/* The Tools menu: a button styled like the links, and a panel of tools below it. */
.landing-nav-menu { position: relative; }
.landing-nav-menu__button { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--header-ink); font: 400 .75rem/1.25 var(--font-body); white-space: nowrap; cursor: pointer; }
.landing-nav-menu__button[data-active] { color: var(--color-accent); }
.landing-nav-menu__chevron { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-short, 150ms) var(--ease-out, ease); }
.landing-nav-menu__button[aria-expanded="true"] .landing-nav-menu__chevron { transform: rotate(180deg); }
.landing-nav-menu__panel { position: absolute; top: calc(100% + 6px); left: 50%; z-index: 1; display: grid; gap: 2px; width: max-content; min-width: min(16.25rem, calc(100vw - 32px)); max-width: min(20rem, calc(100vw - 32px)); padding: 8px; border-radius: 16px; translate: -50% 0;
  /* The header is fixed, so on a short window the panel scrolls instead of running off the bottom. */
  max-height: calc(100dvh - var(--header-height) - 16px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--color-paper); color: var(--color-ink);
  box-shadow: 0 0 0 1px var(--color-rule), 0 16px 40px -12px rgb(0 0 0 / .3), 0 4px 10px -4px rgb(0 0 0 / .15);
  animation: landing-nav-menu-in 160ms var(--ease-out, ease); }
.landing-nav-menu__panel[hidden] { display: none; }
@keyframes landing-nav-menu-in { from { opacity: 0; translate: -50% -4px; } }
.landing-nav-menu__heading { margin: 0; padding: 6px 12px 4px; color: var(--color-ink-soft); font: 600 .6875rem/1.3 var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
.landing-header__nav .landing-nav-menu__item { display: grid; gap: 2px; min-height: 44px; padding: 10px 12px; border-radius: 10px; color: var(--color-ink); white-space: normal; text-decoration: none; }
.landing-nav-menu__item:hover, .landing-nav-menu__item:focus-visible { background: var(--color-surface-raised, var(--color-accent-soft)); }
.landing-header__nav .landing-nav-menu__item:hover { text-decoration: none; }
.landing-nav-menu__item[aria-current="page"] .landing-nav-menu__title { color: var(--color-accent); }
.landing-nav-menu__title { font: 500 .875rem/1.3 var(--font-body); }
.landing-nav-menu__description { color: var(--color-ink-soft); font: 400 .75rem/1.4 var(--font-body); }
@media (hover: hover) and (pointer: fine) {
  .landing-nav-menu__button:hover { text-decoration: underline; text-underline-offset: 4px; }
}

/* Medium widths keep the links but tighten the spacing; "Sign in" goes because the pill leads
   to the same page. Below 48rem (768px; wider at a larger Text size) the links fold into the menu; the
   glass expands to hold it. */
@media (max-width: 74.999rem) {
  .landing-header__inner { gap: 16px; }
  .landing-header__nav { gap: clamp(14px, 2vw, 24px); }
  .landing-header__account { gap: 14px; }
  .landing-header .listening-button { gap: 10px; padding: 10px 18px; }
}
@media (min-width: 48rem) and (max-width: 63.999rem) {
  .landing-header .listening-header__sign-in { display: none; }
}
@media (max-width: 47.999rem) {
  html[data-landing-menu-open] { overflow: hidden; }
  .landing-header__inner { grid-template-columns: minmax(0, 1fr) auto; }
  .landing-header__inner:has(> .processing-tasks:not([hidden])) { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .landing-header__nav, .landing-header__account { display: none; }
  .landing-mobile-actions { display: flex; align-items: center; gap: 6px; }
}
.landing-mobile-nav summary { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: var(--header-ink); cursor: pointer; list-style: none; }
.landing-mobile-nav summary::-webkit-details-marker { display: none; }
.landing-mobile-nav__icon { position: relative; display: block; width: 1rem; height: 1rem; }
.landing-mobile-nav__icon i { position: absolute; inset: .34rem 0 auto; height: 1.5px; border-radius: 99px; background: currentColor; transition: transform var(--dur-short) var(--ease-out); }
.landing-mobile-nav__icon i:last-child { transform: translateY(.32rem); }
.landing-mobile-nav[open] .landing-mobile-nav__icon i:first-child { transform: translateY(.16rem) rotate(45deg); }
.landing-mobile-nav[open] .landing-mobile-nav__icon i:last-child { transform: translateY(.16rem) rotate(-45deg); }
.landing-mobile-nav nav {
  position: fixed; inset: var(--header-height) 0 auto; display: grid; gap: 20px; width: 100%;
  max-height: calc(100dvh - 96px); padding: 12px var(--header-gutter) 32px; overflow-y: auto; overscroll-behavior: contain;
  background: transparent;
  transform: translateY(calc(var(--menu-expansion) - var(--menu-height, 0px)));
  clip-path: inset(max(0px, calc(var(--menu-height, 0px) - var(--menu-expansion))) 0 0);
}
.landing-mobile-nav:not([open]) nav { display: none; }
.landing-mobile-nav__primary-links, .landing-mobile-nav__utility-links { display: grid; gap: 8px; }
.landing-mobile-nav nav :is(a, .landing-sign-out) { display: flex; align-items: center; min-height: 44px; color: var(--color-ink); font: 400 1.125rem/1.5 var(--font-body); text-decoration: none; }
.landing-mobile-nav nav a[aria-current="page"] { color: var(--color-accent); }
.landing-mobile-nav__utility-links { padding-top: 16px; border-top: 1px solid var(--color-rule); }
/* In the phone menu, the tools are a labelled group rather than a menu inside the menu. */
.landing-mobile-nav__group { display: grid; gap: 0; padding-left: 14px; border-left: 2px solid var(--color-rule); }
.landing-mobile-nav__group-label { padding-top: 4px; color: var(--color-ink-soft); font: 600 .75rem/1.3 var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
@media (prefers-reduced-motion: reduce) {
  .landing-header::before, .listening-header__edge, .landing-mobile-nav__icon i, .landing-nav-menu__chevron { transition: none; }
  .landing-nav-menu__panel { animation: none; }
}

/* Messages' unread pill (RFC 0014 SC-D14). */
.nav-unread-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 1.125rem; height: 1.125rem; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--color-accent); color: var(--color-accent-ink, #fff); font: 600 .6875rem/1 var(--font-body); font-variant-numeric: tabular-nums; }
.nav-unread-pill__label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
