@import url("/assets/brand/constellation-1.0.0.css");

/* MAICO public shell v2.0. BRAND-001A owns the imported token contract; this
 * file only maps those tokens to the shared public shell behavior. */

/* --------------------------------------------------------------------------
 * 2. Shell surface tokens (light-first)
 * -------------------------------------------------------------------------- */
:root {
  color-scheme: light;
  --shell-height: 64px;
  --shell-max-width: 1280px;
  --shell-bg: var(--brand-neutral-50);
  --shell-surface: var(--brand-cream-100);
  --shell-surface-2: var(--brand-neutral-100);
  --shell-text: var(--brand-neutral-900);
  --shell-muted: var(--brand-neutral-600);
  --shell-border: var(--brand-neutral-200);
  --shell-accent: var(--brand-amber-500);
  --shell-link: color-mix(in srgb, var(--brand-ochre-700) 80%, var(--brand-neutral-950));
  --shell-indigo: var(--brand-indigo-600);
  --shell-focus: var(--brand-amber-500);
  --shell-mycelium: var(--brand-moss-700);
  --text-faint: var(--brand-neutral-600);
  --text-muted: var(--brand-neutral-600);

  --font-display: var(--brand-font-display);
  --font-body: var(--brand-font-body);
  --display: var(--brand-font-display);
  --body: var(--brand-font-body);
  --ui: var(--brand-font-ui);
}

[data-theme="dark"] {
  color-scheme: dark;
  --shell-bg: var(--brand-neutral-950);
  --shell-surface: var(--brand-neutral-900);
  --shell-surface-2: var(--brand-neutral-800);
  --shell-text: var(--brand-cream-100);
  --shell-muted: var(--brand-neutral-400);
  --shell-border: var(--brand-neutral-800);
  --shell-accent: var(--brand-amber-500);
  --shell-link: var(--brand-cream-100);
  --shell-indigo: color-mix(in srgb, var(--brand-indigo-400) 75%, var(--brand-cream-100));
  --shell-focus: var(--brand-amber-500);
  --shell-mycelium: var(--brand-paramo-500);
  --text-faint: var(--brand-neutral-400);
  --text-muted: var(--brand-neutral-200);
  --brand-shadow-1: 0 1px 2px oklch(0% 0 0 / 0.30);
  --brand-shadow-2: 0 2px 8px oklch(0% 0 0 / 0.36);
  --brand-shadow-3: 0 8px 24px oklch(0% 0 0 / 0.44);
}

html { scroll-padding-top: calc(var(--shell-height) + var(--brand-space-4)); }
body { background-color: var(--shell-bg); color: var(--shell-text); font-family: var(--body); }
body::before { display: none !important; background: none !important; }

#page-title > em {
  color: var(--shell-muted) !important;
}

:where(h1, h2) > em {
  color: var(--shell-link) !important;
}

.status-badge {
  color: var(--shell-link) !important;
}

.pill {
  color: var(--shell-link) !important;
}

.btn-profile,
.btn-submit,
.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px !important;
}

.btn-profile,
.btn-submit,
.btn-primary {
  background: var(--shell-link) !important;
  color: var(--shell-bg) !important;
}

.btn-ghost {
  border-color: var(--shell-link) !important;
  color: var(--shell-link) !important;
}

.form-check a,
.footer-legal a,
a.inline,
.sec > span {
  color: var(--shell-link) !important;
}

.form-check a,
.footer-legal a,
a.inline {
  text-decoration: underline !important;
  text-decoration-thickness: .08em !important;
}

body[data-page="catalog"] :where(.eyebrow, .secondary-link, .text-button, .source-links a, .detail-actions a, footer a),
body[data-page="map"] :where(.eyebrow, .secondary-link, .text-button, .source-links a, .detail-actions a, footer a) {
  color: var(--shell-link) !important;
}
#cursor-dot,
#cursor-ring { display: none; }

