/* =========================================================
   The Ape Society — v14 "Noir, centred"
   v7's black and polish on the OG site's symmetrical layout.
   ========================================================= */

:root {
  --bg: #0a0a09;
  --bg-2: #121110;
  --ink: #efe9df;
  --ink-2: rgba(239, 233, 223, .7);
  --ink-3: rgba(239, 233, 223, .48);
  --gold: #c9a45c;
  --gold-l: #dcc08a;
  --rule: rgba(201, 164, 92, .18);
  --rule-2: rgba(201, 164, 92, .38);

  --serif: "Playfair Display", "Times New Roman", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 64px);
  --maxw: 1240px;
  --col: 760px;
  --sec-pad: clamp(72px, 9vw, 128px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.7 var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
figure { margin: 0; }
h1, h2, h3, p { margin: 0; }
p { text-wrap: pretty; }

::selection { background: var(--gold); color: var(--bg); }

:focus-visible { outline: 1px solid var(--gold-l); outline-offset: 4px; }

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

.skip {
  position: fixed; top: 12px; left: 12px; z-index: 200;
  padding: 10px 16px; background: var(--gold); color: var(--bg);
  font: 500 13px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  transform: translateY(-160%); transition: transform .3s var(--ease);
}
.skip:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.col { max-width: var(--col); margin-inline: auto; text-align: center; }
.center { display: flex; justify-content: center; }

/* ---------- type ---------- */
.h2 {
  font: 400 clamp(36px, 4.6vw, 62px)/1.08 var(--serif);
  letter-spacing: -.01em;
  text-align: center;
  text-wrap: balance;
  margin-bottom: clamp(28px, 3.4vw, 44px);
}
.h3 { font: 400 clamp(24px, 2.1vw, 30px)/1.15 var(--serif); }

.lead {
  font: 400 clamp(20px, 1.9vw, 25px)/1.5 var(--serif);
  color: var(--ink);
}
.lead-sm {
  font: 400 clamp(19px, 1.6vw, 22px)/1.55 var(--serif);
  color: var(--ink);
}
.muted { color: var(--ink-2); margin-top: 20px; }

/* ---------- buttons ---------- */
.btn {
  --h: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 28px;
  font: 500 12px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase;
  border: 1px solid transparent; border-radius: 0;
  cursor: pointer; white-space: nowrap;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn-sm { --h: 38px; padding: 0 18px; font-size: 11px; }
.btn-lg { --h: 58px; padding: 0 52px; font-size: 13px; }
.btn-solid { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.btn-solid:hover { background: var(--gold-l); border-color: var(--gold-l); }
.btn-line { border-color: var(--rule-2); color: var(--ink); background: transparent; }
.btn-line:hover { border-color: var(--gold); color: var(--gold-l); }
.btn[disabled] {
  cursor: not-allowed; color: rgba(239, 233, 223, .56); border-color: var(--rule-2); background: transparent;
  border-style: dashed;
}

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  border-bottom: 1px solid transparent;
  background: linear-gradient(180deg, rgba(10, 10, 9, .72), rgba(10, 10, 9, 0)) border-box;
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(10, 10, 9, .9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--rule);
}
.header-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  height: 80px; max-width: 1440px;
  transition: height .4s var(--ease);
}
.is-scrolled .header-inner { height: 66px; }
.brand { justify-self: start; }

.nav ul { display: flex; gap: clamp(18px, 2.4vw, 38px); }
.nav a {
  font: 500 11.5px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink); opacity: .85;
  padding: 10px 0; position: relative;
  transition: opacity .3s, color .3s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: var(--gold); transform: scaleX(0);
  transition: transform .4s var(--ease);
}
.nav a:hover { opacity: 1; color: var(--gold-l); }
.nav a:hover::after { transform: scaleX(1); }

