/* Shared polish for every page: slim top bar (inner pages), page transitions,
   and quiet motion. Colors, type and radii come from tokens.css; no shadows. */

/* ---- Page-to-page cross-fade (Chrome, Edge, Safari 18+; others just navigate) ---- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }

html { scroll-behavior: smooth; }

/* ---- Slim top bar for inner pages ---- */
.nlbar { position: sticky; top: 0; z-index: 50; background: #F4EEE2; border-bottom: 1px solid #1A1714; view-transition-name: nlbar; }
.nlbar .in { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); height: 60px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.nlbar .brand { display: inline-flex; align-items: center; gap: 10px; color: #1A1714; text-decoration: none; justify-self: start; min-height: 44px; }
.nlbar .brand img { height: 26px; width: auto; display: block; transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.nlbar .brand:hover img { transform: rotate(-6deg); }
.nlbar .brand span { font-family: var(--font-display, 'Inter Tight', sans-serif); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.nlbar nav { display: flex; gap: clamp(16px, 3vw, 32px); }
.nlbar nav a { position: relative; display: inline-flex; align-items: center; height: 60px; color: #1A1714; text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; }
.nlbar nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: #1A1714; transform: scaleX(0); transform-origin: left; transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.nlbar nav a:hover::after { transform: scaleX(0.6); }
.nlbar nav a[aria-current="page"]::after { transform: scaleX(1); }
.nl-cta { justify-self: end; display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; background: #1A1714; color: #F4EEE2 !important; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background 120ms, transform 120ms; }
.nl-cta:hover { background: #3D362F; color: #F4EEE2; }
.nl-cta:active { transform: translateY(1px) scale(0.98); }
@media (max-width: 640px) {
  .nlbar .in { grid-template-columns: auto 1fr auto; gap: 10px; }
  .nlbar .brand span { display: none; }
  .nlbar nav { justify-content: center; gap: 14px; }
  .nlbar nav a { font-size: 14px; }
  .nl-cta { height: 36px; padding: 0 14px; font-size: 13px; }
}
/* The smallest phones (320 to 380px wide): tighten the bar so Subscribe stays on screen. */
@media (max-width: 380px) {
  .nlbar .in { padding: 0 12px; gap: 6px; }
  .nlbar .brand img { height: 22px; }
  .nlbar nav { gap: 9px; }
  .nlbar nav a { font-size: 13px; }
  .nl-cta { padding: 0 11px; }
}

/* ---- Buttons and links feel ---- */
button, .btn, a { -webkit-tap-highlight-color: transparent; }
.btn, .submit, button[type="submit"] { transition: background 120ms, color 120ms, transform 120ms; }
.btn:active, .submit:active, button[type="submit"]:active { transform: translateY(1px) scale(0.98); }
.nl-arrow { display: inline-block; transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
a:hover .nl-arrow, button:hover .nl-arrow { transform: translateX(3px); }

/* ---- Entrances ---- */
@keyframes nlrise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.nl-in { animation: nlrise 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.nl-in.d1 { animation-delay: 80ms; } .nl-in.d2 { animation-delay: 160ms; } .nl-in.d3 { animation-delay: 240ms; }
/* Sections rise in as they scroll into view, where the browser supports it. */
@supports (animation-timeline: view()) {
  .nl-reveal { animation: nlrise linear both; animation-timeline: view(); animation-range: entry 0% entry 30%; }
}

/* ---- Native dialogs open softly ---- */
dialog[open] { animation: nlpop 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
dialog[open]::backdrop { animation: nlfadein 200ms ease-out; }
@keyframes nlpop { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes nlfadein { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

/* ---- Latest issues on the homepage ---- */
.nl-issue-lead h3 { text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: 5px; transition: text-decoration-color 200ms; }
.nl-issue-lead:hover h3 { text-decoration-color: #1A1714; }
.nl-issue-img img { transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.nl-issue-lead:hover .nl-issue-img img { transform: scale(1.02); }
@media (hover: hover) {
  .nl-issue-row { margin: 0 -12px; padding-left: 12px !important; padding-right: 12px !important; transition: background 160ms; }
  .nl-issue-row:hover { background: rgba(26, 23, 20, 0.035); }
}
.nl-issue-row:hover .nl-arrow, .nl-issue-lead:hover .nl-arrow { transform: translateX(3px); }

/* ---- "Open to a move" band on the homepage ---- */
.nl-openband:hover .nl-cta { background: #3D362F; }
.nl-openband:hover .nl-arrow { transform: translateX(3px); }

/* ---- Homepage headline on one line at desktop width ---- */
@media (min-width: 860px) {
  #hero-title { white-space: nowrap; font-size: min(5.6vw, 108px) !important; margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important; }
  #hero-title > span { display: inline !important; }
}