@media (hover: hover) and (pointer: fine) {
  body,
  a,
  button,
  [role="button"] { cursor: auto !important; }

  html.custom-cursor-active body,
  html.custom-cursor-active a,
  html.custom-cursor-active button,
  html.custom-cursor-active [role="button"] { cursor: none !important; }

  html.custom-cursor-active :where(input, textarea, select, [contenteditable="true"]) {
    cursor: auto !important;
  }

  #cursor-dot,
  #cursor-ring {
    position: fixed;
    inset: 0 auto auto 0;
    z-index: 9999;
    display: block;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
    will-change: left, top, width, height;
  }

  #cursor-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--shell-accent);
    transition: opacity var(--brand-duration-instant) var(--brand-ease-out-quad),
                transform var(--brand-duration-instant) var(--brand-ease-out-quad);
  }

  #cursor-ring {
    z-index: 9998;
    width: 32px;
    height: 32px;
    border: 1.5px solid color-mix(in srgb, var(--shell-mycelium) 72%, transparent);
    border-radius: 50%;
    transition: opacity var(--brand-duration-instant) var(--brand-ease-out-quad),
                width var(--brand-duration-fast) var(--brand-ease-out-quad),
                height var(--brand-duration-fast) var(--brand-ease-out-quad),
                border-color var(--brand-duration-fast) var(--brand-ease-out-quad);
  }

  html.custom-cursor-active.cursor-visible:not(.custom-cursor-native) :is(#cursor-dot, #cursor-ring) {
    opacity: 1;
  }

  #cursor-dot.cursor-hover { transform: translate(-50%, -50%) scale(.55); }
  #cursor-ring.cursor-hover {
    width: 46px;
    height: 46px;
    border-color: color-mix(in srgb, var(--shell-mycelium) 94%, transparent);
  }
  #cursor-ring.cursor-card {
    width: 52px;
    height: 52px;
    border-color: color-mix(in srgb, var(--shell-accent) 78%, transparent);
  }
  #cursor-ring.cursor-down { width: 24px; height: 24px; }
}

.skip-link {
  position: fixed !important;
  z-index: 10000 !important;
  top: var(--brand-space-2) !important;
  left: var(--brand-space-2) !important;
  min-height: 44px;
  padding: 10px 16px !important;
  border-radius: var(--brand-radius-sm);
  background: var(--shell-text) !important;
  color: var(--shell-bg) !important;
  font-family: var(--ui);
  transform: translateY(-140%);
  transition: transform var(--brand-duration-fast) var(--brand-ease-out-quad);
}
.skip-link:focus { transform: translateY(0); }

#navbar,
#main-nav,
.site-nav {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  z-index: 900 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: var(--shell-height) !important;
  height: var(--shell-height) !important;
  padding: 0 clamp(var(--brand-space-4), 3.2vw, 52px) !important;
  gap: clamp(var(--brand-space-3), 2.5vw, var(--brand-space-6)) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--shell-border) !important;
  background: color-mix(in srgb, var(--shell-bg) 94%, transparent) !important;
  color: var(--shell-text) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px) saturate(120%);
}

#scroll-progress {
  position: absolute;
  inset: auto auto -1px 0;
  height: 1px;
  max-width: 100%;
  background: var(--shell-accent);
}

.nav-logo,
.site-nav .brand,
.brand-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 9px !important;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px !important;
  color: var(--shell-text) !important;
  font-family: var(--brand-font-ui) !important;
  font-size: var(--brand-text-sm) !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: .09em !important;
  text-decoration: none !important;
  text-transform: uppercase;
}

.nav-logo svg,
.site-nav .brand svg,
.brand-link svg,
.brand-link .brand-mark,
.nav-logo .brand-mark {
  width: 26px !important;
  height: 26px !important;
  flex: 0 0 auto;
}

.brand-mark--dark { display: none; }
[data-theme="dark"] .brand-mark--light { display: none; }
[data-theme="dark"] .brand-mark--dark { display: block; }

.brand-wordmark {
  color: var(--shell-text);
  font: 700 var(--brand-text-sm)/1 var(--brand-font-ui);
  letter-spacing: .09em;
}

.site-nav .brand span,
.brand-link .brand-domain,
.nav-logo .brand-domain { color: var(--shell-link); }

.nav-center,
.site-nav .nav-links,
#navbar .nav-links {
  position: relative !important;
  inset: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center;
  gap: 2px !important;
  margin: 0 auto !important;
  transform: none !important;
}

