/* Shard website shell. Dark plugin palette from Config.luau (Classic), shared by every page.
   The product demo styles itself under .shard-product-demo; nothing here reaches inside it. */

@font-face { font-family: "Bricolage Grotesque"; src: url("../assets/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../assets/fonts/source-sans-3.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../assets/fonts/source-sans-3-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Code Pro"; src: url("../assets/fonts/source-code-pro.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  color-scheme: dark;

  --night: #0e0f14;
  --panel: #18191e;
  --raised: #2d2f37;
  --line: #262830;
  --line-strong: #3a3d48;
  --paper: #f0f4f8;
  --fog: #b4b6be;
  --dim: #8d909b;
  /* Brand colors, sampled from the Shard logo. */
  --cyan: #29b0ea;
  --blue: #0b74e0;
  --aqua: #9ce8e8;
  --lilac: #bb9af7;
  --sun: #fabd2f;
  --on-accent: #06121c;

  --accent: var(--cyan);
  --accent-2: var(--blue);

  --font-display: "Bricolage Grotesque", "Source Sans 3", system-ui, sans-serif;
  --font-text: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Source Code Pro", ui-monospace, Consolas, monospace;

  --wrap: 1200px;
  --gutter: 20px;
  --radius-s: 5px;
  --radius-m: 12px;
  --radius-l: 18px;
  --section-space: 64px;
  --header-height: 64px;
}

@media (min-width: 900px) {
  :root {
    --gutter: 32px;
    --section-space: 96px;
  }
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--night);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

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

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-stretch: 100%;
  font-weight: 760;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.75rem, 1.6rem + 4.6vw, 5.25rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3.1rem);
  line-height: 1;
}

h3 {
  font-size: 1.375rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1em;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

.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-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-m);
  background: var(--sun);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0.6rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font-text);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

/* Candy buttons: a solid ledge underneath, a soft top highlight, and a press-down on hover and click.
   The button moves down by the same amount the ledge shrinks, so its bottom edge stays put. */
.btn-primary {
  --ledge: #1679ad;
  background: var(--cyan);
  color: var(--on-accent);
  box-shadow: 0 5px 0 var(--ledge), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:hover {
  background: #3dbcee;
  color: var(--on-accent);
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--ledge), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:active {
  background: #24a6dc;
  transform: translateY(5px);
  box-shadow: 0 0 0 var(--ledge), inset 0 2px 3px rgba(0, 0, 0, 0.18);
}

/* Same build as .btn-primary, in grey: no border, and a ledge light enough to read against the dark page. */
.btn-ghost {
  --ledge: #1f2027;
  background: #34363f;
  color: var(--paper);
  box-shadow: 0 5px 0 var(--ledge), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
  background: #3c3e48;
  color: var(--paper);
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--ledge), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-ghost:active {
  background: #30323a;
  transform: translateY(5px);
  box-shadow: 0 0 0 var(--ledge), inset 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* Room for the ledge, so stacked buttons and the text below them don't touch it. */
.btn {
  margin-bottom: 5px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  transform: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin: 0;
}

.text-link {
  font-weight: 700;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--night) 88%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.bar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 760;
  font-stretch: 85%;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand:hover {
  color: var(--paper);
}

.brand img {
  width: 30px;
  height: 30px;
  flex: none;
}

.brand small {
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--sun);
  color: var(--on-accent);
  font-family: var(--font-text);
  font-size: 0.8125rem;
  font-weight: 700;
  font-stretch: 100%;
  letter-spacing: 0;
  line-height: 1.4;
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--fog);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--panel);
  color: var(--paper);
}

.site-nav a[aria-current="page"] {
  color: var(--paper);
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 8px 8px 0 0;
}

