/* MASTO FOREVER store. Layout after tecca.co; MASTO's look: black, white, strictly black and white (Nate 9/24: no accent colour), his ∞ mark, film grain. */
@font-face {
  font-family: "Chivo Mono";
  src: url("../fonts/chivomono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #000;
  --fg: #f4f4f2;
  --dim: #8d8d8d;
  --tile: #0c0c0c;
  --line: #262626;
  --mono: "Chivo Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 72px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 400 14px/1.45 var(--mono);
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--fg); color: #000; padding: 10px 14px; font-weight: 700; }
.skip:focus { top: 12px; }

/* film grain over everything (his FOREVER-era footage is grainy); frozen when the viewer asks for less motion */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 40;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.6 -.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ───── loading screen (home only): FOREVER written out, then it opens by itself ───── */
html.door-open, html.door-open body { overflow: hidden; }
#door {
  position: fixed;
  inset: 0;
  z-index: 35;            /* under the film grain (40), so the grain plays over the writing */
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(22px, 4vh, 40px);
  padding: 24px;
  background: #000;
  cursor: pointer;
  transition: opacity .6s var(--ease), visibility 0s linear .6s;
}
#door .write { width: min(86vw, 1000px); height: auto; color: var(--fg); overflow: visible; filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, .35)); transition: transform .9s var(--ease), opacity .5s var(--ease); }
#door .hint { margin: 0; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); opacity: 0; transition: opacity .6s var(--ease); }
#door .hint.show { opacity: 1; }
/* exit in two beats (Nate 9/25: no clothes showing through the landing screen): the writing fades to black first,
   then the black lifts to reveal the shop; the product tiles hold their entrance until the screen is gone */
#door.leaving { pointer-events: none; }
#door.leaving .write { opacity: 0; transform: scale(.96); }
#door.leaving .hint { opacity: 0; transition: opacity .3s var(--ease); }
#door.lifting { opacity: 0; visibility: hidden; }
html.door-open .grid li { animation-play-state: paused; }
#door:focus-visible { outline: none; }
#door:focus-visible .hint { color: var(--fg); }

/* ───── header: SHOP chip · centered script logo · cart ───── */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: clamp(18px, 3vw, 30px) var(--gutter) 0;
}
.chip {
  justify-self: start;
  background: var(--fg);
  color: #000;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .08em;
  padding: 11px 16px 10px;
  transition: background .25s var(--ease);
}
.chip:hover { background: #000; color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.logo { display: flex; align-items: center; gap: clamp(10px, 1.6vw, 22px); color: var(--fg); transition: color .4s var(--ease), filter .6s var(--ease); }
.logo .inf { width: clamp(130px, 15vw, 220px); height: auto; aspect-ratio: 4629 / 2745; overflow: visible; }
.draw:not(.ready) .pen { opacity: 0; }   /* until draw.js primes the pen strokes, show nothing rather than the whole mark */
  /* header = his ∞ only (Nate 9/24); FOREVER is written on the loading screen */
.logo:hover { filter: drop-shadow(0 0 16px rgba(255, 255, 255, .35)); }

.cartbtn {
  justify-self: end;
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  cursor: pointer;
}
.cartbtn svg { width: 22px; height: 22px; }
.cartbtn:hover { color: var(--dim); }
.count {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--fg);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  transform: scale(0);
  transition: transform .3s var(--ease);
}
.count.on { transform: scale(1); }
.count.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.45); } }

.nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px clamp(22px, 3vw, 40px);
  padding: clamp(14px, 2vw, 22px) var(--gutter) 0;
  font-size: 14px;
  text-transform: uppercase;
}
.nav a { position: relative; padding: 6px 0; }
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ───── shop grid ───── */
.shop { max-width: 1280px; margin: 0 auto; padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(60px, 8vw, 110px); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(40px, 5vw, 64px) clamp(18px, 3vw, 40px); list-style: none; margin: 0; padding: 0; }
.card { display: block; text-align: center; text-transform: uppercase; }
.grid li { animation: rise .9s var(--ease) both; }
.grid li:nth-child(1) { animation-delay: .35s; } .grid li:nth-child(2) { animation-delay: .43s; } .grid li:nth-child(3) { animation-delay: .51s; }
.grid li:nth-child(4) { animation-delay: .59s; } .grid li:nth-child(5) { animation-delay: .67s; } .grid li:nth-child(6) { animation-delay: .75s; }
.grid li:nth-child(n+7) { animation-delay: .83s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.art {
  position: relative;
  aspect-ratio: 1;
  background: var(--tile);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.art img { width: 100%; height: 100%; object-fit: contain; transition: transform .8s var(--ease), opacity .5s var(--ease); }
.art.photo { background: #ececea; }                      /* product photos sit on a light tile: black pieces stay visible */
.art .alt { position: absolute; inset: 0; opacity: 0; }  /* back view, shown on hover */
.card:hover .art .alt { opacity: 1; }
.card:hover .art.photo img:not(.alt) { opacity: 0; }
.art.photo::before { display: none; }   /* no outline on the product boxes (Nate 9/25) */
.card:hover .art img { transform: scale(1.04); }
.art .mark { width: 34%; color: var(--fg); opacity: .13; transition: opacity .5s var(--ease), color .5s var(--ease), transform .8s var(--ease); }
.card:hover .art .mark { opacity: .7; color: var(--fg); transform: scale(1.06); }
.art::before { /* hairline frame that draws in on hover */
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--fg);
  opacity: 0;
  clip-path: inset(0 100% 100% 0);
  transition: clip-path .6s var(--ease), opacity .3s;
}
.card:hover .art::before { opacity: .55; clip-path: inset(0 0 0 0); }
.num { position: absolute; left: 14px; bottom: 11px; font-size: 11px; color: var(--dim); letter-spacing: .12em; }

.card h2, .card h3 { margin: 18px 0 0; font-size: 14px; font-weight: 400; letter-spacing: .06em; line-height: 1.35; }
.price { margin: 5px 0 0; font-weight: 700; font-size: 13px; }
.flag { margin: 9px 0 0; font-weight: 700; font-size: 12px; letter-spacing: .1em; color: var(--fg); }

/* ───── product page ───── */
.pdp {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(36px, 5vw, 64px) var(--gutter) clamp(60px, 8vw, 110px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.gallery .art { animation: rise .9s var(--ease) .2s both; }
.gallery .art .mark { width: 30%; opacity: .16; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; list-style: none; padding: 0; }
.thumbs button { width: 76px; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); background: #ececea; cursor: pointer; }
.thumbs button[aria-pressed="true"] { border-color: var(--fg); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; display: block; }
.buy { animation: rise .9s var(--ease) .35s both; }
.buy h1 { margin: 0; font-size: clamp(18px, 2vw, 22px); font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
.buy .price { font-size: 16px; margin-top: 10px; }
.note { margin: 8px 0 0; font-size: 12px; color: var(--dim); }
.note a { text-decoration: underline; text-underline-offset: 3px; }
fieldset { border: 0; margin: 26px 0 0; padding: 0; }
legend { padding: 0; font-weight: 700; font-size: 13px; letter-spacing: .1em; margin-bottom: 10px; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.sizes label { position: relative; }
.sizes input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sizes span {
  display: grid;
  place-items: center;
  min-width: 52px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  font-size: 13px;
  transition: border-color .2s, background .2s, color .2s;
}
.sizes input:hover + span { border-color: var(--dim); }
.sizes input:checked + span { border-color: var(--fg); background: var(--fg); color: #000; font-weight: 700; }
.sizes input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }
.sizes input:disabled + span { color: #4a4a4a; border-color: #1a1a1a; text-decoration: line-through; }

.btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 22px;
  padding: 14px 18px 13px;
  border: 1px solid var(--fg);
  background: transparent;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s;
}
.btn:hover:not(:disabled) { background: var(--fg); color: #000; }
.btn.solid { background: var(--fg); color: #000; }
.btn.solid:hover:not(:disabled) { background: transparent; color: var(--fg); }
.btn:disabled { cursor: not-allowed; border-color: #333; color: #5a5a5a; }
.msg { min-height: 1.4em; margin: 10px 0 0; font-size: 12px; color: var(--fg); }
.details { margin: 26px 0 0; padding: 0; list-style: none; text-transform: uppercase; font-size: 14px; line-height: 1.6; }
.details li + li { margin-top: 10px; }
.trust { margin: 28px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); list-style: none; font-size: 12px; color: var(--dim); }
.trust li { display: flex; gap: 10px; align-items: baseline; }
.trust li + li { margin-top: 8px; }
.trust li::before { content: "∞"; color: var(--fg); }
.trust a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* ───── cart drawer ───── */
.veil { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); opacity: 0; transition: opacity .35s var(--ease); }
.veil.open { opacity: 1; }
.drawer {
  position: fixed;
  z-index: 61;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  background: #070707;
  border-left: 1px solid var(--line);
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 22px calc(env(safe-area-inset-bottom, 0px) + 22px);
  transform: translateX(102%);
  transition: transform .45s var(--ease);
}
.drawer.open { transform: none; }
.drawer header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.drawer h2 { margin: 0; font-size: 15px; letter-spacing: .12em; }
.x { width: 40px; height: 40px; border: 0; background: none; font-size: 22px; cursor: pointer; }
.x:hover { color: var(--dim); }
.lines { flex: 1; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.line { display: grid; grid-template-columns: 68px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line .art { width: 68px; }
.line .art .mark { width: 50%; opacity: .2; }
.line h3 { margin: 0; font-size: 12px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
.line .meta { margin: 3px 0 0; font-size: 11px; color: var(--dim); }
.qty { display: inline-flex; align-items: center; margin-top: 10px; border: 1px solid var(--line); }
.qty button { width: 30px; height: 30px; border: 0; background: none; cursor: pointer; }
.qty button:hover { color: var(--dim); }
.qty output { min-width: 26px; text-align: center; font-size: 12px; }
.line .amt { font-size: 12px; font-weight: 700; text-align: right; }
.rm { display: block; margin: 12px 0 0 auto; border: 0; background: none; padding: 0; font-size: 10px; letter-spacing: .1em; color: var(--dim); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rm:hover { color: var(--fg); }
.empty { padding: 42px 0; text-align: center; color: var(--dim); text-transform: uppercase; font-size: 12px; letter-spacing: .1em; }
.foot { padding-top: 16px; }
.sum { display: flex; justify-content: space-between; font-weight: 700; letter-spacing: .08em; }
.foot .btn { max-width: none; }
.secure { display: flex; justify-content: center; gap: 8px; align-items: center; margin: 12px 0 0; font-size: 11px; color: var(--dim); }
.secure svg { width: 12px; height: 12px; }
body.locked { overflow: hidden; }

/* ───── text pages: music, contact, legal, thanks ───── */
.page { max-width: 760px; margin: 0 auto; padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(60px, 8vw, 110px); }
.page > h1 { margin: 0 0 8px; font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.page .sub { text-align: center; color: var(--dim); font-size: 12px; margin: 0 0 40px; }
.doc h2 { margin: 36px 0 10px; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
.doc p, .doc li { color: #cfcfcf; font-size: 13px; line-height: 1.75; }
.doc ul { padding-left: 18px; }
.doc a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.doc a:hover { color: var(--dim); }
.doc strong { color: var(--fg); }
.ph-flag { color: #000; background: var(--fg); padding: 0 4px; font-weight: 700; }

.releases { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 2.4vw, 28px); list-style: none; padding: 0; margin: 0; text-transform: uppercase; text-align: center; }
.releases img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; transition: transform .7s var(--ease); }
.releases a:hover img { transform: scale(1.03); }
.releases h2 { margin: 12px 0 0; font-size: 12px; font-weight: 400; letter-spacing: .06em; }
.more { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; margin: 44px 0 0; text-transform: uppercase; font-size: 13px; }
.more a:hover, .contact a:hover { color: var(--dim); }
.contact { text-align: center; }
.contact h2 { margin: 36px 0 6px; font-size: 12px; letter-spacing: .12em; color: var(--dim); font-weight: 400; }
.contact a.mail { font-size: clamp(14px, 1.8vw, 18px); text-decoration: underline; text-underline-offset: 5px; }
.done { text-align: center; }
.done p { color: #cfcfcf; }
.done .btn { margin: 30px auto 0; }

/* ───── footer ───── */
.site-foot { border-top: 1px solid var(--line); padding: 34px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 34px); text-align: center; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.site-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.site-foot nav + nav { margin-top: 14px; }
.site-foot a { color: var(--fg); }
.site-foot a:hover { color: var(--dim); }
.site-foot p { margin: 18px 0 0; }
.site-foot .stripe { display: inline-flex; gap: 7px; align-items: center; }
.site-foot .stripe svg { width: 11px; height: 11px; }

@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .pdp { grid-template-columns: 1fr; }
  .btn { max-width: none; }
  .releases { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 13px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .chip { font-size: 13px; padding: 9px 12px 8px; }
    .logo .inf { width: clamp(96px, 30vw, 130px); }
  .card h2 { font-size: 12px; margin-top: 12px; }
  .nav { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