.nav-link,
.site-nav .nav-links a,
#navbar .nav-links a,
.nav-center a {
  position: relative;
  isolation: isolate;
  display: inline-flex !important;
  align-items: center;
  min-height: 44px;
  padding: 0 clamp(var(--brand-space-2), 1vw, 14px) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--shell-muted) !important;
  font-family: var(--brand-font-ui) !important;
  font-size: var(--brand-text-xs) !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  letter-spacing: .01em;
  text-decoration: none !important;
  white-space: nowrap;
}

.nav-link::before,
.site-nav .nav-links a::before,
#navbar .nav-links a::before,
.nav-center a::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: calc(100% + 18px);
  min-width: 92px;
  height: 32px;
  background: var(--shell-mycelium);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.94);
  transform-origin: center;
  -webkit-mask: url("/assets/ui/nav-mycelium.svg") center / 100% 100% no-repeat;
  mask: url("/assets/ui/nav-mycelium.svg") center / 100% 100% no-repeat;
  transition: opacity var(--brand-duration-fast) var(--brand-ease-out-quad),
              transform var(--brand-duration-fast) var(--brand-ease-out-expo);
}

.nav-link:hover::before,
.nav-link:focus-visible::before,
.site-nav .nav-links a:hover::before,
.site-nav .nav-links a:focus-visible::before,
#navbar .nav-links a:hover::before,
#navbar .nav-links a:focus-visible::before,
.nav-center a:hover::before,
.nav-center a:focus-visible::before {
  opacity: .22;
  transform: translate(-50%, -50%) scale(1);
}

.nav-link::after,
.site-nav .nav-links a::after,
#navbar .nav-links a::after,
.nav-center a::after {
  content: "";
  position: absolute;
  inset: auto 10px 5px;
  height: 1px;
  background: var(--shell-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--brand-duration-fast) var(--brand-ease-out-quad);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active,
.site-nav .nav-links a:hover,
.site-nav .nav-links a:focus-visible,
.site-nav .nav-links a.active,
#navbar .nav-links a:hover,
#navbar .nav-links a:focus-visible,
#navbar .nav-links a.active,
.nav-center a:hover,
.nav-center a:focus-visible,
.nav-center a.active {
  color: var(--shell-text) !important;
}

.nav-link.active::after,
.site-nav .nav-links a.active::after,
#navbar .nav-links a.active::after,
.nav-center a.active::after,
[aria-current="page"]::after {
  transform: scaleX(1);
}
.nav-right,
.nav-actions,
.site-nav .nav-actions,
#navbar .nav-actions {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: var(--brand-space-2) !important;
  flex: 0 0 auto;
}

.btn-theme,
#themeToggle,
#btn-theme,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px !important;
  min-width: 44px;
  height: 44px !important;
  padding: 0 !important;
  border: 1px solid var(--shell-border) !important;
  border-radius: var(--brand-radius) !important;
  background: var(--shell-surface) !important;
  color: var(--shell-text) !important;
  font-family: var(--brand-font-ui) !important;
  cursor: pointer;
}

.btn-nav-cta,
.pilot-link {
  display: inline-flex !important;
  align-items: center;
  min-height: 44px;
  padding: 0 15px !important;
  border: 1px solid color-mix(in srgb, var(--shell-accent) 45%, var(--shell-border)) !important;
  border-radius: var(--brand-radius) !important;
  background: color-mix(in srgb, var(--shell-accent) 13%, var(--shell-surface)) !important;
  color: var(--shell-text) !important;
  font-family: var(--brand-font-ui) !important;
  font-size: var(--brand-text-xs) !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: .03em;
  text-decoration: none !important;
  white-space: nowrap;
}

/* Progressive mobile menu: native <details> works without JS; JS enhances it. */
.nav-mobile-details { display: none; }
.nav-mobile-details > summary { list-style: none; }
.nav-mobile-details > summary::-webkit-details-marker { display: none; }

.nav-hamburger,
#nav-hamburger,
#navHamburger,
.nav-mobile-details > summary {
  display: none !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  align-items: center;
  justify-content: center;
}