.header-cta {
  min-height: 40px;
  padding: 0.45rem 1rem;
  font-size: 1rem;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

.nav-toggle:hover {
  background: var(--raised);
}

@media (max-width: 859px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px #000;
    transform-origin: top center;
    transition: opacity 180ms ease, transform 200ms cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0s;
  }

  /* Closed: slid up and faded out, and hidden from focus and screen readers once the slide ends. */
  .site-nav:not(.is-open) {
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease, visibility 0s linear 140ms;
  }

  .site-nav li {
    transition: opacity 200ms ease, transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .site-nav:not(.is-open) li {
    opacity: 0;
    transform: translateY(-4px);
  }

  /* The links follow the panel in, a few milliseconds apart. */
  .site-nav.is-open li:nth-child(2) { transition-delay: 30ms; }
  .site-nav.is-open li:nth-child(3) { transition-delay: 60ms; }
  .site-nav.is-open li:nth-child(4) { transition-delay: 90ms; }
  .site-nav.is-open li:nth-child(5) { transition-delay: 120ms; }

  .site-nav ul {
    flex-direction: column;
  }

  .site-nav a {
    padding: 12px 8px;
    font-size: 1.125rem;
  }

  .site-nav a[aria-current="page"] {
    box-shadow: inset 3px 0 0 var(--accent);
    border-radius: 0 10px 10px 0;
    padding-left: 14px;
  }

  /* Without the script the toggle can't work; the footer repeats every main link. */
  html:not(.js) .nav-toggle {
    display: none;
  }
}

@media (max-width: 519px) {
  .header-cta {
    display: none;
  }
}

/* ---------- Home: hero ---------- */

.home-hero {
  padding-top: clamp(40px, 6vw, 72px);
  overflow-x: clip;
}

.hero-top {
  display: grid;
  gap: 28px;
  align-items: end;
  margin-bottom: clamp(32px, 4vw, 52px);
}

.hero-top h1 {
  max-width: 13ch;
  margin: 0;
}

.hero-side .lede {
  max-width: 46ch;
}

.lede {
  color: var(--fog);
  font-size: 1.25rem;
  line-height: 1.5;
  max-width: 52ch;
}

@media (min-width: 900px) {
  .hero-top {
    grid-template-columns: 7fr 5fr;
    gap: 48px;
  }

  .hero-side .lede {
    margin-bottom: 24px;
  }
}

/* The page's single orchestrated motion: the headline settles, then Studio docks rise in. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-top h1,
  .js .hero-side {
    animation: rise-in 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .js .hero-side {
    animation-delay: 120ms;
  }

  .js .demo-canvas.shard-product-demo .sd-dock,
  .js .demo-canvas.shard-product-demo .sd-history {
    animation: dock-in 820ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: 260ms;
  }

  .js .demo-canvas.shard-product-demo .sd-side > :first-child {
    animation-delay: 380ms;
  }

  .js .demo-canvas.shard-product-demo .sd-history {
    animation-delay: 480ms;
  }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes dock-in {
  from { opacity: 0; transform: translateY(28px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* ---------- Home: demo stage ---------- */

.demo-stage {
  position: relative;
  isolation: isolate;
}

.demo-canvas {
  max-width: 1120px;
  min-height: 560px;
  margin-inline: auto;
}

.demo-fallback {
  min-height: 560px;
  padding: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  background: var(--panel);
  color: var(--fog);
}

.demo-fallback p {
  max-width: 60ch;
}

.demo-fallback strong {
  color: var(--paper);
}

@media (max-width: 639px) {
  .demo-stage.wrap {
    padding-inline: 10px;
  }
}

/* ---------- Home: sections ---------- */

.home-section {
  padding-block: var(--section-space);
  border-top: 1px solid var(--line);
}

.home-hero + .home-section {
  margin-top: var(--section-space);
}

.section-grid {
  display: grid;
  gap: 32px;
}

.section-head h2 {
  max-width: 13ch;
}

.section-head p {
  max-width: 44ch;
  color: var(--fog);
  font-size: 1.125rem;
}

.section-head .fine {
  font-size: 1rem;
}

@media (min-width: 900px) {
  .section-grid {
    grid-template-columns: 5fr 7fr;
    gap: 32px 64px;
    align-items: start;
  }

  .section-head {
    position: sticky;
    top: calc(var(--header-height) + 32px);
  }
}

.fine {
  max-width: 60ch;
  color: var(--fog);
}

.btn-small {
  min-height: 38px;
  padding: 0.4rem 0.9rem;
  font-size: 1rem;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--sun) 55%, transparent);
  border-bottom-width: 3px;
  border-radius: 6px;
  color: var(--sun);
  font-family: var(--font-text);
  font-size: 0.8125em;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

/* Activity: each capability is named the way the plugin's chat names it. */
.activity-spec {
  display: grid;
  gap: 28px;
}

/* Two columns of short entries: the chat line, with one line of explanation under it. */
.activity-list {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
}

.activity-list > div {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.activity-list dt {
  margin: 0;
}

.activity-list dd {
  margin: 0;
  color: var(--dim);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.activity-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b4b6be;
  font-size: 1.0625rem;
  line-height: 1.3;
}

.activity-row::after {
  content: "›";
  margin-left: 2px;
  color: #b4b6be;
  font-size: 1.35rem;
  line-height: 1;
}

.activity-row.is-plain::after {
  content: none;
}

.activity-row svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 720px) {
  .activity-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 32px;
  }
}