.header-end { justify-self: end; display: flex; align-items: center; gap: 4px; }
.icon-link {
  width: 40px; height: 40px; display: grid; place-items: center;
  color: var(--ink); opacity: .85; transition: opacity .3s, color .3s;
}
.icon-link svg { width: 17px; height: 17px; fill: currentColor; }
.icon-link:hover { opacity: 1; color: var(--gold-l); }
.purchase { margin-left: 10px; }

.menu-btn {
  display: none; align-items: center; gap: 12px;
  background: none; border: 0; padding: 10px 0 10px 12px; cursor: pointer;
  font: 500 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase;
}
.menu-btn-lines { display: grid; gap: 6px; width: 24px; }
.menu-btn-lines i { display: block; height: 1px; background: currentColor; transition: transform .35s var(--ease); }
.menu-btn[aria-expanded="true"] .menu-btn-lines i:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn-lines i:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(10, 10, 9, .98);
  padding: 104px var(--gutter) 120px;
  overflow-y: auto; text-align: center;
  opacity: 0; transition: opacity .35s var(--ease);
}
.mobile-menu.is-open { opacity: 1; }
.mobile-menu ul { max-width: 420px; margin-inline: auto; }
.mobile-menu li + li { border-top: 1px solid var(--rule); }
.mobile-menu ul a {
  display: block; padding: 15px 0;
  font: 400 clamp(26px, 7.4vw, 34px)/1.15 var(--serif);
}
.mobile-menu ul a:hover { color: var(--gold-l); }
.mobile-menu-foot { display: flex; justify-content: center; gap: 28px; margin-top: 32px; }
.mobile-menu-foot a { font: 500 12px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }

/* ---------- hero ---------- */
.hero { position: relative; }
.hero-media {
  position: relative; overflow: hidden; background: #000;
  height: clamp(420px, calc(100vh - 150px), 64vw);
  height: clamp(420px, calc(100svh - 150px), 64vw);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 48%; }
.hero-media::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 46%;
  background: linear-gradient(180deg, rgba(10, 10, 9, 0) 0%, rgba(10, 10, 9, .12) 35%, rgba(10, 10, 9, .38) 65%, rgba(10, 10, 9, .72) 88%, var(--bg) 100%);
  pointer-events: none;
}
.hero-text {
  position: relative; z-index: 1; text-align: center;
  margin-top: clamp(-150px, -9vw, -60px);
  padding-top: clamp(14px, 2vw, 26px);
  padding-bottom: clamp(64px, 8vw, 104px);
}
.hero-title {
  font: 400 clamp(38px, 5.6vw, 82px)/1.05 var(--serif);
  letter-spacing: -.015em;
  text-wrap: balance;
  text-shadow: 0 1px 3px rgba(10, 10, 9, .6), 0 2px 34px rgba(10, 10, 9, .85);
}
.hero-title .nw { white-space: nowrap; }
.hero-actions {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 14px;
  margin-top: clamp(24px, 2.6vw, 34px);
}

/* gentle load fade (only when JS runs) */
.js .hero-media img { opacity: 0; transition: opacity 1.4s var(--ease); }
.js .hero-text { opacity: 0; transition: opacity 1.2s var(--ease) .25s; }
.is-loaded .hero-media img, .is-loaded .hero-text { opacity: 1; }

/* ---------- reveals ---------- */
.js .rv { opacity: 0; transform: translate3d(0, 16px, 0); }
.js .rv.in { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }

/* ---------- sections + divider ---------- */
.section { padding-block: var(--sec-pad); }

.divider {
  width: min(560px, calc(100% - 2 * var(--gutter)));
  aspect-ratio: 1099 / 37;
  margin-inline: auto;
  background: var(--gold);
  opacity: .7;
  -webkit-mask: url("shared/tailor/faqdivider.png") center / contain no-repeat;
  mask: url("shared/tailor/faqdivider.png") center / contain no-repeat;
}

