/* Always show landing navbar (was scroll-reveal only). */
#cortex-nav {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

#cortex-nav .cortex-nav-shell {
  background: rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 10px 34px -14px rgba(17, 20, 28, 0.22) !important;
}

#cortex-nav .cortex-nav-shell [aria-hidden='true'] {
  opacity: 1 !important;
}

/* Cortex homepage — mobile-only layout fixes (max-width matches sm breakpoint) */
@media (max-width: 639px) {
  #cortex-nav {
    padding-top: 0.5rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  #cortex-nav .cortex-nav-shell {
    position: relative;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 8px 28px -12px rgba(17, 20, 28, 0.2) !important;
    border: 1px solid rgba(17, 20, 28, 0.06) !important;
  }

  #cortex-nav .cortex-nav-row {
    padding: 0.45rem 0.55rem 0.45rem 0.85rem !important;
    gap: 0.5rem !important;
  }

  #cortex-nav .cortex-nav-row img {
    height: 22px !important;
    width: 22px !important;
  }

  #cortex-nav .cortex-nav-row > a span {
    font-size: 15px !important;
  }

  .cortex-nav-desktop-actions {
    display: none !important;
  }

  .cortex-nav-menu-btn {
    display: inline-flex !important;
  }

  .cortex-nav-mobile-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    z-index: 80;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(17, 20, 28, 0.08);
    box-shadow: 0 16px 40px -18px rgba(17, 20, 28, 0.35);
  }

  .cortex-nav-mobile-menu.is-open {
    display: flex;
  }

  .cortex-nav-mobile-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    font-family: var(--font-geist-mono, ui-monospace, monospace);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-strong, #1a1614);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(17, 20, 28, 0.06);
  }

  #top > section:first-of-type {
    padding-top: 5.25rem !important;
  }

  #cal-inline-30 {
    min-height: 280px !important;
    max-height: 320px !important;
    overflow: hidden !important;
  }

  #cal-inline-30 iframe {
    max-height: 320px !important;
  }

  .cortex-cal-section {
    margin-top: 2.5rem !important;
  }

  .cortex-cal-card {
    padding: 0.45rem !important;
    border-radius: 16px !important;
  }

  #cortex-site-footer {
    padding: 1.5rem 1rem 2rem !important;
  }

  #cortex-site-footer .cortex-footer-inner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1.25rem !important;
  }

  #cortex-site-footer .cortex-footer-top {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    width: 100% !important;
  }

  #cortex-site-footer .cortex-footer-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.55rem !important;
    width: 100% !important;
  }

  #cortex-site-footer .cortex-footer-nav a {
    font-size: 10px !important;
    letter-spacing: 0.08em !important;
  }

  #cortex-site-footer .cortex-footer-tagline {
    font-size: 9px !important;
    line-height: 1.65 !important;
    letter-spacing: 0.06em !important;
    max-width: 100% !important;
  }
}

@media (min-width: 640px) {
  .cortex-nav-menu-btn,
  .cortex-nav-mobile-menu {
    display: none !important;
  }
}

.cortex-nav-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(17, 20, 28, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-strong, #1a1614);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.cortex-nav-menu-btn svg {
  width: 18px;
  height: 18px;
}

/* —— Click ink + soft press (meadow amber) —— */
.cortex-ink-ripple {
  position: fixed;
  z-index: 99999;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(184, 149, 106, 0.42) 0%,
    rgba(184, 149, 106, 0.16) 38%,
    rgba(184, 149, 106, 0) 72%
  );
  animation: cortex-ink 560ms cubic-bezier(0.16, 0.84, 0.28, 1) forwards;
  mix-blend-mode: multiply;
}

@keyframes cortex-ink {
  from {
    transform: scale(0.35);
    opacity: 0.9;
  }
  to {
    transform: scale(18);
    opacity: 0;
  }
}

a.cortex-press,
button.cortex-press,
.btn-cluely.cortex-press,
[role='button'].cortex-press {
  transform: translateY(1px) scale(0.985);
  transition: transform 90ms ease;
}

/* —— Subtle brand cursor (fine pointers only) —— */
@media (pointer: fine) {
  html.cortex-cursor-on,
  html.cortex-cursor-on body,
  html.cortex-cursor-on a,
  html.cortex-cursor-on button,
  html.cortex-cursor-on .btn-cluely {
    cursor: none;
  }

  html.cortex-cursor-on input,
  html.cortex-cursor-on textarea,
  html.cortex-cursor-on select,
  html.cortex-cursor-on [contenteditable='true'] {
    cursor: text;
  }
}

.cortex-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100000;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  will-change: transform;
}

.cortex-cursor.is-visible {
  opacity: 1;
}

.cortex-cursor-ring,
.cortex-cursor-core {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.cortex-cursor-ring {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(166, 124, 82, 0.45);
  background: rgba(255, 248, 238, 0.12);
  transition: width 160ms ease, height 160ms ease, border-color 160ms ease, background 160ms ease;
}

.cortex-cursor-core {
  width: 5px;
  height: 5px;
  background: #a67c52;
  box-shadow: 0 0 0 1px rgba(255, 248, 238, 0.55);
  transition: transform 160ms ease, background 160ms ease;
}

.cortex-cursor.is-hot .cortex-cursor-ring {
  width: 38px;
  height: 38px;
  border-color: rgba(120, 78, 42, 0.7);
  background: rgba(184, 149, 106, 0.14);
}

.cortex-cursor.is-hot .cortex-cursor-core {
  background: #784e2a;
  transform: translate(-50%, -50%) scale(1.25);
}

@media (prefers-reduced-motion: reduce) {
  .cortex-ink-ripple {
    display: none !important;
  }

  a.cortex-press,
  button.cortex-press,
  .btn-cluely.cortex-press,
  [role='button'].cortex-press {
    transform: none !important;
  }

  .cortex-cursor {
    display: none !important;
  }

  html.cortex-cursor-on,
  html.cortex-cursor-on body,
  html.cortex-cursor-on a,
  html.cortex-cursor-on button,
  html.cortex-cursor-on .btn-cluely {
    cursor: auto !important;
  }
}

/* —— React Bits-inspired ScrambledText / RotatingText —— */
.cortex-scramble-char {
  display: inline-block;
  will-change: contents;
}

/* Keeps a scrambled word atomic so lines never break mid-word. */
.cortex-scramble-word {
  display: inline-block;
  white-space: nowrap;
}

.cortex-rotate {
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

.cortex-rotate-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cortex-rotate-viewport {
  position: relative;
  display: inline-block;
  height: 1.15em;
  overflow: hidden;
  vertical-align: -0.12em;
  color: inherit;
  font: inherit;
}

.cortex-rotate-word {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  white-space: nowrap;
  color: inherit;
  font: inherit;
  line-height: 1.15em;
  transform: translateY(0);
  opacity: 1;
  transition:
    transform 480ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 380ms ease;
  will-change: transform, opacity;
}

.cortex-rotate-word.is-current {
  transform: translateY(0);
  opacity: 1;
}

.cortex-rotate-word.is-below {
  transform: translateY(110%);
  opacity: 0;
  transition: none;
}

.cortex-rotate-word.is-above {
  transform: translateY(-110%);
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .cortex-rotate-word {
    transition: none !important;
  }
}
