/* Rigless website. The colours and the wordmark follow the app (GameBrowser/App/Theme.swift):
   near-black, a warm orange, a heavy rounded name. No scripts, no outside files. */

:root {
  color-scheme: dark light;

  --bg: #090a0d;
  --surface: #13151a;
  --ink: #f2f3f5;
  --muted: #a3a6ad;
  --line: rgba(255, 255, 255, 0.13);
  --brand: #ff7a1c;        /* the app's accent */
  --link: #ff8a36;
  --glow: rgba(255, 122, 28, 0.16);
  --device-edge: #3a3f4a;
  --stop: #ff5a52;         /* the screen edge the pointer runs into */

  --display: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --page: 68rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f1f2f4;
    --surface: #ffffff;
    --ink: #0d0e12;
    --muted: #54575e;
    --line: rgba(13, 14, 18, 0.15);
    --brand: #e8590c;
    --link: #a84300;
    --glow: rgba(255, 122, 28, 0.13);
    --device-edge: #b4b9c2;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(110% 34rem at 50% -8rem, var(--glow), transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 1.0625rem/1.55 var(--body);
}

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
a:hover { text-decoration-thickness: 0.14em; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

h1, h2 { font-family: var(--display); font-weight: 800; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6.4vw, 4rem); line-height: 1.04; letter-spacing: -0.02em; }
h2 { font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.005em; }
p { margin: 0; }
p + p { margin-top: 0.9em; }
p, li { text-wrap: pretty; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- top ---------- */

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.wordmark {
  font: 800 1.75rem/1 var(--display);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark span { color: var(--brand); }

.top nav { display: flex; gap: 1.5rem; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
.top nav a:hover,
.top nav a[aria-current] { color: var(--ink); }

/* ---------- home: hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-top: clamp(1.5rem, 5vw, 4rem);
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
}

.lede { margin-top: 1.4rem; font-size: 1.25rem; line-height: 1.45; max-width: 30em; }
.status { margin-top: 1.4rem; color: var(--muted); }

/* ---------- home: the mouse-lock demo ---------- */

.demo { margin: 0; }

.ipad {
  background: #0c0d11;
  border: 1.5px solid var(--device-edge);
  border-radius: clamp(14px, 3.2vw, 26px);
  padding: clamp(8px, 1.7vw, 14px);
}

.screen {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: clamp(7px, 1.6vw, 13px);
  background: linear-gradient(#0a1024 0%, #17214a 62%, #1d2a55 100%);
}

/* The game world is two identical tiles side by side, so sliding it half its own width
   brings it back to where it started: an endless turn. */
.world {
  position: absolute;
  inset: 0 auto 0 0;
  width: 300%;
  animation: turn 16s linear infinite;
}
.land { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.tape {
  position: absolute;
  top: 7%;
  left: 0;
  width: 100%;
  display: flex;
  font: 700 clamp(0.6rem, 1.5vw, 0.8rem)/1 var(--body);
  color: rgba(255, 255, 255, 0.72);
}
.tape span { flex: 1; text-align: center; }

.needle {
  position: absolute;
  top: 2.5%;
  left: 50%;
  width: 0;
  height: 0;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #fff;
  border-bottom-width: 0;
}

.crosshair,
.pointer { position: absolute; display: block; }
.crosshair { left: 50%; top: 52%; width: 13%; transform: translate(-50%, -50%); }
.pointer {
  top: 50%;
  left: 1%;
  width: 4.4%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(236, 238, 243, 0.82);
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.4);
  opacity: 0;
}

.edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.2%;
  opacity: 0;
}
.edge-r { right: 0; background: linear-gradient(to left, var(--stop), transparent); }
.edge-l { left: 0; background: linear-gradient(to right, var(--stop), transparent); }

@keyframes turn { to { transform: translateX(-50%); } }

/* Without mouse lock: the pointer crosses the screen, the view turns a little with it,
   and both stop at the edge. */
.demo:has(input[value="off"]:checked) .world { animation: nudge 7s ease-in-out infinite; }
.demo:has(input[value="off"]:checked) .pointer { opacity: 1; animation: slide 7s ease-in-out infinite; }
.demo:has(input[value="off"]:checked) .crosshair { display: none; }
.demo:has(input[value="off"]:checked) .edge-r { animation: stop-r 7s linear infinite; }
.demo:has(input[value="off"]:checked) .edge-l { animation: stop-l 7s linear infinite; }

@keyframes nudge {
  0%, 9% { transform: translateX(-10%); }
  41%, 59% { transform: translateX(-15.5%); }
  91%, 100% { transform: translateX(-10%); }
}
@keyframes slide {
  0%, 9% { left: 1%; }
  41%, 59% { left: 94.6%; }
  91%, 100% { left: 1%; }
}
@keyframes stop-r {
  0%, 40% { opacity: 0; }
  43%, 57% { opacity: 1; }
  60%, 100% { opacity: 0; }
}
@keyframes stop-l {
  0%, 7% { opacity: 1; }
  10%, 90% { opacity: 0; }
  93%, 100% { opacity: 1; }
}

.switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 1rem;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.switch label { position: relative; display: block; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch span {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
}
.switch input:checked + span { background: #ff7a1c; color: #190b00; }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.demo figcaption { margin-top: 0.9rem; min-height: 4.6em; }
.caption-off { display: none; }
.demo:has(input[value="off"]:checked) .caption-off { display: block; }
.demo:has(input[value="off"]:checked) .caption-on { display: none; }
.demo-note { color: var(--muted); font-size: 0.9375rem; }

@media (prefers-reduced-motion: reduce) {
  .world,
  .demo:has(input[value="off"]:checked) .world { animation: none; transform: translateX(-15.5%); }
  .demo:has(input[value="off"]:checked) .pointer { animation: none; left: 94.6%; }
  .demo:has(input[value="off"]:checked) .edge-r { animation: none; opacity: 1; }
  .demo:has(input[value="off"]:checked) .edge-l { animation: none; opacity: 0; }
}

/* ---------- sections: heading on the left, content on the right ---------- */

.part {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 1rem 3rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
}
.part-body { max-width: 40rem; }
.part ul,
.part ol { margin: 0; padding-left: 1.2em; }
.part .part-body > * + * { margin-top: 1.1rem; }
.part .part-body > .prices + * { margin-top: 1.5rem; }
.part li + li { margin-top: 0.55em; }
.part ul > li::marker { color: var(--muted); }
.part ol > li::marker { font-weight: 700; color: var(--muted); }
.part li { padding-left: 0.2em; }
.small { color: var(--muted); font-size: 0.9375rem; }

/* ---------- prices ---------- */

.prices { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.prices th,
.prices td { text-align: left; vertical-align: baseline; padding: 0.8rem 1rem 0.8rem 0; border-bottom: 1px solid var(--line); }
.prices th:last-child,
.prices td:last-child { padding-right: 0; }
.prices thead th { font-size: 0.875rem; font-weight: 600; color: var(--muted); padding-top: 0; }
.prices tbody th { font: 800 1.125rem/1.2 var(--display); }
.prices b { font: 800 1.375rem/1.2 var(--display); white-space: nowrap; }
.prices i { display: block; font-style: normal; font-size: 0.875rem; color: var(--muted); }

/* ---------- text pages ---------- */

.page-head { padding-top: clamp(1.5rem, 5vw, 3.5rem); padding-bottom: clamp(2rem, 5vw, 3rem); }
.page-head h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); }
.page-head p { margin-top: 1.2rem; font-size: 1.1875rem; line-height: 1.5; max-width: 40rem; }
.mail { font-weight: 700; white-space: nowrap; }

/* ---------- foot ---------- */

.foot { border-top: 1px solid var(--line); padding-top: 2rem; padding-bottom: 3rem; color: var(--muted); font-size: 0.9375rem; }
.updated { padding-bottom: 2.5rem; }
.foot p { max-width: 44rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 1.4rem; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }

/* ---------- narrower screens ---------- */

@media (max-width: 56rem) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .demo { max-width: 38rem; }
  .part { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 2rem 0; }
}

@media (max-width: 30rem) {
  .top nav { gap: 1.1rem; }
  .prices th,
  .prices td { padding-right: 0.6rem; }
  .prices b { font-size: 1.1875rem; }
  .switch span { padding: 0.55rem 0.4rem; font-size: 0.875rem; }
}
