/* delight.software's look: grey text on white, nothing else. Light only, on purpose: no dark mode. The darkest
   colour is a grey so dark it reads as black, and no true black appears anywhere.
   Two type sizes: the home page's opening, larger, and 17 points, as in Apple's own body text, for everything else;
   within a size, what matters more is set apart by weight and by how dark its grey is. Only the footer is smaller. */
:root {
  --paper: #ffffff;
  --ink: #1d1d1f;
  --quiet: #5f5f63;
  --faint: #86868b;
  --size: 17px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  /* How far under delight.software the text starts, on every page: further on a taller screen. A phone's screen is
     tall for its width, so there it's a little less, which keeps the opening close to the name. */
  --under-name: clamp(48px, 12vh, 128px);
  color-scheme: light;
}
@media (max-width: 600px) {
  :root { --under-name: clamp(48px, 10vh, 128px); }
}

* { box-sizing: border-box; }
/* White past the page's ends too, when it's pulled (rubber-band scrolling). */
html { -webkit-text-size-adjust: 100%; background: var(--paper); color: var(--ink); }
/* Everything on the page shares one left edge: the 16-point gutter on a phone, set in a little further on wider
   screens, and the right edge mirrors it, for the footer's links. The tops of delight.software's letters sit twice
   as far from the top as the footer's baseline sits from the bottom: 64 points and 32, measured on the letters, as
   the eye does, not on their boxes. */
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: flex-start;
  padding: max(61px, env(safe-area-inset-top)) calc(max(16px, env(safe-area-inset-right)) + clamp(0px, 5vw - 16px, 80px))
           max(24px, env(safe-area-inset-bottom)) calc(max(16px, env(safe-area-inset-left)) + clamp(0px, 5vw - 16px, 80px));
  background: var(--paper); color: var(--quiet); text-align: left;
  font-family: var(--font); font-size: var(--size); line-height: 1.55; -webkit-font-smoothing: antialiased;
}
p, h1, h2, ul, address { margin: 0; font-size: inherit; }

/* delight.software, at the very top left. On the legal pages it's the way home. */
.top { font-size: var(--size); line-height: 1.2; font-weight: 600; color: var(--ink); }
.top h1, .top a { font: inherit; }

/* The home page's opening: larger, all of it in the darkest grey. First, who makes the apps, a paragraph of its own.
   The sentences after it each get a line of their own only while every one of them fits on one. Narrower than that,
   they run on as one paragraph, as a forced break after a wrapped sentence would leave a short line and a gap. No
   line ends with a word alone. The longest sentence is 29.9 em wide: 598 points at the opening's smallest size, 20
   points, where the page can get too narrow; at any larger size the page is wide enough for it anyway. The paragraph
   may be 31 em wide and the lines start at 610 points, which leaves room should a browser set the type a little
   wider. (In points rather than em, as browsers have read em in a container query differently.) The opening spans
   the page's width, so the paragraph's width comes from the page, not from its text, as a container query needs.
   Change the sentences or the size, and measure again. */
.intro { align-self: stretch; margin-top: var(--under-name); }
.intro > p {
  max-width: 31em;
  font-size: clamp(20px, 2.5vw, 24px); line-height: 1.4; letter-spacing: -0.01em;
  color: var(--ink); text-wrap: pretty;
}
.intro > p + p { margin-top: 1em; }
.intro .sentences { container-type: inline-size; }
@container (min-width: 610px) {
  .intro .sentences > span { display: block; }
}

/* The apps. Each is its name, in the darkest grey and bolder, a link to the app's site, with what it is under it.
   Only the name answers the pointer and a click; what's under it is plain text.
   Pointed at, the name is underlined at once, as every link is (below). Then an arrow pointing up and out, to say
   the link leaves this site, fades in after the name, sliding in from the left, and the underline stretches on
   under it to its end, as far as the arrow and no further, its far dot riding the line's end. The arrow's room,
   0.9 em with the gap before it, is kept at all times, so nothing moves. The arrow is drawn in the name's colour
   through an outline of it, with the underline's line weight. Leaving, both fade out at once, as the other links
   do. Where motion is turned down, nothing slides or stretches: both only fade. */
