/* 3D Mage: the home page. A dark page so the pictures and footage of each tool's work glow; built to hold hundreds of
   tools (six rows of cards at a time, pictures loaded as they come into view). */
[hidden] { display: none !important; }
:root {
  --bg: #06090f; --bg-2: #0a0f1a; --panel: #0e1422; --panel-2: #121a2c; --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
  --text: #e9eef7; --muted: #9aa6b8; --dim: #78849a; --brand: #6aa9ff; --brand-2: #a58bff; --radius: 18px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: 8px; background: var(--brand); color: #04101f; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }

/* ---- the bar at the top ---- */
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); background: rgba(6, 9, 15, .76); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; flex: none; }
.top nav { display: flex; gap: 22px; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.top nav a:hover { color: var(--text); }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; width: min(320px, 40vw); padding: 0 10px; height: 38px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-2); color: var(--muted); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(106, 169, 255, .18); }
.search svg { width: 16px; height: 16px; flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; outline: none; }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.6); }
.search kbd { font: 12px var(--font); color: var(--dim); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 6px; }

/* ---- buttons ---- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); color: var(--text); font: 600 15px var(--font); text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s, transform .2s, box-shadow .2s; }
.button:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .24); }
.button.primary { border-color: transparent; background: linear-gradient(135deg, var(--accent, var(--brand)), var(--brand-2)); color: #050a16; }
.button.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px -10px var(--glow, rgba(106, 169, 255, .7)); }
.button svg { width: 16px; height: 16px; flex: none; }

/* ---- the opening ---- */
.hero { position: relative; overflow: hidden; padding: 80px 0 56px; text-align: center; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 120%; background: radial-gradient(60% 50% at 30% 30%, rgba(90, 168, 255, .16), transparent 70%), radial-gradient(50% 45% at 72% 35%, rgba(240, 168, 90, .11), transparent 70%); pointer-events: none; }
.eyebrow { margin: 0 0 14px; color: var(--brand); font-size: 13px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { position: relative; font-size: clamp(44px, 6.4vw, 84px); font-weight: 750; margin: 0 auto; }
.hero h1 span { background: linear-gradient(120deg, #fff 20%, #b9d4ff 55%, #ffd9b0 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { position: relative; margin: 22px auto 0; max-width: 64ch; color: var(--muted); font-size: clamp(17px, 1.6vw, 19px); }
.actions { position: relative; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.facts { position: relative; list-style: none; margin: 44px auto 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 980px; text-align: left; }
.facts li { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); }
.facts strong { display: block; font-family: var(--display); font-size: 16px; font-weight: 650; }
.facts span { display: block; margin-top: 4px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.showcase { position: relative; display: grid; grid-template-columns: repeat(var(--count, 2), minmax(0, 1fr)); gap: 22px; margin-top: 56px; text-align: left; }
.tile { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: #000; border: 1px solid var(--line); aspect-ratio: 16 / 10; text-decoration: none; isolation: isolate; box-shadow: 0 30px 80px -40px var(--glow, rgba(90, 168, 255, .45)); transition: transform .35s cubic-bezier(.2, .7, .2, 1), border-color .35s, box-shadow .35s; }
.tile:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: 0 40px 90px -36px var(--glow, rgba(90, 168, 255, .6)); }
.tile video, .tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(4, 6, 12, .92) 0%, rgba(4, 6, 12, .35) 38%, transparent 62%); z-index: 1; }
.tile-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 22px 24px; }
.tile-text h2 { font-size: clamp(22px, 2.2vw, 30px); }
.tile-text p { margin: 6px 0 0; color: #c9d2e0; font-size: 15px; line-height: 1.45; max-width: 46ch; }
.tile-text .go { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--accent, var(--brand)); font-weight: 650; font-size: 15px; }
.tile-text .go svg { width: 15px; height: 15px; transition: transform .25s; }
.tile:hover .go svg { transform: translateX(3px); }

/* ---- a featured tool ---- */
.feature { position: relative; padding: 96px 0; border-top: 1px solid var(--line); }
.feature::before { content: ""; position: absolute; inset: 0; background: radial-gradient(45% 55% at var(--glow-x, 25%) 40%, var(--soft, rgba(90, 168, 255, .09)), transparent 70%); pointer-events: none; }
.feature-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.feature.flip .feature-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.feature.flip .feature-media { order: 2; }
.feature-media { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: #000; aspect-ratio: 16 / 10; box-shadow: 0 40px 100px -50px var(--glow, rgba(90, 168, 255, .55)); }
.feature-media video, .feature-media img { width: 100%; height: 100%; object-fit: cover; }
.feature-media figcaption { position: absolute; left: 14px; bottom: 12px; right: 14px; width: fit-content; padding: 4px 10px; border-radius: 999px; background: rgba(4, 6, 12, .66); color: #c9d2e0; font-size: 12.5px; }
.feature .eyebrow, .details .eyebrow { color: var(--accent, var(--brand)); }
.feature h2 { font-size: clamp(32px, 3.6vw, 46px); }
.feature .lead, .details .lead { margin: 16px 0 0; text-align: left; }
.points { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
.points li { position: relative; padding-left: 28px; color: #cbd4e2; }
.points li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 10px; height: 10px; border-radius: 50%; background: var(--accent, var(--brand)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, var(--brand)) 22%, transparent); }
.feature h3, .details h3 { margin-top: 28px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-family: var(--font); font-weight: 650; }
.outputs { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.outputs li { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: #cbd4e2; font-size: 13.5px; }
.feature .actions, .details .actions { justify-content: flex-start; margin-top: 30px; }
.gallery { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 14px; margin-top: 56px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: auto; aspect-ratio: var(--shot-ratio, 1); object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: #000; transition: transform .3s, border-color .3s; }
.gallery figure:hover img { transform: translateY(-3px); border-color: var(--line-2); }
.gallery figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---- every tool ---- */
.catalog { padding: 96px 0 110px; border-top: 1px solid var(--line); background: linear-gradient(to bottom, var(--bg-2), var(--bg) 60%); }
.catalog-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.catalog-head h2 { font-size: clamp(30px, 3.2vw, 40px); }
.count { margin: 0; color: var(--muted); }
.bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 26px 0 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--muted); font: 600 14px var(--font); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, .26); }
.chip[aria-pressed="true"] { background: var(--text); color: #06090f; border-color: var(--text); }
.chip span { opacity: .6; margin-left: 6px; font-weight: 500; }
.sort { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.sort select { height: 36px; padding: 0 30px 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa6b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 16px; color: var(--text); font: 14px var(--font); appearance: none; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.card a { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; transition: transform .3s cubic-bezier(.2, .7, .2, 1), border-color .3s, box-shadow .3s; }
.card a:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: 0 26px 60px -34px var(--glow, rgba(90, 168, 255, .6)); }
.card .cover { position: relative; aspect-ratio: 16 / 10; background: #000; overflow: hidden; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.card a:hover .cover img { transform: scale(1.04); }
.badge { position: absolute; top: 12px; left: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(4, 6, 12, .72); color: var(--accent, var(--brand)); font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.card .body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.card h3 { font-size: 19px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.card .meta span { font-size: 12.5px; color: var(--dim); }
.card .meta span + span::before { content: "·"; margin-right: 6px; }
.empty { margin: 30px 0 0; padding: 36px; border: 1px dashed var(--line-2); border-radius: 16px; text-align: center; color: var(--muted); }
.empty button { margin-left: 8px; }
.more { display: flex; margin: 36px auto 0; }
.soon { margin: 34px auto 0; max-width: 70ch; color: var(--dim); font-size: 14px; text-align: center; }

/* ---- a tool's details, opened from its card ---- */
.details { width: min(1180px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 1px solid var(--line-2); border-radius: 22px; background: var(--panel); color: var(--text); box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .4); overflow: auto; overscroll-behavior: contain; }
.details::backdrop { background: rgba(2, 4, 9, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.details[open] { animation: details-in .28s cubic-bezier(.2, .7, .2, 1); }
@keyframes details-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.details-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 36px; padding: 28px; }
.details .close { position: absolute; top: 14px; right: 14px; z-index: 3; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(6, 9, 15, .82); color: var(--text); cursor: pointer; }
.details .close:hover { background: rgba(255, 255, 255, .1); }
.details .close svg { width: 18px; height: 18px; }
.details-media { min-width: 0; }
.details-shown { position: relative; margin: 0; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: #03050a; aspect-ratio: 16 / 10; }
.details-shown img, .details-shown video { width: 100%; height: 100%; object-fit: contain; }
.details-shown figcaption { position: absolute; left: 12px; bottom: 10px; right: 12px; width: fit-content; padding: 4px 10px; border-radius: 999px; background: rgba(4, 6, 12, .7); color: #c9d2e0; font-size: 12.5px; }
.details-thumbs { display: flex; gap: 10px; margin-top: 12px; padding: 2px 2px 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.details-thumbs button { flex: 0 0 auto; width: 84px; padding: 0; border: 2px solid transparent; border-radius: 10px; background: #03050a; overflow: hidden; cursor: pointer; aspect-ratio: 16 / 10; scroll-snap-align: start; }
@media (min-width: 721px) {
  /* On a wide window the pictures sit in rows of even length (home.js sets how many across). */
  .details-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); overflow: visible; }
  .details-thumbs button { width: auto; }
}
.details-thumbs button img { width: 100%; height: 100%; object-fit: cover; opacity: .72; transition: opacity .2s; }
.details-thumbs button:hover img, .details-thumbs button[aria-pressed="true"] img { opacity: 1; }
.details-thumbs button[aria-pressed="true"] { border-color: var(--accent, var(--brand)); }
.details-copy { min-width: 0; padding: 8px 8px 8px 0; }
.details h2 { font-size: clamp(28px, 3vw, 40px); padding-right: 40px; }
.details .points { margin-top: 22px; gap: 10px; }
.details .points li { font-size: 15.5px; line-height: 1.55; }
.details .note { margin: 14px 0 0; color: var(--dim); font-size: 13.5px; }

/* ---- the foot ---- */
footer { border-top: 1px solid var(--line); padding: 34px 0 44px; color: var(--dim); font-size: 14px; }
footer .wrap { display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); text-decoration: underline; }

/* ---- coming into view ---- */
.rise { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; transform: none; transition: none; }
  .tile, .card a, .card .cover img, .gallery img, .button { transition: none; }
  .details[open] { animation: none; }
}

/* ---- narrower windows ---- */
@media (max-width: 960px) {
  .feature-grid, .feature.flip .feature-grid { grid-template-columns: 1fr; gap: 36px; }
  .feature.flip .feature-media { order: 0; }
  .top nav { display: none; }
  .details-inner { grid-template-columns: 1fr; gap: 22px; padding: 18px; }
  .details-copy { padding: 0 4px 6px; }
  .facts { grid-template-columns: 1fr; max-width: 560px; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .top .wrap { gap: 14px; }
  .search { width: auto; flex: 1; min-width: 0; }
  .showcase { grid-template-columns: 1fr; }
  .hero { padding-top: 52px; }
  .feature { padding: 72px 0; }
  .search kbd { display: none; }
  .sort { margin-left: 0; }
  .details { width: calc(100% - 16px); max-height: calc(100% - 16px); border-radius: 18px; }
}
