/*
 * arc2zen. One page, one direction: the page is dressed like the inside of a
 * browser, because the thing it rebuilds is a browser sidebar.
 *
 * No web fonts on purpose. The tool is macOS-only, so the system faces are
 * known and good: New York for display, SF Pro for prose, SF Mono for code.
 * That also keeps the strict content security policy satisfiable, since
 * nothing is fetched from anywhere.
 */

:root {
  --ink: #0d1017;
  --ink-2: #12161e;
  --panel: #171c26;
  --panel-2: #1e2430;
  --line: #2b3341;
  --line-soft: #222a36;

  --text: #e8ebf1;
  --muted: #9aa4b4;
  /* Light enough to clear 4.5:1 on the panels, since the labels and badges
     that use it are small. */
  --dim: #8b95a6;

  --coral: #ff7a6b;
  --violet: #9b8cff;
  --warn: #ffc46b;
  --bad: #ff8d7a;

  --serif: ui-serif, "New York", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", ui-sans-serif,
    system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  --measure: 62ch;
  --shell: 58rem;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Nothing on this page may push the viewport sideways. */
body,
main {
  overflow-x: hidden;
}

a {
  color: var(--violet);
  text-underline-offset: 3px;
}

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

code {
  font-size: 0.86em;
  color: #cfd6e2;
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 0.1em 0.36em;
  overflow-wrap: break-word;
}

kbd {
  font-size: 0.78em;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.12em 0.42em;
  white-space: nowrap;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.6rem 1.5rem 1.2rem;
  border-bottom: 1px solid var(--line-soft);
}

.wordmark {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

/* The single coloured thing above the fold: the move itself. */
.wordmark-arrow {
  display: inline-block;
  margin: 0 0.45em;
  background: linear-gradient(100deg, var(--coral), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.1em;
}

.masthead-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--dim);
}

/* ----------------------------------------------------------------- main */

main {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero {
  padding: 3.4rem 0 2.6rem;
}

h1 {
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 6.4vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 24ch;
}

.standfirst {
  margin: 0 0 1.4rem;
  max-width: var(--measure);
  font-size: 1.12rem;
  color: #d3d9e4;
}

.privacy {
  margin: 0;
  max-width: var(--measure);
  font-size: 0.92rem;
  color: var(--muted);
  padding-left: 0.9rem;
  border-left: 2px solid var(--line);
}

/* -------------------------------------------------------- warning panel */

.warning-panel {
  margin: 0 0 3.2rem;
  padding: 1.5rem 1.6rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
}

.warning-panel h2 {
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warn);
}

.warning-panel dl {
  margin: 0;
  display: grid;
  gap: 0.3rem;
}

.warning-panel dt {
  font-weight: 600;
  color: var(--text);
}

.warning-panel dd {
  margin: 0 0 0.9rem;
  max-width: var(--measure);
  color: var(--muted);
  font-size: 0.95rem;
}

.warning-panel dd:last-child {
  margin-bottom: 0.2rem;
}

/* ---------------------------------------------------------------- steps */

.step {
  padding: 2.6rem 0;
  border-top: 1px solid var(--line-soft);
}

.step h2 {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin: 0 0 1.1rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.45rem, 3.4vw, 1.9rem);
  letter-spacing: -0.01em;
}

/* Numbered because this genuinely is a sequence: the order is the method. */
.step-number {
  flex: none;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--dim);
  padding-top: 0.35em;
}

.step-lede {
  margin: -0.4rem 0 1.4rem;
  max-width: var(--measure);
  color: var(--muted);
}

.aside-note {
  margin: 1rem 0 0;
  max-width: var(--measure);
  font-size: 0.88rem;
  color: var(--dim);
}

.warn-inline {
  margin: 0.5rem 0 0;
  max-width: var(--measure);
  font-size: 0.9rem;
  color: var(--warn);
}

/* --------------------------------------------------------------- step 1 */

.path-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.path-row code {
  flex: 1 1 22rem;
  min-width: 0;
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  background: var(--ink-2);
  border-radius: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

.button {
  flex: none;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.button:hover {
  background: #232a37;
  border-color: #38414f;
}

.button-accent {
  color: #10131a;
  background: linear-gradient(100deg, var(--coral), var(--violet));
  border-color: transparent;
  font-weight: 600;
}

.button-accent:hover {
  background: linear-gradient(100deg, #ff8b7d, #a89bff);
  border-color: transparent;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* A disabled button must not look ready to press. */
.button-accent:disabled,
.button-accent:disabled:hover {
  color: var(--dim);
  background: var(--panel-2);
  border-color: var(--line);
}

.button.is-done {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line);
}

.finder-steps,
.run-steps {
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: item;
  display: grid;
  gap: 0.55rem;
  max-width: var(--measure);
}

.finder-steps li,
.run-steps li {
  counter-increment: item;
  padding-left: 2rem;
  position: relative;
  color: var(--muted);
}

.finder-steps li::before,
.run-steps li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
}

.run-steps {
  gap: 1.15rem;
}

.run-steps li {
  padding-top: 0.05rem;
}

.run-steps p {
  margin: 0;
  color: var(--muted);
}

.run-steps strong {
  color: var(--text);
}

/* --------------------------------------------------------------- step 2 */

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone.is-over {
  border-color: var(--violet);
  background: #191d2c;
}

.dropzone.is-loaded {
  border-style: solid;
  border-color: var(--line);
}

.dropzone-label {
  display: grid;
  place-items: center;
  gap: 0.3rem;
  padding: 2.6rem 1.5rem;
  cursor: pointer;
  text-align: center;
}

.dropzone-headline {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--text);
}

.dropzone-sub {
  font-size: 0.86rem;
  color: var(--dim);
}

.error {
  margin: 1.1rem 0 0;
  padding: 0.9rem 1.1rem;
  max-width: var(--measure);
  background: #22161a;
  border: 1px solid #4a2a2c;
  border-left: 3px solid var(--bad);
  border-radius: 10px;
  color: #f2cfc9;
  font-size: 0.94rem;
}

.error strong {
  display: block;
  color: var(--bad);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* --------------------------------------------------------------- step 3 */

.tally {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.4rem;
}

.tally-item {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}

.tally-item b {
  color: var(--text);
  font-weight: 600;
}

.preview {
  display: grid;
  gap: 1.1rem;
}

/* The signature element: the rebuilt sidebar, drawn as a sidebar. */
.container-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.3rem;
}

/* Marked as an example by its outline, not by fading it: the labels inside
   are meant to be read, and dimming them would drop below 4.5:1. */
.container-card.is-example {
  border-style: dashed;
}

.container-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line-soft);
}

