/* drawinfinite.com (ADR 0170): the app's own paper and dark chrome, its blue, and Apple's
   rounded face where there is one. The top bar is the editor's, with its zoom readout. */
:root {
  --paper: #f0ebe0;
  --paper-deep: #e7e0d2;
  --chrome: #1c1c1c;
  --ink: #1d1d1f;
  --muted: #625d53;
  --blue: #0a84ff;
  /* Every section's sides: its content is one column, centred, at most 1240px wide. */
  --gutter: max(28px, 5vw, calc((100% - 1240px) / 2));
  --blue-ink: #0060c7;
  --rounded: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); font: 18px/1.55 var(--body); -webkit-text-size-adjust: 100%; }
a { color: var(--blue-ink); text-underline-offset: 0.16em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; padding: 8px 14px; background: #fff; color: var(--ink); border-radius: 8px; z-index: 3; }
.skip:focus { top: 10px; }

/* The bar: the editor's, dark, with the name in the middle and the zoom at the end. */
.site-bar {
  position: sticky; top: 0; z-index: 2;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  height: 56px; padding: 0 max(16px, env(safe-area-inset-left));
  background: var(--chrome); color: #f5f5f7;
}
.site-bar .mark { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 600 17px var(--rounded); justify-self: start; }
.site-bar .mark svg { width: 28px; height: 28px; border-radius: 7px; }
.site-bar nav { display: flex; gap: 4px; justify-self: center; }
.site-bar nav a { color: #c7c7cc; text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: 15px; }
.site-bar nav a:hover, .site-bar nav a[aria-current="page"] { color: #fff; background: rgb(255 255 255 / 0.1); }
.site-bar .end { justify-self: end; display: flex; align-items: center; gap: 10px; }
.readout {
  font: 500 14px var(--mono); color: #f5f5f7; font-variant-numeric: tabular-nums;
  padding: 5px 10px; border-radius: 8px; background: rgb(255 255 255 / 0.1); min-width: 8.5ch; text-align: center;
}
.readout:empty, .readout[hidden] { display: none; }
.bar-draw { color: #fff; background: var(--blue); text-decoration: none; padding: 6px 14px; border-radius: 9px; font-weight: 600; font-size: 15px; }

/* The hero: the zooming drawing, and the name on its paper. */
.hero { position: relative; height: clamp(560px, calc(100svh - 56px), 900px); overflow: hidden; }
.zoom { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  /* The paper fades in behind the words, wherever the column puts them. */
  background: linear-gradient(90deg, var(--paper) 0%, rgb(240 235 224 / 0.92) max(30%, calc(var(--gutter) + 22rem)), rgb(240 235 224 / 0) max(52%, calc(var(--gutter) + 40rem)));
}
.hero-text {
  position: absolute; z-index: 1; left: var(--gutter); bottom: clamp(36px, 8vh, 96px);
  max-width: min(36rem, 46vw);
}
.hero h1 {
  margin: 0; font: 800 clamp(64px, 9.5vw, 148px)/0.88 var(--rounded); letter-spacing: -0.045em;
}
.lede { margin: 22px 0 0; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.45; color: var(--ink); text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 30px; }
.button {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 26px; border-radius: 14px;
  background: var(--blue); color: #fff; text-decoration: none; font: 700 19px var(--rounded);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.08), 0 8px 24px -10px rgb(10 132 255 / 0.7);
}
.button:hover { background: #0077ed; }
.soon { font: 600 16px var(--rounded); color: var(--muted); }
.hero-note { margin: 14px 0 0; font-size: 15px; color: var(--muted); }

/* Below: what each place to draw has, and where drawings are kept. */
.places, .yours { padding-left: var(--gutter); padding-right: var(--gutter); }
.places { padding-top: 96px; }
h2 { font: 800 clamp(30px, 3.4vw, 44px)/1.1 var(--rounded); letter-spacing: -0.025em; margin: 0 0 28px; text-wrap: balance; }
.place-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.place { background: var(--paper-deep); border-radius: 22px; padding: 30px 32px 34px; }
.place h3 { font: 700 22px/1.25 var(--rounded); margin: 0 0 14px; }
.place ul { margin: 0; padding: 0; list-style: none; }
.place li { position: relative; padding: 9px 0 9px 26px; border-top: 1px solid rgb(29 29 31 / 0.09); }
.place li:first-child { border-top: 0; }
.place li::before { content: ""; position: absolute; left: 3px; top: 1.05em; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--blue); }
.text-link { display: inline-block; margin-top: 18px; font-weight: 600; }
.yours { padding-top: 88px; padding-bottom: 104px; }
.yours p { max-width: 40rem; margin: 0; font-size: 20px; }
@media (min-width: 1000px) {
  .yours { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
  .yours h2 { margin: 0; }
  .yours p { padding-top: 0.35em; }
}

/* Text pages: support, the privacy policy, the acknowledgements. */
.page { max-width: 720px; margin: 0 auto; padding: 64px max(24px, 5vw) 104px; }
.page h1 { font: 800 clamp(44px, 6vw, 68px)/1 var(--rounded); letter-spacing: -0.035em; margin: 0 0 20px; }
.page h2 { font-size: 24px; letter-spacing: -0.015em; margin: 44px 0 10px; }
.page .lede { margin-bottom: 8px; }
.page li { margin-bottom: 6px; }
.page.legal { overflow-wrap: anywhere; }

/* How it works (ADR 0170): the story stays on screen while the page scrolls through it; the step
   being shown is the one in full ink. */
.story { height: 620vh; position: relative; }
.story-stage {
  position: sticky; top: 56px; height: calc(100svh - 56px);
  display: grid; grid-template-columns: minmax(16rem, 0.8fr) minmax(0, 1.5fr); align-items: center; gap: clamp(28px, 4vw, 64px);
  padding: 0 var(--gutter);
}
.story-text h2 { margin-bottom: 22px; }
.story-steps { list-style: none; margin: 0; padding: 0; }
.story-steps li { padding: 10px 0 10px 18px; border-left: 3px solid rgb(29 29 31 / 0.1); opacity: 0.32; transition: opacity 0.3s, border-color 0.3s; }
.story-steps li[data-current] { opacity: 1; border-left-color: var(--blue); }
.story-steps h3 { margin: 0; font: 700 clamp(19px, 1.7vw, 24px)/1.25 var(--rounded); }
.story-steps p { margin: 4px 0 0; font-size: 16px; color: var(--muted); }
.device {
  justify-self: center; width: min(100%, calc((100svh - 56px - 72px) * 4 / 3 + 28px));
  padding: 14px; border-radius: 34px; background: #0e0e10;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.55), inset 0 0 0 1.5px #2c2c2e;
}
.device-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 38px; padding: 0 12px;
  background: var(--chrome); border-radius: 20px 20px 0 0; color: #d1d1d6; font-size: 13px;
}
.device-dots { width: 24px; height: 24px; border-radius: 50%; background: rgb(255 255 255 / 0.12) radial-gradient(circle, #d1d1d6 1.4px, transparent 1.6px) 4px 0 / 6px 100% repeat-x; }
.device-name { font-weight: 600; }
.device-readout { justify-self: end; font: 500 12px var(--mono); font-variant-numeric: tabular-nums; padding: 3px 8px; border-radius: 7px; background: rgb(255 255 255 / 0.12); }
.story-canvas { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 0 0 20px 20px; background: var(--paper); }

/* What you can do: a loop of each, drawn by hand. */
.features, .try { padding: 96px var(--gutter) 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.feature { background: var(--paper-deep); border-radius: 22px; padding: 12px 12px 22px; }
.feature canvas { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; background: var(--paper); }
.feature h3 { font: 700 21px/1.25 var(--rounded); margin: 16px 10px 4px; }
.feature p { margin: 0 10px; font-size: 16px; color: var(--muted); }

/* Try it here: a pad to draw and zoom on. */
.pad { position: relative; border-radius: 22px; overflow: hidden; background: var(--paper-deep); padding: 10px; }
.pad-canvas { display: block; width: 100%; height: clamp(320px, 56vh, 520px); border-radius: 14px; background: var(--paper); touch-action: none; cursor: crosshair; }
.pad-hint {
  position: absolute; left: 50%; top: 28px; transform: translateX(-50%); margin: 0; pointer-events: none;
  padding: 8px 16px; border-radius: 999px; background: rgb(28 28 28 / 0.86); color: #fff; font-size: 15px; white-space: nowrap;
  transition: opacity 0.4s;
}
.pad-hint[data-drawn] { opacity: 0; }
.pad-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px 2px; }
.pad-colors, .pad-zoom { display: flex; align-items: center; gap: 8px; }
.pad button { font: 600 16px var(--rounded); color: var(--ink); background: var(--paper); border: 0; border-radius: 10px; min-width: 44px; height: 44px; cursor: pointer; }
.pad button:hover { background: #fff; }
.pad .pad-color { min-width: 0; width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 3px var(--paper); }
.pad .pad-color[aria-pressed="true"] { outline: 3px solid var(--blue); outline-offset: 2px; }
.pad-color[data-color="Ink"] { background: var(--ink); }
.pad-color[data-color="Blue"] { background: var(--blue); }
.pad-color[data-color="Orange"] { background: #ff9f0a; }
.pad-color[data-color="Pink"] { background: #ff375f; }
.pad .pad-color:hover { filter: brightness(1.1); }
.pad-readout { font: 500 14px var(--mono); font-variant-numeric: tabular-nums; min-width: 9ch; text-align: center; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }
.pad .pad-clear { padding: 0 16px; }
.try-more { max-width: 44rem; margin: 18px 0 0; font-size: 18px; }
.try-more a { font-weight: 600; }

/* With reduced motion: each step a still picture, in turn. */
.story[data-still] { height: auto; padding-top: 96px; }
.story[data-still] .story-stage { position: static; height: auto; display: block; }
.story[data-still] .device { display: none; }
.story[data-still] .story-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 24px; }
.story[data-still] .story-steps li { opacity: 1; border: 0; padding: 0; }
.story-still { display: block; width: 100%; aspect-ratio: 4 / 3; margin-top: 12px; border-radius: 16px; }

.site-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px;
  padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom)); background: var(--chrome); color: #a1a1a6; font-size: 15px;
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-foot a { color: #e5e5ea; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }

@media (min-width: 761px) and (max-width: 1080px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .site-bar { grid-template-columns: 1fr auto; }
  .site-bar nav { display: none; }
  .hero { height: clamp(620px, calc(100svh - 56px), 820px); }
  .hero::after { background: linear-gradient(0deg, var(--paper) 0%, rgb(240 235 224 / 0.94) 42%, rgb(240 235 224 / 0) 62%); }
  .hero-text { left: var(--gutter); right: var(--gutter); bottom: 34px; max-width: none; }
  .places { padding-top: 64px; }
  :root { --gutter: 20px; }
  .place-list { grid-template-columns: 1fr; }
  .place { padding: 24px 22px 26px; }
  .yours { padding-top: 64px; padding-bottom: 72px; }
  .story { height: 560vh; }
  .features, .try { padding-top: 64px; }
  .feature-grid { grid-template-columns: 1fr; }
  .pad-canvas { height: min(58svh, 440px); }
  .pad-hint { white-space: normal; width: calc(100% - 48px); text-align: center; border-radius: 16px; }
  .pad-tools { flex-wrap: wrap; }
  .story-stage { grid-template-columns: 1fr; grid-template-rows: auto auto; align-items: start; align-content: start; gap: 18px; padding: 18px var(--gutter) 0; }
  .story-text { order: 2; }
  .story-text h2 { display: none; }
  .story-steps li { display: none; border: 0; padding: 0; }
  .story-steps li[data-current] { display: block; }
  .device { order: 1; width: 100%; padding: 8px; border-radius: 22px; }
  .device-bar { height: 32px; border-radius: 15px 15px 0 0; }
  .story-canvas { border-radius: 0 0 15px 15px; }
  .story[data-still] .story-steps li { display: block; }
}
