/* MarkUpX homepage. Brand: charcoal #2A2826, raised #3A3836, grey #CAC9C9, orange #FE8417.
   The idea: the page is a workbench, pictures are paper sheets, and orange is only ever "ink",
   the marks MarkUpX makes (plus the main button that takes you to it). */
html, body { background: #2a2826; }

:root {
  color-scheme: dark;
  --bench: #2a2826;
  --bench-2: #312f2d;
  --raised: #3a3836;
  --line: rgba(242, 239, 234, 0.12);
  --ink: #f2efea;
  --ink-2: rgba(242, 239, 234, 0.78);
  --ink-3: rgba(242, 239, 234, 0.58);
  --grey: #cac9c9;
  --orange: #fe8417;
  --on-orange: #2a2826;
  --paper: #f4f3f0;
  --font: Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; color: var(--ink); font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
::selection { background: rgba(254, 132, 23, 0.35); color: var(--ink); }
a { color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
code { font: 600 0.92em ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--ink); }
kbd {
  display: inline-block; min-width: 1.9em; padding: 1px 7px; text-align: center;
  font: 600 0.8em/1.6 var(--font); color: var(--ink);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--raised);
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 16px; border-radius: 999px; background: var(--orange); color: var(--on-orange); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---- Buttons ---- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px; border-radius: 999px;
  font: 700 16px/1 var(--font); letter-spacing: -0.005em; text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms, border-color 200ms, color 200ms;
}
.pill:active { transform: scale(0.97); }
.pill-primary { background: var(--orange); color: var(--on-orange); padding-right: 10px; }
.pill-primary:not(:has(.pill-arrow)) { padding-right: 24px; }
.pill-primary:hover { background: #ff9637; }
.pill-arrow { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--on-orange); transition: transform 200ms var(--ease-out); }
.pill-arrow svg { width: 16px; height: 16px; fill: none; stroke: var(--orange); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill:hover .pill-arrow { transform: translateX(3px); }
.pill-ghost { background: transparent; color: var(--ink); border-color: rgba(242, 239, 234, 0.32); }
.pill-ghost:hover { border-color: var(--ink); background: rgba(242, 239, 234, 0.06); }
.pill-small { min-height: 40px; padding: 9px 18px; font-size: 14.5px; }
.pill-large { min-height: 60px; padding: 14px 14px 14px 30px; font-size: 18px; }
.pill-large .pill-arrow { width: 38px; height: 38px; }

/* ---- Top bar ---- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 24px;
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: 14px var(--gutter); padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(42, 40, 38, 0.86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark img { width: 32px; height: 32px; border-radius: 8px; }
.wordmark span { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; color: var(--grey); }
.wordmark b { color: var(--orange); font-weight: 900; }
.top-nav { display: flex; gap: 26px; margin-left: auto; font-size: 14.5px; }
.top-nav a { color: var(--ink-2); text-decoration: none; padding: 8px 0; }
.top-nav a:hover { color: var(--ink); }

/* ---- Hero ---- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); align-items: center;
  gap: clamp(32px, 5vw, 72px);
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) var(--gutter) clamp(56px, 8vw, 104px);
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.01em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
h1 {
  margin-top: 22px; font-size: clamp(54px, 7vw, 100px); line-height: 0.95; letter-spacing: -0.045em; font-weight: 800;
}
h1 .line { display: block; white-space: nowrap; }
.circled { position: relative; display: inline-block; }
.ink { position: absolute; overflow: visible; pointer-events: none; }
.ink path { fill: none; stroke: var(--orange); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ink-ring { left: -9%; top: -14%; width: 118%; height: 128%; }
.ink-ring path { stroke-width: 5px; }
.lede { margin-top: 28px; max-width: 32rem; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.55; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 26px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-3); }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 14px; height: 9px; border: solid var(--grey); border-width: 0 0 2px 2px; transform: rotate(-45deg) translateY(-2px); opacity: 0.8; }

.hero-board { margin: 0; scroll-margin: 84px 0 16px; }
/* The canvas: a dotted board like the editor's endless workspace, with real pieces on it. */
.board-wrap {
  position: relative; border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(242, 239, 234, 0.08), 0 24px 60px rgba(0, 0, 0, 0.38), 0 4px 14px rgba(0, 0, 0, 0.22);
}
.board { width: 100%; height: auto; touch-action: auto; user-select: none; -webkit-user-select: none; }
.board.drawing { touch-action: none; }
.board.can-move .piece { cursor: grab; }
.board.can-draw { cursor: crosshair; }
.piece .lift { transition: filter 160ms; }
.piece.held { cursor: grabbing; }
.piece.held .lift { filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.45)); }
.piece .lift, .page .lift { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.28)); }
/* Marks never catch a press, so a press on a mark picks up the picture under it. */
.board .example, .board .user-marks { pointer-events: none; }
.board .example { transition: opacity 260ms; }
.board.own .example { opacity: 0; }
.board.can-move .piece:hover .lift { filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.36)); }
/* The bar is shown by main.js; with scripts on, its space is kept from the start so nothing jumps. */
.js .try-bar[hidden] { display: flex !important; visibility: hidden; }
.try-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; min-height: 44px; }
.try-hint { font-size: 14.5px; color: var(--ink-3); }
.try-tools { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--raised); }
.try-tools button {
  display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color 160ms, color 160ms;
}
.try-tools button:hover { color: var(--ink); background: rgba(242, 239, 234, 0.08); }
.try-tools button[aria-pressed="true"] { background: var(--orange); color: var(--on-orange); }
.try-tools svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Draw-in of the marks: rest state is fully drawn, so nothing is hidden if scripts don't run. */
.js .hero .m { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .hero .tag { opacity: 0; }
.js .hero .ink-ring path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .hero.play .m1 { animation: draw 520ms var(--ease-out) 700ms forwards; }
.js .hero.play .m2 { animation: draw 560ms var(--ease-out) 1250ms forwards; }
.js .hero.play .m3 { animation: draw 220ms var(--ease-out) 1760ms forwards; }
.js .hero.play .m4 { animation: draw 480ms var(--ease-out) 1900ms forwards; }
.js .hero.play .t1 { animation: pop 380ms var(--ease-out) 2550ms forwards; }
.js .hero.play .t2 { animation: pop 380ms var(--ease-out) 2150ms forwards; }
.js .hero.play .t3 { animation: pop 380ms var(--ease-out) 2400ms forwards; }
.js .hero.play .ink-ring path { animation: draw 900ms cubic-bezier(0.65, 0, 0.35, 1) 300ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tag { transform-box: fill-box; transform-origin: center; }

/* ---- Sections ---- */
.how, .private, .everywhere, .closer { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section-title { font-size: clamp(32px, 4.4vw, 54px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; max-width: 18ch; }
.section-sub { margin-top: 18px; max-width: 34rem; color: var(--ink-2); font-size: 18px; }

.how { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(72px, 10vw, 128px); border-top: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); margin: clamp(32px, 5vw, 56px) 0 0; padding: 0; list-style: none; }
.step { position: relative; padding: 0 0 30px; border-radius: 14px; background: var(--bench-2); border: 1px solid var(--line); overflow: hidden; }
.step-pic { width: 100%; height: auto; aspect-ratio: 640 / 420; background: #232120; border-bottom: 1px solid var(--line); }
.step .num { margin: -22px 0 0 26px; position: relative; box-shadow: 0 0 0 6px var(--bench-2); }
.step h3, .step p { padding: 0 28px; }
.num {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--orange); color: var(--on-orange); font-weight: 800; font-size: 20px;
}
.step h3 { margin-top: 18px; font-size: 23px; letter-spacing: -0.02em; }
.step p { margin-top: 10px; color: var(--ink-2); font-size: 16.5px; }

.private {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 96px); align-items: start;
  padding-top: clamp(72px, 10vw, 128px); padding-bottom: clamp(72px, 10vw, 128px); border-top: 1px solid var(--line);
}
.private-head { position: sticky; top: 96px; }
.claims { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 48px); margin: 0; }
.claim { padding: 24px 0 26px; border-top: 1px solid var(--line); }
.claim dt { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.claim dt::before { content: ""; flex: none; width: 10px; height: 10px; border: 2px solid var(--orange); border-radius: 3px; }
.claim dd { margin: 8px 0 0 22px; color: var(--ink-2); font-size: 16px; }

.everywhere { padding-top: clamp(72px, 10vw, 128px); padding-bottom: clamp(72px, 10vw, 128px); border-top: 1px solid var(--line); }
.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); margin-top: clamp(32px, 5vw, 56px); }
.platform { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 30px 28px; border-radius: 14px; background: var(--raised); }
.platform h3 { font-size: 30px; letter-spacing: -0.03em; }
.platform p:not(.status) { color: var(--ink-2); font-size: 16.5px; flex: 1; }
.platform .pill { margin-top: 8px; }
.platform .platform-note { flex: 0 0 auto; color: var(--ink-3); font-size: 15px; }
.platform-planned { background: transparent; border: 1.5px dashed rgba(242, 239, 234, 0.22); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status-live { color: var(--ink-2); }
.status-live::before { background: #7ccf8a; }
.status-planned { color: var(--ink-3); }
.status-planned::before { border: 2px solid var(--ink-3); width: 6px; height: 6px; }

.closer { padding-top: clamp(72px, 10vw, 136px); padding-bottom: clamp(80px, 11vw, 144px); text-align: center; border-top: 1px solid var(--line); }
.closer h2 { font-size: clamp(38px, 6vw, 80px); line-height: 1; letter-spacing: -0.045em; font-weight: 800; }
.underlined { position: relative; display: inline-block; white-space: nowrap; }
.ink-under { left: -2%; bottom: -0.2em; width: 104%; height: 0.3em; }
.ink-under path { stroke-width: 6px; }
.closer p { margin: 26px auto 36px; max-width: 30rem; color: var(--ink-2); font-size: 18px; }
/* 404 page */
.lost h1 { font-size: clamp(38px, 6vw, 80px); line-height: 1.05; letter-spacing: -0.045em; font-weight: 800; }
.lost .underlined { white-space: normal; }
.lost-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px;
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: 28px var(--gutter) max(28px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  font-size: 14.5px; color: var(--ink-3);
}
.wordmark-small span { font-size: 17px; }
.foot nav { display: flex; gap: 24px; }
.foot nav a { color: var(--ink-2); text-decoration: none; }
.foot nav a:hover { color: var(--ink); text-decoration: underline; }
.foot p { margin-left: auto; }

/* Scroll reveal: only when scripts run, once, small. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }

/* Keyboard wording for computers, touch wording for phones and tablets. */
.touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .kb, .kb-only { display: none; }
  .touch { display: inline; }
}

/* ---- Smaller screens ---- */
@media (max-width: 1020px) {
  .top-nav { display: none; }
  .top .pill { margin-left: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  /* One column: the canvas (4:3) is centred and never taller than the screen, so its tools stay
     in view on a phone held sideways. */
  .hero-board { width: 100%; max-width: 680px; margin-inline: auto; }
  .board-wrap { margin-inline: auto; max-width: calc((100vh - 160px) * 4 / 3); }
  @supports (height: 100svh) { .board-wrap { max-width: calc((100svh - 160px) * 4 / 3); } }
  .private { grid-template-columns: minmax(0, 1fr); }
  .private-head { position: static; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  /* Phones: the canvas comes straight after the headline, then the words and buttons. */
  .hero { gap: 0; }
  .hero-copy { display: contents; }
  .hero-board { order: 1; margin-top: 30px; }
  .lede, .actions, .facts { order: 2; }
  .steps, .platforms { grid-template-columns: minmax(0, 1fr); }
  .claims { grid-template-columns: minmax(0, 1fr); }
  .actions .pill { flex: 1 1 auto; }
  .try-bar { flex-wrap: wrap; }
  .foot p { margin-left: 0; width: 100%; }
}
@media (max-width: 420px) {
  .top .pill { padding: 8px 14px; }
  .wordmark span { font-size: 19px; }
  h1 { font-size: clamp(48px, 15vw, 60px); }
  .ink-ring { left: -6%; width: 112%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .hero .m, .js .hero .ink-ring path { stroke-dashoffset: 0 !important; animation: none !important; }
  .js .hero .tag { opacity: 1 !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .pill, .pill-arrow { transition: none; }
}

/* Printing: show everything, dark ink on white paper, no practice canvas. */
@media print {
  :root { --ink: #111; --ink-2: #333; --ink-3: #555; --line: #ccc; --grey: #555; }
  html, body { background: #fff !important; color: #111; }
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .js .hero .m, .js .hero .ink-ring path { stroke-dashoffset: 0 !important; animation: none !important; }
  .js .hero .tag { opacity: 1 !important; animation: none !important; }
  .top, .private-head { position: static; }
  .top { -webkit-backdrop-filter: none; backdrop-filter: none; background: none; }
  .try-bar, .skip { display: none !important; }
  .pill-ghost { border-color: #999; }
  .step, .platform, kbd { background: none !important; border-color: #ccc; }
  .step, .platform, .board-wrap { break-inside: avoid; }
}
