/* Volary AB - volary.pro
   Plain CSS, no build step, no scripts, nothing loaded from other servers.
   System fonts, one accent color (the red of a reject box), light and dark.
   The recurring motif is the detection box: corner brackets and monospace labels. */

:root {
  color-scheme: light dark;
  --bg: #f5f4ef;
  --surface: #eae8e0;
  --card: #fbfaf7;
  --fg: #15150f;
  --muted: #5d5c55;
  --line: #d5d3c9;
  --accent: #c22f1c;
  --band: #15150f;
  --gutter: 20px;
  --label: 15rem;
  --measure: 40rem;
  --radius: 6px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121210;
    --surface: #1c1c19;
    --card: #1a1a17;
    --fg: #eeede8;
    --muted: #a4a39b;
    --line: #33332d;
    --accent: #ff8b76;
    --band: #1e1e1a;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  /* A short page still fills the window, so the footer sits at the bottom. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; }

::selection { background: var(--accent); color: var(--bg); }

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--fg);
  color: var(--bg);
  z-index: 20;
}
.skip:focus { top: 0.5rem; color: var(--bg); }

/* Full-width bands. The element itself stays in the page column; its background is
   extended sideways with a shadow and cut off at its top and bottom edge. */

.band,
.site-footer {
  background: var(--bg);
  box-shadow: 0 0 0 100vmax var(--bg);
  clip-path: inset(0 -100vmax);
}
/* The header does the same with a border image, which can also carry the hairline below it. */
.site-header {
  background: var(--bg);
  border-image: linear-gradient(var(--bg), var(--bg)) fill 0 / 0 / 0 100vw;
}

/* A band is always dark, in both themes, so everything inside takes the dark tokens. */
.band,
.site-footer {
  --bg: var(--band);
  --fg: #f5f4ef;
  --muted: #a9a79e;
  --line: #3b3b34;
  --accent: #ff8b76;
  --card: #1f1f1a;
  --surface: #26261f;
  color: var(--fg);
}

/* Header */

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
/* The mark is the favicon, so the tab and the header show the same sign. */
.wordmark::before {
  content: "";
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 22.5%;
  background: url(favicon.svg) center / cover no-repeat;
  box-shadow: 0 0 0 1px var(--line);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}
.site-nav a { text-decoration: none; display: inline-block; padding: 0.3rem 0; color: var(--muted); }
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--fg); }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}
/* The last entry of every nav is Contact, shown as a button. */
.site-nav li:last-child a {
  color: var(--bg);
  background: var(--fg);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius);
  font-weight: 600;
}
.site-nav li:last-child a:hover { background: var(--accent); color: var(--bg); }

@media (min-width: 54rem) {
  .site-header {
    position: sticky;
    top: 0;
    border-image: linear-gradient(var(--bg) calc(100% - 1px), var(--line) 0) fill 0 / 0 / 0 100vw;
  }
  html { scroll-padding-top: 5.5rem; }
}

@media (max-width: 34rem) {
  .site-nav ul { gap: 0.25rem 1.1rem; font-size: 0.92rem; }
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--fg);
  border-radius: var(--radius);
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  text-decoration: none;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.quiet { background: transparent; color: var(--fg); font-weight: 500; }
.btn.quiet:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* Hero */

.hero { padding-top: 3.5rem; padding-bottom: 3rem; }

