/* mvibe home. Tokens in shared/tokens.css are measured from the art.
 * Metaphor: a night gallery. The art is the light source; the UI is dark glass and drips of paint. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--paper); font: 400 17px/1.6 var(--sans); overflow-x: hidden; }
img { max-width: 100%; }
a { color: var(--sky); }
.wrap { width: min(1200px, 100% - 32px); margin: 0 auto; }
.eyebrow { display: inline-block; font: 500 12px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--sky); }
h1, h2 { font-family: var(--serif); letter-spacing: -.02em; margin: 0; }
h1 em, h2 em { font-style: italic; font-weight: 500; color: var(--bloom); }

/* ---------- nav: one line, always ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(16px, calc((100% - 1200px) / 2)); transition: background .4s var(--ease), border-color .4s; border-bottom: 1px solid transparent; }
.nav.solid { background: rgba(1, 6, 27, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: rgba(255, 255, 255, .06); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; font: 800 20px/1 var(--serif); }
.brand img { width: 30px; height: 30px; transition: transform .6s var(--ease); }
.brand:hover img { transform: rotate(180deg) scale(1.08); }
.nav nav { display: flex; gap: 4px; white-space: nowrap; }
.nav nav a { color: var(--paper); text-decoration: none; font: 600 14px/1 var(--sans); padding: 10px 12px; border-radius: 999px; transition: background .25s; }
.nav nav a:hover { background: rgba(255, 255, 255, .08); }
.nav nav a.gh { border: 1px solid rgba(84, 197, 222, .35); }
@media (max-width: 480px) { .nav nav a { padding: 9px 8px; font-size: 13px; } .brand span { display: none; } }

/* ---------- buttons ---------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 700 15px/1 var(--sans); color: #fff; background: linear-gradient(180deg, var(--bloom), var(--magenta));
  box-shadow: 0 14px 34px -14px rgba(223, 71, 104, .95), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .3s var(--ease), box-shadow .3s; --mx: 50%; --my: 50%; }
.btn::after { content: ""; position: absolute; inset: 0; background: radial-gradient(130px circle at var(--mx) var(--my), rgba(255, 255, 255, .3), transparent 60%); opacity: 0; transition: opacity .25s; }
.btn:hover { transform: translateY(-2px); }
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: rgba(1, 6, 27, .35); color: var(--paper); border: 1px solid rgba(238, 241, 247, .22); box-shadow: none; backdrop-filter: blur(6px); }
.btn.ghost:hover { border-color: var(--sky); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.cta.center { justify-content: center; margin-top: 30px; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; padding: 120px 0 64px; isolation: isolate; overflow: hidden; }
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.08);
  transition: opacity 1.8s ease, transform 9s linear; }
.hero-art img.on { opacity: 1; transform: scale(1); }
.hero-veil { position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(1, 6, 27, .55) 0%, rgba(1, 6, 27, .1) 35%, rgba(1, 6, 27, .7) 72%, var(--night) 100%),
              radial-gradient(900px 500px at 15% 85%, rgba(1, 6, 27, .75), transparent 70%); }
.hero-copy { width: min(1200px, 100% - 32px); margin: 0 auto; display: grid; gap: 22px; }
.hero .logo { width: clamp(150px, 22vw, 240px); height: auto; filter: drop-shadow(0 8px 30px rgba(0, 0, 0, .6)); }
.hero h1 { font-weight: 900; font-size: clamp(48px, 10vw, 128px); line-height: .92; text-shadow: 0 10px 50px rgba(1, 6, 27, .7); }
.hero p { margin: 0; max-width: 56ch; font-size: clamp(17px, 2vw, 20px); color: #dfe4f1; text-shadow: 0 2px 20px rgba(1, 6, 27, .9); }
.hero-caption { position: absolute; right: max(16px, calc((100% - 1200px) / 2)); bottom: 22px; font: 500 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(238, 241, 247, .6); text-align: right; }
@media (max-width: 700px) { .hero-caption { display: none; } }

/* ---------- ticker ---------- */
.ticker { overflow: hidden; border-block: 1px solid rgba(255, 255, 255, .07); background: linear-gradient(90deg, rgba(88, 27, 159, .25), rgba(29, 98, 159, .25)); }
.ticker-track { display: flex; width: max-content; padding: 14px 0; animation: tick 50s linear infinite;
  font: 500 13px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #c4cbe0; }
.ticker-track span { display: inline-flex; align-items: center; gap: 16px; padding-right: 26px; }
.ticker-track img { width: 16px; height: 16px; opacity: .85; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: clamp(70px, 10vw, 130px) 0; position: relative; }
.head { display: grid; gap: 14px; margin-bottom: 34px; max-width: 760px; }
.head h2 { font-weight: 700; font-size: clamp(34px, 5.4vw, 64px); line-height: 1.02; }
.head p { margin: 0; color: #b9c1d8; font-size: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { cursor: pointer; padding: 9px 15px; border-radius: 999px; border: 1px solid rgba(238, 241, 247, .16); background: rgba(11, 19, 61, .55);
  color: #c4cbe0; font: 600 13px/1 var(--sans); transition: all .25s var(--ease); }
.chip:hover { border-color: var(--sky); color: var(--paper); }
.chip[aria-selected="true"] { background: var(--paper); color: var(--night); border-color: var(--paper); }

/* ---------- tool cards ---------- */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.tool { --mx: 50%; --my: 50%; --accent: var(--bloom); position: relative; display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  border-radius: var(--radius); background: #0d1440; border: 1px solid rgba(255, 255, 255, .07); box-shadow: var(--shadow);
  color: var(--paper); text-decoration: none; transition: transform .45s var(--ease), border-color .3s, box-shadow .45s; }
.tool::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(360px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%); opacity: 0; transition: opacity .3s; }
.tool:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .9); }
.tool:hover::before { opacity: 1; }
.tool.hidden { display: none; }
.tool-art { position: relative; aspect-ratio: 16 / 8; overflow: hidden; background: var(--ink); }
.tool-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ease), filter .6s; }
.tool:hover .tool-art img { transform: scale(1.06); filter: saturate(1.25); }
/* paint drip edge between art and label */
.tool-art::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 22px; background: #0d1440;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 22' preserveAspectRatio='none'%3E%3Cpath d='M0 14 C20 14 22 4 40 6 S60 20 80 12 S110 2 130 9 S150 22 170 16 S200 3 225 8 S245 21 268 14 S300 5 320 10 S350 20 372 12 S392 6 400 9 V22 H0Z'/%3E%3C/svg%3E") center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 22' preserveAspectRatio='none'%3E%3Cpath d='M0 14 C20 14 22 4 40 6 S60 20 80 12 S110 2 130 9 S150 22 170 16 S200 3 225 8 S245 21 268 14 S300 5 320 10 S350 20 372 12 S392 6 400 9 V22 H0Z'/%3E%3C/svg%3E") center / 100% 100%; }
.tool-badge { position: absolute; top: 12px; left: 12px; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.tool-badge span { padding: 6px 9px; border-radius: 999px; background: rgba(1, 6, 27, .72); backdrop-filter: blur(6px); font: 600 11px/1 var(--mono); letter-spacing: .06em; color: var(--paper); }
.tool-body { position: relative; z-index: 1; display: grid; gap: 10px; align-content: start; padding: 6px 20px 20px; }
.tool-title { display: flex; align-items: center; gap: 10px; }
.tool-title img { width: 26px; height: 26px; opacity: .9; }
.tool-title h3 { margin: 0; font: 700 24px/1.1 var(--serif); }
.tool-body p { margin: 0; color: #b9c1d8; font-size: 15px; }
.tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.tool-go { display: inline-flex; align-items: center; gap: 8px; font: 700 14px/1 var(--sans); color: var(--accent); }
.tool-go i { display: inline-block; transition: transform .35s var(--ease); font-style: normal; }
.tool:hover .tool-go i { transform: translateX(5px); }
.tool-src { font: 500 12px/1 var(--mono); color: var(--mist); text-decoration: none; position: relative; z-index: 3; }
.tool-src:hover { color: var(--sky); }

/* ---------- gallery ---------- */
.art { background: linear-gradient(180deg, var(--night), #070b2a 30%, var(--night)); }
.gallery { columns: 4 260px; column-gap: 14px; }
.piece { --rx: 0deg; --ry: 0deg; break-inside: avoid; margin: 0 0 14px; position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  border-radius: 12px; overflow: hidden; box-shadow: 0 14px 40px -20px rgba(0, 0, 0, .9);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); opacity: 0; translate: 0 18px;
  transition: transform .5s var(--ease), box-shadow .4s, opacity .7s, translate .8s var(--ease); }
.piece.in { opacity: 1; translate: 0 0; }
.piece img { display: block; width: 100%; height: auto; }
.piece:hover { box-shadow: 0 26px 60px -20px rgba(0, 0, 0, 1); }
.piece figcaption { position: absolute; inset: auto 0 0; padding: 26px 12px 10px; text-align: left; font: 500 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--paper); background: linear-gradient(transparent, rgba(1, 6, 27, .85)); opacity: 0; transition: opacity .3s; }
.piece:hover figcaption, .piece:focus-visible figcaption { opacity: 1; }
.piece.hidden { display: none; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 70px); align-items: center; }
.about-art { position: relative; aspect-ratio: 4 / 5; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); background: var(--ink); }
.about-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s ease; }
.about-art img.on { opacity: 1; }
.about-copy { display: grid; gap: 16px; }
.about-copy h2 { font-weight: 700; font-size: clamp(40px, 6vw, 72px); line-height: 1; }
.about-copy p { margin: 0; color: #c4cbe0; }
.about-copy .lead { font-size: 21px; color: var(--paper); }
.stats { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 14px; }
.stats li { flex: 1 1 140px; padding: 16px 18px; border-radius: 16px; background: rgba(11, 19, 61, .7); border: 1px solid rgba(255, 255, 255, .06); display: grid; gap: 2px; }
.stats b { font: 900 34px/1 var(--serif); color: var(--paper); }
.stats span { font: 500 12px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sky); }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } .about-art { aspect-ratio: 16 / 10; } }

