/* SquareByte home page */
@font-face {
  font-family: "DM Sans";
  src: url("fonts/dmsans-var.woff") format("woff");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --paper: #f7f9fc;
  --ink: #16163a;
  --ink-2: #44476a;
  --ink-3: #6b6f8f;
  --line: #e3e8f2;
  --sky: #8fd3ff;
  --sky-2: #5ebff2;
  --lav: #6c4de6;
  --lav-2: #a58cff;
  --lav-50: #f4f1ff;
}

* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: var(--lav); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 8px; }
img, svg { display: block; max-width: 100%; }

/* ---------- full-screen stage ---------- */
.stage {
  position: relative; overflow: hidden;
  height: calc(100svh - 92px); min-height: 560px; max-height: 1040px;
  margin: 0 clamp(0px, 1.4vw, 20px);
  border-radius: clamp(0px, 2vw, 28px);
  background:
    radial-gradient(90% 70% at 70% 0%, #dcf0ff 0%, rgba(220, 240, 255, 0) 65%),
    linear-gradient(#eef7ff, #f6f9fd);
}
.stage::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(to right, rgba(31, 143, 207, .06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(31, 143, 207, .06) 1px, transparent 1px);
  background-size: 48px 48px;
}
.scene { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }
.stage-fallback { position: absolute; z-index: 1; left: 14%; top: 50%; width: min(24%, 240px); height: auto; transform: translateY(-50%); }
.js .stage-fallback { display: none; }

/* the text panel that arrives at the end */
.finale {
  position: absolute; z-index: 2;
  right: clamp(24px, 6vw, 96px); top: 50%; transform: translateY(-50%);
  width: min(540px, 46%);
}
.js .finale > * { opacity: 0; transform: translateY(14px); }
.finale.on > * { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .3, 1); }
.finale.on > :nth-child(1) { transition-delay: 0s; }
.finale.on > :nth-child(2) { transition-delay: .35s; }
.finale.on > :nth-child(3) { transition-delay: .5s; }
.finale.on > :nth-child(4) { transition-delay: .65s; }
.finale.instant > * { transition: none !important; }

.wordmark { margin: 0 0 22px; display: flex; flex-direction: column; gap: 8px; }
.wm-name { display: flex; font-size: clamp(2.2rem, 4.4vw, 3.6rem); font-weight: 640; letter-spacing: -0.035em; color: var(--ink); line-height: 1; }
.wm-name i { position: relative; font-style: normal; display: inline-block; }
.wm-name i:nth-child(n+7) { color: var(--lav); }
.wm-sub { font-size: clamp(.74rem, 1.1vw, .9rem); font-weight: 560; text-transform: uppercase; letter-spacing: .34em; color: var(--lav); }
.js .wm-name i { opacity: 0; transform: translateY(.35em); }
.js .wm-sub { opacity: 0; }
.js .wm-name i::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: .42em; height: .42em; margin: -.21em 0 0 -.21em;
  border-radius: .08em; background: var(--lav-2); transform: scale(0);
}
.finale.on .wm-name i { animation: letter-in .7s cubic-bezier(.2, .9, .3, 1.2) forwards; }
.finale.on .wm-name i::after { animation: letter-square .7s ease forwards; }
.finale.on .wm-sub { animation: sub-in .9s ease forwards .6s; }
.finale.instant .wm-name i, .finale.instant .wm-sub { animation: none; opacity: 1; transform: none; letter-spacing: .34em; }
.finale.instant .wm-name i { letter-spacing: normal; }
.finale.instant .wm-name i::after { display: none; }
.wm-name i:nth-child(2), .wm-name i:nth-child(2)::after { animation-delay: .05s !important; }
.wm-name i:nth-child(3), .wm-name i:nth-child(3)::after { animation-delay: .10s !important; }
.wm-name i:nth-child(4), .wm-name i:nth-child(4)::after { animation-delay: .15s !important; }
.wm-name i:nth-child(5), .wm-name i:nth-child(5)::after { animation-delay: .20s !important; }
.wm-name i:nth-child(6), .wm-name i:nth-child(6)::after { animation-delay: .25s !important; }
.wm-name i:nth-child(7), .wm-name i:nth-child(7)::after { animation-delay: .34s !important; }
.wm-name i:nth-child(8), .wm-name i:nth-child(8)::after { animation-delay: .39s !important; }
.wm-name i:nth-child(9), .wm-name i:nth-child(9)::after { animation-delay: .44s !important; }
.wm-name i:nth-child(10), .wm-name i:nth-child(10)::after { animation-delay: .49s !important; }
@keyframes letter-in {
  0% { opacity: 0; transform: translateY(.35em); color: transparent; }
  45% { opacity: 1; color: transparent; }
  100% { opacity: 1; transform: none; }
}
@keyframes letter-square {
  0% { transform: scale(0) rotate(0); }
  40% { transform: scale(1) rotate(45deg); }
  100% { transform: scale(0) rotate(90deg); }
}
@keyframes sub-in { from { opacity: 0; letter-spacing: .9em; } to { opacity: 1; letter-spacing: .34em; } }