/* about */
.policy {
  margin: 36px auto 0; padding-top: 24px; border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.policy-label { font: 500 11px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.policy-id {
  font: 400 13.5px/1.5 var(--sans); letter-spacing: .04em;
  color: var(--ink-2); word-break: break-all; max-width: 100%;
}
.policy-copy {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  background: none; border: 1px solid var(--rule-2); height: 36px; padding: 0 14px; cursor: pointer;
  font: 500 11px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink);
  transition: border-color .3s, color .3s;
}
.policy-copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.policy-copy:hover { border-color: var(--gold); color: var(--gold-l); }
.policy-copy.is-done { border-color: var(--gold); color: var(--gold); }

.pillars {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
  max-width: 1080px; margin: clamp(64px, 7vw, 96px) auto 0;
  text-align: center;
}
.pillar-fig { overflow: hidden; aspect-ratio: 1; background: #2a2926; }
.pillar-fig img { width: 100%; height: 100%; object-fit: cover; }
.pillar .h3 { margin-top: 24px; }
.pillar p { margin: 12px auto 0; color: var(--ink-2); max-width: 34ch; }

/* art */
.ape-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 2.4vw, 36px) clamp(14px, 2vw, 28px);
  margin-top: clamp(56px, 6vw, 84px);
  text-align: center;
}
.ape-img { overflow: hidden; aspect-ratio: 1; background: var(--bg-2); }
.ape-img img { width: 100%; height: 100%; object-fit: cover; transition: opacity .4s var(--ease); }
.ape:hover .ape-img img { opacity: .86; }
.ape figcaption { padding-top: 14px; }
.ape-name { display: block; font: 400 clamp(17px, 1.4vw, 20px)/1.25 var(--serif); }
.ape-meta { display: block; margin-top: 5px; font: 400 11px/1.5 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }

/* lore */
.lore-text { max-width: 700px; }
.lore-text p { font-size: 17px; line-height: 1.85; color: var(--ink-2); }
.lore-text p + p { margin-top: 24px; }
.lore .center { margin-top: clamp(40px, 4.4vw, 56px); }

/* classes */
.class-tabs {
  display: flex; justify-content: center; flex-wrap: wrap;
  max-width: 1080px; margin-inline: auto;
  border-bottom: 1px solid var(--rule);
}
.class-tab {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: none; border: 0; padding: 8px 6px 20px; cursor: pointer;
  position: relative; color: rgba(239, 233, 223, .58);
  transition: color .3s var(--ease);
}
.class-tab::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 1px;
  background: var(--gold); transform: scaleX(0);
  transition: transform .4s var(--ease);
}
.ct-icon { height: 52px; display: grid; place-items: center; }
.ct-icon img { max-height: 52px; max-width: 64px; width: auto; height: auto; opacity: .42; transition: opacity .3s var(--ease); }
.ct-name {
  font: 500 11.5px/1.35 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  text-align: center;
}
.class-tab:hover { color: var(--ink-2); }
.class-tab:hover .ct-icon img { opacity: .75; }
.class-tab[aria-selected="true"] { color: var(--ink); }
.class-tab[aria-selected="true"] .ct-icon img { opacity: 1; }
.class-tab[aria-selected="true"]::after { transform: scaleX(1); }
.class-tab:focus-visible { outline-offset: -2px; }

