/* BKYMZ: the studio as a tabletop. Five dice spell the name; each product section wears its own colors. */

:root {
  --violet: #481fff;      /* the hero table, borrowed from Vanilla */
  --violet-deep: #3510d6;
  --magenta: #ff1fb4;
  --ink: #1c1442;
  --chalk: #f5f4fb;
  --blush: #f4d9d4;       /* Investour's board */
  --blush-deep: #e9bdb5;
  --cocoa: #5b2f25;
  --die: #fdfcf8;
  --die-shade: #e4e1ee;

  --display: "Dela Gothic One", "Arial Black", system-ui, sans-serif;
  --text: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Perfect-fourth scale on an 18px body */
  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: 1.5rem;
  --step-2: 2rem;
  --step-3: clamp(2.25rem, 4.6vw, 3.55rem);

  --gutter: clamp(16px, 4vw, 40px);
  --radius-s: 10px;
  --radius-l: 22px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

:focus-visible {
  outline: 3px solid var(--magenta);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  background: var(--chalk); color: var(--ink); padding: 10px 14px; border-radius: var(--radius-s);
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 16px; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px;
  font: 700 1rem/1 var(--text);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-light { background: var(--die); color: var(--ink); }
.btn-light:hover { background: #fff; }
.btn-ghost { background: transparent; color: var(--die); border-color: rgb(255 255 255 / 0.55); }
.btn-ghost:hover { border-color: var(--die); background: rgb(255 255 255 / 0.08); }

/* ---------- Hero: the table ---------- */

.hero {
  position: relative;
  background:
    radial-gradient(120% 70% at 50% 58%, #5a33ff 0%, var(--violet) 45%, var(--violet-deep) 100%);
  color: var(--die);
  min-height: min(100svh, 980px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 22px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 400 1.25rem/1 var(--display);
  letter-spacing: 0.02em;
  text-decoration: none;
}
.brand-pips { width: 30px; height: 30px; }
.brand-pips rect { fill: var(--die); }
.brand-pips circle { fill: var(--violet); }

.nav-links { display: flex; gap: clamp(14px, 3vw, 32px); }
.nav-links a {
  font-weight: 600; font-size: 1rem; text-decoration: none;
  padding-block: 6px;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { border-bottom-color: currentColor; }

.hero-body {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  gap: clamp(36px, 6vw, 64px);
  padding-block: clamp(24px, 5vw, 56px) clamp(56px, 8vw, 96px);
}

/* Dice */

.table { margin: 0; }

.dice {
  --s: clamp(46px, 13.5vw, 160px);
  display: flex;
  justify-content: flex-start;
  gap: clamp(10px, 3vw, 44px);
  padding-left: calc(var(--s) * 0.2);
  perspective: 1600px;
  min-height: calc(var(--s) * 1.35);
  align-items: center;
  padding-top: calc(var(--s) * 0.1);
  max-width: 100%;
}

/* With JS on, the box keeps one height for both renderers so nothing jumps */
.js .dice { aspect-ratio: 10 / 2.7; min-height: 100px; }
.js .die-fallback { visibility: hidden; }
.dice.is-3d { display: block; position: relative; padding: 0; perspective: none; }
.dice.is-3d canvas { position: absolute; left: 0; pointer-events: none; }

.die-fallback {
  width: var(--s); height: var(--s);
  display: grid; place-items: center;
  background: var(--die); color: var(--ink);
  border-radius: 18%;
  font: 400 calc(var(--s) * 0.56)/1 var(--display);
}

.die-slot {
  position: relative;
  width: var(--s); height: var(--s);
  transform-style: preserve-3d;
  transform: translateY(var(--lift, 0)) rotateZ(var(--tilt, 0deg));
  transition: transform 1.3s cubic-bezier(.25, 1.35, .45, 1);
  cursor: pointer;
}
/* Shadow on the felt */
.die-slot::after {
  content: "";
  position: absolute; left: 6%; right: 6%; bottom: calc(var(--s) * -0.16);
  height: calc(var(--s) * 0.18);
  background: radial-gradient(closest-side, rgb(20 0 90 / 0.45), transparent);
  transform: translateZ(calc(var(--s) * -0.6));
  pointer-events: none;
}

.die {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform var(--dur, 1.4s) cubic-bezier(.15, .75, .25, 1);
}

.face {
  position: absolute; inset: -0.5px; /* overlap neighbouring faces so no seam shows along the edges */
  border-radius: 17%;
  backface-visibility: hidden;
  background:
    radial-gradient(130% 130% at 30% 22%, #fff 0%, var(--die) 45%, var(--die-shade) 100%);
  box-shadow: inset 0 0 0 1px rgb(28 20 66 / 0.06), inset 0 -6px 14px rgb(28 20 66 / 0.08);
}
/* Triangles that close the holes where three rounded face corners meet (placed in main.js) */
.corner {
  position: absolute; left: 50%; top: 50%;
  width: var(--s); height: var(--s);
  transform-origin: 0 0;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  background: var(--die-shade);
}

.f-front  { transform: translateZ(calc(var(--s) / 2)); }
.f-back   { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.f-right  { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.f-left   { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.f-top    { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.f-bottom { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }

.f-front {
  display: grid; place-items: center;
  color: var(--ink);
  font: 400 calc(var(--s) * 0.56)/1 var(--display);
  padding-bottom: 4%;
}

.pips {
  position: absolute; inset: 16%;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
}
.pips i {
  width: 62%; aspect-ratio: 1; margin: auto;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3b2f7a, var(--ink));
}
/* pip positions on a 3×3 grid */
.p-tl { grid-area: 1 / 1; } .p-tr { grid-area: 1 / 3; }
.p-ml { grid-area: 2 / 1; } .p-c  { grid-area: 2 / 2; } .p-mr { grid-area: 2 / 3; }
.p-bl { grid-area: 3 / 1; } .p-br { grid-area: 3 / 3; }

.hero-copy {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 28px 48px;
}
.lede {
  max-width: 34ch;
  font-size: clamp(1.25rem, 2.4vw, var(--step-2));
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Products ---------- */

.product { padding-block: clamp(72px, 11vw, 140px); }

.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 96px);
  align-items: center;
}
.product-grid.flip .product-copy { order: 2; }

.product-copy { max-width: 560px; }

.product-head { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.app-icon {
  width: 72px; height: 72px; border-radius: 18px; flex: none;
  box-shadow: 0 0 0 1px rgb(28 20 66 / 0.08);
}
.product h2 {
  font: 400 var(--step-3)/1 var(--display);
  letter-spacing: -0.01em;
}
.product-lede {
  font-size: clamp(1.125rem, 1.7vw, 1.3rem);
  line-height: 1.5;
  max-width: 44ch;
  text-wrap: pretty;
}

.facts {
  display: flex; flex-wrap: wrap; gap: 14px 40px;
  margin-block: 32px;
}
.facts div { display: flex; flex-direction: column-reverse; }
.facts dd { font: 400 var(--step-2)/1.1 var(--display); }
.facts dt { font-size: var(--step--1); font-weight: 600; opacity: 0.75; margin-top: 4px; }

.features { display: grid; gap: 12px; margin-bottom: 36px; max-width: 48ch; }
.features li { padding-left: 22px; position: relative; font-size: 1.0625rem; }
.features li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 9px; height: 9px; border-radius: 3px;
  background: var(--accent);
}

/* Deed card: the "where to get it" list, styled like a property card */
.deed {
  max-width: 440px;
  border: 2px solid var(--deed-line);
  border-radius: var(--radius-s);
  background: var(--deed-bg);
  overflow: hidden;
}
.deed-band {
  background: var(--deed-band);
  color: var(--deed-band-text);
  font: 400 1.0625rem/1 var(--display);
  padding: 14px 18px;
  text-align: center;
}
.deed-rows li + li { border-top: 1px dashed var(--deed-line); }
.deed-rows a, .deed-rows .is-soon {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 18px;
  text-decoration: none;
}
.deed-rows a:hover { background: var(--deed-hover); }
.deed-rows a:hover .deed-store { text-decoration: underline; text-underline-offset: 3px; }
.deed-platform { font-weight: 700; }
.deed-store { text-align: right; font-weight: 500; }
.deed-rows a .deed-store { color: var(--accent-text); }
.is-soon { opacity: 0.6; }

/* Vanilla */
.vanilla {
  --accent: linear-gradient(135deg, var(--magenta), var(--violet));
  --accent-text: var(--violet);
  --deed-line: var(--ink);
  --deed-bg: #fff;
  --deed-band: linear-gradient(100deg, var(--magenta), var(--violet) 80%);
  --deed-band-text: #fff;
  --deed-hover: #f3efff;
  background: #fff;
}

.phone {
  justify-self: center;
  width: min(340px, 100%);
  aspect-ratio: 9 / 17.5;
  padding: 12px;
  border-radius: 46px;
  background: var(--ink);
  box-shadow: 0 40px 80px -30px rgb(72 31 255 / 0.45);
  transform: rotate(3deg);
}
.phone-screen {
  height: 100%;
  border-radius: 36px;
  background: #f7f6fb;
  display: flex; flex-direction: column;
  overflow: hidden;
  font-size: 0.9375rem;
}
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 40px 18px 14px;
  background: #fff;
  border-bottom: 1px solid #ebe8f4;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #ffb36b, var(--magenta));
}
.chat-name { font-weight: 700; display: flex; flex-direction: column; line-height: 1.2; }
.chat-name small { font-weight: 500; font-size: 0.8125rem; color: #6c6690; }
.chat-video { width: 24px; height: 24px; margin-left: auto; fill: var(--violet); }

.chat { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 18px 14px; justify-content: flex-end; }
.chat-day { align-self: center; font-size: 0.75rem; font-weight: 600; color: #8a84ad; margin-bottom: 4px; }
.msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.35;
}
.msg.in { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 1px 0 #e7e3f2; }
.msg.out {
  align-self: flex-end; color: #fff; border-bottom-right-radius: 6px;
  background: linear-gradient(120deg, var(--magenta), var(--violet) 85%);
}
.translated {
  display: block; margin-top: 6px; padding-top: 6px;
  border-top: 1px solid #ece9f5;
  color: var(--violet); font-weight: 600; font-size: 0.875rem;
}
.translated::before { content: "Translated: "; color: #8a84ad; font-weight: 500; }
.chat-input {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 12px 16px; padding: 8px 8px 8px 16px;
  border-radius: 999px; background: #fff; border: 1px solid #e7e3f2;
  color: #9d98ba;
}
.chat-input i { width: 30px; height: 30px; border-radius: 50%; background: var(--violet); }

/* Investour */
.investour {
  --accent: var(--cocoa);
  --accent-text: var(--cocoa);
  --deed-line: var(--cocoa);
  --deed-bg: #fbeeeb;
  --deed-band: var(--cocoa);
  --deed-band-text: #fbeeeb;
  --deed-hover: #f7e2dd;
  background: var(--blush);
  color: var(--cocoa);
}
.investour .app-icon { box-shadow: 0 0 0 2px var(--cocoa); }

.board-shot { position: relative; padding-bottom: 14%; }
.board-shot img {
  border-radius: var(--radius-l);
  border: 3px solid var(--cocoa);
  box-shadow: 10px 12px 0 var(--blush-deep);
}
.board-closeup {
  position: absolute; right: -4%; bottom: 0;
  width: 48%;
  transform: rotate(-4deg);
  border-radius: 16px !important;
}

/* ---------- Studio ---------- */

.studio {
  background: var(--ink);
  color: var(--chalk);
  padding-block: clamp(72px, 10vw, 128px);
}
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(40px, 7vw, 96px);
  align-items: start;
}
.studio h2 { font: 400 var(--step-3)/1.05 var(--display); margin-bottom: 24px; }
.studio p { max-width: 46ch; font-size: 1.1875rem; }
.studio p + p { margin-top: 16px; }
.studio .aka {
  display: inline-block;
  margin-bottom: 24px;
  padding: 12px 16px;
  border-radius: var(--radius-s);
  background: rgb(245 244 251 / 0.08);
  border-left: 4px solid var(--magenta);
}
.studio .aka strong { font-weight: 800; }

/* A three-square stretch of board track */
.track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 2px solid rgb(245 244 251 / 0.85);
  border-radius: var(--radius-s);
  overflow: hidden;
  counter-reset: none;
}
.square {
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  min-height: 200px;
  padding: 18px;
}
.square + .square { border-left: 2px solid rgb(245 244 251 / 0.85); }
.square-when { font: 400 clamp(1.125rem, 1.8vw, var(--step-1))/1.1 var(--display); white-space: nowrap; }
.square-what { font-weight: 600; line-height: 1.3; }
.square.start { background: var(--violet); }
.square.next {
  background: repeating-linear-gradient(-45deg, transparent 0 10px, rgb(245 244 251 / 0.06) 10px 20px);
  color: rgb(245 244 251 / 0.8);
}

/* ---------- Footer ---------- */

.footer { background: var(--ink); color: rgb(245 244 251 / 0.7); border-top: 1px solid rgb(245 244 251 / 0.12); }
.footer-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  padding-block: 28px; font-size: 0.9375rem;
}
.footer ul { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer a:hover { color: var(--chalk); }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .product-grid, .studio-grid { grid-template-columns: minmax(0, 1fr); }
  .product-grid.flip .product-copy { order: 0; }
  .phone { width: min(300px, 86%); }
  .board-closeup { right: -2%; }
}

@media (max-width: 560px) {
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.9375rem; }
  .brand span { display: none; }
  .hero-actions, .hero-actions .btn { width: 100%; }
  .track { grid-template-columns: minmax(0, 1fr); }
  .square { min-height: 0; flex-direction: row; justify-content: flex-start; align-items: baseline; gap: 16px; }
  .square + .square { border-left: 0; border-top: 2px solid rgb(245 244 251 / 0.85); }
  .square-when { min-width: 6.4em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .die, .die-slot { transition: none !important; }
}