h1 {
  font-size: clamp(2.4rem, 6.6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 1.75rem;
  max-width: 16em;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
  max-width: 34rem;
  margin: 0 0 0.75rem;
}

.hero .who { color: var(--muted); max-width: 34rem; margin: 0; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2.25rem 0 0;
}
.also { color: var(--muted); font-size: 0.95rem; margin: 1.1rem 0 0; }

@media (min-width: 54rem) {
  .hero { padding-top: 6rem; padding-bottom: 4rem; }
}

/* The inspection strip: a dithered board across the full width, with one detection.
   On load a scan line crosses it once and the box appears where the line passes the knot. */

.strip { margin: 0 auto; max-width: 120rem; }
.strip .view {
  overflow: hidden;
  border-top: 1px solid var(--fg);
  border-bottom: 1px solid var(--fg);
}
.strip .scan { position: relative; }
.strip svg { display: block; width: 100%; height: auto; }
.strip .ink { stroke: currentColor; stroke-width: 1; fill: none; shape-rendering: crispEdges; }
.strip .box { stroke: var(--accent); stroke-width: 0.9; fill: none; }
/* The label sits on the top left corner of the box (116.5, 11.5 in a 192 x 44 image). */
.strip .tag {
  position: absolute;
  left: 60.45%;
  bottom: 75.2%;
  padding: 0.05rem 0.4rem;
  background: var(--accent);
  color: var(--bg);
  font: 600 0.68rem/1.5 var(--mono);
  white-space: nowrap;
}
.strip .beam {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0;
}
.strip figcaption {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  margin-top: 0.6rem;
}

/* On a phone the strip is too flat at full length, so it shows the part around the knot. */
@media (max-width: 40rem) {
  .strip .scan { width: 220%; margin-left: -90%; }
}

@media (prefers-reduced-motion: no-preference) {
  .strip .beam { animation: sweep 2.8s cubic-bezier(0.4, 0, 0.6, 1) 0.4s both; }
  .strip .box,
  .strip .tag { animation: detect 0.5s steps(1) 2.25s both; }
}
@keyframes sweep {
  0% { left: 0; opacity: 1; }
  92% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@keyframes detect {
  0% { opacity: 0; }
  25% { opacity: 1; }
  50% { opacity: 0.2; }
  75%, 100% { opacity: 1; }
}

/* The terms at a glance, under the strip. */
.readout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 2rem auto 0;
}
.readout > div { padding: 0.9rem 1rem 0.9rem 0; border-top: 1px solid var(--line); }
.readout dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.readout dd { margin: 0.2rem 0 0; font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
@media (min-width: 54rem) {
  .readout { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 2.5rem; }
  .readout > div { border-top: 0; border-left: 1px solid var(--line); padding: 0.2rem 1rem 0.2rem 1.25rem; }
}

/* Sections: label column and content column */

.section {
  border-top: 1px solid var(--line);
  padding-top: 3rem;
  padding-bottom: 3.5rem;
  margin-top: 1.5rem;
}
main > .hero + .section,
.strip + .section,
.readout + .section { margin-top: 4rem; }

h2 {
  font-size: 1.7rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: -0.005em;
  margin: 2.25rem 0 0.45rem;
}
.body > h3:first-child { margin-top: 0; }

/* A heading with its years set to the right, as in the track record. */
h3.dated {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}
h3.dated .when {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0;
}

/* Text keeps a reading measure, grids of cards may use the whole column. */
.body > * { max-width: var(--measure); }
.body > .cases,
.body > .apps,
.body > .shots { max-width: none; }
.body p { margin: 0 0 0.95rem; text-wrap: pretty; }
.body > :last-child { margin-bottom: 0; }

@media (min-width: 54rem) {
  .section {
    display: grid;
    grid-template-columns: var(--label) minmax(0, 1fr);
    column-gap: 2.5rem;
    padding-top: 4rem;
    padding-bottom: 4.5rem;
  }
  /* The label stays in view while its section scrolls past. */
  .section > h2 {
    font-size: 1.45rem;
    line-height: 1.2;
    position: sticky;
    top: 5.5rem;
    align-self: start;
    margin: 0;
  }
}

.section.band { border-top: 0; }
.section.band + .section { border-top: 0; margin-top: 0; }
.section.closing { margin-top: 3rem; }

main { padding-bottom: 4rem; }
main:has(> .closing:last-child) { padding-bottom: 0; }

/* Cases: short statements as cards with the corners of a detection box. */

ul.cases {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}
@media (min-width: 40rem) {
  ul.cases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
ul.cases li {
  position: relative;
  padding: 1.4rem 1.4rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 1.08rem;
  line-height: 1.4;
  font-weight: 550;
  letter-spacing: -0.008em;
}
ul.cases li::before,
ul.cases li::after {
  content: "";
  position: absolute;
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid var(--accent);
}
ul.cases li::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
ul.cases li::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* Plain list with a dash */

ul.plain {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
}
ul.plain li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
ul.plain li:first-child { border-top: 1px solid var(--line); }
ul.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15em;
  width: 0.6rem;
  height: 2px;
  background: var(--accent);
}

/* The same list with counted entries, for the deliverables of the diagnostic. */
ul.plain.counted { counter-reset: item; margin: 1.25rem 0 1.5rem; }
ul.plain.counted li {
  counter-increment: item;
  padding: 0.75rem 0 0.75rem 2.75rem;
  font-size: 1.08rem;
  font-weight: 550;
  letter-spacing: -0.008em;
}
ul.plain.counted li::before {
  content: counter(item, decimal-leading-zero);
  top: 0.95rem;
  width: auto;
  height: auto;
  background: none;
  color: var(--accent);
  font: 400 0.8rem/1.6 var(--mono);
  letter-spacing: 0;
}

/* Definition rows: terms of the diagnostic, work history, legal details */

dl.rows { margin: 0 0 1.1rem; }
dl.rows > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  column-gap: 1rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
dl.rows > div:first-child { border-top: 1px solid var(--line); }
dl.rows dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
dl.rows dd { margin: 0; }

@media (max-width: 26rem) {
  dl.rows > div { grid-template-columns: 1fr; }
}

.note { color: var(--muted); }

.mail {
  font-size: clamp(1.9rem, 6vw, 3.6rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 0 1.5rem;
  overflow-wrap: anywhere;
}
.body > .mail { max-width: none; }
.mail a { text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 0.14em; }

/* Footer */

.site-footer {
  padding-top: 2rem;
  padding-bottom: 3rem;
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0 0 0.35rem; }
.site-footer strong { color: var(--fg); font-weight: 650; }

/* Text pages (privacy, 404) and the head of an app page */

.page { padding-top: 3.5rem; }
main.page { padding-bottom: 4rem; }
.page h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 1.25rem; }
.page .body h2 { font-size: 1.15rem; letter-spacing: -0.01em; margin: 2.25rem 0 0.5rem; }

/* iOS section: the app list (home page, iOS landing page) and the app pages */

.crumb {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  margin: 0 0 1.75rem;
}

.app-icon {
  display: block;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px var(--line), 0 6px 16px -6px rgb(0 0 0 / 0.3);
}
/* An app without an icon gets an empty tile, so the list stays aligned. */
.app-icon.none { border: 1px solid var(--line); box-shadow: none; }

.app-head {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0 0 1.5rem;
}
.app-head .app-icon { width: 112px; height: 112px; }
.app-head h1 { margin: 0 0 0.4rem; }
.app-head .lede { margin: 0; font-size: clamp(1.1rem, 2vw, 1.35rem); }

/* State of an app: a ring for "in progress", then the plain sentence. */
.status {
  position: relative;
  margin: 0;
  padding-left: 1.3rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.38em;
  width: 0.6rem;
  height: 0.6rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
}

/* The icons of all apps in a row, on the iOS landing page. */
.shelf { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 0 0 2rem; }
.shelf a { border-radius: 22.5%; transition: transform 0.15s ease; }
.shelf a:hover { transform: translateY(-3px); }
.shelf .app-icon { width: 72px; height: 72px; }

/* Each app is a card, and the whole card is the link. */
ul.apps {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0.9rem;
}
ul.apps li {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 1.1rem;
  align-items: start;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
ul.apps li:hover,
ul.apps li:focus-within { border-color: var(--fg); transform: translateY(-2px); }
ul.apps h3 { margin: 0 0 0.2rem; font-size: 1.15rem; letter-spacing: -0.015em; }
ul.apps h3 a { text-decoration: none; }
ul.apps h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
ul.apps h3 a:focus-visible { outline: none; }
ul.apps h3 a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
ul.apps p { margin: 0 0 0.35rem; font-size: 0.97rem; line-height: 1.5; }
ul.apps .status { margin-bottom: 0.5rem; font-size: 0.86rem; }
ul.apps li > div > :last-child { margin-bottom: 0; }

/* Screenshots of an app: phone screens side by side, scrolling sideways when they do not fit. */
.shots {
  display: flex;
  gap: 1.25rem;
  margin: 0 0 1rem;
  padding: 0.25rem 0 1rem;
  overflow-x: auto;
}
.page > .shots { margin-top: 2.5rem; }
.shots figure { flex: none; margin: 0; width: 15rem; }
.shots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.9rem;
  border: 1px solid var(--line);
  box-shadow: 0 14px 30px -18px rgb(0 0 0 / 0.45);
}
.shots figcaption { color: var(--muted); font-size: 0.86rem; line-height: 1.45; margin-top: 0.7rem; }

@media (max-width: 26rem) {
  .app-head { gap: 1rem; }
  .app-head .app-icon { width: 76px; height: 76px; }
  .shelf { gap: 0.7rem; }
  .shelf .app-icon { width: 52px; height: 52px; }
  ul.apps li { grid-template-columns: 52px minmax(0, 1fr); padding: 1.1rem; }
  ul.apps .app-icon { width: 52px; height: 52px; }
  .shots figure { width: 12.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  ul.apps li, .shelf a { transition: none; }
  ul.apps li:hover, .shelf a:hover { transform: none; }
}

@media print {
  .site-nav, .skip, .strip, .actions, .also { display: none; }
  body { background: #fff; color: #000; }
  .site-header, .band, .site-footer { box-shadow: none; clip-path: none; border-image: none; background: none; color: #000; position: static; }
}

/* A single picture inside a section's text, such as the battery panel on work.html */
.figure { margin: 1.5rem 0 1.75rem; max-width: 30rem; }
.figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.figure figcaption { color: var(--muted); font-size: 0.86rem; line-height: 1.45; margin-top: 0.7rem; }
