/* PocketCAD: the app's own world. Graphite canvas, one instrument surface, PocketCAD blue
   (Palette.swift, Instrument.swift). */

:root {
  color-scheme: dark;
  --canvas: #17181d;
  --bg-top: #22252b;
  --bg-bottom: #16171c;
  --surface: #1e2127;
  --raised: rgba(255, 255, 255, 0.08);
  --raised-on: rgba(255, 255, 255, 0.24);
  --edge: rgba(255, 255, 255, 0.09);
  --ink: #e8eaee;
  --ink-2: #a3a9b4;
  --ink-3: #8a91a0;
  --accent: #2f6bff;
  --accent-ink: #5c8bff;
  --region: #a3b8ee;
  --focus: var(--accent-ink);
  --r-key: 8px;
  --r-tile: 14px;
  --r-card: 22px;
  --wide: "Mona Sans", system-ui, sans-serif;
  --text: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
}

body.pc {
  background: var(--bg-bottom);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.55;
}

.wide {
  font-family: var(--wide);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.02;
}

/* The one surface: matte graphite, one hairline edge, one shadow. */
.surface {
  background: rgba(30, 33, 39, 0.96);
  box-shadow:
    inset 0 0 0 1px var(--edge),
    0 5px 28px rgba(0, 0, 0, 0.3);
  border-radius: var(--r-card);
}

/* The one button family: capsules drawn like the pad's keys. */
.capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 17px;
  white-space: nowrap;
  transition:
    transform var(--snap-dur) var(--snap),
    background-color 0.2s;
}
.capsule:active,
.capsule.is-down {
  transform: scale(0.96);
}
.capsule--primary {
  background: var(--accent);
  color: #fff;
}
.capsule--primary:hover {
  background: #3d76ff;
}
.capsule--secondary {
  background: var(--raised);
  color: var(--ink);
}
.capsule--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}
.capsule--small {
  height: 34px;
  padding: 0 14px;
  font-size: 15px;
}
.capsule svg {
  width: 18px;
  height: 18px;
}

/* ---- The company's bar, over the app's world */

.pc-bar {
  position: relative;
  z-index: 10;
  height: 52px;
  background: var(--bg-top);
  border-bottom: 1px solid var(--edge);
}
.pc-bar .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pc-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-variation-settings: "opsz" 32;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.03em;
  color: var(--ink-2);
  transition: color 0.2s;
}
.pc-bar__brand:hover {
  color: var(--ink);
}
.pc-bar__brand svg {
  width: 16px;
  height: 16px;
  transition: transform 0.4s var(--settle);
}
.pc-bar__brand:hover svg {
  transform: translateX(-3px);
}
.pc-bar nav {
  display: flex;
  gap: 24px;
  font-size: 15px;
  color: var(--ink-2);
}
.pc-bar nav a:hover {
  color: var(--ink);
}

/* ---- The print bed: the app's landing, on the page */

.bed {
  /* Where the name docks over the heading, and how tall it stands there: the app's 14 and 12 points. */
  --dock-top: 14px;
  --dock-height: 12px;
  position: relative;
  /* The bed above, framed in its own box as the app frames its view; the words and buttons under it. */
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  touch-action: pan-y;
  height: calc(100svh - 52px);
  min-height: 600px;
  max-height: 1060px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  view-transition-name: pocketcad-stage;
  user-select: none;
  -webkit-user-select: none;
}
.bed__flat {
  position: absolute;
  inset: 0;
  background: var(--canvas);
  opacity: 0;
  pointer-events: none;
}
.bed__stage {
  position: relative;
  min-height: 0;
}
.bed canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}
.bed canvas:active {
  cursor: grabbing;
}

/* The launch screen's still: the canvas colour and the art, centred on the bed. */
.bed__still {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: var(--canvas);
  pointer-events: none;
}
.bed__art {
  /* The app's launch art fills half a phone's width; here, a similar share of the view. */
  width: min(clamp(220px, 40vh, 420px), 62vw);
  height: auto;
}
.no-js .bed__still,
.bed.is-static .bed__still {
  background: transparent;
}