.undo-note {
  display: grid;
  gap: 14px;
  padding: 20px 22px;
  border-left: 3px solid var(--sun);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  background: color-mix(in srgb, var(--sun) 7%, var(--panel));
}

.undo-note h3 {
  color: var(--sun);
}

.undo-note .fine {
  color: #e9dcb8;
}

.undo-note h3,
.undo-note p,
.undo-note ul {
  margin: 0;
}

.undo-note > p:not(.fine) {
  max-width: 52ch;
  color: var(--paper);
  font-size: 1.125rem;
}

.undo-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.undo-steps li {
  padding: 3px 10px;
  border-radius: var(--radius-s);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--paper);
  font-size: 0.9375rem;
}

/* Providers: grouped by how they connect. Lilac belongs to model and provider context. */
.provider-picker {
  display: grid;
  gap: 28px;
}

.provider-groups {
  display: grid;
  gap: 24px;
}

.provider-group h3 {
  margin: 0 0 12px;
  font-size: 1.125rem;
}

.provider-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.provider-options button {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--lilac) 38%, transparent);
  border-radius: 8px;
  background: transparent;
  color: var(--lilac);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.provider-options button:hover {
  border-color: var(--lilac);
}

.provider-options button[aria-pressed="true"] {
  border-color: var(--lilac);
  background: var(--lilac);
  color: var(--on-accent);
}

.provider-detail {
  display: grid;
  gap: 10px;
  padding: 20px 22px;
  border-radius: var(--radius-m);
  background: var(--panel);
}

.provider-detail h3,
.provider-detail p {
  margin: 0;
}

.provider-detail > p:first-of-type {
  max-width: 56ch;
  color: var(--fog);
}

.provider-models {
  color: var(--paper);
}

.provider-models span:first-child {
  margin-right: 8px;
  color: var(--dim);
}

/* ---------- Home: launch ---------- */

.launch {
  padding-block: var(--section-space);
  border-top: 1px solid var(--line);
  background: var(--night);
}

.launch-grid {
  display: grid;
  align-items: center;
  gap: 32px;
}

.launch-copy h2 {
  max-width: 14ch;
  margin-bottom: 24px;
}

.launch-copy > p {
  max-width: 46ch;
  color: var(--fog);
  font-size: 1.125rem;
}

.launch-copy .launch-availability {
  margin-bottom: 8px;
  color: var(--sun);
}

.launch-copy .btn-row {
  margin-top: 24px;
}

.launch-account {
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--panel);
}

.launch-account h3 {
  margin-bottom: 12px;
  color: var(--paper);
  font-size: 1.5rem;
}

.launch-account p {
  max-width: 32ch;
  margin: 0 0 24px;
  color: var(--fog);
}

.launch-account .btn {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

@media (min-width: 900px) {
  .launch-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 64px;
  }
}

/* ---------- Account ---------- */

.account-layout {
  display: grid;
  gap: 20px;
  padding-top: clamp(28px, 4vw, 44px);
  padding-bottom: var(--section-space);
}

.account-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 900px) {
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.account-card {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--panel);
}

.account-card h2 {
  margin: 0;
  font-size: 1.5rem;
}

.account-card p {
  margin: 0;
}

[data-roblox] {
  display: grid;
  gap: 16px;
}

.account-muted {
  color: var(--fog);
  font-size: 0.9375rem;
}

.account-banner {
  margin: 0;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--paper);
  font-weight: 600;
}

.account-banner.is-success {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #2cc88c 55%, transparent);
  color: #7fe0b6;
}

.account-banner.is-error {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #e75750 55%, transparent);
  color: #f2a29d;
}

/* Sign-in panel: the plugin's AuthGui (Classic theme), so both places look the same. */
.auth-panel {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 400px;
  padding: 26px 22px 22px;
  border: 1px solid #0f1116;
  border-radius: 10px;
  background: #18191e;
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
}

.auth-intro h2 {
  margin: 0 0 4px;
  color: #ffffff;
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
}

.auth-intro p {
  margin: 0;
  color: #b4b6be;
  font-size: 15px;
  line-height: 1.35;
}

/* Username / Email: the plugin's segmented switch, the chosen side raised like a selected Settings page. */
.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: #202127;
  box-shadow: inset 0 0 0 1px rgba(52, 53, 59, 0.55);
}

.auth-switch button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b4b6be;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.auth-switch button[aria-checked="true"] {
  background: #2d2f37;
  color: #ffffff;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-panel .field {
  display: grid;
  gap: 6px;
}

.auth-panel .field label {
  color: #ffffff;
  font-size: 16px;
  font-weight: 400;
}