@property --draw { syntax: "<number>"; inherits: false; initial-value: 0; }
.apps { display: grid; gap: 22px; max-width: 40rem; margin-top: 56px; padding: 0; list-style: none; }
.apps a {
  font-weight: 600;
  background-position: left bottom, calc(100% - 0.9em * (1 - var(--draw))) bottom, 0.75px bottom;
  background-size: 1.5px 1.5px, 1.5px 1.5px, calc(100% - 1.5px - 0.9em * (1 - var(--draw))) 1.5px;
  transition: --underline 0.1s ease, --draw 0s 0.1s;
}
.apps a::after {
  content: ""; display: inline-block; width: 0.65em; height: 0.65em;
  margin-left: 0.25em; vertical-align: 0.12em;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat; mask: var(--arrow) center / contain no-repeat;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.75 8.25 8.25 1.75M3.25 1.75h5v5'/%3E%3C/svg%3E");
  opacity: 0; transform: translateX(-0.35em);
  transition: opacity 0.1s ease, transform 0s 0.1s;
}
.apps a:is(:hover, :focus-visible) {
  --draw: 1;
  transition: --underline 0.1s ease, --draw 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.apps a:is(:hover, :focus-visible)::after {
  opacity: 1; transform: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  .apps a { --draw: 1; }
  .apps a::after { transform: none; }
}
/* What an app is, under its name. Where it's two sentences and they don't fit on one line, the second starts a line
   of its own rather than breaking off mid-sentence: on every phone, as Licht's two need 409 points, more than a
   phone's widest line, 396. The line starts at 420 points, which leaves room should a browser set the type a little
   wider. Change the sentences, and measure again. */
.apps { container-type: inline-size; }
@container (width < 420px) {
  .apps p > span { display: block; }
}
.apps p { text-wrap: pretty; }

/* The footer, smaller than the rest, across the page's width: who made it on the left, the legal pages in the
   lightest grey on the right. Where the line is too short for both, the legal pages go under it, on the left. */
.site-foot {
  align-self: stretch; margin-top: auto; padding-top: 72px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px;
  font-size: 13px; line-height: 1.4;
}
.site-foot .credit { margin-right: auto; }
.site-foot .legal { display: flex; gap: 16px; }
.site-foot .legal a { color: var(--faint); font-weight: 400; transition: color 0.1s ease, --underline 0.1s ease; }
.site-foot .legal a:is(:hover, :focus-visible) { color: var(--quiet); --underline: var(--quiet); }

/* The legal pages: the text, starting as far down as the home page's, its headings in the darkest grey. */
.doc { max-width: 40rem; margin-top: var(--under-name); }
.doc h1, .doc h2 { font-weight: 600; color: var(--ink); }
.doc h2 { margin-top: 2em; }
.doc .updated { color: var(--faint); }
.doc p, .doc address, .doc ul { margin-top: 0.6em; text-wrap: pretty; }
.doc .updated + p { margin-top: 1.6em; }
.doc address { font-style: normal; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 0.3em; }

/* Links, as on sailmode.app: the dark grey, a little bolder, and pointed at, a 1.5-point line under them with round
   ends, further below the letters than a plain underline, clear of g, p and y. It's drawn as the link's background,
   a bar with a dot at each end, so a link that wraps gets it on every line, and it fades in over a tenth of a second:
   its colour is a registered property, which the browser can fade where a background alone it can't. */
@property --underline { syntax: "<color>"; inherits: false; initial-value: transparent; }
a {
  color: var(--ink); font-weight: 500; text-decoration: none; padding-bottom: 3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background-image:
    radial-gradient(circle closest-side, var(--underline) 92%, transparent),
    radial-gradient(circle closest-side, var(--underline) 92%, transparent),
    linear-gradient(var(--underline), var(--underline));
  background-repeat: no-repeat;
  background-position: left bottom, right bottom, center bottom;
  background-size: 1.5px 1.5px, 1.5px 1.5px, calc(100% - 1.5px) 1.5px;
  transition: --underline 0.1s ease;
}
a:is(:hover, :focus-visible) { --underline: var(--ink); }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
