/* Forgiven — shared tokens, primitives and site chrome for every page */

/* Headings: Chomsky by Fredrick Brennan, SIL Open Font License 1.1 (assets/fonts/Chomsky-OFL.txt) */
@font-face {
  font-family: "Chomsky";
  src: url("../fonts/Chomsky.woff2") format("woff2"), url("../fonts/Chomsky.woff") format("woff");
  font-display: swap;
}

:root {
  --black: #0a0a0a;
  /* Palette: primary black, secondary grey, tertiary white */
  --grey: #8a8a8a;
  --white: #f5f5f5;

  --font-gothic: "Chomsky", "Old English Text MT", serif;
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;

  --gutter: clamp(16px, 4vw, 64px);
  --track: 0.28em;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  overflow-x: clip;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }

/* Type */
.gothic { font-family: var(--font-gothic); font-weight: 400; letter-spacing: 0; line-height: 1; }
.label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--track);
  text-transform: uppercase;
}
/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 15px 28px;
  border: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  transition: background .25s, color .25s;
}
/* Icons */
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* Shirt print details (pre-cropped from the product photo) */
.crop {
  background: var(--black) center / cover no-repeat;
}
.crop--face   { background-image: url("../img/detail-face.webp"); }
.crop--wing   { background-image: url("../img/detail-wing.webp"); }
.crop--wing-right { background-image: url("../img/detail-wing-right.webp"); }

/* Closing verse — shared sign-off at the top of every footer */
.closing-verse { max-width: 760px; margin: 0 auto; padding: 72px var(--gutter) 60px; text-align: center; }
.closing-verse__rule { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 28px; }
.closing-verse__rule span { width: 72px; height: 1px; background: currentColor; opacity: .35; }
.closing-verse__rule svg { width: 12px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.2; opacity: .7; }
.closing-verse__text {
  margin: 0 0 16px;
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-size: clamp(22px, 2.6vw, 32px); line-height: 1.35;
}
.closing-verse__ref { margin: 0; opacity: .5; }

/* Site chrome — white pages with an optional black section, fixed top bar, footer */
:root { --bg: var(--white); --fg: var(--black); --line: rgba(10,10,10,.42); }
body {
  background: var(--bg); color: var(--fg);
  /* hairline that fades out at both ends */
  --divider: linear-gradient(90deg, transparent, var(--line) 22%, var(--line) 78%, transparent);
}
/* A black section: flips text, lines and logos to white */
.theme-dark { --bg: var(--black); --fg: var(--white); --line: rgba(245,245,245,.38); background: var(--bg); color: var(--fg); }
.theme-dark .inverts { filter: invert(1); }

/* Fixed chrome is white with difference blending, so it reads white over black and black over white */
.chrome-top {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 26px var(--gutter);
  color: #fff; mix-blend-mode: difference;
}
.mark img { width: 34px; filter: invert(1); }
.chrome-top nav { display: flex; gap: 30px; font-size: 10px; }
.chrome-top nav a { position: relative; padding-bottom: 4px; opacity: .75; transition: opacity .25s; }
.chrome-top nav a:hover, .chrome-top nav a[aria-current] { opacity: 1; }
/* Underline draws in on hover (left to right) and retracts on leave; stays on the current page */
.chrome-top nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.chrome-top nav a:hover::after, .chrome-top nav a[aria-current]::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 560px) { .chrome-top nav { gap: 14px; letter-spacing: .16em; } }
.btn--ghost { background: var(--fg); border-color: var(--fg); color: var(--bg); padding: 13px 34px; font-size: 10px; }
.btn--ghost:hover { background: transparent; color: var(--fg); }

.end { text-align: center; padding: 0 var(--gutter) 40px; }
.end .closing-verse { position: relative; margin-bottom: 48px; }
.end .closing-verse::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--divider); }
.end img { width: 150px; margin: 0 auto 14px; opacity: .9; }
.end small { opacity: .4; }
/* Designer credit under the copyright line */
.credit { display: block; width: fit-content; margin: 10px auto 0; font-size: 9px; opacity: .3; transition: opacity .25s; }
.credit:hover { opacity: .8; }

