/* rasifox.com — product-page style. One family (Metastaz Sans), light by default, a careful dark mode. */

@font-face { font-family: "Metastaz Sans"; src: url("/fonts/MetastazSans-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #ffffff;
  --tile: #f5f5f7;
  --ink: #1d1d1f;
  --sub: #6e6e73;
  --link: #0066cc;
  --rule: #d2d2d7;
  --nav: rgba(255, 255, 255, 0.72);
  --abyss: #000000;          /* the Ranix tile is always black: Baron lives there */
  --abyss-ink: #f5f5f7;
  --abyss-sub: #a1a1a6;
  --abyss-link: #2997ff;

  --font: "Metastaz Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --page: 1024px;
  --wide: 1240px;
  --gutter: clamp(16px, 4vw, 32px);
  --r-big: 28px;
  --r-small: 18px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --tile: #161617; --ink: #f5f5f7; --sub: #a1a1a6; --link: #2997ff; --rule: #424245;
    --nav: rgba(22, 22, 23, 0.72);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 450 17px/1.47 var(--font); letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, p { margin: 0; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--bg); padding: 8px 12px; border-radius: 8px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40; height: 52px;
  background: var(--nav);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent);
}
.nav .in { max-width: var(--page); height: 100%; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 28px; }
.nav .brand { color: var(--ink); font-weight: 650; font-size: 19px; letter-spacing: -0.03em; margin-right: auto; }
.nav .brand:hover { text-decoration: none; }
.nav a.l { color: var(--ink); opacity: .8; font-size: 13px; letter-spacing: -0.01em; }
.nav a.l:hover { opacity: 1; text-decoration: none; }
.nav a.l[aria-current] { opacity: 1; font-weight: 600; }
@media (max-width: 720px) { .nav .sec { display: none; } .nav .in { gap: 20px; } }

