/*
 * Squircle Dock: components
 * Built only from tokens.css. Link tokens.css first, then this file.
 */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sq-bezel);
  color: var(--sq-text);
  font-family: var(--sq-sans);
  font-size: var(--sq-text-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-family: var(--sq-display); font-weight: 700; line-height: 1.05; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--sq-sky); outline-offset: 2px; }

/* ---------- App shell: bezel, icon strip, sidebar, canvas ---------- */
.sq-app {
  display: grid;
  grid-template-columns: var(--sq-strip) var(--sq-sidebar) minmax(0, 1fr);
  gap: var(--sq-bezel-gap);
  min-height: 100vh;
  padding: var(--sq-bezel-gap) var(--sq-bezel-gap) var(--sq-bezel-gap) 0;
}
.sq-strip {
  position: sticky; top: var(--sq-bezel-gap);
  height: calc(100vh - 2 * var(--sq-bezel-gap));
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 0;
}
.sq-strip hr { width: 20px; border: 0; border-top: 1px solid var(--sq-line); margin: 6px 0; }
.sq-strip-btn {
  width: 36px; height: 36px; border-radius: var(--sq-radius-sm);
  display: grid; place-items: center; color: var(--sq-faint);
  transition: background .2s var(--sq-ease), color .2s var(--sq-ease);
}
.sq-strip-btn:hover, .sq-strip-btn.is-active { background: var(--sq-raised); color: var(--sq-text); }
.sq-strip-btn svg { width: 18px; height: 18px; }
.sq-strip .sq-strip-end { margin-top: auto; }

