/* Studio websites (etregame.com, studiolifeforms.com). Theme colors and fonts come from --vars set by
   render.js on <html>. Everything is in rem so big screens scale the whole page up (see the html rules),
   phones get one column, and nothing scrolls sideways. */

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
@media (min-width: 1900px) { html { font-size: 20px; } }   /* 1080p+ monitors */
@media (min-width: 2500px) { html { font-size: 26px; } }   /* 1440p / 4K at 150% */
@media (min-width: 3400px) { html { font-size: 34px; } }   /* 4K at 100% */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.45 var(--body-font); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
body.stars { background: transparent; }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; background: var(--bg); pointer-events: none; }
img, video { max-width: 100%; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: min(77.5rem, 100% - 2 * clamp(1rem, 5vw, 5.5rem)); margin-inline: auto; }
.wrap.full { width: calc(100% - 2 * clamp(.5rem, 1.4vw, 1.25rem)); }
.wrap.edge { width: 100%; }
.wrap.edge .media, .wrap.edge .frame, .wrap.edge .frame .media { border-radius: 0; }
.wrap.edge .frame { border: 0; }
.wrap.edge figcaption, .wrap.edge .caption { padding-inline: clamp(1rem, 5vw, 5.5rem); }
.wrap.narrow { width: min(66rem, 100% - 2 * clamp(1rem, 5vw, 5.5rem)); }
.wrap.mid { width: min(41.6rem, 100% - 2 * clamp(1rem, 5vw, 5.5rem)); }
.center { text-align: center; }
.left { text-align: left; }

/* ---------- menu ---------- */
.nav { padding: 1.6rem 0 1.1rem; position: relative; z-index: 10; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; }
.nav .links { display: flex; flex: 1; justify-content: space-between; gap: 2rem; }
.nav .l, .nav .r { display: flex; gap: 2.75rem; }
.nav a, .nav span { font: 400 1.375rem/1 var(--title-font); color: var(--navc); text-decoration: none; text-transform: uppercase; letter-spacing: .01em; }
.nav a:hover { color: var(--heading); }
.nav .menu { display: none; }
@media (max-width: 719px) {
  .nav { padding: 1rem 0; }
  .nav .menu { display: flex; flex-direction: column; justify-content: center; gap: 5px; margin-left: auto; width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer; }
  .nav .menu i { display: block; height: 2px; background: var(--navc); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .nav.open .menu i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .menu i:nth-child(2) { opacity: 0; }
  .nav.open .menu i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav .links { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; padding: .5rem clamp(1rem, 5vw, 5.5rem) 1.25rem; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); }
  .nav.open .links { display: flex; }
  .nav .l, .nav .r { flex-direction: column; gap: 0; }
  .nav .links a, .nav .links span { padding: .8rem 0; font-size: 1.25rem; }
}

/* ---------- sections ---------- */
.s { margin-top: 4.5rem; }
.s.gap-s { margin-top: .7rem; }
.s.gap-l { margin-top: 8rem; }
.s.gap-none { margin-top: 0; }
main { display: flex; flex-direction: column; } /* flex: space above and below add up instead of collapsing */
main > .s { min-width: 0; }
main > .s:first-child { margin-top: 0; }
@media (max-width: 719px) { .s { margin-top: 3rem; } .s.gap-l { margin-top: 5rem; } .s.gap-s { margin-top: .5rem; } }
/* exact spacing from the editor (px at laptop size; rem scales it on big screens, --gk shrinks it on phones) */
:root { --gk: 1; }
@media (max-width: 719px) { :root { --gk: .65; } }
.s.gt { margin-top: calc(var(--gt) * var(--gk) * .0625rem); }
.s.gb { margin-bottom: calc(var(--gb) * var(--gk) * .0625rem); }
main > .s.gt:first-child { margin-top: calc(var(--gt) * var(--gk) * .0625rem); }

