/* Shared storefront components reuse the authorized reference's theme primitives. */
@font-face {
  font-family: Urbanist;
  src: url("/assets/urbanist-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}

@font-face {
  font-family: Caveat;
  src: url("/assets/caveat-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --market-green: #227333;
  --market-green-light: #edf5e9;
  --market-focus: #276132;
  --market-radius: 16px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --market-page: #202020;
  --light: #282828;
  --dark: #f1f1f1;
  --gray-text: #bababa;
  --bg: #242424;
  --whitesmoke: #303030;
  --stroke: #3d3d3d;
  --border-color: #595959;
  --market-green: #b0c6ad;
  --market-green-light: #303a30;
  --market-focus: #afc5ac;
  --market-control-border: #717171;
  --market-hover: #363636;
  --market-hover-border: #777;
  --market-selected-border: #82977f;
  --market-landscape-shade: linear-gradient(155deg, #18181873, #181818b3);
  background: var(--market-page);
}

:where(button, input, select, textarea) { font-size: 1rem; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--market-focus); outline-offset: 4px; }
[hidden] { display: none !important; }
body {
  position: relative;
  isolation: isolate;
  background: var(--market-page, var(--light));
}
body::before {
  --brick-width: max(85vw, 210svh);
  --brick-height: calc(var(--brick-width) * 595 / 1399);
  --brick-edge: max(0px, calc((100% - var(--brick-width)) / 2));
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: url("/assets/hero-brick-pattern.png") center top / var(--brick-width) var(--brick-height) repeat-y;
  mask-image: linear-gradient(to right, transparent var(--brick-edge), #000 calc(var(--brick-edge) + 5%),
    #000 calc(95% - var(--brick-edge)), transparent calc(100% - var(--brick-edge))),
    repeating-linear-gradient(to bottom, transparent, #000 calc(var(--brick-height) * .08),
      #000 calc(var(--brick-height) * .91), transparent calc(var(--brick-height) * .98),
      transparent var(--brick-height));
  mask-composite: intersect;
  mix-blend-mode: multiply;
  opacity: .8;
}
.market-rain {
  position: fixed;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#main { min-height: 55vh; }
#main:focus { outline: none; }
.market-skip { position: fixed; top: 10px; left: 14px; z-index: 50; transform: translateY(-160%); padding: 12px; background: var(--dark); color: var(--light); }
.market-skip:focus { transform: none; }

.market-header { position: relative; z-index: 5; }
.market-nav { display: grid; grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr); align-items: center; gap: 16px; min-height: 64px; }
.market-nav > .market-brand { justify-self: start; }
.market-brand { display: inline-flex; align-items: center; flex: none; gap: 7px; color: var(--dark); text-decoration: none; font-size: 23px; font-weight: 800; letter-spacing: -.065em; }
.market-brand-mark {
  display: block;
  flex: none;
  width: 38px;
  aspect-ratio: 1;
  background: currentColor;
  mask:
    url("/assets/apostate-julian-bust.png") center / contain no-repeat,
    linear-gradient(#000 81%, transparent 97%);
  mask-mode: luminance, alpha;
  mask-composite: intersect;
}
.market-nav-links, .market-actions { display: flex; align-items: center; gap: 16px; }
.market-nav-links { justify-content: center; flex-wrap: wrap; }
.market-nav-links .nav-link, .market-actions > a { white-space: nowrap; }
.market-nav-links .nav-link[aria-current="page"] { text-decoration: underline; text-decoration-color: #8b978a; text-underline-offset: 5px; }
.market-actions { justify-content: flex-end; gap: 14px; }
.market-actions .market-signin { align-items: center; min-height: 42px; padding: 8px 15px; }
.market-actions > .market-primary { min-height: 44px; }
.market-actions > .market-primary .button-primary-inner { padding: 8px 15px; }
.market-cart { position: relative; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--dark); min-height: 42px; }
.market-cart span { display: grid; place-items: center; min-width: 17px; height: 17px; padding-inline: 3px; border-radius: 12px; background: var(--whitesmoke); font-size: 11px; font-weight: 700; }
.market-theme-toggle {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px;
  padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: var(--dark); cursor: pointer; transition: background-color .18s ease, border-color .18s ease;
}
.market-theme-toggle:hover { border-color: var(--stroke); background: var(--whitesmoke); }
.market-theme-toggle[aria-pressed="true"] { border-color: var(--stroke); background: var(--whitesmoke); }
.market-theme-toggle[aria-pressed="true"]:hover { border-color: var(--border-color); }
.market-menu-toggle { display: none; place-items: center; width: 42px; height: 42px; border: 0; background: transparent; color: var(--dark); cursor: pointer; }
.market-mobile-nav { display: none; }

.market-hero { position: relative; isolation: isolate; overflow: hidden; container-type: inline-size; }
.market-hero-content { position: relative; z-index: 1; text-align: center; padding-top: clamp(42px,6vw,88px); }
.market-hero h1 {
  max-width: 13.5em;
  margin: 0 auto;
  font-size: clamp(35px, 5.25vw, 76px);
  line-height: .99;
  font-weight: 800;
  letter-spacing: -.055em;
}
.market-hero-intro { display: block; text-wrap: balance; }
.market-hero-type { display: grid; justify-items: center; }
.market-hero-type > span { grid-area: 1 / 1; }
.market-hero-type-sizing { visibility: hidden; padding-inline: .06em; }
.market-hero-type-phrase { position: relative; }
.market-hero-type-phrase[data-typing]::after {
  content: "";
  position: absolute;
  top: .1em;
  bottom: 0;
  left: calc(100% + .055em);
  width: 2px;
  background: currentColor;
  opacity: .6;
}
.market-hero p { max-width: 34rem; margin: 24px auto 30px; font-size: clamp(16px, 1.45vw, 20px); line-height: 1.4; }
.market-button-row { display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; gap: 12px; }
.market-button-row > .button-secondary { background: #ffffffdb; border-color: var(--stroke); }
.market-hero-mask { position: absolute; pointer-events: none; }
.market-hero-art {
  position: relative;
  margin-top: clamp(44px, 5vw, 78px);
  overflow: hidden;
  aspect-ratio: 128 / 45;
}
.market-hero-art:not([data-landscape]) { clip-path: url(#market-hero-wave); }
.market-hero-art > :is(img, video) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-x, 50%) var(--hero-y, 50%);
  transform: scale(var(--hero-zoom, 1));
  transform-origin: var(--hero-x, 50%) var(--hero-y, 50%);
  pointer-events: none;
}
.market-hero-art video { opacity: 0; }
.market-hero-art.has-playing-frame video { opacity: 1; }

.market-hero:has(.market-hero-art[data-landscape]) {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}
.market-hero-art[data-landscape] {
  flex: 1;
  min-height: clamp(160px, 25vw, 300px);
  margin-top: clamp(-150px, -7.7vw, -32px);
  aspect-ratio: auto;
}
.market-hero-landscape {
  position: absolute;
  inset: 0;
  transform: scale(var(--hero-zoom, 1));
  transform-origin: var(--hero-x, 50%) var(--hero-y, 50%);
  pointer-events: none;
}
.market-hero-hills {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-x, 50%) var(--hero-y, 50%);
}
.market-hero-statue {
  position: absolute;
  bottom: max(9%, clamp(24px, 4.3vw, 84px));
  width: clamp(136px, 14vw, 252px);
}
.market-hero-statue img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(.89) saturate(.76);
  mask-image: linear-gradient(#000 94%, transparent);
}
.market-hero-statue::before {
  content: "";
  position: absolute;
  bottom: -1%;
  left: var(--shadow-left);
  width: var(--shadow-width);
  height: 8%;
  background: radial-gradient(ellipse, #202115ad, transparent 69%);
}
.market-hero-statue-left {
  left: 19%;
  --shadow-left: -7%;
  --shadow-width: 76%;
}
.market-hero-statue-right {
  right: 16%;
  --shadow-left: 1%;
  --shadow-width: 96%;
}

@media (max-width: 768px) {
  .market-hero:has(.market-hero-art[data-landscape]) { min-height: 80svh; }
  .market-hero-art[data-landscape] { margin-top: clamp(-115px, -22vw, -55px); }
  .market-hero-hills { top: -16%; height: 116%; }
  .market-hero-statue { width: clamp(78px, 25vw, 174px); }
  .market-hero-statue-left { left: 13%; }
  .market-hero-statue-right { right: 11%; }
}

.market-hero-motion {
  position: absolute;
  right: clamp(12px, 3vw, 48px);
  bottom: clamp(12px, 3vw, 32px);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ffffff59;
  border-radius: 50%;
  background: #202020c9;
  color: #fff;
  cursor: pointer;
}
.market-hero-motion:hover { background: #202020; }
.market-hero-motion:focus-visible { outline-color: #fff; }
.market-hero-motion:not([data-playing="true"]) .market-motion-pause,
.market-hero-motion[data-playing="true"] .market-motion-play { display: none; }

.market-section { padding-block: clamp(62px,7vw,105px); }
.market-home-products { padding-bottom: clamp(52px, 7vw, 96px); }
.market-section-heading { margin-bottom: 32px; }
.market-section-heading h2 { margin: 0; }
.market-products-subtitle {
  margin: 4px 0 0;
  color: var(--gray-text);
  font: 400 clamp(21px, 1.7vw, 24px)/1.2 Caveat, "Segoe Print", cursive;
}
.market-community { padding-bottom: clamp(40px, 5.6vw, 76px); }
.market-community-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: clamp(320px, 33vw, 418px);
  padding: clamp(28px, 5vw, 70px);
  border: 1px solid var(--stroke);
  border-radius: var(--market-radius);
  background: #202419;
  color: #fff;
}
.market-community-image, .market-community-panel::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.market-community-image { z-index: -2; object-fit: cover; object-position: 66% center; }
.market-community-panel::after {
  content: "";
  z-index: -1;
  background: linear-gradient(95deg, #11150fed, #171b10bd 33%, #14180d32 66%, transparent);
  pointer-events: none;
}
.market-community-copy h2 {
  margin: 0 0 clamp(18px, 2vw, 26px);
  font-family: var(--heading-font);
  font-size: clamp(36px, 4.6vw, 60px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
}
.market-community-copy .button-primary { min-height: 50px; }
.market-community-copy .button-primary:not(:active) {
  box-shadow: inset 0 1px #ffffff4d, inset 0 -3px #080808, 0 2px 3px #0005;
}
.market-community-copy .button-primary:hover:not(:active) {
  box-shadow: inset 0 1px #ffffff4d, inset 0 -3px #080808, 0 5px 15px #0008;
}
.market-community-copy .button-primary:focus-visible { outline-color: #fff; }
@media (max-width: 600px) {
  .market-community-panel { align-items: start; padding: 30px 24px; }
  .market-community-panel::after {
    background: linear-gradient(160deg, #11150ff0, #171b10a6 31%, #14180d20 72%, transparent);
  }
}

.market-footer { border-top: 1px solid var(--stroke); background: var(--bg); color: var(--dark); }
.market-footer-links { display: grid; grid-template-columns: 1.8fr repeat(3,1fr); gap: 28px; padding-block: 48px; }
.market-footer-links p { max-width: 290px; color: var(--gray-text); }
.market-footer-links nav { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.market-footer-links nav a { color: var(--gray-text); text-decoration: none; }
.market-footer-links nav a:hover { color: var(--dark); text-decoration: underline; text-underline-offset: 4px; }
.market-footer-end { display: flex; justify-content: space-between; gap: 12px; padding-block: 18px; border-top: 1px solid var(--stroke); color: var(--gray-text); font-size: 14px; }

.market-footer-wordmark {
  position: relative;
  container-type: inline-size;
  width: min(1104px, calc(100% - 48px));
  aspect-ratio: 1104 / 181;
  margin: 22px auto 0;
  overflow: clip;
  mask-image: linear-gradient(#000 45%, transparent);
  user-select: none;
}
.market-footer-wordmark > div {
  position: absolute;
  inset: 0;
}
.market-footer-wordmark-base {
  color: color-mix(in srgb, var(--dark) 24%, transparent);
  --wordmark-stroke: color-mix(in srgb, var(--dark) 17%, transparent);
}
.market-footer-wordmark-letters {
  position: absolute;
  inset: 0;
  background: var(--wordmark-stroke);
  mask: url("/assets/apostate-footer-lettering.svg") center / 100% 100% no-repeat;
}
.market-footer-wordmark-head {
  position: absolute;
  inset: 1% auto auto 30.69%;
  width: 15.17%;
  height: 79.37%;
  background: currentColor;
  mask:
    url("/assets/apostate-julian-original.png") center top / 133% 179% no-repeat,
    linear-gradient(#000 74%, transparent 93%);
  mask-mode: luminance, alpha;
  mask-composite: intersect;
}
.market-footer-wordmark-light {
  color: var(--dark);
  --wordmark-stroke: var(--dark);
  opacity: 0;
  pointer-events: none;
}
@media (any-hover: hover) and (prefers-reduced-motion: no-preference) {
  .market-footer-wordmark-light {
    mask-image: radial-gradient(circle clamp(65px, 10cqi, 110px) at var(--beam-x, 50%) var(--beam-y, 50%), #000 12%, #000b 47%, transparent 100%);
    transition: opacity .2s ease;
  }
  .market-footer-wordmark.is-lit .market-footer-wordmark-light { opacity: 1; }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
  animation-timing-function: ease-in-out;
}

:where([data-theme="dark"] a) { color: inherit; }
.button-primary {
  color: #fff;
  transition: box-shadow .2s ease;
}
.button-primary-text { color: inherit; }
:is(.market-actions, .market-hero .market-button-row) > .market-primary:not(:active) {
  box-shadow: inset 0 1px #ffffff4d, inset 0 -3px #080808, 0 2px 3px #00000026;
}
.button-primary:active:not(:disabled) {
  box-shadow: inset 0 1px #ffffff4d, inset 0 -1px #080808, 0 1px 3px #0004;
}
[data-theme="dark"] .button-secondary {
  border-color: var(--market-control-border);
  background: var(--light);
  color: var(--dark);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
[data-theme="dark"] .market-nav-links .nav-link[aria-current="page"] {
  color: var(--market-green);
  text-decoration-color: currentColor;
}
[data-theme="dark"] body::before {
  filter: grayscale(1) invert(1);
  mix-blend-mode: screen;
  opacity: .34;
}
[data-theme="dark"] .market-menu-toggle { border-radius: 8px; }
[data-theme="dark"] .market-mobile-nav a[aria-current="page"] {
  border-color: var(--market-selected-border);
  background: var(--market-green-light);
  color: var(--market-green);
}
[data-theme="dark"] :is(.nav-link, .market-cart, .market-footer-links nav a):hover {
  color: var(--market-green);
}

@media (hover: hover) {
  [data-theme="dark"] .button-secondary.is-light:hover {
    border-color: var(--market-hover-border);
    background: var(--market-hover);
    box-shadow: none;
  }
  [data-theme="dark"] :is(.market-menu-toggle, .market-theme-toggle):hover {
    background: var(--market-hover);
  }
}

@media (max-width: 1120px) {
  .market-nav { grid-template-columns: 1fr max-content; }
  .market-nav-links { display: none; }
  .market-menu-toggle { display: grid; }
  .market-mobile-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding-block: 2px 16px; }
  .market-mobile-nav a { padding: 12px; border: 1px solid var(--stroke); border-radius: 8px; }
  .market-mobile-nav a[aria-current="page"] { background: var(--whitesmoke); }
}
@media (max-width: 700px) {
  .market-actions { gap: 12px; }
  .market-actions > .market-primary, .market-signin { display: none; }
  .market-hero-content { padding-top: 45px; }
  .market-hero h1 { font-size: clamp(28px, 6.9vw, 47px); }
  .market-hero p { margin: 18px auto 22px; }
  .market-footer-links { grid-template-columns: 1fr 1fr; gap: 22px 14px; padding-block: 32px; }
  .market-footer-links > div { grid-column: 1 / -1; }
  .market-footer-end { flex-wrap: wrap; }
}
@media (max-width: 370px) {
  .market-nav { gap: 10px; }
  .market-actions { gap: 8px; }
  .market-button-row > a { width: 100%; }
  .market-button-row > .button-primary { border-radius: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .market-theme-toggle, .button-primary,
  :root[data-theme="dark"] .button-secondary { transition: none; }
}