/* The name, drawn from the launch art: under the mark as the page opens, gliding to the heading. */
.bed__wordmark {
  position: absolute;
  z-index: 4;
  left: 0;
  top: 0;
  width: auto;
  height: var(--dock-height);
  transform-origin: 0 0;
  opacity: 0;
  pointer-events: none;
}

.bed__head {
  position: absolute;
  z-index: 3;
  left: var(--inset);
  top: calc(var(--dock-top) + var(--dock-height) + 14px);
  right: var(--inset);
  opacity: 0;
  transition: opacity var(--leave-dur) var(--leave);
  pointer-events: none;
}
.bed__head.is-shown {
  opacity: 1;
  transition: opacity var(--panel-dur) var(--panel);
}
.bed__name {
  font-family: var(--wide);
  font-stretch: 125%;
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.bed__detail {
  margin-top: 6px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.bed__chrome {
  --inset: max(var(--gutter), calc((100% - var(--measure)) / 2));
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
}
.bed__chrome.is-shown {
  opacity: 1;
  transition: opacity var(--panel-dur) var(--panel);
}
.bed__chrome > * {
  pointer-events: auto;
}
.bed__head {
  pointer-events: none;
}
.bed__foot {
  position: relative;
  z-index: 3;
  padding: 4px var(--gutter) clamp(18px, 3.5vh, 36px);
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.bed__foot.is-shown {
  opacity: 1;
  transition: opacity var(--panel-dur) var(--panel);
}
.bed__count {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.bed__dots {
  display: flex;
  gap: 6px;
}
.bed__dots i {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(232, 234, 238, 0.22);
  transition:
    width var(--snap-dur) var(--snap),
    background-color var(--snap-dur);
}
.bed__dots i.is-on {
  width: 16px;
  background: var(--accent);
}
.bed__tagline {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink);
  font-weight: 500;
  max-width: 34rem;
}
.bed__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.bed__hint {
  max-width: 34rem;
  font-size: 14px;
  color: var(--ink-2);
}
.bed__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border-radius: 50%;
  color: var(--accent-ink);
  transition:
    background-color 0.2s,
    transform var(--snap-dur) var(--snap);
}
.bed__arrow:hover {
  background: var(--raised);
}
.bed__arrow:active {
  transform: scale(0.92);
}
.bed__arrow svg {
  width: 22px;
  height: 22px;
}
.bed__arrow--prev {
  left: max(8px, calc(var(--inset) - 16px));
}
.bed__arrow--next {
  right: max(8px, calc(var(--inset) - 16px));
}
@media (max-width: 640px) {
  .bed__arrow {
    top: 46%;
  }
}

/* ---- Sections below the bed */

.pc-section {
  padding-block: clamp(72px, 12vh, 140px);
}
.pc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.pc-kicker svg {
  width: 18px;
  height: 18px;
}
.statement h2 {
  margin-top: 20px;
  font-size: clamp(2.5rem, 6.4vw, 5.6rem);
  max-width: 14ch;
}
.statement p {
  margin-top: 28px;
  max-width: 40rem;
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  color: var(--ink-2);
}
.statement p strong {
  color: var(--ink);
  font-weight: 600;
}

/* Push/Pull: the icon's part pulled to its ghost, the card and pad beside it. */
.pull {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.pull__copy h2 {
  margin-top: 18px;
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
}
.pull__copy p {
  margin-top: 20px;
  color: var(--ink-2);
  max-width: 30rem;
}
.pull__demo {
  position: relative;
  display: grid;
  gap: 18px;
  justify-items: center;
}
.pull__stage {
  position: relative;
  width: min(100%, 420px, 70vw);
  aspect-ratio: 1;
}
.pull__stage svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.handle {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translate(-19px, -19px);
  opacity: 0;
  transition: opacity var(--panel-dur) var(--panel);
  pointer-events: none;
}
.handle.is-shown {
  opacity: 1;
}
.handle__knob {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #14161b;
  box-shadow:
    inset 0 0 0 2px var(--accent),
    0 4px 14px rgba(0, 0, 0, 0.5);
  color: var(--accent-ink);
}
.handle__knob svg {
  width: 20px;
  height: 20px;
}
.handle__chip {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(30, 33, 39, 0.96);
  box-shadow: inset 0 0 0 1px var(--edge);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.handle__chip small {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.instrument {
  width: min(100%, 560px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.op-card {
  padding: 16px 16px 14px 18px;
}
.op-card__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.op-card__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 17px;
  margin-right: auto;
}
.op-card__title .glyph {
  width: 22px;
  height: 22px;
  color: var(--accent-ink);
}
.op-card__hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.pad {
  padding: 12px;
}
.pad__read {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 2px 6px 10px;
}
.pad__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-right: 8px;
  align-self: center;
}
.pad__sign {
  font-size: 18px;
  color: var(--ink-3);
  align-self: center;
  margin-right: 4px;
}
.pad__digit {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 26px;
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: rgba(232, 234, 238, 0.32);
  transition: color var(--snap-dur);
}
.pad__digit::after {
  content: "";
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: rgba(232, 234, 238, 0.18);
  transition: background-color var(--snap-dur);
}
.pad__digit.is-set {
  color: var(--ink);
}
.pad__digit.is-at {
  color: var(--accent-ink);
}
.pad__digit.is-at::after {
  background: var(--accent);
}
.pad__digit.is-down {
  transform: scale(0.94);
}
.pad__dot {
  font-size: 24px;
  line-height: 1;
  color: var(--ink-2);
  padding-bottom: 8px;
}
.pad__unit {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-2);
  align-self: center;
}
.pad__keys {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}
.pad__keys span {
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: var(--r-key);
  background: var(--raised);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  transition:
    background-color 0.1s ease-out,
    transform 0.1s ease-out;
}
.pad__keys span.is-down {
  background: var(--raised-on);
  transform: scale(0.94);
}
@media (max-width: 900px) {
  .pull {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .pad__keys span {
    height: 38px;
    font-size: 17px;
  }
  .pad__digit {
    min-width: 20px;
    font-size: 21px;
  }
  .pad__digit::after {
    width: 16px;
  }
}

/* The tools, each on the instrument's card with the app's own glyph. */
.tools-head h2 {
  margin-top: 18px;
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  max-width: 18ch;
}
.tools {
  margin-top: clamp(32px, 6vh, 64px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.tool {
  padding: 22px 22px 24px;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
}
.tools.is-in .tool {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--bloom-dur) var(--settle),
    transform var(--bloom-dur) var(--bloom);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.tool__glyph {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-tile);
  background: var(--raised);
  color: var(--ink);
}
.tool__glyph .glyph {
  width: 26px;
  height: 26px;
}
.tool h3 {
  margin-top: 18px;
  font-size: 17px;
  font-weight: 600;
}
.tool p {
  margin-top: 6px;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.5;
}
.glyph {
  display: inline-block;
  flex: none;
  width: 1.25em;
  height: 1.25em;
}
.glyph svg {
  width: 100%;
  height: 100%;
}
.pc-kicker .glyph {
  width: 20px;
  height: 20px;
}

/* Parametric: the history beside the part it builds. */
.param {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
}
.param__copy h2 {
  margin-top: 18px;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
}
.param__copy > p {
  margin-top: 20px;
  color: var(--ink-2);
  max-width: 32rem;
}
.param__stage {
  position: relative;
  aspect-ratio: 7 / 5;
  border-radius: var(--r-card);
  background: radial-gradient(120% 90% at 50% 20%, #23262d, #17181d);
  box-shadow: inset 0 0 0 1px var(--edge);
  overflow: hidden;
}
.param__stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.history {
  margin-top: 28px;
  padding: 10px 8px 8px;
  max-width: 420px;
}
.history__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 10px;
  font-size: 15px;
}
.history__head .glyph {
  width: 18px;
  height: 18px;
  color: var(--ink-2);
}
.history__count {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.history__rows {
  display: grid;
  gap: 2px;
}
.history__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-tile);
  transition:
    background-color var(--snap-dur) var(--snap),
    box-shadow var(--snap-dur) var(--snap);
}
.history__row.is-open {
  background: rgba(47, 107, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(92, 139, 255, 0.55);
}
.history__glyph {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--raised);
  color: var(--ink);
}
.history__glyph .glyph {
  width: 18px;
  height: 18px;
}
.history__row.is-open .history__glyph {
  color: var(--accent-ink);
}
.history__row.is-open .history__text small {
  color: var(--ink);
  font-weight: 600;
}
.history__row.is-replayed .history__glyph {
  animation: replay 0.7s var(--settle);
}
@keyframes replay {
  0% {
    background: var(--accent);
    color: #fff;
  }
  100% {
    background: var(--raised);
  }
}
.history__text {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}
.history__text b {
  font-size: 15px;
  font-weight: 600;
}
.history__text small {
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history__chev {
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--ink-3);
}
@media (max-width: 900px) {
  .param {
    grid-template-columns: 1fr;
  }
  .param__stage {
    order: 2;
  }
}

/* Two promises side by side. */
.duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.duo__card {
  padding: clamp(26px, 4vw, 44px);
}
.duo__card h3 {
  margin-top: 16px;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
}
.duo__card p {
  margin-top: 14px;
  color: var(--ink-2);
}
.duo__card ul {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}
.duo__card li {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.duo__card li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-2px);
}
@media (max-width: 820px) {
  .duo {
    grid-template-columns: 1fr;
  }
}

/* The facts, and the few questions there are before it ships. */
.details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.details h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
}
.specs {
  margin-top: 24px;
  padding: 6px 24px;
}
.specs div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
}
.specs div + div {
  border-top: 1px solid var(--edge);
}
.specs dt {
  color: var(--ink-2);
}
.faq {
  margin-top: 24px;
  display: grid;
  gap: 10px;
}
.faq details {
  padding: 0 22px;
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2);
  transform: translateY(-3px) rotate(45deg);
  transition: transform var(--snap-dur) var(--snap);
}
.faq details[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}
.faq details p {
  padding-bottom: 20px;
  color: var(--ink-2);
}
.faq a,
.details a {
  color: var(--accent-ink);
}
@media (max-width: 860px) {
  .details {
    grid-template-columns: 1fr;
  }
  .specs div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.pc-footer {
  border-top: 1px solid var(--edge);
  padding-block: 30px 40px;
  font-size: 14px;
  color: var(--ink-3);
}
.pc-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: space-between;
}
.pc-footer nav {
  display: flex;
  gap: 22px;
}
.pc-footer a:hover {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .tool {
    opacity: 1;
    transform: none;
  }
}

/* ---- Phones: the same page, closer together */
@media (max-width: 700px) {
  .pc-section {
    padding-block: clamp(40px, 6vh, 56px);
  }
  .pc-section + .pc-section {
    padding-top: 8px;
  }
  .statement h2,
  .pull__copy h2,
  .param__copy h2,
  .tools-head h2 {
    margin-top: 12px;
  }
  .statement p,
  .pull__copy p,
  .param__copy > p {
    margin-top: 14px;
  }
  .param,
  .pull {
    gap: 24px;
  }
  .history {
    margin-top: 20px;
  }
  .pull__stage {
    width: min(100%, 300px);
  }
  .tools {
    margin-top: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .tool {
    padding: 14px 14px 16px;
  }
  .tool__glyph {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }
  .tool__glyph .glyph {
    width: 22px;
    height: 22px;
  }
  .tool h3 {
    margin-top: 12px;
    font-size: 15px;
  }
  .tool p {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.45;
  }
  .duo {
    gap: 10px;
  }
  .duo__card {
    padding: 22px;
  }
  .duo__card h3 {
    margin-top: 12px;
  }
  .duo__card ul {
    margin-top: 16px;
  }
  .details {
    gap: 32px;
  }
}