/* ---------- hero ---------- */
.hero { text-align: center; padding: clamp(72px, 13vw, 150px) var(--gutter) clamp(56px, 9vw, 110px); }
.hero h1 { font-size: clamp(56px, 11vw, 132px); line-height: 1.02; font-weight: 720; letter-spacing: -0.052em; }
.hero .line { font-size: clamp(28px, 4.6vw, 56px); line-height: 1.08; font-weight: 640; letter-spacing: -0.035em; margin-top: 10px; color: var(--sub); }
.hero .intro { max-width: 34em; margin: 28px auto 0; font-size: clamp(19px, 2vw, 21px); line-height: 1.43; color: var(--ink); }
.ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 28px; margin-top: 30px; font-size: clamp(17px, 1.8vw, 19px); }
.btn { display: inline-block; background: var(--link); color: #fff; padding: 11px 22px; border-radius: 980px; font-weight: 500; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.more { display: inline-block; padding: 11px 0; }
.more::after { content: " ›"; }
.hero-inner { will-change: transform, opacity; }

/* ---------- tiles ---------- */
.tiles { max-width: var(--wide); margin: 0 auto; padding: 0 12px; display: grid; gap: 12px; }
.tile { border-radius: var(--r-big); background: var(--tile); overflow: hidden; position: relative; text-align: center; }
.tile .copy { padding: clamp(44px, 6vw, 64px) var(--gutter) 0; max-width: 760px; margin: 0 auto; }
.tile h2 { font-size: clamp(44px, 6.4vw, 80px); line-height: 1.04; font-weight: 720; letter-spacing: -0.045em; }
.tile .sub { font-size: clamp(21px, 2.6vw, 28px); line-height: 1.18; font-weight: 600; letter-spacing: -0.028em; margin-top: 8px; }
.tile .body { margin: 16px auto 0; max-width: 36em; color: var(--sub); font-size: clamp(17px, 1.6vw, 19px); }
.tile .ctas { margin-top: 18px; }

/* Ranix */
.ranix { background: var(--abyss); color: var(--abyss-ink); }
@media (prefers-color-scheme: dark) { .ranix { outline: 1px solid #2a2a2c; outline-offset: -1px; } }
.ranix .body { color: var(--abyss-sub); }
.ranix a { color: var(--abyss-link); }
.ranix .stage { position: relative; height: clamp(320px, 46vw, 560px); margin-top: 8px; overflow: hidden; }
.ranix .baron { position: absolute; left: 50%; top: 6%; width: clamp(250px, 38vw, 480px); transform: translate(-50%, var(--py, 0px)) rotate(var(--rot, 0deg)); will-change: transform; }
.ranix .surface { position: absolute; left: 0; right: 0; bottom: 0; height: 28%; background: linear-gradient(to bottom, rgba(0,0,0,0), #000 70%); }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 880px; margin: 0 auto; padding: 8px var(--gutter) 0; text-align: center; position: relative; }
.specs b { display: block; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; font-weight: 680; letter-spacing: -0.035em; color: #fff; }
.specs span { display: block; margin-top: 6px; color: var(--abyss-sub); font-size: 15px; line-height: 1.4; }
.ranix blockquote { margin: clamp(48px, 7vw, 80px) auto 0; padding: 0 var(--gutter) clamp(48px, 7vw, 72px); max-width: 820px; }
.ranix blockquote p { font-size: clamp(26px, 3.6vw, 44px); line-height: 1.12; font-weight: 640; letter-spacing: -0.035em; color: #fff; }
.ranix blockquote footer { margin-top: 14px; color: var(--abyss-sub); font-size: 15px; }
@media (max-width: 640px) { .specs { grid-template-columns: 1fr; gap: 20px; } }

/* two-up */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair .tile { display: flex; flex-direction: column; }
.pair .tile h2 { font-size: clamp(40px, 4.6vw, 56px); }
.pair .tile .sub { font-size: clamp(20px, 2vw, 24px); }
.pair .visual { flex: 1; padding: 36px var(--gutter) 44px; display: grid; place-items: center; }
@media (max-width: 820px) { .pair { grid-template-columns: 1fr; } }

.icons { display: grid; grid-template-columns: repeat(3, 76px); gap: 18px 22px; justify-content: center; }
.icons li { list-style: none; text-align: center; font-size: 12px; color: var(--sub); }
.icons img { width: 76px; height: 76px; border-radius: 18px; margin: 0 auto 6px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--rule) 70%, transparent); background: #fff; }
.icons ul, ul.icons { margin: 0; padding: 0; }

.chassis { width: min(300px, 70%); color: var(--ink); }
.chassis .wheel { transform-box: fill-box; transform-origin: center; transform: rotate(var(--a, 45deg)); transition: transform .2s linear; }
.chassis .frame { fill: none; stroke: currentColor; stroke-width: 3; }
.chassis .rail { stroke: var(--rule); stroke-width: 2; }
.chassis .mod { fill: var(--bg); stroke: currentColor; stroke-width: 2.5; }
.chassis .tread { fill: currentColor; }
.chassis .bump { fill: none; stroke: var(--link); stroke-width: 6; stroke-linejoin: round; opacity: .9; }
.chassis-cap { margin-top: 14px; font-size: 13px; color: var(--sub); }

/* ---------- principles: lines light up as they cross the middle of the screen ---------- */
.principles { max-width: var(--page); margin: 0 auto; padding: clamp(96px, 14vw, 170px) var(--gutter); }
.principles h2 { font-size: clamp(21px, 2.2vw, 24px); font-weight: 600; color: var(--sub); letter-spacing: -0.02em; margin-bottom: 28px; }
.principles p { font-size: clamp(30px, 4.8vw, 56px); line-height: 1.1; font-weight: 680; letter-spacing: -0.04em; max-width: 19em; }
.principles p + p { margin-top: .55em; }
.principles p span { color: var(--sub); font-weight: 600; }
.motion .principles p { opacity: var(--lit, .22); transition: opacity .25s linear; }

/* ---------- small projects ---------- */
.projects { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter) clamp(80px, 10vw, 120px); }
.projects h2 { font-size: clamp(40px, 5.4vw, 64px); line-height: 1.05; font-weight: 720; letter-spacing: -0.045em; }
.projects .lead { color: var(--sub); font-size: clamp(19px, 2vw, 21px); margin-top: 10px; }
.grid { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.grid a { display: block; height: 100%; background: var(--tile); border-radius: var(--r-small); padding: 24px 24px 26px; color: var(--ink); transition: transform .2s ease; }
.grid a:hover { text-decoration: none; transform: scale(1.012); }
.grid .lang { font-size: 13px; color: var(--sub); }
.grid h3 { font-size: 21px; font-weight: 650; letter-spacing: -0.025em; margin-top: 2px; }
.grid p { color: var(--sub); font-size: 15px; line-height: 1.45; margin-top: 8px; }

/* ---------- closing ---------- */
.work { text-align: center; padding: clamp(80px, 11vw, 140px) var(--gutter); border-top: 1px solid var(--rule); max-width: var(--page); margin: 0 auto; }
.work h2 { font-size: clamp(36px, 5vw, 56px); line-height: 1.06; font-weight: 700; letter-spacing: -0.042em; }
.work p { margin-top: 14px; font-size: clamp(19px, 2vw, 24px); }

.foot { background: var(--tile); color: var(--sub); font-size: 12px; line-height: 1.5; }
.foot .in { max-width: var(--page); margin: 0 auto; padding: 18px var(--gutter) calc(22px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.foot .c { margin-right: auto; }
.foot a { color: var(--ink); opacity: .8; }

/* ---------- simple pages (/now, 404) ---------- */
.page { max-width: 760px; margin: 0 auto; padding: clamp(64px, 10vw, 120px) var(--gutter) clamp(72px, 10vw, 120px); }
.page h1 { font-size: clamp(48px, 8vw, 88px); line-height: 1.02; font-weight: 720; letter-spacing: -0.05em; }
.page .lead { margin-top: 14px; font-size: clamp(19px, 2vw, 22px); color: var(--sub); }
.page dl { margin: 48px 0 0; }
.page dt { font-size: clamp(24px, 3vw, 32px); font-weight: 680; letter-spacing: -0.035em; }
.page dd { margin: 6px 0 36px; font-size: 19px; color: var(--sub); }
.page .stamp { font-size: 14px; color: var(--sub); }
.page .back { display: inline-block; margin-top: 28px; }

/* ---------- reveal (only with JS and motion allowed; content is never hidden otherwise) ---------- */
.motion .rv { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.motion .rv.in { opacity: 1; transform: none; }

/* the hidden one */
@keyframes flip { 0% { transform: translate(-50%, var(--py,0px)) rotate(0); } 50% { transform: translate(-50%, calc(var(--py,0px) - 90px)) rotate(-200deg); } 100% { transform: translate(-50%, var(--py,0px)) rotate(-360deg); } }
.ranix .baron.flip { animation: flip 1.4s cubic-bezier(.3,.6,.3,1); }

@media print { .nav { position: static; } .motion .rv { opacity: 1; transform: none; } }
