/* Rimble Launcher — documentation site.
   No web fonts and no framework: the site should feel as light as the app. */

:root {
  --indigo: #3d5afe;
  --violet: #8e3cf7;
  --coral: #ff6a88;
  --paper: #f5f4fb;
  --ink: #1c1842;
  --muted: #5f5b7d;
  --line: #dcd9ec;
  --panel: rgba(28, 24, 66, 0.55);
  --radius-panel: 22px;
  --radius-control: 10px;
  --measure: 38rem;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans JP", sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.4rem, 5.2vw, 3.6rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.85;
  word-break: auto-phrase; /* keep Japanese phrases together when wrapping */
  overflow-wrap: anywhere;
}

a {
  color: var(--indigo);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--violet);
}

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

img {
  display: block;
  max-width: 100%;
}

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0.05em 0.45em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.85em;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: #eceaf6;
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: #eceaf6;
  font-size: var(--step--1);
  line-height: 1.6;
}

pre code {
  padding: 0;
  background: none;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: #fff;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 34px;
}

.site-nav {
  display: flex;
  gap: 1.4rem;
  font-size: var(--step--1);
  white-space: nowrap;
}

.site-nav a {
  color: inherit;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--indigo);
  text-decoration: underline;
}

.hero .site-header,
.hero .site-nav a {
  color: #fff;
}

/* ---------- Hero: the launcher itself ---------- */

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(60rem 30rem at 85% 110%, rgba(255, 106, 136, 0.75), transparent 60%),
    radial-gradient(50rem 30rem at 10% -10%, rgba(61, 90, 254, 0.9), transparent 60%),
    linear-gradient(160deg, #2c2a8f, var(--violet) 70%);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 3rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.hero h1 {
  margin: 0 0 1.2rem;
  font-size: var(--step-4);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.hero-lead {
  max-width: 30rem;
  margin: 0 0 2rem;
  font-size: var(--step-1);
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.88);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.4rem;
}

.button {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(28, 24, 66, 0.35);
}

.button:hover {
  color: var(--violet);
}

.hero-actions small {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--step--1);
}

.hero-actions a.text-link {
  color: #fff;
  font-size: var(--step--1);
}

/* The demo panel mirrors the real app's layout: field above result rows. */
.demo {
  position: relative;
  /* Room for the field and every visible row, so the hero doesn't jump while typing. */
  min-height: 27.5rem;
}

.launcher {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-panel);
  background: var(--panel);
  box-shadow: 0 30px 80px rgba(18, 10, 60, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.launcher-field {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 1.2rem;
  height: 4rem;
}

.launcher-field svg {
  flex: none;
  width: 22px;
  height: 22px;
  opacity: 0.75;
}

.launcher-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 1.45rem;
  outline: none;
}

.launcher-field input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.launcher:focus-within {
  border-color: rgba(255, 255, 255, 0.7);
}

.launcher-results {
  margin: 0;
  padding: 0 0.5rem;
  list-style: none;
}

.launcher-results:not(:empty) {
  padding-bottom: 0.5rem;
}

.result {
  display: grid;
  grid-template-columns: 2.1rem 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.45rem 0.7rem;
  border-radius: 12px;
  cursor: pointer;
}

.result[aria-selected="true"] {
  background: rgba(61, 90, 254, 0.55);
}

.result-icon {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.result-title {
  display: block;
  font-weight: 600;
  line-height: 1.4;
}

.result-subtitle {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-hint {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.demo-status {
  min-height: 1.6rem;
  margin: 0.9rem 0.3rem 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--step--1);
}

.demo-modes {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
}

.demo-modes button {
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: var(--step--1);
  cursor: pointer;
}

.demo-modes button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
}

.demo-modes kbd {
  border-color: rgba(28, 24, 66, 0.2);
  font-size: 0.75rem;
}

.demo-modes button[aria-pressed="false"] kbd {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* ---------- Content ---------- */

main {
  display: block;
}

.section {
  max-width: 72rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0 0 1.5rem;
  font-size: var(--step-3);
  line-height: 1.35;
}

.section > p,
.prose p {
  max-width: var(--measure);
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}

.feature h3 {
  margin: 0 0 0.6rem;
  font-size: var(--step-1);
}

.feature p {
  margin: 0 0 0.8rem;
  color: var(--muted);
}

.feature .keys {
  color: var(--ink);
  font-size: var(--step--1);
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin: 0;
}

.facts div {
  padding-left: 1rem;
  border-left: 3px solid var(--violet);
}

.facts dt {
  font-size: var(--step-2);
  font-weight: 800;
  line-height: 1.3;
}

.facts dd {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.steps {
  max-width: var(--measure);
  margin: 0;
  padding-left: 1.4rem;
}

.steps li {
  margin-bottom: 0.9rem;
  padding-left: 0.3rem;
}

.steps li::marker {
  color: var(--violet);
  font-weight: 800;
}

.note {
  max-width: var(--measure);
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--coral);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: #fff;
}

.note p {
  margin: 0;
}

.note p + p {
  margin-top: 0.6rem;
}

table {
  width: 100%;
  max-width: 46rem;
  border-collapse: collapse;
  font-size: var(--step--1);
}

th,
td {
  padding: 0.7rem 0.8rem 0.7rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

/* ---------- Docs layout ---------- */

.docs {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 3.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.docs-nav {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  font-size: var(--step--1);
}

.docs-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-nav li + li {
  margin-top: 0.35rem;
}

.docs-nav a {
  color: var(--muted);
  text-decoration: none;
}

.docs-nav a:hover {
  color: var(--indigo);
}

.prose h1 {
  margin: 0 0 1rem;
  font-size: var(--step-3);
  line-height: 1.35;
}

.prose h2 {
  margin: 3.5rem 0 1rem;
  padding-top: 0.5rem;
  font-size: var(--step-2);
  line-height: 1.4;
  scroll-margin-top: 1.5rem;
}

.prose h3 {
  margin: 2rem 0 0.6rem;
  font-size: var(--step-1);
}

.prose ul {
  max-width: var(--measure);
  padding-left: 1.3rem;
}

.prose li + li {
  margin-top: 0.3rem;
}

.lede {
  color: var(--muted);
  font-size: var(--step-1);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--step--1);
}

.site-footer div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.site-footer a {
  color: inherit;
}

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

@media (max-width: 860px) {
  .hero-inner,
  .features,
  .facts,
  .docs {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-inner {
    gap: 2.5rem;
    padding-top: 1.5rem;
  }

  .demo {
    min-height: 0;
  }

  .docs-nav {
    position: static;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--line);
  }

  .docs-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
  }

  .docs-nav li + li {
    margin-top: 0;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding-inline: 1.1rem;
  }

  .brand {
    gap: 0.45rem;
    font-size: 0.95rem;
  }

  .brand img {
    width: 28px;
    height: 28px;
  }

  .site-nav {
    gap: 0.8rem;
    font-size: 0.82rem;
  }

  .result-hint {
    display: none;
  }

  .result {
    grid-template-columns: 2.1rem 1fr;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .launcher {
    animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both 0.15s;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(14px) scale(0.98);
    }
  }
}