.auth-panel .field input {
  width: 100%;
  height: 36px;
  min-height: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: #202127;
  box-shadow: inset 0 0 0 1px rgba(52, 53, 59, 0.55);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
}

.auth-panel .field input::placeholder {
  color: #b4b6be;
  opacity: 1;
}

.auth-panel .field input:focus-visible {
  outline: 2px solid #08d3f4;
  outline-offset: 1px;
}

.auth-panel .form-error {
  color: #e75750;
  font-size: 14px;
  font-weight: 400;
}

.form-notice {
  margin: 0;
  color: #b4b6be;
  font-size: 14px;
  line-height: 1.35;
}

/* The plugin's accent action, like Settings' Upgrade button. */
.auth-panel .auth-submit {
  width: 100%;
  min-height: 38px;
  border-radius: 6px;
  background: #08d3f4;
  color: #14161c;
  font-family: inherit;
  font-size: 17px;
}

.auth-panel .auth-submit:hover {
  background: #3edcf6;
  color: #14161c;
}

.auth-foot {
  margin: 0;
  color: #b4b6be;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.form-error {
  margin: 0;
  color: #f2a29d;
  font-weight: 600;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.account-rows {
  margin: 0;
}

.account-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.account-rows > div:first-child {
  border-top: 1px solid var(--line);
}

.account-rows dt {
  color: var(--fog);
}

.account-rows dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-weight: 600;
}

/* Profile: each detail is a row with Change; the edit form opens under it, like the plugin's Account page. */
.identity-list {
  border-top: 1px solid var(--line);
}

.identity-row {
  display: grid;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.identity-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.identity-label {
  flex: none;
  min-width: 6rem;
  color: var(--fog);
}

.identity-value {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
  text-align: right;
}

.identity-edit {
  flex: none;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: var(--raised);
  color: var(--paper);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.identity-edit:hover {
  background: #3c3e48;
}

.identity-edit[hidden] {
  display: none;
}

.identity-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #1f2026;
}

.identity-form[hidden] {
  display: none;
}

.identity-form .field {
  display: grid;
  gap: 6px;
}

.identity-form .field[hidden] {
  display: none;
}

.identity-form label {
  font-size: 0.9375rem;
}

.identity-form input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--paper);
  font: inherit;
}

.identity-form input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.identity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.identity-message {
  color: var(--fog);
  font-size: 0.9375rem;
}

.identity-message.is-success {
  color: #8fe3bf;
}

/* Plan continues the Profile rows directly below them. */
.identity-list + .account-rows {
  margin-top: -16px;
}

.identity-list + .account-rows > div:first-child {
  border-top: 0;
}

.limit {
  display: grid;
  gap: 6px;
}

.limit-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.limit-head span:last-child {
  color: var(--fog);
  font-variant-numeric: tabular-nums;
}

.limit-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--raised);
}

.limit-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

.limit.is-full .limit-bar span {
  background: var(--sun);
}

/* ---------- Supporting pages ---------- */

.page-hero {
  padding-top: clamp(48px, 7vw, 88px);
  padding-bottom: clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  max-width: 16ch;
  font-size: clamp(2.5rem, 1.6rem + 3.4vw, 4.25rem);
  margin-bottom: 16px;
}

.page-hero .lede {
  margin-bottom: 0;
}

.page-content {
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: var(--section-space);
}

.prose {
  max-width: 72ch;
  min-width: 0;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  margin-top: 2em;
  margin-bottom: 0.5em;
  font-size: clamp(1.625rem, 1.3rem + 1vw, 2.125rem);
  line-height: 1.1;
}

.prose h3 {
  margin-top: 1.75em;
  margin-bottom: 0.5em;
}

.prose p,
.prose li,
.prose dd {
  color: #d5d8de;
}

.prose p,
.prose ul,
.prose ol,
.prose dl,
.prose table,
.prose pre,
.prose figure,
.prose blockquote {
  margin-top: 0;
  margin-bottom: 1.15em;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: 0.4em;
}

.prose li::marker {
  color: var(--accent);
}

.prose strong {
  color: var(--paper);
  font-weight: 700;
}

.prose dt {
  margin-top: 1em;
  color: var(--paper);
  font-weight: 700;
}

.prose dd {
  margin-left: 0;
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: var(--radius-s);
  background: var(--raised);
  color: var(--paper);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.prose pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--panel);
  font-size: 0.9rem;
  line-height: 1.6;
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

.prose kbd {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--panel);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: 0.875em;
  font-weight: 700;
}

.prose blockquote {
  margin-left: 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--line-strong);
  color: var(--fog);
}

.prose hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose figure {
  margin-inline: 0;
}

