/* HYPERFINEX v2.1 — core.css
   Global styles + reusable components.
   Theme variables come from <style><?= themeCSS() ?></style> in <head>.
*/

/* ── Reset + base ─────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--back);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
section { position: relative; z-index: 1; }

/* ── Background particle canvas ───────────────────────────── */
#fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Wrapper ──────────────────────────────────────────────── */
.wrap {
  max-width: var(--box-w);
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 1;
}
.wrap--wide { max-width: 1140px; }

/* ── Site navigation ──────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.site-nav__brand {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--brand);
  text-shadow: 0 0 20px var(--aura);
  text-decoration: none;
}
.site-nav__menu {
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-nav__link {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 10px;
  transition: all 0.25s;
}
.site-nav__link:hover,
.site-nav__link--active {
  color: var(--ink);
  background: var(--skin-2);
}
.site-nav__cta {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 9px 20px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 0 16px var(--aura-sm);
  transition: all 0.25s;
}
.site-nav__cta:hover {
  box-shadow: 0 0 28px var(--aura);
  background: var(--brand-up);
  transform: translateY(-1px);
}
.site-nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
  flex-direction: column;
  gap: 5px;
}
.site-nav__toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.3s;
}
.site-nav__toggle--open .site-nav__toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.site-nav__toggle--open .site-nav__toggle-bar:nth-child(2) {
  opacity: 0;
}
.site-nav__toggle--open .site-nav__toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Section header (reusable) ────────────────────────────── */
.sec-tag {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}
.sec-title {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}
.sec-lead {
  font-size: 17px;
  color: var(--ink-dim);
  line-height: 1.6;
  max-width: 540px;
}

/* ── Buttons (action) ─────────────────────────────────────── */
.action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s;
}
.action--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 24px var(--aura-md);
}
.action--primary:hover {
  box-shadow: 0 0 40px var(--aura);
  transform: translateY(-2px);
}
.action--ghost {
  background: var(--skin-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.action--ghost:hover {
  border-color: var(--line-hi);
  background: var(--skin-3);
}

/* ── Mod tile (reusable — main page + catalog) ────────────── */
.mod-tile {
  background: var(--skin);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}
.mod-tile:hover {
  border-color: var(--line-hi);
  box-shadow: 0 0 40px var(--aura-xs);
  transform: translateY(-6px);
}
.mod-tile__cover {
  position: relative;
  width: 100%;
  height: 190px;
  overflow: hidden;
}
.mod-tile__cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mod-tile__cover::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(to bottom, transparent, var(--back));
  pointer-events: none;
}
.mod-tile__ribbon {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px var(--aura-md);
}
.mod-tile__body {
  padding: 18px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.mod-tile__name {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.3;
}
.mod-tile__desc {
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.5;
  margin-bottom: 14px;
  height: 2.95em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mod-tile__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-dim);
  margin-bottom: 16px;
}
.mod-tile__meta-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.mod-tile__meta-row svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.mod-tile__link {
  width: 100%;
  padding: 12px;
  background: var(--brand);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 0 16px var(--aura-sm);
  text-decoration: none;
  display: block;
  text-align: center;
  margin-top: auto;
}
.mod-tile__link:hover {
  box-shadow: 0 0 28px var(--aura);
  transform: translateY(-1px);
}

/* ── QA accordion (shared — index.php / faq.php) ──────────
   Page-level sections (e.g. .qa, .qa__head, .qa__rule,
   .qa-full, .qa-full__cat) live inline on each page.
*/
.qa__list {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qa__item {
  background: var(--skin);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.qa__item--open { border-color: var(--line-hi); }
.qa__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: color 0.2s;
  user-select: none;
}
@media (hover: hover) {
  .qa__q:hover { color: var(--brand-top); }
}
.qa__q svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: var(--brand);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  transition: transform 0.3s;
}
.qa__item--open .qa__q svg { transform: rotate(45deg); }
.qa__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.qa__item--open .qa__a { max-height: 360px; }
.qa__a-inner {
  padding: 16px 24px 20px;
  font-size: 14px;
  color: var(--ink-dim);
  line-height: 1.7;
  border-top: 1px solid var(--line);
}

/* ── Site footer ──────────────────────────────────────────── */
.site-foot {
  position: relative;
  z-index: 1;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  text-align: center;
}
.site-foot__text {
  font-size: 13px;
  color: var(--ink-low);
  font-weight: 500;
}
.site-foot__links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
}
.site-foot__link {
  font-size: 13px;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.site-foot__link:hover {
  color: var(--brand);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .wrap { padding: 0 20px; }
  .site-nav { padding: 0 20px; }
  .site-nav__toggle { display: flex; }
  .site-nav__menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    flex-direction: column;
    background: var(--nav-bg-open);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    padding: 16px 20px;
    gap: 4px;
  }
  .site-nav__menu--open { display: flex; }
  .site-nav__menu .site-nav__link {
    width: 100%;
    padding: 12px 16px;
  }
  .site-nav__menu .site-nav__cta {
    display: block;
    text-align: center;
    margin-top: 8px;
  }
  .sec-title { font-size: 30px; }
}


/* Local accessible FAQ controls */
.qa__q {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.qa__q:focus-visible {
  outline: 2px solid var(--brand-top);
  outline-offset: -4px;
  border-radius: 14px;
}
.qa__a[hidden] {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .qa__q,
  .qa__q svg,
  .qa__a,
  .qa__item {
    transition: none;
  }
}
@media (forced-colors: active) {
  .qa__q:focus-visible {
    outline-color: Highlight;
  }
}


/* Local accessible library controls */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.search-field__input:focus-visible,
.tag-bar__btn:focus-visible,
.pager__btn:focus-visible {
  outline: 2px solid var(--brand-top);
  outline-offset: 3px;
}
.mods-empty {
  grid-column: 1 / -1;
  margin: 32px 0;
  color: var(--ink-dim);
  text-align: center;
}

.mod-tile[hidden],
.pager[hidden],
.mods-empty[hidden] {
  display: none !important;
}


/* Local deployment controls */
body {
  overflow-x: clip;
}
section[id] {
  scroll-margin-top: 84px;
}
.contact-honeypot {
  position: absolute !important;
  inset-inline-start: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.contact-status {
  min-height: 1.5em;
  margin-top: 12px;
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1.5;
}
.contact-status[data-state="error"] {
  color: #ff8a8a;
}
.action:focus-visible,
.site-nav__link:focus-visible,
.site-nav__brand:focus-visible,
.mod-tile__link:focus-visible,
.reach__card:focus-visible,
.site-foot__link:focus-visible,
.key-strip__copy:focus-visible {
  outline: 2px solid var(--brand-top);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
@media (max-width: 480px) {
  .search-field__input,
  .reach__input,
  .reach__select,
  .reach__textarea {
    font-size: 16px;
  }
}

.qa-full__aura,
.legal__aura,
.reach__aura {
  max-width: 100vw;
  pointer-events: none;
}
