/* Critical Mass Customs site v1. Dark editorial (from Lorna's v2 Option B). CSS-only tabs via :target. */
@font-face { font-family: "Fraunces"; src: url("/fonts/Fraunces.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #111214; --bg-2: #1a1c1f; --bg-3: #15171a; --fg: #f2f0eb; --muted: #9a9da3; --line: #2a2d31;
  --accent: #ff6a3d; --phys: #e0a458; --file: #b493ff; --sw: #5b8cff; --ok: #7ee2a8; --warn: #f4c542;
  --font-display: "Fraunces", Georgia, serif; --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2.5rem; --s5: 4rem;
  --radius: 10px; --max: 1240px; --hdr: 76px;
}
* { box-sizing: border-box; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 400 1rem/1.6 var(--font-body); min-height: 100dvh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.muted { color: var(--muted); } .sm { font-size: .88rem; } .mono { font-family: var(--font-mono); font-size: .84em; } .center { text-align: center; margin-top: var(--s3); }
.kicker { font: 600 .74rem/1 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: .8rem; }
.link { display: inline-block; margin-top: var(--s2); color: var(--accent); font-weight: 600; }
.btn { display: inline-block; background: var(--accent); color: #111; padding: .7rem 1.3rem; border-radius: 99px; font-weight: 700; cursor: default; }
.btn.sm { padding: .45rem .95rem; font-size: .82rem; }
.btn.ghost { background: none; color: var(--fg); border: 1px solid #55595f; }
.pill { border: 1px solid var(--line); border-radius: 99px; padding: .4rem 1rem; font-size: .88rem; color: var(--muted); }
.pill b { color: var(--accent); }
.ph { display: grid; place-items: center; width: 100%; height: 100%; padding: var(--s2); text-align: center; color: var(--muted); font-size: .8rem; border: 1px dashed #55595f; border-radius: inherit; background: repeating-linear-gradient(45deg, #1a1c1f 0 12px, #15171a 12px 24px); }

/* Header + tabs */
.top { position: sticky; top: 0; z-index: 10; background: #111214f2; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: .7rem max(var(--s3), calc((100% - var(--max)) / 2 + var(--s3))); min-height: var(--hdr); }
.brand { display: flex; align-items: center; gap: .75rem; flex: none; }
.badge { display: grid; place-items: center; width: 44px; height: 54px; background: #fff; border-radius: 9px; padding: 3px; overflow: hidden; }
.badge img { width: 100%; height: 100%; object-fit: contain; }
.wordmark { font: 600 1.1rem/1 var(--font-display); }
.tabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.tab { padding: .5rem .9rem; border-radius: 99px; font-size: .9rem; color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.tab:hover { color: var(--fg); }
/* active tab: the targeted panel, or Home when nothing is targeted */
body:has(#home:target) .t-home, body:not(:has(.panel:target)) .t-home,
body:has(#shop:target) .t-shop, body:has(#blog:target) .t-blog, body:has(#video:target) .t-video,
body:has(#links:target) .t-links, body:has(#live:target) .t-live { color: #111; background: var(--fg); }

/* Panels: one visible at a time, each bounded to the viewport */
.panels { flex: 1; }
.panel { display: none; scroll-margin-top: var(--hdr); }
.panel:target, .panels:not(:has(.panel:target)) #home { display: block; }
.panel-in { max-width: var(--max); margin: 0 auto; padding: var(--s4) var(--s3); min-height: calc(100dvh - var(--hdr) - 60px); }
.ph-head { margin-bottom: var(--s4); }
.ph-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); flex-wrap: wrap; }
.sec { font: 500 clamp(1.9rem, 3.4vw, 2.6rem)/1.05 var(--font-display); }
.sub { font: 500 1.5rem/1.1 var(--font-display); }
.row-head { display: flex; justify-content: space-between; align-items: baseline; margin: var(--s4) 0 var(--s2); }

/* Home */
.intro { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); align-items: center; }
.intro h1 { font: 400 clamp(2.4rem, 4.6vw, 4rem)/1.06 var(--font-display); letter-spacing: -.02em; }
.intro h1 em { color: var(--muted); }
.lede { margin-top: var(--s3); color: var(--muted); font-size: 1.1rem; max-width: 46ch; }
.focal { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color .2s; }
.focal:hover { border-color: var(--accent); }
.focal-img { aspect-ratio: 4/5; background: #000; }
.focal-img img { width: 100%; height: 100%; object-fit: cover; }
.focal-copy { padding: var(--s3); display: flex; flex-direction: column; justify-content: center; }
.focal-copy h2 { font: 500 1.6rem/1.15 var(--font-display); margin-bottom: .5rem; }
.chapters { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.chapters article { padding-right: var(--s2); }
.num { font: 500 .8rem var(--font-mono); color: var(--accent); }
.chapters h3 { font: 500 1.35rem/1.2 var(--font-display); margin: .2rem 0 .4rem; }

/* Horizontal rails keep Home bounded instead of growing downward */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s2); scrollbar-color: #3a3d42 transparent; }
.rail > * { scroll-snap-align: start; }
.work .slot, .prod .slot { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: var(--s2); }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.fit-top img { object-position: top left; }
.fit-contain img { object-fit: contain; padding: 14%; }
.fit-dark { background: #000 !important; } .fit-light { background: #fff !important; }
.tag { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.k-phys .tag { color: var(--phys); } .k-file .tag { color: var(--file); } .k-sw .tag { color: var(--sw); }
.work h3, .prod h3, .nc h3 { font: 500 1.15rem/1.25 var(--font-display); margin: .15rem 0 .25rem; }

/* Out now / Coming soon */
.nc-rail { grid-auto-columns: minmax(200px, 1fr); }
.nc { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: .2rem; }
.nc.soon { border-style: dashed; }
.nc .btn { align-self: flex-start; margin-top: auto; }
.nc-img { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #000; margin-bottom: .6rem; }
.nc-img img { width: 100%; height: 100%; object-fit: cover; }
.nc-img.blur img { filter: blur(10px) saturate(.6) brightness(.7); transform: scale(1.15); }
.nc-img.shadow img { filter: grayscale(1) contrast(1.6) brightness(.28); }
.nc-img.shadow::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, transparent 30%, #000 85%); }
.flag { position: absolute; z-index: 1; top: 10px; left: 10px; font: 700 .66rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; padding: .4rem .6rem; border-radius: 99px; background: #111214e0; color: var(--accent); border: 1px solid var(--accent); }
.flag.on { color: var(--ok); border-color: var(--ok); }
.q { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; font: 400 4rem/1 var(--font-display); color: #ffffffb0; }
.nc p { margin-bottom: .6rem; }

/* Marketplace: CSS-only category filter (radio inputs) */
.filters > input { position: absolute; opacity: 0; pointer-events: none; }
.filters > label { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: .4rem 1rem; margin: 0 .35rem .5rem 0; font-size: .88rem; color: var(--muted); cursor: pointer; }
.filters > input:checked + label { background: var(--fg); color: #111; border-color: var(--fg); }
.filters > input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.prod-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4) var(--s3); margin-top: var(--s3); }
.prod { display: flex; flex-direction: column; }
.p-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: var(--s2); }

/* Blog */
.posts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.post { display: grid; grid-template-columns: 200px 1fr; gap: var(--s3); align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.post img { aspect-ratio: 4/3; width: 100%; object-fit: cover; border-radius: 8px; }
.post h3 { font: 500 1.25rem/1.2 var(--font-display); margin: .2rem 0; }
.date { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }

/* Video */
.video { display: grid; gap: var(--s2); max-width: 960px; }
.vframe { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); border: 1px dashed #55595f; background: radial-gradient(circle, #24272b, #0d0e10 75%); display: grid; place-items: center; overflow: hidden; }
.vframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play { width: 84px; height: 84px; border-radius: 50%; background: var(--accent); position: relative; box-shadow: 0 0 0 12px #ff6a3d26; }
.play::after { content: ""; position: absolute; left: 34px; top: 26px; border-style: solid; border-width: 16px 0 16px 26px; border-color: transparent transparent transparent #111; }
.vlabel { position: absolute; left: 16px; bottom: 14px; font-size: .78rem; color: var(--muted); }

/* Links */
.links { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.lnk { display: flex; flex-direction: column; gap: .3rem; padding: var(--s3); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.lnk:hover { border-color: var(--accent); }
.lnk b { font: 500 1.2rem var(--font-display); }

/* Live data */
.api { display: inline-flex; align-items: center; gap: .5rem; font: .78rem var(--font-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: .4rem .7rem; }
.api i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); margin-bottom: var(--s3); }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); display: flex; flex-direction: column; gap: .3rem; }
.stat b { font: 500 2.2rem/1 var(--font-display); }
.stat small { color: var(--muted); }
.src { display: inline-block; align-self: flex-start; font: 600 .7rem/1 var(--font-mono); font-style: normal; padding: .3rem .5rem; border-radius: 4px; border: 1px solid currentColor; }
.s-fightlab { color: var(--accent); } .s-sheight { color: var(--warn); } .s-ikag { color: var(--sw); } .s-shop { color: var(--phys); } .s-dmd { color: var(--file); } .s-caregiver { color: var(--ok); }
.feed { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .88rem; margin-bottom: var(--s2); }
.fr { display: grid; grid-template-columns: 90px 120px 1.1fr 2fr 80px; gap: var(--s2); padding: .7rem var(--s3); border-top: 1px solid var(--line); align-items: center; }
.fr:nth-child(even) { background: var(--bg-3); }
.fh { border-top: 0; background: var(--bg-2); font: 600 .7rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ok { color: var(--ok); } .wait { color: var(--warn); }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s2); padding: var(--s2) max(var(--s3), calc((100% - var(--max)) / 2 + var(--s3))); border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }

@media (max-width: 1000px) {
  .intro { grid-template-columns: 1fr; gap: var(--s4); }
  .prod-grid { grid-template-columns: repeat(3, 1fr); }
  .posts { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --hdr: 112px; }
  .top { flex-direction: column; align-items: stretch; gap: .5rem; padding: .6rem var(--s2); }
  .badge { width: 34px; height: 42px; }
  .wordmark { font-size: 1rem; }
  .tabs { margin: 0 calc(-1 * var(--s2)); padding: 0 var(--s2); }
  .tab { padding: .4rem .75rem; font-size: .84rem; }
  .panel-in { padding: var(--s3) var(--s2); }
  .focal { grid-template-columns: 1fr 1.2fr; }
  .focal-img { aspect-ratio: auto; }
  .chapters { grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s2); }
  .rail { grid-auto-columns: 72%; }
  .nc-rail { grid-auto-columns: 58%; }
  .prod-grid { grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s2); }
  .post { grid-template-columns: 110px 1fr; gap: var(--s2); }
  .links { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .fh { display: none; }
  .fr { grid-template-columns: auto 1fr auto; row-gap: .3rem; padding: .7rem var(--s2); }
  .fr span:nth-child(3) { grid-column: 1 / 3; }
  .fr span:nth-child(4) { grid-column: 1 / -1; word-break: break-word; }
  .fr span:nth-child(5) { grid-row: 1; grid-column: 3; }
  .play { width: 64px; height: 64px; } .play::after { left: 26px; top: 19px; border-width: 13px 0 13px 21px; }
}
@media (prefers-reduced-motion: no-preference) { .panel:target, .panels:not(:has(.panel:target)) #home { animation: fade .25s ease; } }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