.title { font: 400 clamp(1.6rem, 1rem + 2.7vw, 3rem)/1.14 var(--title-font); color: var(--heading); margin: 0 0 .5em; letter-spacing: .005em; overflow-wrap: break-word; }
h1.title { font-size: clamp(1.6rem, 1rem + 3vw, 3.25rem); }
.lead { font-size: clamp(1.1rem, .95rem + .55vw, 1.4rem); line-height: 1.35; color: var(--ink); }
.body { font-size: clamp(1.05rem, .92rem + .45vw, 1.375rem); line-height: 1.4; color: var(--ink); }
.lead p, .body p { margin: 0 0 1.1em; }
.lead p:last-child, .body p:last-child { margin-bottom: 0; }
.body strong, .lead strong { color: color-mix(in srgb, var(--ink) 55%, #fff); font-weight: 700; }
.lead + .btn, .title + .btn { margin-top: 1.4rem; }
.center .lead, .center .body { margin-inline: auto; }
.s-text .lead { color: var(--quiet); }

.btn { display: inline-block; margin-top: 2rem; padding: .62em 3.4em; border-radius: .5rem; background: var(--accent); color: var(--btn-ink); font: 400 1.1rem/1.1 var(--title-font); text-decoration: none; border: 2px solid var(--accent); transition: filter .15s, transform .15s; }
a.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn.outline { background: transparent; color: var(--accent); }
.btn.small { padding: .55em 2em; font-size: 1rem; margin-top: 1.4rem; }
.btnrow { display: flex; flex-wrap: wrap; gap: .8rem 1rem; justify-content: center; }
.btnrow .btn { margin-top: 0; }

.media { display: block; width: 100%; height: auto; border-radius: var(--radius); background: color-mix(in srgb, var(--bg) 70%, #000); object-fit: cover; }
.s-banner .media { background: transparent; border-radius: 0; }
.s-banner a { display: block; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; opacity: .9; }
.logo { margin: 2.6rem auto 2.4rem; width: min(15.6rem, 60%); }
.left .logo { margin-left: 0; }
.logo .media { border-radius: 0; background: transparent; }
.s-text .logo + .body { color: var(--quiet); }

.grid { display: grid; gap: .7rem; }
.grid.c2, .grid.c3 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid.c2 { grid-template-columns: 1fr 1fr; } .grid.c3 { grid-template-columns: repeat(3, 1fr); } }
.grid figure { margin: 0; }
figcaption, .caption { color: var(--quiet); font-size: .95rem; margin: .6rem 0 0; text-align: center; }

/* video: YouTube plays only after a click (no Google requests before that) */
.frame { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 25%, transparent); background: #000; }
.frame .media { border-radius: 0; }
.yt { all: unset; display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; cursor: pointer; }
.yt .media { position: absolute; inset: 0; width: 100%; height: 100%; }
.yt .play { position: absolute; left: 50%; top: 50%; width: 4.4rem; height: 3.1rem; transform: translate(-50%, -50%); border-radius: .9rem; background: rgba(20, 20, 24, .82); transition: background .15s, transform .15s; }
.yt .play::after { content: ''; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%); border-style: solid; border-width: .62rem 0 .62rem 1.05rem; border-color: transparent transparent transparent #fff; }
.yt:hover .play, .yt:focus-visible .play { background: var(--accent); transform: translate(-50%, -50%) scale(1.06); }
.yt:hover .play::after, .yt:focus-visible .play::after { border-left-color: var(--btn-ink); }
.frame iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }

/* feature rows: picture | text, alternating; one column on phones */
.feature { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
.feature .fm .media { aspect-ratio: 1 / 1 !important; }
.feature .ft { padding: 2rem 4% 2rem 25%; }
.feature.flip .fm { order: 2; }
.feature.flip .ft { order: 1; padding: 2rem 8% 2rem 24%; }
.feature .ft .title, .feature .ft .body { max-width: 11.5rem; }
.feature .ft .title { max-width: 6.6em; }
.feature .title { font-size: clamp(1.9rem, 1rem + 2.6vw, 3.1rem); line-height: 1.17; }
.feature .body { font-size: clamp(1rem, .9rem + .3vw, 1.125rem); line-height: 1.33; max-width: 19.5em !important; }
.feature .body p { margin-bottom: 1.4em; }
@media (max-width: 819px) {
  .feature { grid-template-columns: 1fr; margin-bottom: 2.5rem; }
  .feature .fm, .feature.flip .fm { order: 0; }
  .feature .ft, .feature.flip .ft { order: 1; padding: 1.4rem 0 0; }
  .feature .body, .feature .ft .title { max-width: none !important; }
  .feature .fm .media { aspect-ratio: auto !important; }
}

/* ---------- footer ---------- */
.foot { padding: 2.2rem 0 4rem; }
.foot .cols { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem 2.6rem; }
.foot .col { display: flex; flex-direction: column; gap: .35rem; min-width: 6.5rem; }
.foot h4 { margin: 0 0 .25rem; font: 600 1rem/1.3 var(--body-font); color: #fff; }
.foot a, .foot span { font-size: 1rem; line-height: 1.4; text-decoration: none; }
.foot a { color: var(--accent); font-weight: 600; }
.foot a:hover { text-decoration: underline; }
.foot span { color: var(--quiet); }
.foot .note { margin-top: 2rem; text-align: center; color: var(--quiet); font-size: .9rem; }
@media (max-width: 479px) { .foot .cols { justify-content: flex-start; } .foot .col { min-width: 40%; } }

/* ---------- phone layer: per-section phone tweaks from the editor (section.phone) ---------- */
@media (min-width: 720px) { .s.only-phone { display: none !important; } }
@media (max-width: 719px) {
  .s.only-desktop, .s.ph-hide { display: none !important; }
  .s.pgt { margin-top: calc(var(--pgt) * .0625rem) !important; }
  .s.pgb { margin-bottom: calc(var(--pgb) * .0625rem) !important; }
  .s.pw-wide .wrap, .s.pw-narrow .wrap { width: calc(100% - 2 * clamp(1rem, 5vw, 5.5rem)); }
  .s.pw-full .wrap { width: calc(100% - 2 * clamp(.5rem, 1.4vw, 1.25rem)); }
  .s.pw-edge .wrap { width: 100%; }
  .s.pw-wide .media, .s.pw-narrow .media, .s.pw-full .media, .s.pw-wide .frame, .s.pw-narrow .frame, .s.pw-full .frame { border-radius: var(--radius); }
  .s.s-banner.pw-wide .media, .s.s-banner.pw-narrow .media, .s.s-banner.pw-full .media { border-radius: 0; }
  .s.pw-edge .media, .s.pw-edge .frame, .s.pw-edge .frame .media { border-radius: 0; }
  .s.pw-edge .frame { border: 0; }
  .s.pc-1 .grid { grid-template-columns: 1fr; }
  .s.pc-2 .grid { grid-template-columns: 1fr 1fr; }
  .s.pc-3 .grid { grid-template-columns: repeat(3, 1fr); }
  .s.pa-left .wrap { text-align: left; }
  .s.pa-left .lead, .s.pa-left .body, .s.pa-left .logo { margin-left: 0; }
  .s.pa-center .wrap { text-align: center; }
  .s.pa-center .lead, .s.pa-center .body, .s.pa-center .logo { margin-inline: auto; }
  .s.ptp .title { font-size: calc(var(--ptp) * .0625rem) !important; }
  .s.pcrop .media { aspect-ratio: var(--pcr) !important; height: auto; object-fit: cover; object-position: var(--pfx, 50%) 50%; }
  .s.pcrop .yt { aspect-ratio: var(--pcr); }
  .s.pf-tf .feature .ft { order: 0 !important; padding: 0 0 1.2rem !important; }
  .s.pf-tf .feature .fm { order: 1 !important; }
}

/* editor preview: outline the section being edited */
body.preview .s { cursor: pointer; }
body.preview .s:hover { outline: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 6px; }
body.preview .s.picked { outline: 2px solid var(--accent); outline-offset: 6px; }

/* editor preview: drag handles for spacing and order */
.edit-h { position: absolute; left: 0; right: 0; z-index: 50; pointer-events: auto; }
.edit-h.sp { height: 14px; cursor: ns-resize; display: flex; align-items: center; justify-content: center; }
.edit-h.sp::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--accent); opacity: .9; }
.edit-h.sp span { position: relative; font: 700 13px/1 system-ui, sans-serif; background: var(--accent); color: #0b0d10; padding: 3px 7px; border-radius: 9px; white-space: nowrap; }
.edit-zone { position: absolute; left: 0; right: 0; z-index: 49; pointer-events: none; background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--accent) 22%, transparent) 0 6px, transparent 6px 12px); }
.edit-grip { position: absolute; z-index: 51; cursor: grab; font: 700 14px/1 system-ui, sans-serif; background: var(--accent); color: #0b0d10; padding: 6px 10px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.4); user-select: none; }
.edit-grip:active { cursor: grabbing; }
.edit-drop { position: absolute; left: 0; right: 0; height: 4px; z-index: 52; background: #ffd27a; box-shadow: 0 0 0 2px rgba(0,0,0,.4); pointer-events: none; }
body.dragging, body.dragging * { cursor: ns-resize !important; user-select: none !important; }
body.moving, body.moving * { cursor: grabbing !important; user-select: none !important; }

/* grids with one picture shape: cropped to fill, rows line up */
.grid.uni .media { aspect-ratio: var(--gar) !important; height: auto; object-fit: cover; }

/* inner space set in the editor: replaces the section's built-in top/bottom padding */
.s.ipt { padding-top: calc(var(--ipt) * var(--gk) * .0625rem); }
.s.ipb { padding-bottom: calc(var(--ipb) * var(--gk) * .0625rem); }
.s.ipt .slabel, .s.ipt .statement, .s.ipt.s-project > .wrap { padding-top: 0 !important; }
.s.ipb .statement, .s.ipb > .wrap, .s.ipb .foot { padding-bottom: 0 !important; }
@media (max-width: 719px) {
  .s.pipt { padding-top: calc(var(--pipt) * .0625rem) !important; }
  .s.pipb { padding-bottom: calc(var(--pipb) * .0625rem) !important; }
  .s.pipt .slabel, .s.pipt .statement, .s.pipt.s-project > .wrap { padding-top: 0 !important; }
  .s.pipb .statement, .s.pipb > .wrap { padding-bottom: 0 !important; }
}
.edit-h.sp.in::before { background: #6cc4ff; height: 0; border-top: 2px dashed #6cc4ff; }
.edit-h.sp.in span { background: #6cc4ff; }
.edit-zone.in { background: repeating-linear-gradient(-45deg, rgba(108,196,255,.22) 0 6px, transparent 6px 12px); }

/* ======================= motion (theme.motion) ======================= */
.motion .s.rv { opacity: 0; transform: translateY(1.8rem); transition: opacity .8s, transform .8s cubic-bezier(.2, .8, .2, 1); }
.motion .s.rv.in { opacity: 1; transform: none; }
/* titles glitch in: slices + chromatic split together (never a lone effect) */
.motion .s.rv.in:not(.noanim) .title { animation: glitchin .9s steps(1, end) both; }
@keyframes glitchin {
  0%   { clip-path: inset(0 0 100% 0); text-shadow: none; transform: translateX(0); }
  8%   { clip-path: inset(12% 0 58% 0); text-shadow: -.08em 0 #ff2e88, .08em 0 #2ef2ff; transform: translateX(-.06em); }
  16%  { clip-path: inset(62% 0 8% 0); text-shadow: .1em 0 #ff2e88, -.1em 0 #2ef2ff; transform: translateX(.08em); }
  24%  { clip-path: inset(30% 0 40% 0); text-shadow: -.05em 0 #ff2e88, .05em 0 #2ef2ff; transform: translateX(-.03em); }
  34%  { clip-path: inset(0 0 0 0); text-shadow: .06em 0 #ff2e88, -.06em 0 #2ef2ff; transform: translateX(.04em); }
  46%  { clip-path: inset(44% 0 30% 0); text-shadow: -.04em 0 #ff2e88, .04em 0 #2ef2ff; transform: translateX(0); }
  58%  { clip-path: inset(0 0 0 0); text-shadow: .03em 0 #ff2e88, -.03em 0 #2ef2ff; }
  72%  { text-shadow: -.015em 0 #ff2e88, .015em 0 #2ef2ff; }
  100% { clip-path: inset(0 0 0 0); text-shadow: none; transform: none; }
}
/* buttons breathe a soft glow */
.motion .btn { animation: glow 2.8s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); } 50% { box-shadow: 0 0 1.4rem .15rem color-mix(in srgb, var(--accent) 55%, transparent); } }

/* hero wordmark options */
.hero-box.center .hero-in { top: 50%; bottom: auto; transform: translateY(-50%); }
.hero-box.center .hero-in .mark { margin-inline: auto; }
.hero-box.blend-screen .mark { mix-blend-mode: screen; filter: none; }
.hero-box.blend-lighten .mark { mix-blend-mode: lighten; filter: none; }

/* Wishlist bar: appears after the first screen; top-right pill on desktop, bottom bar on phones */
.ctabar { position: fixed; z-index: 40; right: clamp(1rem, 3vw, 2.5rem); top: 1.1rem; display: inline-flex; align-items: center; gap: .6em; padding: .7em 1.4em; border-radius: 99px; background: var(--accent); color: var(--btn-ink); font: 400 1rem/1 var(--title-font); text-decoration: none; box-shadow: 0 .6rem 2rem rgba(0, 0, 0, .45); transform: translateY(-160%); opacity: 0; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
.ctabar::before { content: ''; width: .55em; height: .55em; border-radius: 50%; background: currentColor; animation: blinkdot 1.6s ease-in-out infinite; }
@keyframes blinkdot { 50% { opacity: .25; } }
body.cta-on .ctabar { transform: none; opacity: 1; }
.ctabar:hover { filter: brightness(1.1); }
@media (max-width: 719px) {
  .ctabar { left: 0; right: 0; top: auto; bottom: 0; border-radius: 0; justify-content: center; padding: 1em 1em calc(1em + env(safe-area-inset-bottom)); transform: translateY(110%); }
  body.cta-on main, body.cta-on .foot { padding-bottom: 3.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .motion .s.rv { opacity: 1 !important; transform: none !important; }
  .motion .s.rv.in .title, .motion .btn, .ctabar::before { animation: none !important; }
}