.nav-mobile,
#nav-mobile,
#navMobile,
#mobile-menu {
  position: fixed !important;
  z-index: 880 !important;
  inset: var(--shell-height) 0 auto 0 !important;
  display: none !important;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  max-height: calc(100vh - var(--shell-height));
  overflow: auto;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 4px;
  padding: 10px 16px 16px !important;
  border-bottom: 1px solid var(--shell-border) !important;
  background: var(--shell-bg) !important;
  box-shadow: var(--brand-shadow-3);
}

.nav-mobile.open,
#nav-mobile.open,
#navMobile.open,
#mobile-menu.open,
.nav-mobile-details[open] > .nav-mobile,
.nav-mobile-details[open] > nav#nav-mobile,
.nav-mobile-details[open] > nav#navMobile,
.nav-mobile-details[open] > nav#mobile-menu { display: grid !important; }

.nav-mobile a,
.nav-mobile span,
#nav-mobile a,
#nav-mobile span,
#navMobile a,
#navMobile span,
#mobile-menu a,
#mobile-menu span {
  display: flex !important;
  align-items: center;
  min-height: 44px;
  padding: 7px 10px !important;
  color: var(--shell-muted) !important;
  text-decoration: none;
  font-family: var(--brand-font-ui);
  font-size: var(--brand-text-sm);
}

.nav-mobile a.active,
#nav-mobile a.active,
#navMobile a.active,
#mobile-menu a.active { color: var(--shell-text) !important; font-weight: 700; }

body[data-page="catalog"] main,
body[data-page="map"] main { padding-top: var(--shell-height); }

footer {
  border-top-color: var(--shell-border) !important;
  background: var(--shell-surface) !important;
  color: var(--shell-muted) !important;
}
footer a { min-height: 44px; color: var(--shell-text) !important; }
.site-footer { padding: clamp(36px, 6vw, 72px) clamp(20px, 4vw, 52px) 28px; }
.site-footer__inner { width: min(100%, var(--shell-max-width)); margin-inline: auto; }
.site-footer__brand { display: grid; gap: var(--brand-space-2); max-width: 58ch; }
.footer-brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-family: var(--brand-font-ui);
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
}
.site-footer__brand p { margin: 0; color: var(--shell-muted); }
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--brand-space-5);
  margin-block: var(--brand-space-6);
  padding-block: var(--brand-space-3);
  border-block: 1px solid var(--shell-border);
}
.site-footer__nav a {
  display: inline-flex;
  align-items: center;
  font-family: var(--brand-font-ui);
  font-size: var(--brand-text-sm);
  text-decoration: none;
}
.site-footer__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--brand-space-3);
  color: var(--shell-muted);
  font-size: var(--brand-text-xs);
}
.section-eyebrow,
.page-eyebrow,
.footer-tagline,
.footer-nav-title,
.footer-col-title,
.footer-copy,
.footer-standard,
.footer-bottom,
.footer-legal { color: var(--shell-muted) !important; }

