@font-face {
  font-family: "Rethink Sans";
  src: url("assets/rethink-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #17151e;
  --panel: #211d2b;
  --ink: #f8f2fa;
  --muted: #c4b9ce;
  --line: #494155;
  --amber: #ffd364;
  --feedback: 130ms cubic-bezier(.23, 1, .32, 1);
  font-family: "Rethink Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body { margin: 0; }
button, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
::selection { background: #725f85; color: var(--ink); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
.frame { width: min(1160px, calc(100% - 56px)); margin-inline: auto; }

.skip-link { position: absolute; z-index: 20; top: 8px; left: 8px; padding: 10px 14px; background: var(--amber); color: #241b12; }
.skip-link:not(:focus) { clip-path: inset(50%); }

.site-header { border-bottom: 1px solid #332d3e; }
.header-row, .footer-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.header-row { min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 650; text-decoration: none; }
.brand img { display: block; }
.header-row nav, .footer-row nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.header-row nav a, .footer-row nav a { color: var(--muted); font-size: 14px; font-weight: 550; text-decoration: none; }
.header-row nav a:hover, .footer-row nav a:hover { color: var(--ink); text-decoration: underline; }

.intro { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(28px, 5vw, 70px); padding: clamp(36px, 6vw, 84px) 0 52px; }
.intro-copy { align-self: start; padding-top: 39px; }
h1, h2 { margin: 0; font-weight: 650; }
h1 { font-size: clamp(54px, 7vw, 96px); line-height: 1; letter-spacing: -.04em; }
.intro-copy p { max-width: 28ch; margin: 22px 0 30px; color: var(--muted); font-size: clamp(16px, 1.6vw, 20px); line-height: 1.56; }
.button { display: inline-flex; min-height: 45px; align-items: center; justify-content: center; padding: 10px 17px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 650; line-height: 1.3; text-align: center; text-decoration: none; }
.primary { background: var(--amber); color: #241b12; }
.secondary { border-color: var(--line); }

.playground h2 { margin-bottom: 11px; color: var(--ink); font-size: clamp(16px, 2vw, 20px); letter-spacing: -.025em; }
.demo-panel { overflow: hidden; border: 1px solid #494154; border-radius: 12px; background: var(--panel); }
.demo-screen { position: relative; isolation: isolate; overflow: hidden; height: clamp(278px, 31vw, 364px); background: linear-gradient(#251e32, #39344d 72%, #3d344d); touch-action: pan-y; }
.demo-screen:focus-visible { outline-offset: -3px; }
.wallpaper { position: absolute; inset: 0; pointer-events: none; }
.wallpaper span { position: absolute; inset: auto -12% 26px; height: 44%; background: #272740; clip-path: polygon(0 100%, 0 72%, 19% 30%, 34% 75%, 59% 17%, 79% 61%, 100% 25%, 100% 100%); }
.wallpaper span + span { height: 33%; background: #222237; clip-path: polygon(0 100%, 0 40%, 23% 77%, 43% 25%, 61% 73%, 77% 34%, 100% 68%, 100% 100%); }
.desktop-taskbar { position: absolute; inset: auto 0 0; height: 27px; z-index: 4; pointer-events: none; border-top: 1px solid #9a86ac38; background: #151322b0; }
.demo-status { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 53px; padding: 4px 12px 4px 16px; border-block: 1px solid #493e56; color: var(--muted); font-size: 14px; line-height: 1.45; }

.demo-character, .demo-object { position: absolute; z-index: 7; inset: 0 auto auto 0; padding: 0; border: 0; border-radius: 50%; background: transparent; touch-action: none; user-select: none; -webkit-user-select: none; }
.demo-character { width: clamp(118px, 15vw, 150px); aspect-ratio: 1; clip-path: circle(49.5%); cursor: grab; }
.demo-character:focus, .demo-object:focus { outline: none; }
.demo-character:focus-visible::after, .demo-object:focus-visible::after { content: ""; position: absolute; inset: 7.5%; border: 2px solid var(--amber); border-radius: inherit; pointer-events: none; }
.demo-character.dragging, .demo-toy.dragging { cursor: grabbing; }
.demo-character canvas, .demo-object canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.demo-object { z-index: 8; }
.demo-toy { width: 40px; height: 40px; cursor: grab; }
.demo-notebook { width: clamp(76px, 10vw, 106px); aspect-ratio: 200 / 144; border-radius: 10px; }
.demo-notebook:focus-visible::after { inset: 0; }
.demo-screen.cursor-caught, .demo-screen.cursor-caught :is(.demo-character, .demo-toy) { cursor: none; }

.demo-message { position: absolute; z-index: 11; pointer-events: none; max-width: min(220px, calc(100% - 20px)); padding: 7px 10px; border: 1px solid #ab96c6; border-radius: 11px; background: #252031; color: #fff2d0; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; text-align: center; opacity: 0; transition: opacity var(--feedback); }
.demo-message.visible { opacity: 1; }
.demo-message::after { content: ""; position: absolute; width: 7px; height: 7px; bottom: -5px; left: var(--tail, 50%); transform: rotate(45deg); background: #252031; border-right: 1px solid #ab96c6; border-bottom: 1px solid #ab96c6; }
.demo-message.below::after { top: -5px; bottom: auto; transform: rotate(225deg); }
.demo-effects { position: absolute; z-index: 10; inset: 0; pointer-events: none; overflow: hidden; }
.demo-mark { position: absolute; inset: 0 auto auto 0; color: var(--amber); font-weight: 750; line-height: 1; text-shadow: 0 1px 4px #281b37; }
.demo-mark.irritated { width: 20px; height: 20px; color: #ff7188; }
.demo-mark.irritated svg { width: 100%; height: 100%; }
.demo-menu { position: absolute; z-index: 15; width: min(189px, calc(100% - 16px)); padding: 4px; border: 1px solid #ac96be; border-radius: 9px; background: #231b2e; box-shadow: 0 8px 24px #1b122999; }
.demo-menu:not([hidden]) { display: grid; }
.demo-menu button { padding: 8px 7px; border: 0; border-radius: 5px; background: transparent; color: #faeddc; font-size: 13px; line-height: 1.3; text-align: left; }
.demo-menu button:is(:hover, :focus-visible) { background: #5e486b; }

.help { max-width: 65ch; margin: 11px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.demo-controls { padding: 12px 14px 2px; }
.demo-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.expression-list { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-panel [data-action], .demo-controls button, .demo-controls select { min-height: 44px; padding: 7px 10px; border: 1px solid #5e506a; border-radius: 7px; background: #2a2335; color: var(--ink); font-size: 13px; font-weight: 550; line-height: 1.35; }
.demo-status [data-action] { min-width: 75px; border-color: transparent; background: transparent; color: var(--muted); }
.demo-panel button[aria-pressed="true"] { background: #40344b; color: var(--amber); border-color: #8e759e; }
.expressions { margin-top: 6px; color: var(--muted); font-size: 14px; }
.expressions summary { width: fit-content; min-height: 44px; padding: 12px 3px; cursor: pointer; }
.expressions[open] { padding-bottom: 12px; }
.extra-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 15px; margin-top: 8px; }
.toy-choice { display: inline-flex; align-items: center; gap: 8px; }

.downloads { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 30px 0 44px; border-top: 1px solid #3b3146; }
.downloads h2 { font-size: clamp(22px, 3vw, 31px); letter-spacing: -.04em; }
.downloads p { max-width: 62ch; margin: 9px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.download-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.site-footer { border-top: 1px solid #332d3e; }
.footer-row { min-height: 74px; padding-block: 14px; font-size: 13px; color: var(--muted); }
.footer-row p { margin: 0; line-height: 1.5; }

@media (hover: hover) and (pointer: fine) {
  .button, .demo-panel [data-action], .expression-button {
    transition: background-color var(--feedback), border-color var(--feedback), transform var(--feedback);
  }
  .primary:hover { background: #ffe298; }
  .secondary:hover, .demo-panel [data-action]:hover, .expression-button:hover {
    background: #3b3047;
    border-color: #8e759e;
  }
  .button:active:not(:focus-visible), .demo-panel [data-action]:active:not(:focus-visible), .expression-button:active:not(:focus-visible) {
    transform: scale(.98);
  }
}

@media (max-width: 960px) {
  .demo-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .intro { grid-template-columns: minmax(0, 185px) minmax(0, 1fr); gap: 24px; }
  .intro-copy { padding-top: 24px; }
}

@media (max-width: 640px) {
  .frame { width: calc(100% - 32px); }
  .header-row { min-height: 57px; }
  .header-row nav { gap: 12px; }
  .intro { grid-template-columns: minmax(0, 1fr); padding: 29px 0 36px; gap: 26px; }
  .intro-copy { padding: 0; }
  h1 { font-size: 54px; }
  .intro-copy p { margin: 10px 0 17px; max-width: 38ch; }
  .demo-screen { height: clamp(246px, 69vw, 340px); }
  .demo-toy { width: 34px; height: 34px; }
  .downloads, .footer-row { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .demo-message, .demo-panel [data-action], .expression-button { transition: none; }
  .button:active:not(:focus-visible), .demo-panel [data-action]:active:not(:focus-visible), .expression-button:active:not(:focus-visible) { transform: none; }
}

.support-page { max-width: 820px; padding-block: clamp(32px, 7vw, 78px); }
.support-intro h1 { font-size: clamp(38px, 8vw, 72px); line-height: 1.02; letter-spacing: -.055em; }
.support-intro p, .support-page section > p, .support-card p:not(.support-meta) { max-width: 68ch; color: var(--muted); line-height: 1.65; }
.support-intro nav, .support-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.support-page section { margin-top: 44px; scroll-margin-top: 24px; }
.support-page section h2 { margin-bottom: 14px; font-size: clamp(23px, 4vw, 32px); letter-spacing: -.035em; }
.support-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: clamp(16px, 4vw, 24px); }
.support-meta { color: var(--amber); font-size: 14px; margin: 0 0 9px; }
.support-card h3 { font-size: 20px; margin: 0; }
.support-card a, .support-page section > a { color: var(--amber); overflow-wrap: anywhere; }
.support-card p:last-child { margin-bottom: 0; }
@media (max-width: 440px) {
  .support-intro .button, .support-actions .button { width: 100%; justify-content: center; text-align: center; }
}