h1 {
  margin: 0; color: var(--ink);
  font-size: clamp(1.9rem, 3.3vw, 2.9rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 640;
  text-wrap: balance;
}
.lede { margin: 18px 0 28px; font-size: clamp(1rem, 1.25vw, 1.12rem); max-width: 34em; }

.cta {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 12px 22px 12px 12px; border-radius: 16px;
  background: var(--ink); color: #fff; text-decoration: none;
  box-shadow: 0 18px 40px -18px rgba(22, 22, 58, .55);
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), background-color .25s ease;
}
.cta:hover { color: #fff; background: #23235a; transform: translateY(-2px); }
.cta-hop { position: relative; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .08); flex: none; }
.cta-hop i { position: absolute; left: 13px; bottom: 11px; width: 18px; height: 18px; border-radius: 5px; background: var(--sky); box-shadow: inset -5px 0 0 var(--sky-2); }
.cta:hover .cta-hop i { animation: mini-hop .55s cubic-bezier(.3, .7, .4, 1) infinite; }
@keyframes mini-hop { 0%, 100% { transform: translateY(0) scale(1.1, .9); } 45% { transform: translateY(-13px) scale(.95, 1.06); } }
.cta-text { display: flex; flex-direction: column; font-size: 1.12rem; font-weight: 640; line-height: 1.2; }
.cta-text small { font-size: .9rem; font-weight: 450; color: #b9bbdc; margin-top: 3px; }
.cta-arrow { font-size: 1.35rem; margin-left: 4px; transition: transform .25s ease; }
.cta:hover .cta-arrow { transform: translateX(4px); }

.controls { position: absolute; z-index: 3; right: 18px; bottom: 18px; display: flex; gap: 8px; }
.ctl {
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink);
  background: rgba(255, 255, 255, .88); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; min-height: 40px; cursor: pointer;
}
.ctl:hover { background: #fff; }
.ctl[hidden] { display: none; }
.no-anim .controls { display: none; }
#byte { cursor: pointer; }

/* portrait screens: logo up top, text below */
@media (max-aspect-ratio: 1/1), (max-width: 820px) {
  .stage { height: auto; min-height: calc(100svh - 92px); max-height: none; display: flex; flex-direction: column; justify-content: flex-end; }
  .scene { height: 100%; }
  .finale { position: relative; right: auto; top: auto; transform: none; width: auto; margin: 46vh 22px 76px; }
  .stage-fallback { left: 50%; top: 22vh; width: 30%; transform: translate(-50%, -50%); }
  .controls { left: 18px; right: auto; }
}

/* ---------- picks ---------- */
.picks { width: min(100% - 40px, 1180px); margin: 0 auto; padding: clamp(56px, 7vw, 96px) 0 0; }
.yc-gap { height: clamp(40px, 6vw, 72px); }
.picks h2 { margin: 0; color: var(--ink); font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -0.03em; line-height: 1.1; font-weight: 640; }
.picks > p { margin: 10px 0 24px; color: var(--ink-3); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.chips a {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 12px 20px; border-radius: 14px; background: #fff; border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 560;
  transition: border-color .2s ease, transform .2s cubic-bezier(.3, 1.6, .5, 1), background-color .2s ease;
}
.chips a::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--lav-2); transition: transform .3s ease, background-color .3s ease; }
.chips a:hover { border-color: var(--lav-2); background: var(--lav-50); transform: translateY(-2px); }
.chips a:hover::before { transform: rotate(45deg); background: var(--sky-2); }

