@font-face {
  font-family: "Rotundo Fat";
  src: url("fonts/Rotundo-Fat.woff2") format("woff2");
  font-weight: 400;
  font-display: swap
}

@font-face {
  font-family: "Rotundo";
  src: url("fonts/Rotundo-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap
}

:root {
  --bg: #e9eaee;
  --ink: #191b22;
  --mute: #5b606c;
  --line: #c9ccd4;
  --btn: #191b22;
  --btnink: #e9eaee;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px)
}

@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1c23;
    --ink: #eceef3;
    --mute: #9aa0ae;
    --line: #33363f;
    --btn: #eceef3;
    --btnink: #1a1c23
  }
}

:root[data-theme="dark"] {
  --bg: #1a1c23;
  --ink: #eceef3;
  --mute: #9aa0ae;
  --line: #33363f;
  --btn: #eceef3;
  --btnink: #1a1c23
}

html {
  scroll-padding-top: env(safe-area-inset-top, 0px)
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: center;
  min-height: 88vh
}

h1 {
  font-size: clamp(3.4rem, 10vw, 7.5rem);
  line-height: .95;
  letter-spacing: -.01em;
  font-weight: 400;
  font-family: "Rotundo Fat", "Arial Rounded MT Bold", system-ui, sans-serif;
  margin: 0 0 20px
}

.lede {
  font-size: 1.25rem;
  max-width: 30ch;
  color: var(--mute);
  margin: 0 0 28px
}

.stage {
  perspective: 900px;
  height: min(80vw, 440px);
  display: grid;
  place-items: center;
  touch-action: none;
  cursor: grab;
  user-select: none
}

.stage:active {
  cursor: grabbing
}

.rot,
.grp {
  transform-style: preserve-3d;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0
}

.cubie {
  position: absolute;
  left: -33px;
  top: -33px;
  width: 66px;
  height: 66px;
  transform-style: preserve-3d
}

.face {
  position: absolute;
  inset: 0;
  background: #0c0c0e;
  backface-visibility: hidden
}

.face::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 7px;
  background: var(--c, transparent)
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center
}

button {
  font: inherit;
  font-family: "Rotundo", system-ui, sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
  background: var(--btn);
  color: var(--btnink);
  border: 0;
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink)
}

button:focus-visible {
  outline: 3px solid #0051ba;
  outline-offset: 3px
}

.hint {
  color: var(--mute);
  font-size: .9rem;
  margin: 0 0 0 6px
}

section {
  border-top: 1px solid var(--line);
  padding: 56px 0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px
}

h2 {
  font-size: 1.6rem;
  margin: 0;
  font-family: "Rotundo", system-ui, sans-serif;
  font-weight: 400
}

section p {
  margin: 0 0 1em;
  max-width: 62ch;
  font-size: 1.1rem
}

a {
  color: var(--ink);
  text-underline-offset: 4px
}

footer {
  padding: 0 0 40px;
  color: var(--mute);
  font-size: .9rem
}

.theme {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: 14px;
  z-index: 10;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--ink);
  border: 1.5px solid var(--line)
}

.theme:hover {
  border-color: var(--ink)
}

@media (max-width:760px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 32px
  }

  .stage {
    order: -1
  }

  section {
    grid-template-columns: 1fr;
    gap: 12px
  }
}