/* ---------- footer ---------- */
.foot { padding: 50px 0 70px; border-top: 1px solid rgba(255, 255, 255, .07); background: #00030f; }
.foot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.foot-logo { width: 150px; height: auto; margin-bottom: 12px; }
.foot p { margin: 0 0 10px; color: #aeb7d0; font-size: 15px; max-width: 52ch; }
.foot .small { font-size: 13px; color: var(--mist); }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- lightbox ---------- */
.lightbox { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(1, 6, 27, .94); color: var(--paper); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: min(92vw, 1400px); max-height: 82svh; object-fit: contain; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.lb-cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; margin: 0; font: 500 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #aeb7d0; }
.lb-close, .lb-nav { position: absolute; border: 0; cursor: pointer; color: var(--paper); background: rgba(255, 255, 255, .08); border-radius: 50%; width: 46px; height: 46px; font-size: 28px; line-height: 1; }
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .18); }
.lb-close { top: 16px; right: 16px; }
.lb-nav.prev { left: 14px; top: 50%; } .lb-nav.next { right: 14px; top: 50%; }

/* ---------- click reward: small eyes fly from the click point ---------- */
.spark { position: fixed; z-index: 100; width: 18px; height: 18px; pointer-events: none; margin: -9px 0 0 -9px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .piece { opacity: 1; translate: 0 0; }
}