.promise {
  width: min(100% - 40px, 1180px); margin: clamp(40px, 6vw, 72px) auto 0;
  padding: clamp(24px, 3vw, 36px); border-radius: 24px; background: #fff; border: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px;
}
.promise ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 28px; flex: 1 1 720px; }
.promise li { font-size: .97rem; color: var(--ink-3); line-height: 1.45; }
.promise b { display: block; color: var(--ink); font-weight: 620; margin-bottom: 2px; }
.more { font-weight: 600; text-decoration: none; white-space: nowrap; }
@media (max-width: 900px) { .promise ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .promise ul { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { .cta:hover .cta-hop i { animation: none; } }

/* ---------- help blocks ---------- */
.helpgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.help {
  position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 20px 22px 20px 64px; border-radius: 18px; background: #fff; border: 1px solid var(--line);
  color: var(--ink-2); text-decoration: none;
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), border-color .2s ease, box-shadow .25s ease;
}
.help i { position: absolute; left: 20px; top: 22px; width: 26px; height: 26px; border-radius: 8px; background: var(--lav-2); box-shadow: inset -7px 0 0 var(--lav); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.help.sky i { background: var(--sky); box-shadow: inset -7px 0 0 var(--sky-2); }
.help.ink i { background: var(--ink); box-shadow: inset -7px 0 0 #2d2d6b; }
.help b { color: var(--ink); font-weight: 620; font-size: 1.05rem; line-height: 1.3; }
.help span { font-size: .95rem; color: var(--ink-3); line-height: 1.45; }
.help:hover { color: var(--ink-2); transform: translateY(-3px); border-color: var(--lav-2); box-shadow: 0 18px 40px -26px rgba(108, 77, 230, .5); }
.help.sky:hover { border-color: var(--sky-2); box-shadow: 0 18px 40px -26px rgba(31, 143, 207, .5); }
.help:hover i { transform: translateY(-5px) rotate(-8deg); }
@media (max-width: 900px) { .helpgrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .helpgrid { grid-template-columns: 1fr; } }

.helpgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1060px) { .helpgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .helpgrid { grid-template-columns: 1fr; } }

/* help blocks: white with cube icons */
.help { background: #fff; border: 1px solid #e6e0ff; }
.help i { width: 30px; height: 34px; border-radius: 0; box-shadow: none; background: url("img/cube-lav.svg") center / contain no-repeat; top: 20px; }
.help.sky i { background-image: url("img/cube-sky.svg"); box-shadow: none; }
.help.ink i { background-image: url("img/cube-ink.svg"); box-shadow: none; }
.help.sky:hover { border-color: var(--sky-2); }
.help.ink { background: var(--ink); border-color: var(--ink); }
.help.ink b { color: #fff; } .help.ink span { color: #c9cbe4; }
.help { padding: 0 0 18px; overflow: hidden; gap: 0; }
.help i { display: none; }
.help b { display: block; padding: 14px 20px; margin-bottom: 10px; background: var(--lav-100); font-weight: 700; transition: background-color .2s ease; }
.help span { padding: 0 20px; }
.help:hover b { background: #ded5ff; }
.help.sky:hover { border-color: var(--lav-2); box-shadow: 0 18px 40px -26px rgba(108, 77, 230, .5); }
.help.ink b { background: rgba(255, 255, 255, .1); color: #fff; }
.help.ink:hover b { background: rgba(255, 255, 255, .16); }
.picks { padding: clamp(28px, 4vw, 56px); margin-top: clamp(48px, 6vw, 80px); }
:root { --paper: #E3F1FC; --ink-3: #555a7c; }
.stage { background: radial-gradient(90% 70% at 70% 0%, #ffffff 0%, rgba(255, 255, 255, 0) 65%), linear-gradient(#f3f9fe, #eaf5fd); border: 1px solid #d3e5f5; }
.promise { border-color: #d9e8f7; }
:root { --paper: #C4E0F6; --ink-3: #4a4e70; }
.stage { border-color: #b3d2ec; }
.promise { border-color: #b9d6ee; }
.picks-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.picks-head p { margin: 10px 0 0; }
.see-all-btn { display: inline-flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: 14px; background: var(--lav); color: #fff; font-weight: 640; text-decoration: none; box-shadow: 0 14px 30px -16px rgba(108, 77, 230, .8); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), background-color .2s ease; }
.see-all-btn i { font-style: normal; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(255, 255, 255, .18); transition: transform .25s ease; }
.see-all-btn:hover { color: #fff; background: #5536c9; transform: translateY(-2px); }
.see-all-btn:hover i { transform: translateX(4px); }
.finale-link { display: inline-block; margin: 16px 0 0 6px; font-weight: 620; color: #4f35c8; }
.js .finale > .finale-link { opacity: 0; }
.finale.on > .finale-link { opacity: 1; transition: opacity .7s ease .85s; }
.finale.instant > .finale-link { opacity: 1; }
/* "Something else": brand colours with an accent */
.help.ink { background: #fff; border: 2px dashed var(--lav-2); }
.help.ink b { background: linear-gradient(90deg, var(--lav-100), #d6efff); color: var(--ink); }
.help.ink span { color: var(--ink-3); }
.help.ink b::after { content: " ✦"; color: var(--lav); }
.help.ink:hover { border-style: solid; border-color: var(--lav); }
.help.ink:hover b { background: linear-gradient(90deg, #ded5ff, #c4e6ff); }

/* consultation button: brand lavender, clean */
.cta { gap: 14px; padding: 16px 18px 16px 24px; border-radius: 16px; background: linear-gradient(135deg, #6C4DE6 0%, #7D5FF0 100%); box-shadow: 0 16px 34px -16px rgba(108, 77, 230, .75), inset 0 1px 0 rgba(255, 255, 255, .25); }
.cta:hover { background: linear-gradient(135deg, #5a3fd6 0%, #6C4DE6 100%); }
.cta-hop { display: none; }
.cta-text { font-size: 1.12rem; }
.cta-text small { color: #E4DEFF; }
.cta-arrow { display: grid; place-items: center; width: 38px; height: 38px; margin-left: 6px; border-radius: 11px; background: rgba(255, 255, 255, .18); font-size: 1.15rem; }
.finale-link { color: #4f35c8; }