.species-card { cursor: default !important; }
.species-card--plate {
  border: 1px solid var(--shell-border);
  background: var(--shell-surface) !important;
}
.species-img-wrap {
  align-items: stretch !important;
  background: #eee9df;
}
.species-illustration {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
}
.species-illustration picture {
  display: grid;
  flex: 1;
  min-height: 0;
  place-items: center;
  padding: 14px;
}
.species-illustration img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: #eee9df;
}
.species-illustration figcaption {
  padding: 12px 14px 14px;
  border-top: 1px solid rgb(61 57 51 / .18);
  background: #f7f3ec;
  color: #595348;
  font: 500 .74rem/1.45 Archivo, system-ui, sans-serif;
}
.species-illustration figcaption strong { color: #302c26; }
.species-card--plate .species-info {
  position: relative !important;
  inset: auto !important;
  z-index: 3;
  padding: 24px !important;
  background: #211f1b !important;
  color: #fffaf0;
}
.species-card--plate .species-desc { opacity: 1; transform: none; }
.species-info .species-name { color: #fffaf0 !important; }
.species-info .species-taxonomy { color: #f4b769 !important; }
.species-info .species-common,
.species-info .species-desc { color: rgb(255 250 240 / .86) !important; }
.species-info .species-card-link { color: #fffaf0 !important; }

.authority-card {
  margin-top: 36px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--shell-border);
  border-left: 3px solid var(--shell-accent);
  background: var(--shell-surface);
  color: var(--shell-text);
}
.authority-card h3 { margin: 0 0 6px; font-size: clamp(1.3rem, 2.2vw, 1.75rem); }
.authority-card p { max-width: 70ch; color: var(--shell-muted); }
.authority-card a { display: inline-flex; align-items: center; min-height: 44px; color: var(--shell-indigo); font-weight: 700; }
.authority-card__scope {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--shell-border);
}
.authority-card__scope .section-eyebrow { margin-bottom: 8px; }
.authority-card__scope p:last-child { margin-bottom: 0; }
#proyecto .about-grid { grid-template-columns: minmax(0, 820px) !important; }

.anatomy-plate {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin: clamp(52px, 8vw, 96px) 0 0;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--shell-border);
  background: var(--shell-surface);
}
.anatomy-plate__visual {
  display: block;
  padding: clamp(10px, 2vw, 20px);
  background: #eee9df;
}
.anatomy-plate__visual img { width: 100%; height: auto; }
.anatomy-plate figcaption { color: var(--shell-muted); }
.anatomy-plate h3 {
  margin: 10px 0 16px;
  color: var(--shell-text);
  font: 700 clamp(1.5rem, 3vw, 2.35rem)/1.08 var(--font-display, Archivo), system-ui, sans-serif;
}
.anatomy-plate figcaption p { margin: 0; }
.anatomy-plate__review {
  margin-top: 22px !important;
  padding-top: 18px;
  border-top: 1px solid var(--shell-border);
  font-size: .82rem;
}

.snapshot-meta { grid-template-columns: 1fr !important; gap: 7px !important; }
.snapshot-meta div {
  display: grid;
  grid-template-columns: minmax(8rem, .9fr) 1.4fr;
  gap: 12px;
}
.snapshot-meta dd { overflow-wrap: anywhere; }
.citation-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--shell-border);
}
.citation-text {
  margin: 0 0 12px;
  color: var(--shell-muted);
  font-size: .88rem;
  line-height: 1.55;
}
.copy-citation {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--shell-border);
  border-radius: 5px;
  background: var(--shell-surface);
  color: var(--shell-text);
  font-weight: 700;
  cursor: pointer;
}
.snapshot-context {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--shell-border);
  background: var(--shell-surface);
}
.snapshot-context h2 { margin-top: 0; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--shell-focus) !important;
  outline-offset: 3px !important;
}

@media (max-width: 1080px) {
  .nav-center,
  .site-nav .nav-links { display: none !important; }
  .nav-hamburger,
  #navHamburger,
  .site-nav .nav-actions .nav-hamburger { display: inline-flex !important; }

  body:not([data-public-shell-ready]) .nav-center {
    position: fixed !important;
    inset: var(--shell-height) 0 auto 0 !important;
    z-index: 880;
    display: flex !important;
    justify-content: flex-start;
    overflow-x: auto;
    padding: var(--brand-space-2) var(--brand-space-4);
    border-bottom: 1px solid var(--shell-border);
    background: var(--shell-bg);
  }
  body:not([data-public-shell-ready]) .nav-hamburger { display: none !important; }

  .species-card:nth-child(1) .species-img-wrap,
  .species-card:nth-child(2) .species-img-wrap,
  .species-card:nth-child(3) .species-img-wrap {
    height: auto !important;
    min-height: 0;
    display: block;
  }
  .species-card--plate .species-img-wrap { height: auto !important; }
  .species-illustration { height: auto; }
  .species-illustration picture { padding: 10px; }
  .species-illustration img { height: auto; }
  .species-card--plate .species-info { padding: 18px 16px 22px !important; }
  .anatomy-plate { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  #navbar,
  #main-nav,
  .site-nav { padding-inline: 14px !important; }
  .btn-nav-cta,
  .pilot-link { display: none !important; }
  .species-illustration figcaption { font-size: .7rem; }
  .anatomy-plate { padding: 12px; }
  .site-footer__meta { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
  .nav-link::before,
  .site-nav .nav-links a::before { transition: none; }

  #cursor-dot,
  #cursor-ring { display: none !important; }
}
