/* noiro.dev. One typeface, dark only. Geist Mono is self-hosted, so nothing loads from another server.
   Vermilion is the one colour: cursors, section numbers, the reading line, hovers, selection and the scrollbar.
   Every animation is CSS, and all of it stops for people who ask their device to reduce motion. */
@font-face { font-family: "Geist Mono"; src: url(/assets/fonts/geist-mono.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #0D0D0C; --ink: #F2EDE4; --muted: #A89C90; --rule: rgba(242, 237, 228, .14); --accent: #EC5A1C;
  --glow: rgba(236, 90, 28, .45);
  --spring: cubic-bezier(.34, 1.56, .64, 1); --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* A faint warm glow behind the top of each page, like light from a lamp. */
html {
  background: radial-gradient(48rem 26rem at 50% -8rem, rgba(236, 90, 28, .13), transparent 70%) no-repeat, var(--paper);
  scrollbar-color: rgba(236, 90, 28, .55) transparent; scrollbar-width: thin;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
body {
  max-width: calc(60ch + 40px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(32px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  color: var(--ink);
  font: 400 15px/1.7 "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: break-word;
}
@media (min-width: 720px) { body { font-size: 16px; padding-top: 56px; } }
::selection { background: var(--accent); color: var(--paper); }
h1, h2 { margin: 0; font: inherit; font-weight: 600; }
p, ul, ol { margin: 0 0 1.15em; }
p, li { text-wrap: pretty; }
ul, ol { padding-left: 2ch; }
li { margin: .4em 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* Links sit on a grey hairline, and a vermilion one draws itself across when you point at them. */
a {
  color: inherit; text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat,
              linear-gradient(var(--muted), var(--muted)) 0 100% / 100% 1px no-repeat;
  background-origin: content-box;
  transition: background-size .45s var(--ease);
}
a:hover, a:focus-visible { background-size: 100% 1px, 100% 1px; }

/* The wordmark ends in a blinking block cursor, and its letters stretch out when you point at it. */
header { margin-bottom: 3.5em; }
header p { margin: 0; color: var(--muted); }
header h1, header > a { display: inline-block; font-weight: 600; background: none; transition: letter-spacing .5s var(--spring); }
header h1:hover, header > a:hover { letter-spacing: .14em; }
header h1::after, header > a::after, main > :last-child > p:last-child::after, main > p:last-child::after {
  content: ""; display: inline-block; width: .6em; height: 1.15em; margin-left: .2em; vertical-align: -.22em;
  background: var(--accent); animation: blink 1.1s steps(1) infinite;
}
/* The page also ends with a cursor, smaller, so every page reads as if I'm still writing it. */
main > :last-child > p:last-child::after, main > p:last-child::after { width: .5em; height: 1em; margin-left: .4em; vertical-align: -.15em; animation-delay: .55s; }
@keyframes blink { 50% { opacity: 0; } }

main > h1 { margin-bottom: .6em; font-size: 1.45em; line-height: 1.3; letter-spacing: -.01em; }
main > p:first-of-type { color: var(--muted); }

/* The app on the home page. Its icon breathes a soft glow, and tips and lifts when you point at it.
   A small light by "Coming to iPhone" pulses like a status lamp. */
.app { display: flex; gap: 2ch; }
.app img { flex: none; width: 64px; height: 64px; border-radius: 14px; animation: breathe 5s ease-in-out infinite; transition: transform .5s var(--spring); }
.app:hover img { transform: rotate(-6deg) scale(1.06); }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 1px var(--rule), 0 8px 24px -14px var(--glow); }
  50% { box-shadow: 0 0 0 1px var(--rule), 0 10px 34px -6px var(--glow); }
}
.app p { margin: 0; }
.app p:last-of-type { color: var(--muted); }
.app p:last-of-type::before {
  content: ""; display: inline-block; width: .5em; height: .5em; margin-right: 1.2ch; vertical-align: .1em;
  border-radius: 50%; background: var(--accent); animation: ping 2.4s ease-out infinite;
}
@keyframes ping { 0% { box-shadow: 0 0 0 0 var(--glow); } 70%, 100% { box-shadow: 0 0 0 .55em rgba(236, 90, 28, 0); } }
nav { display: flex; flex-wrap: wrap; gap: 0 3ch; }
nav a { padding: 6px 0; }
.app nav { margin-top: 8px; }

/* An app's own page (/ascelo/). Its sections are separated by a hairline but not numbered, since only the
   steps have a real order. The download link is the one solid vermilion shape on the site. */
.page section + section { margin-top: 3.5em; padding-top: 2em; border-top: 1px solid var(--rule); }
.page h2 { margin-bottom: .8em; }
.page h3 { margin: 1.8em 0 .4em; font: inherit; font-weight: 600; }
.hero .icon { display: block; width: 64px; height: 64px; margin-bottom: 1.6em; border-radius: 14px; box-shadow: 0 0 0 1px var(--rule), 0 10px 34px -10px var(--glow); }
.hero h1 { margin-bottom: .55em; font-size: clamp(1.9em, 7.5vw, 2.6em); line-height: 1.12; letter-spacing: -.035em; text-wrap: balance; }
.hero .lead { font-size: 1.06em; }
.facts { color: var(--muted); font-size: .9em; }
.cta {
  display: inline-block; padding: .8em 1.3em; border-radius: 8px;
  background: var(--accent); color: var(--paper); font-weight: 600; line-height: 1.3;
  transition: transform .35s var(--spring), box-shadow .35s;
}
.cta:hover, .cta:focus-visible { background: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 30px -12px var(--glow); }
.wide { display: block; width: 100%; height: auto; margin-top: 1.8em; border-radius: 10px; box-shadow: 0 0 0 1px var(--rule); }
.shot { display: block; width: min(100%, 300px); height: auto; margin-top: 1.5em; border-radius: 14px; }
.steps { padding-left: 3ch; }
.steps li { margin: .9em 0; padding-left: .5ch; }
.steps li::marker { color: var(--accent); font-weight: 600; }
/* Screenshots sit in a row that scrolls sideways inside the column, so the page itself never does. */
.shots { display: flex; gap: 12px; margin: 0; padding: 0 0 12px; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.shots li { flex: none; margin: 0; padding: 0; scroll-snap-align: start; }
.shots li::before { content: none; }
.shots img { display: block; width: 220px; height: auto; border-radius: 14px; }

/* The contents list: a quiet box that warms when you point into it, in two columns where there's room.
   An arrow slides in to point back at the item you're on. */
.index { margin: 2.5em 0 0; padding: 1em 2ch 1em 6ch; list-style: decimal-leading-zero; border: 1px solid var(--rule); border-radius: 10px; transition: border-color .4s, box-shadow .4s; }
.index:hover { border-color: rgba(236, 90, 28, .35); box-shadow: 0 0 40px -20px var(--glow); }
.index li { margin: .3em 0; break-inside: avoid; transition: color .2s; }
.index li::marker { color: var(--muted); }
.index li:hover::marker { color: var(--accent); }
.index a { background: none; }
.index a::after { content: "←"; display: inline-block; margin-left: 1.5ch; color: var(--accent); opacity: 0; transform: translateX(8px); transition: opacity .2s, transform .35s var(--spring); }
.index a:hover::after, .index a:focus-visible::after { opacity: 1; transform: none; }
@media (min-width: 720px) { .index { columns: 2; column-gap: 4ch; } }

/* Each section starts with a hairline and a vermilion number, so the page reads in chunks. */
main { counter-reset: s; }
section[id] { margin-top: 3em; padding-top: 2em; border-top: 1px solid var(--rule); counter-increment: s; scroll-margin-top: 1.5em; }
section[id] h2 { margin-bottom: .8em; }
section[id] h2::before { content: counter(s, decimal-leading-zero) "  "; white-space: pre; color: var(--accent); }
/* Jumping to a section from the contents makes its number flash once. */
section[id]:target h2::before { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 40% { color: var(--paper); background: var(--accent); } }
section p:last-child, section ul:last-child { margin-bottom: 0; }
section ul { padding-left: 0; list-style: none; }
section ul li { position: relative; padding-left: 3ch; }
section ul li::before { content: "–"; position: absolute; left: 0; color: var(--muted); transition: color .2s, transform .3s var(--spring); }
section ul li:hover::before { color: var(--accent); transform: translateX(.5ch); }

footer { margin-top: 4em; padding-top: 1.5em; border-top: 1px solid var(--rule); color: var(--muted); }
footer a { color: var(--ink); }

/* The 404 page: a big number that flickers like a sign with a loose wire. */
.lost h1 { font-size: 5em; line-height: 1; letter-spacing: -.04em; color: var(--accent); text-shadow: 0 0 .3em var(--glow); animation: rise .7s var(--ease) .1s both, flicker 6s linear 1s infinite; }
@keyframes flicker {
  0%, 18%, 21%, 23%, 60%, 62%, 100% { opacity: 1; }
  19%, 22%, 61% { opacity: .25; text-shadow: none; }
}

/* Motion. The top of each page comes in line by line. */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
header, main > h1, main > p, .index, .app, .hero, footer { animation: rise .7s var(--ease) both; }
main > h1, .app, .hero { animation-delay: .1s; }
main > p:nth-of-type(1) { animation-delay: .18s; }
main > p:nth-of-type(2) { animation-delay: .26s; }
.index { animation-delay: .34s; }
footer { animation-delay: .4s; }

/* Where the browser can tie animation to scrolling: sections drift up as they arrive, and a thin vermilion
   line across the top shows how far through the page you are. Elsewhere both are simply absent. */
@supports (animation-timeline: view()) {
  section[id] { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
  body::before {
    content: ""; position: fixed; inset: 0 0 auto; height: 2px; z-index: 1;
    background: var(--accent); box-shadow: 0 0 8px var(--glow); transform-origin: 0 50%; transform: scaleX(0);
    animation: progress linear both; animation-timeline: scroll(root);
  }
  @keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body::before { display: none; }
}

/* Printed, it's black on white with no cursors or glow, so a policy doesn't use a cartridge of ink. */
@media print {
  :root { --paper: #fff; --ink: #000; --muted: #444; --rule: #bbb; --accent: #000; color-scheme: light; }
  html { background: #fff; }
  *, *::before, *::after { animation: none !important; transition: none !important; box-shadow: none !important; text-shadow: none !important; }
  body::before, header h1::after, header > a::after, main > :last-child > p:last-child::after, main > p:last-child::after, .app p:last-of-type::before { display: none; }
}