.class-stage { max-width: 980px; margin: clamp(44px, 5vw, 64px) auto 0; }
.class-panel {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 4vw, 56px); align-items: start;
}
.class-panel[hidden] { display: none; }
.class-panel:focus-visible { outline-offset: 10px; }
.cp-fig img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--bg-2); }
.cp-fig figcaption { margin-top: 12px; text-align: center; font: 400 12px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.cp-title { font: 400 clamp(30px, 3vw, 40px)/1.1 var(--serif); }
.cp-meta { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 20px 0 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cp-meta div { padding: 14px 0; }
.cp-meta div + div { border-left: 1px solid var(--rule); padding-left: 20px; }
.cp-meta dt { font: 500 10.5px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.cp-meta dd { margin: 10px 0 0; font: 400 28px/1 var(--serif); color: var(--gold); font-variant-numeric: lining-nums; }
.cp-body p { margin-top: 16px; font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.cp-body .cp-lead { font: 400 17px/1.6 var(--serif); color: var(--ink); margin-top: 22px; }

.class-panel.is-entering { animation: fadeIn .45s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* team */
.team-list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
  max-width: 960px; margin-inline: auto; text-align: center;
}
.member figure { overflow: hidden; aspect-ratio: 1; background: var(--bg-2); }
.member img { width: 100%; height: 100%; object-fit: cover; }
.member-name { margin-top: 20px; font: 400 clamp(24px, 2.2vw, 30px)/1.1 var(--serif); }
.member-link {
  display: inline-block; margin-top: 10px; padding: 6px 0;
  font: 500 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
  border-bottom: 1px solid var(--rule-2);
  transition: color .3s, border-color .3s;
}
.member-link:hover { color: var(--gold-l); border-color: var(--gold); }

/* join */
.join { padding-bottom: clamp(88px, 10vw, 140px); }
.join .h2 { margin-bottom: 0; }
.join-key { width: clamp(120px, 12vw, 170px); margin: clamp(28px, 3vw, 40px) auto; opacity: .9; }

/* footer */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: clamp(56px, 6vw, 84px) 0 112px;
  text-align: center;
}
.footer-brand { display: inline-block; }
.footer-brand img { width: 132px; }
.footer-cols {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 24px clamp(40px, 7vw, 96px);
  margin-top: 44px;
}
.footer-h { font: 500 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.footer-col a { color: var(--ink-2); font-size: 15px; transition: color .3s; }
.footer-col a:hover { color: var(--ink); }
.social-row { display: flex; justify-content: center; margin-top: -10px; }
.footer-base {
  display: flex; justify-content: center; gap: 28px; flex-wrap: wrap;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule);
  font: 400 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}
.footer-base a { color: var(--ink-2); }
.footer-base a:hover { color: var(--gold-l); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
  .nav ul { gap: 18px; }
  .nav a { letter-spacing: .15em; }
}

@media (max-width: 1080px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .nav, .header-end .icon-link { display: none; }
  .menu-btn { display: inline-flex; }
}

@media (max-width: 860px) {
  .pillars { grid-template-columns: 1fr; max-width: 460px; row-gap: 56px; }
  .ape-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; margin-inline: auto; }

  .class-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 0; row-gap: 4px; }
  .class-tab { border-bottom: 1px solid var(--rule); }
  .class-panel { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
  .cp-fig { max-width: 400px; width: 100%; margin-inline: auto; }
  .cp-title { text-align: center; }
}

@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .header-inner { height: 64px; }
  .is-scrolled .header-inner { height: 60px; }
  .purchase { display: none; }

  .hero-media { height: clamp(320px, 60svh, 560px); }
  .hero-text { margin-top: -72px; }
  .hero-media img { object-position: 46% 50%; }
  .hero-actions .btn { flex: 1 1 100%; max-width: 320px; }

  .ape-grid { column-gap: 12px; }
  .ape-meta { font-size: 10px; letter-spacing: .1em; }

  .class-tab { padding: 6px 2px 14px; gap: 8px; }
  .ct-icon { height: 40px; }
  .ct-icon img { max-height: 40px; max-width: 48px; }
  .ct-name { font-size: 10px; letter-spacing: .08em; }
  .cp-meta dd { font-size: 24px; }
  .cp-meta div + div { padding-left: 14px; }

  .lore-text { max-width: 700px; }
.lore-text p { font-size: 16px; }
  .footer-cols { flex-direction: column; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
}

/* Horizontal gold lockup in the nav */
.logo-h{display:block;height:clamp(15px,1.3vw,19px)!important;width:auto!important;max-width:none!important;min-width:0!important;margin:0!important;filter:none}
@media (max-width:420px){.logo-h{height:13px!important}}

/* Long lore paragraphs read better left-aligned on phones */
@media (max-width: 640px) { .lore-text p { text-align: left; } }