.prose figcaption {
  margin-top: 8px;
  color: var(--dim);
  font-size: 0.9375rem;
}

.prose img {
  height: auto;
  border-radius: var(--radius-m);
}

/* Tables scroll inside themselves on phones instead of widening the page. */
.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 1rem;
}

.prose th,
.prose td {
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  color: var(--paper);
  font-weight: 700;
  border-bottom-color: var(--line-strong);
  white-space: nowrap;
}

.prose td {
  color: #d5d8de;
}

.prose td:first-child {
  color: var(--paper);
  font-weight: 600;
}

/* Preview and draft notices: the yellow warning colour, tinted so the notice reads before the text does. */
.notice {
  margin-bottom: 2em;
  padding: 14px 18px;
  border-left: 3px solid var(--sun);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  background: color-mix(in srgb, var(--sun) 8%, var(--panel));
  color: #e9dcb8;
}

.prose .notice {
  color: #e9dcb8;
}

.notice strong,
.prose .notice strong {
  color: var(--sun);
}

.resource-grid {
  display: grid;
  gap: 12px;
  margin: 0 0 2em;
}

@media (min-width: 640px) {
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.resource-link {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--panel);
  color: var(--paper);
  text-decoration: none;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.resource-link:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: #1d1e24;
  color: var(--paper);
}

.prose .resource-link h2,
.resource-link h2 {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.prose .resource-link p,
.resource-link p {
  margin: 0;
  color: var(--fog);
  font-size: 1rem;
}

.faq-list {
  border-top: 1px solid var(--line);
  margin-bottom: 2em;
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  position: relative;
  padding: 18px 40px 18px 0;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-stretch: 90%;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 6px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 150ms ease;
}

.faq-list details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq-list summary:hover {
  color: var(--accent);
}

.faq-list details > :not(summary) {
  margin-top: 0;
  padding-bottom: 6px;
  max-width: 64ch;
}

/* Answers open smoothly: the height animates where the browser supports it, and the text fades in everywhere. */
@media (prefers-reduced-motion: no-preference) {
  .faq-list {
    interpolate-size: allow-keywords;
  }

  .faq-list details::details-content {
    height: 0;
    overflow: hidden;
    transition: height 240ms cubic-bezier(0.2, 0.7, 0.2, 1), content-visibility 240ms allow-discrete;
  }

  .faq-list details[open]::details-content {
    height: auto;
  }

  .faq-list details[open] > :not(summary) {
    animation: faq-in 260ms ease both;
  }
}

@keyframes faq-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* Docs: sidebar of page links beside the article. */
.doc-layout {
  display: grid;
  gap: 24px;
  padding-top: clamp(28px, 4vw, 48px);
  padding-bottom: var(--section-space);
}

.doc-sidebar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.doc-sidebar a {
  display: block;
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--fog);
  font-weight: 600;
  text-decoration: none;
  background: var(--panel);
}

.doc-sidebar a:hover {
  background: var(--raised);
  color: var(--paper);
}

.doc-sidebar a[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  color: var(--paper);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

@media (min-width: 900px) {
  .doc-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
  }

  .doc-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 24px);
  }

  .doc-sidebar nav {
    flex-direction: column;
    gap: 2px;
    padding-left: 0;
    border-left: 1px solid var(--line);
  }

  .doc-sidebar a {
    margin-left: -1px;
    padding: 7px 14px;
    border-left: 2px solid transparent;
    border-radius: 0 8px 8px 0;
    background: none;
  }

  .doc-sidebar a[aria-current="page"] {
    border-left-color: var(--accent);
    background: var(--panel);
    box-shadow: none;
  }
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--fog);
}

.footer-grid {
  display: grid;
  gap: 32px;
  padding-top: 56px;
  padding-bottom: 40px;
}

.footer-grid p {
  margin: 14px 0 0;
}

.footer-grid h2 {
  margin: 0 0 12px;
  color: var(--paper);
  font-family: var(--font-text);
  font-size: 1rem;
  font-weight: 700;
  font-stretch: 100%;
  letter-spacing: 0;
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li + li {
  margin-top: 8px;
}

.footer-grid nav a {
  color: var(--fog);
  text-decoration: none;
}

.footer-grid nav a:hover {
  color: var(--paper);
  text-decoration: underline;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .footer-grid > :first-child {
    grid-column: auto;
  }
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  padding-bottom: 28px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.9375rem;
}

.footer-bottom p {
  margin: 0;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 200ms;
    animation-timing-function: ease;
  }

  /* The header stays put while the page under it changes. */
  .site-header {
    view-transition-name: site-header;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .btn-primary:hover,
  .btn-primary:active {
    transform: none;
  }
}