/* Cart drawer (assets/js/cart.js) */
/* Closed: invisible and click-through; .is-open slides the panel in and fades the overlay */
.cart { position: fixed; inset: 0; z-index: 50; visibility: hidden; pointer-events: none; transition: visibility 0s .45s; }
.cart.is-open { visibility: visible; pointer-events: auto; transition: none; }
.cart__overlay { position: absolute; inset: 0; background: rgba(10,10,10,.45); opacity: 0; transition: opacity .45s ease; }
.cart.is-open .cart__overlay { opacity: 1; }
.cart__panel {
  transform: translateX(100%); transition: transform .45s cubic-bezier(.2,.7,.2,1);
  box-shadow: -20px 0 60px rgba(0,0,0,.18);
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  display: flex; flex-direction: column;
  background: var(--white); color: var(--black);
}
.cart.is-open .cart__panel { transform: none; }
.cart__head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid #e2e2e2; }
.cart__head h2 { font-size: 34px; margin: 0; }
.cart__close { background: none; border: 0; font-size: 18px; cursor: pointer; padding: 6px; }
.cart__lines { flex: 1; overflow-y: auto; padding: 8px 24px; }
.cart__empty { opacity: .55; margin: 40px 0; text-align: center; }
.cart__line { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid #e2e2e2; }
.cart__line img { width: 76px; aspect-ratio: 4 / 5; object-fit: contain; background: #fff; }
.cart__name { font-size: 13px; font-weight: 700; text-transform: uppercase; }
.cart__variant { margin: 2px 0 10px; font-size: 12px; opacity: .6; }
.cart__qty { display: inline-flex; align-items: center; border: 1px solid #cfcfcf; }
.cart__qty button { width: 30px; height: 30px; background: none; border: 0; cursor: pointer; font-size: 15px; }
.cart__qty span { min-width: 24px; text-align: center; font-size: 13px; }
.cart__right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; font-size: 14px; }
.cart__remove { background: none; border: 0; padding: 0; cursor: pointer; font-size: 11px; text-decoration: underline; opacity: .6; }
.cart__foot { padding: 20px 24px 24px; border-top: 1px solid #e2e2e2; }
.cart__foot[hidden] { display: none; }
.cart__subtotal { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; }
.cart__note { margin: 6px 0 18px; font-size: 12px; opacity: .55; }
.cart__checkout { width: 100%; justify-content: center; --fg: var(--black); --bg: var(--white); }

/* Loading screen + landing (assets/js/transitions.js).
   An inline script adds .js to <html>; transitions.js adds .is-loaded once the page is ready
   (an inline 4s fallback guarantees it) and .is-leaving just before navigating to another page. */
.loader { display: none; }
.js .loader {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: var(--black); transition: opacity .55s ease, visibility 0s .55s;
}
.loader__inner { display: grid; justify-items: center; gap: 22px; }
.loader__logo { width: min(240px, 56vw); filter: invert(1); animation: loader-in .9s cubic-bezier(.2,.7,.2,1) both; }
.loader__bar { width: 120px; height: 1px; background: rgba(245,245,245,.22); overflow: hidden; }
.loader__bar::after { content: ""; display: block; height: 100%; background: var(--white); animation: loader-bar 1.1s ease-in-out infinite; }
.js.is-loaded .loader { opacity: 0; visibility: hidden; }
.js.is-loaded.is-leaving .loader { opacity: 1; visibility: visible; transition: opacity .35s ease; }
@keyframes loader-in { from { opacity: 0; transform: scale(.96); filter: invert(1) blur(4px); } }
@keyframes loader-bar { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* Landing: content rises in once the loader lifts. [data-in] items can stagger with --d */
.js [data-in] { opacity: 0; translate: 0 18px; }
.js.is-loaded [data-in] {
  opacity: 1; translate: none;
  transition: opacity .9s ease var(--d, .1s), translate .9s cubic-bezier(.2,.7,.2,1) var(--d, .1s);
}

@media (prefers-reduced-motion: reduce) {
  .chrome-top nav a::after, .cart, .cart__overlay, .cart__panel { transition: none; }
  .loader__logo, .loader__bar::after { animation: none; }
  .js [data-in] { translate: none; }
}
