/* Shared floating nav + iOS drawer for inner pages — lifted from the homepage design.
   Loaded only on inner pages (the homepage uses home.css). */
/* palette + tokens */
:root {
  /* cool palette */
  --cream:   oklch(0.97 0.008 235);
  --cream-2: oklch(0.94 0.012 230);
  --cream-3: oklch(0.90 0.018 228);
  --ink:     oklch(0.18 0.03 250);
  --ink-2:   oklch(0.30 0.028 245);
  --muted:   oklch(0.50 0.018 245);
  --line:    oklch(0.86 0.014 235);

  --blue:        oklch(0.55 0.13 245);
  --blue-deep:   oklch(0.40 0.14 250);
  --blue-soft:   oklch(0.78 0.07 235);
  --blue-tint:   oklch(0.88 0.04 235);
  --teal:        oklch(0.55 0.06 200);
  --sand:        oklch(0.75 0.06 70);

  /* legacy aliases used in markup */
  --terracotta:      var(--blue);
  --terracotta-deep: var(--blue-deep);
  --sage:            var(--teal);

  --max: 1180px;
  --gutter: clamp(14px, 2.8vw, 36px);

  --serif: "Lora", "Times New Roman", Times, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 34px;

  --ease: cubic-bezier(.2,.7,.2,1);
}

/* scoped box-sizing (do NOT touch Tailwind's global reset) */
.nav, .nav *, .drawer, .drawer * { box-sizing: border-box; }

/* floating pill nav + brand */
.nav {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 6px 6px 6px 14px;
  background: oklch(0.97 0.008 235 / .42);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid oklch(0.97 0.008 235 / .35);
  border-radius: 999px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.55) inset,
    0 0 0 1px oklch(0.97 0.008 235 / .25) inset,
    0 8px 30px oklch(0.4 0.08 250 / .1),
    0 24px 48px oklch(0.4 0.08 250 / .08);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), background .5s var(--ease);
}
.nav.scrolled {
  background: oklch(0.97 0.008 235 / .62);
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 0 0 1px oklch(0.97 0.008 235 / .3) inset,
    0 14px 40px oklch(0.4 0.08 250 / .18);
}

.brand { display: flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 20px; letter-spacing: 0.02em; line-height: 1; flex-shrink: 0; }
.brand-logo {
  height: 28px; width: 28px;
  flex-shrink: 0;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0 1px 2px oklch(0.4 0.08 250 / .2));
}
.brand-large .brand-logo { height: 38px; width: 38px; }
.brand-text { font-style: italic; }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--ink-2);
  margin: 0 4px;
  position: relative;
  padding: 4px;
}
.nav-indicator {
  position: absolute;
  top: 4px;
  left: 0;
  width: 0;
  height: calc(100% - 8px);
  background: var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 14px oklch(0.18 0.03 250 / .35), inset 0 1px 0 oklch(0.35 0.04 250 / .5);
  transform: translateX(0);
  transition:
    transform .55s cubic-bezier(.34, 1.3, .64, 1),
    width .55s cubic-bezier(.34, 1.3, .64, 1),
    opacity .35s var(--ease);
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}
.nav-indicator.show { opacity: 1; }

.nav-links a {
  position: relative;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 999px;
  z-index: 1;
  transition: color .35s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active,
.nav-links a.preview { color: var(--cream); }
.nav-links a::after { display: none; }

.nav-cta {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.nav-cta:hover { background: var(--blue-deep); transform: translateY(-1px); }

@media (max-width: 820px) {
  .nav { gap: 8px; padding: 5px 5px 5px 12px; }
  .nav-links { display: none; }
}

/* status dot */
.meta-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px oklch(0.55 0.06 200 / .22);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px oklch(0.55 0.06 200 / .22); } 50% { box-shadow: 0 0 0 9px oklch(0.55 0.06 200 / 0); } }

/* buttons used inside the drawer */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 500;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
  position: relative;
}
.btn-primary {
  background: var(--ink); color: var(--cream);
  box-shadow: 0 10px 30px oklch(0.18 0.03 250 / .25), inset 0 0 0 1px oklch(0.32 0.04 250 / .5);
}
.btn-primary:hover { background: var(--blue-deep); transform: translateY(-2px); box-shadow: 0 14px 44px oklch(0.4 0.14 250 / .3); }
.btn-ghost {
  background: oklch(0.97 0.008 235 / .55);
  border: 1px solid oklch(0.86 0.018 230 / .7);
  color: var(--ink);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: oklch(0.94 0.012 230 / .8); }
.ghost-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 var(--blue);
  animation: pulse-call 1.8s var(--ease) infinite;
}
@keyframes pulse-call { 0%, 100% { box-shadow: 0 0 0 0 oklch(0.55 0.13 245 / .5); } 50% { box-shadow: 0 0 0 8px oklch(0.55 0.13 245 / 0); } }