.container-swatch {
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #37adff;
}

.container-swatch[data-color="blue"] { background: #37adff; }
.container-swatch[data-color="purple"] { background: #af7cf5; }
.container-swatch[data-color="green"] { background: #6cc94b; }
.container-swatch[data-color="orange"] { background: #ff9f45; }
.container-swatch[data-color="pink"] { background: #ff6bd0; }
.container-swatch[data-color="red"] { background: #ff6b52; }
.container-swatch[data-color="yellow"] { background: #ffcb45; }

.container-name {
  font-family: var(--serif);
  font-size: 1.1rem;
}

.container-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--dim);
}

.name-field {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--text);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.2rem 0.5rem;
  min-width: 6rem;
  max-width: 14rem;
}

.emoji-field {
  width: 3.2rem;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.2rem 0.3rem;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--dim);
}

.essentials {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.row-label {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.essential-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.essential-tiles li {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  width: 4.4rem;
}

/* No favicons: the page cannot fetch anything, so the initial stands in. */
.tile {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 1rem;
  color: #c9d1de;
}

.tile-name {
  font-size: 0.68rem;
  color: var(--dim);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.9rem 0 0.2rem;
}

.workspace-tab {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
}

.workspace-tab.is-current {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line);
}

/* Renaming row under the workspace tabs. */
.workspace-editor {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.85rem 0 0.2rem;
}

.workspace-editor .name-field {
  font-family: var(--sans);
  font-size: 0.9rem;
  max-width: 11rem;
}

.tree-holder {
  padding-top: 0.2rem;
}

.tree {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.tree .tree {
  margin: 0.1rem 0 0.2rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--line-soft);
}

/* Flex, not grid: the icon badge belongs next to the name it describes, not
   pushed to the far right of the card. */
.node {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.16rem 0;
  font-size: 0.9rem;
}

.node > .tree {
  flex-basis: 100%;
}

.twig {
  flex: none;
  width: 1.1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dim);
  text-align: center;
}

.node-folder > .node-name {
  color: var(--text);
  font-weight: 500;
}

.node-tab > .node-name {
  color: var(--muted);
}

.node-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-live > .node-name {
  color: var(--text);
}

.icon-badge {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--dim);
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 0.05rem 0.36rem;
  white-space: nowrap;
}

.icon-badge.is-live {
  color: #a9e0c0;
  border-color: #2c4438;
}

.empty-note {
  margin: 0.7rem 0 0;
  font-size: 0.86rem;
  color: var(--dim);
}

.notes {
  margin: 1.6rem 0 0;
  padding: 1.1rem 1.3rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
}

.notes h3 {
  margin: 0 0 0.7rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warn);
}

.notes ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.notes li {
  max-width: var(--measure);
  color: var(--muted);
  font-size: 0.93rem;
}

/* --------------------------------------------------------------- step 4 */

.script-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-2);
}

.script-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.85rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.script-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

pre {
  margin: 0;
  padding: 1rem 1.1rem;
  max-height: 26rem;
  overflow: auto;
  font-size: 0.74rem;
  line-height: 1.65;
  color: #c3ccdb;
  tab-size: 2;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* --------------------------------------------------------------- step 6 */

.leftovers {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.7rem;
  max-width: var(--measure);
}

.leftovers li {
  color: var(--muted);
  padding-left: 1.1rem;
  border-left: 1px solid var(--line);
}

.leftovers strong {
  color: var(--text);
  font-weight: 600;
}

/* --------------------------------------------------------------- footer */

.footer {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2.4rem 1.5rem 3.4rem;
  border-top: 1px solid var(--line-soft);
}

.footer p {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
  max-width: var(--measure);
}

/* ----------------------------------------------------------- responsive */

@media (max-width: 40rem) {
  .hero {
    padding: 2.4rem 0 2rem;
  }

  .step {
    padding: 2rem 0;
  }

  .step h2 {
    gap: 0.6rem;
  }

  .warning-panel,
  .container-card,
  .notes {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .path-row code {
    flex-basis: 100%;
  }

  pre {
    font-size: 0.7rem;
    max-height: 20rem;
  }
}

/* ---------------------------------------------------------------- motion */

/* One orchestrated moment: the preview arriving. Nothing else moves. */
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.container-card.is-fresh {
  animation: card-in 0.32s ease both;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