.sq-sidebar {
  position: sticky; top: var(--sq-bezel-gap);
  height: calc(100vh - 2 * var(--sq-bezel-gap));
  display: flex; flex-direction: column;
  background: var(--sq-rail);
  border: var(--sq-border);
  border-radius: var(--sq-radius);
  padding: 14px 10px 10px;
}
.sq-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 18px; }
.sq-brand { font-family: var(--sq-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.sq-round {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; border: 1px solid var(--sq-line-strong); color: var(--sq-text);
  cursor: pointer; flex: none;
}
.sq-round svg { width: 16px; height: 16px; }
.sq-round:hover { background: var(--sq-hover); }
.sq-round.is-solid { background: var(--sq-raised); border-color: transparent; }

.sq-tools { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sq-tool {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: var(--sq-radius-sm);
  font-weight: 500; color: var(--sq-text);
  transition: background .2s var(--sq-ease);
}
.sq-tool:hover { background: var(--sq-raised); }
.sq-tool.is-active { background: var(--sq-hover); }
.sq-tool.is-muted { color: var(--sq-faint); }
.sq-tool .sq-tool-end { margin-left: auto; color: var(--sq-faint); }

.sq-side-foot { margin-top: auto; display: grid; gap: 2px; }
.sq-side-foot .sq-tool { justify-content: space-between; }
.sq-side-foot .sq-btn { width: 100%; margin-top: 8px; }

.sq-canvas {
  min-width: 0;
  background: var(--sq-canvas);
  border: var(--sq-border);
  border-radius: var(--sq-radius);
  overflow: hidden;
}

/* ---------- Squircle icons ---------- */
.sq-icon {
  width: 22px; height: 22px; flex: none;
  border-radius: var(--sq-radius-xs);
  display: grid; place-items: center;
  background: var(--sq-raised); color: #fff;
  box-shadow: var(--sq-icon-shine);
}
.sq-icon svg { width: 13px; height: 13px; }
.sq-icon-lg { width: 44px; height: 44px; border-radius: 13px; }
.sq-icon-lg svg { width: 22px; height: 22px; }
.sq-icon.is-tomato { background: var(--sq-tomato); }
.sq-icon.is-butter { background: var(--sq-butter); color: var(--sq-on-white); }
.sq-icon.is-mint { background: var(--sq-mint); color: var(--sq-on-white); }
.sq-icon.is-sky { background: var(--sq-sky); }
.sq-icon.is-grape { background: var(--sq-grape); }
.sq-icon.is-rose { background: var(--sq-rose); }
.sq-icon.is-white { background: var(--sq-white); color: var(--sq-on-white); }

/* ---------- Layout helpers ---------- */
.sq-wrap { width: min(var(--sq-content), 100% - 48px); margin-inline: auto; }
.sq-narrow { width: min(var(--sq-narrow), 100% - 48px); margin-inline: auto; }
.sq-section { padding-block: var(--sq-section); }
.sq-section + .sq-section { padding-top: 0; }
.sq-stack { display: grid; gap: 16px; }
.sq-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ---------- Type ---------- */
.sq-eyebrow {
  font-family: var(--sq-mono); font-size: var(--sq-text-micro);
  text-transform: uppercase; letter-spacing: .12em; color: var(--sq-faint);
}
.sq-title { font-size: var(--sq-text-hero); letter-spacing: var(--sq-tracking-hero); }
.sq-h2 { font-size: var(--sq-text-h2); letter-spacing: var(--sq-tracking-h2); }
.sq-h3 { font-size: var(--sq-text-h3); letter-spacing: -.01em; font-weight: 700; }
.sq-lead { font-size: var(--sq-text-lead); color: var(--sq-soft); max-width: 58ch; }
.sq-soft { color: var(--sq-soft); }
.sq-small { font-size: var(--sq-text-small); color: var(--sq-soft); }

/* ---------- Buttons ---------- */
.sq-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px;
  border: 0; border-radius: var(--sq-radius-sm);
  background: var(--sq-white); color: var(--sq-on-white);
  font: 600 15px/1 var(--sq-sans);
  white-space: nowrap; cursor: pointer;
  transition: transform .2s var(--sq-ease), background .2s var(--sq-ease);
}
.sq-btn:hover { transform: translateY(-1px); background: #ececec; }
.sq-btn.is-pill { border-radius: var(--sq-radius-pill); }
.sq-btn.is-ghost { background: var(--sq-raised); color: var(--sq-text); }
.sq-btn.is-ghost:hover { background: var(--sq-hover); }
.sq-btn.is-small { height: 36px; padding: 0 14px; font-size: 14px; }
.sq-btn svg { width: 16px; height: 16px; }

/* ---------- Badges and chips ---------- */
.sq-badge-ring {
  display: inline-flex; align-items: center; width: fit-content; justify-self: start;
  padding: 1px; border-radius: var(--sq-radius-pill);
  background: var(--sq-ring);
  white-space: nowrap;
}
.sq-badge-ring > span {
  display: block; padding: 2px 9px; border-radius: var(--sq-radius-pill);
  background: var(--sq-rail); color: var(--sq-text);
  font-size: var(--sq-text-micro); font-weight: 600;
}
.sq-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px 0 6px;
  border-radius: var(--sq-radius-pill);
  background: var(--sq-raised); font-size: var(--sq-text-small); font-weight: 500;
  white-space: nowrap;
}
.sq-chip .sq-icon { width: 20px; height: 20px; border-radius: var(--sq-radius-pill); }

/* ---------- Media tiles (the signature) ---------- */
.sq-tile { display: grid; gap: 16px; }
.sq-tile-media {
  position: relative; overflow: hidden;
  aspect-ratio: 5 / 2;
  border-radius: var(--sq-radius-lg);
  background: var(--sq-raised);
  border: 1px solid rgba(255, 255, 255, .06);
}
.sq-tile-media.is-tall { aspect-ratio: 4 / 3; }
.sq-tile-media.is-square { aspect-ratio: 1; }
.sq-tile-caption { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sq-tile-caption h2, .sq-tile-caption h3 {
  font-family: var(--sq-sans); font-weight: 500;
  font-size: var(--sq-text-caption); letter-spacing: -.01em; line-height: 1.25;
}
.sq-tile-caption .sq-row { flex-wrap: nowrap; gap: 8px; }

/* Scene backgrounds for drawn media */
.sq-scene-sky { background: linear-gradient(160deg, #dfe6f3, #c4d0e6 60%, #aebcda); }
.sq-scene-butter { background: radial-gradient(120% 90% at 20% 10%, #fff1c4, #ffd36a 55%, #f4a93a); }
.sq-scene-mint { background: radial-gradient(110% 100% at 80% 0%, #c9f5e2, #6fdcac 50%, #2bae7c); }
.sq-scene-grape { background: radial-gradient(120% 100% at 0% 100%, #2a1650, #5b34b8 55%, #9a6bff); }
.sq-scene-tomato { background: radial-gradient(120% 100% at 100% 100%, #7a1f0a, #d9481f 50%, #ff8a5c); }

/* Drawn objects inside scenes */
.sq-sticker {
  position: absolute;
  padding: 8px 16px; border-radius: 10px;
  background: #fff; color: var(--sq-on-white);
  font: 700 clamp(14px, 2vw, 26px)/1 var(--sq-display); letter-spacing: -.02em;
  box-shadow: 0 0 0 5px #fff, 0 14px 30px rgba(0, 0, 0, .25);
  white-space: nowrap;
}
.sq-sticker.is-tomato { background: var(--sq-tomato); color: #fff; }
.sq-sticker.is-sky { background: var(--sq-sky); color: #fff; }
.sq-sticker.is-grape { background: var(--sq-grape); color: #fff; }
.sq-sticker.is-mint { background: var(--sq-mint); }
.sq-sticker.is-butter { background: var(--sq-butter); }
.sq-sticker.is-rose { background: var(--sq-rose); color: #fff; }
.sq-dot { position: absolute; border-radius: 50%; }
.sq-pole {
  position: absolute; width: 4%; min-width: 14px;
  border-radius: 999px;
  background: repeating-linear-gradient(180deg, #fff 0 18px, var(--sq-rose) 18px 34px, var(--sq-butter) 34px 50px, var(--sq-sky) 50px 66px);
  box-shadow: 0 0 0 4px #fff;
}

/* ---------- Cards ---------- */
.sq-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.sq-card {
  display: grid; gap: 12px; align-content: start;
  padding: 22px; border-radius: var(--sq-radius);
  background: var(--sq-rail); border: var(--sq-border);
}
.sq-card p { color: var(--sq-soft); font-size: 15px; }
.sq-card:hover { background: var(--sq-raised); }

.sq-stat { display: grid; gap: 4px; }
.sq-stat strong { font-family: var(--sq-display); font-size: 40px; letter-spacing: -.03em; line-height: 1; }

/* ---------- Top bar inside the canvas ---------- */
.sq-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: var(--sq-border);
}
.sq-crumbs { display: flex; align-items: center; gap: 8px; font-size: var(--sq-text-small); color: var(--sq-soft); min-width: 0; }
.sq-crumbs b { color: var(--sq-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Pricing ---------- */
.sq-toggle {
  display: inline-flex; padding: 4px; gap: 4px;
  border-radius: var(--sq-radius-pill); background: var(--sq-rail); border: var(--sq-border);
}
.sq-toggle button {
  border: 0; background: transparent; color: var(--sq-soft);
  height: 34px; padding: 0 16px; border-radius: var(--sq-radius-pill);
  font: 500 14px/1 var(--sq-sans); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.sq-toggle button.is-on { background: var(--sq-hover); color: var(--sq-text); }
.sq-plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); align-items: stretch; }
.sq-plan {
  display: flex; flex-direction: column; gap: 18px;
  padding: 26px; border-radius: var(--sq-radius-lg);
  background: var(--sq-rail); border: var(--sq-border);
}
.sq-plan.is-featured { position: relative; border-color: transparent; background: linear-gradient(var(--sq-raised), var(--sq-raised)) padding-box, var(--sq-ring) border-box; border: 1px solid transparent; }
.sq-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sq-price { font-family: var(--sq-display); font-size: 48px; letter-spacing: -.03em; line-height: 1; }
.sq-price small { font-family: var(--sq-sans); font-size: 15px; color: var(--sq-soft); letter-spacing: 0; font-weight: 400; }
.sq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; color: var(--sq-soft); }
.sq-list li { display: flex; gap: 10px; align-items: flex-start; }
.sq-list li::before {
  content: ""; flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 5px;
  background: var(--sq-mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.5L12 5.4' fill='none' stroke='%23111113' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.sq-plan .sq-btn { margin-top: auto; width: 100%; }

.sq-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sq-table th, .sq-table td { text-align: left; padding: 14px 12px; border-bottom: var(--sq-border); }
.sq-table th { font-weight: 500; color: var(--sq-soft); }
.sq-table td:not(:first-child), .sq-table th:not(:first-child) { text-align: center; }
.sq-table-wrap { overflow-x: auto; border-radius: var(--sq-radius); border: var(--sq-border); background: var(--sq-rail); }

.sq-faq { display: grid; gap: 8px; }
.sq-faq details { border-radius: var(--sq-radius); background: var(--sq-rail); border: var(--sq-border); padding: 16px 20px; }
.sq-faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.sq-faq summary::after { content: "+"; color: var(--sq-faint); }
.sq-faq details[open] summary::after { content: "\2212"; }
.sq-faq p { margin-top: 10px; color: var(--sq-soft); }

/* ---------- Article ---------- */
.sq-article { font-size: 18px; line-height: 1.7; }
.sq-article > * + * { margin-top: 1.1em; }
.sq-article h2 { font-size: 30px; letter-spacing: -.02em; margin-top: 1.8em; }
.sq-article p { color: #d9d8dd; }
.sq-article a { color: var(--sq-text); text-decoration: underline; text-decoration-color: var(--sq-grape); text-underline-offset: 3px; }
.sq-article blockquote {
  margin: 1.6em 0; padding: 22px 24px; border-radius: var(--sq-radius);
  background: var(--sq-rail); border: var(--sq-border);
  font-family: var(--sq-display); font-size: 24px; line-height: 1.3; letter-spacing: -.01em;
}
.sq-article ul { padding-left: 1.2em; color: #d9d8dd; }
.sq-article figure { margin: 1.8em 0; }
.sq-article figcaption { margin-top: 10px; font-size: var(--sq-text-small); color: var(--sq-faint); }
.sq-byline { display: flex; align-items: center; gap: 12px; font-size: var(--sq-text-small); color: var(--sq-soft); }
.sq-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sq-ring); flex: none; }
.sq-code {
  font-family: var(--sq-mono); font-size: 14px; line-height: 1.6;
  background: var(--sq-bezel); border: var(--sq-border); border-radius: var(--sq-radius);
  padding: 18px 20px; overflow-x: auto; color: var(--sq-soft); white-space: pre;
}

/* ---------- Forms ---------- */
.sq-form { display: grid; gap: 16px; }
.sq-field { display: grid; gap: 8px; }
.sq-label { font-size: var(--sq-text-small); font-weight: 500; color: var(--sq-soft); }
.sq-input {
  height: 46px; width: 100%; padding: 0 14px;
  border-radius: var(--sq-radius-sm); border: 1px solid var(--sq-line-strong);
  background: var(--sq-bezel); color: var(--sq-text);
  font: 400 15px var(--sq-sans);
}
.sq-input::placeholder { color: var(--sq-faint); }
.sq-input:focus { outline: none; border-color: var(--sq-sky); box-shadow: 0 0 0 3px rgba(79, 140, 255, .25); }
.sq-check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--sq-text-small); color: var(--sq-soft); }
.sq-check input { margin-top: 3px; accent-color: var(--sq-mint); }
.sq-divider { display: flex; align-items: center; gap: 12px; font-size: var(--sq-text-micro); color: var(--sq-faint); text-transform: uppercase; letter-spacing: .1em; }
.sq-divider::before, .sq-divider::after { content: ""; flex: 1; border-top: var(--sq-border); }
.sq-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.sq-pick label {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  border-radius: var(--sq-radius-sm); background: var(--sq-rail); border: var(--sq-border);
  font-size: 14px; font-weight: 500;
}
.sq-pick input { position: absolute; opacity: 0; pointer-events: none; }
.sq-pick input:checked + label { border-color: var(--sq-text); background: var(--sq-raised); }

/* ---------- Footer ---------- */
.sq-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  padding: 28px 24px; border-top: var(--sq-border);
  font-size: var(--sq-text-small); color: var(--sq-faint);
}
.sq-foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.sq-foot a:hover { color: var(--sq-text); }

/* ---------- Phones and tablets: the rails fold into a top bar ---------- */
@media (max-width: 900px) {
  .sq-app { display: block; padding: var(--sq-bezel-gap); }
  .sq-strip { display: none; }
  .sq-sidebar {
    position: static; height: auto; margin-bottom: var(--sq-bezel-gap);
    padding: 10px;
  }
  .sq-sidebar-head { padding: 2px 4px 10px; }
  .sq-tools { display: flex; flex-wrap: wrap; gap: 6px; }
  .sq-tool { padding: 6px 10px 6px 6px; background: var(--sq-raised); border-radius: var(--sq-radius-pill); font-size: 14px; }
  .sq-tool .sq-icon { border-radius: var(--sq-radius-pill); }
  .sq-tool.is-muted, .sq-tool .sq-tool-end { display: none; }
  .sq-side-foot { display: none; }
  .sq-tile-media { aspect-ratio: 4 / 3; }
  .sq-wrap, .sq-narrow { width: calc(100% - 32px); }
  .sq-topbar { padding: 12px 16px; }
}