/* burger + slide-out drawer */
.nav-burger {
  display: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid oklch(0.86 0.018 230 / .7);
  background: oklch(0.97 0.008 235 / .55);
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  padding: 0;
  transition: transform .2s var(--ease), background .25s var(--ease);
}
.nav-burger:active { transform: scale(0.92); }
.nav-burger span {
  display: block; width: 14px; height: 1.4px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .35s var(--ease), opacity .25s var(--ease);
}

.drawer {
  position: fixed; inset: 0;
  z-index: 100;
  pointer-events: none;
  visibility: hidden;
}
.drawer.open { pointer-events: auto; visibility: visible; }

.drawer-scrim {
  position: absolute; inset: 0;
  background: oklch(0.18 0.03 250 / .35);
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.drawer.open .drawer-scrim { opacity: 1; }

.drawer-panel {
  position: absolute;
  top: 8px; right: 8px; bottom: 8px;
  width: min(380px, calc(100vw - 16px));
  background: var(--cream);
  border-radius: 22px;
  box-shadow:
    0 24px 60px oklch(0.18 0.03 250 / .35),
    0 0 0 1px oklch(0.86 0.018 230 / .6),
    inset 0 0 0 1px rgba(255,255,255,.55);
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
  transform: translate3d(110%, 0, 0);
  transition: transform .55s cubic-bezier(.22,1,.36,1);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.drawer.open .drawer-panel { transform: translate3d(0, 0, 0); }

.drawer-handle {
  width: 36px; height: 4px; border-radius: 4px;
  background: oklch(0.86 0.018 230);
  margin: 2px auto 4px;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head .brand { font-size: 20px; }
.drawer-head .brand-logo { height: 30px; width: 30px; }
.drawer-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s var(--ease), background .25s var(--ease);
}
.drawer-close:active { transform: scale(0.92); }
.drawer-close:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.drawer-status {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  padding: 7px 13px 7px 10px;
  background: oklch(0.55 0.06 200 / .1);
  border: 1px solid oklch(0.55 0.06 200 / .25);
  border-radius: 999px;
  font-size: 12px; color: var(--ink-2);
}

.drawer-nav {
  display: flex; flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.drawer-nav a {
  display: grid;
  grid-template-columns: 28px 1fr 22px;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 14px;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.1;
  color: var(--ink);
  transition: background .25s var(--ease), transform .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.drawer-nav a:active { transform: scale(0.985); background: var(--cream-2); }
.drawer-nav a:hover { background: var(--cream-2); }
.drawer-num {
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--blue-deep);
  align-self: center;
}
.drawer-arrow { font-family: var(--serif); font-size: 18px; color: var(--muted); }

.drawer-actions {
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 12px;
  margin-top: auto;
  border-top: 1px solid var(--line);
}
.drawer-actions .btn { width: 100%; justify-content: center; padding: 14px 18px; font-size: 14px; }

.drawer-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 6px;
  font-size: 11px; color: var(--muted);
  font-family: var(--mono); letter-spacing: 0.08em;
}
.drawer-foot a:hover { color: var(--blue-deep); }

@media (max-width: 820px) {
  .nav-burger { display: inline-flex; }
  .nav-cta { display: none; }
}

/* lock body scroll while drawer open */
body.drawer-open { overflow: hidden; }


/* ---- old-device fallbacks ---- */
@supports not (color: oklch(0.5 0 0)) {
  :root { --cream:#f2f5f7; --cream-2:#e9eef1; --cream-3:#dfe6ea; --ink:#1b2331; --ink-2:#39434f; --muted:#6b7480; --line:#d6dde2; --blue:#3f74c0; --blue-deep:#2c4f8a; --blue-soft:#a9c3e6; --blue-tint:#d3e0f0; --teal:#5aa0a0; --sand:#c9b48f; }
  .nav { background:rgba(245,247,249,.9); }
  .drawer-panel { background:#f2f5f7; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav { background:rgba(245,247,249,.94); }
}

/* ---- fancier global buttons (polish pass) ---- */
.nav-cta { box-shadow:0 6px 18px rgba(20,30,45,.20); }
.nav-cta:hover { transform:translateY(-2px); box-shadow:0 12px 28px rgba(63,116,192,.32); }
.nav-cta svg, .btn svg { transition:transform .2s ease; }
.nav-cta:hover svg, .btn:hover svg { transform:translateX(3px); }
.btn-primary { background:linear-gradient(135deg,var(--blue),var(--blue-deep)); box-shadow:0 10px 26px rgba(63,116,192,.30); }
.btn-primary:hover { transform:translateY(-2px); filter:brightness(1.06); box-shadow:0 16px 36px rgba(63,116,192,.42); }
.btn-ghost { transition:transform .2s ease, background .2s ease, border-color .2s ease; }
.btn-ghost:hover { transform:translateY(-1px); }
