/* StackNine
 *
 * Styled after the Veilio settings window, so the site and the product look
 * like they come from the same people: dark tonal surfaces, a navigation
 * rail with pill-shaped links, content in rounded cards made of rows, and
 * small uppercase labels over each group. The accent is the Veilio teal
 * rather than the settings window's blue.
 *
 * No framework, no build step, no requests to anyone else. The only font
 * file is the wordmark's, served from this site (fonts/, SIL Open Font
 * Licence). Everything else uses the fonts the reader's machine already has.
 */

@font-face {
  font-family: "Wordmark";
  src: url("/fonts/plus-jakarta-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --surface: #111416;
  --surface-low: #181c1e;
  --surface-container: #1d2224;
  --surface-high: #272c2e;
  --on-surface: #e2e4e3;
  --on-surface-variant: #c2c8c6;
  --muted: #8d9593;
  --outline: #434a48;
  --outline-variant: #2a3031;
  --primary: #7fd0c6;
  --on-primary: #00382f;
  --secondary-container: #1f4a45;
  --on-secondary-container: #c9ece6;
  --amber: #e2a24a;
  /* The StackNine teal: the mark's corner square and "Nine". */
  --brand-teal: #2fd6c3;
  --radius: 16px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font: 16px/1.6 var(--font);
}

a { color: var(--primary); }

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- layout: a rail on the left, content on the right ------------------ */

.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

nav.rail {
  background: var(--surface-low);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 24px;
  color: var(--on-surface);
  text-decoration: none;
}

.brand .mark { width: 30px; height: 30px; flex: none; }

.brand .name {
  font: 600 22px/1 "Wordmark", var(--font);
  letter-spacing: -.02em;
  white-space: nowrap;
}

.brand .nine { color: var(--brand-teal); }

nav.rail a.item {
  display: block;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--on-surface-variant);
  text-decoration: none;
}

nav.rail a.item:hover { background: var(--surface-container); }

nav.rail a.item[aria-current="page"] {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-weight: 600;
}

/* The pages that belong to Veilio sit under it, a step in. */
nav.rail a.item.sub { padding-left: 32px; font-size: 14.5px; }

nav.rail .spacer { flex: 1; }

nav.rail .foot {
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--muted);
}

nav.rail .foot a { color: var(--on-surface-variant); }

main {
  padding: 40px 44px 64px;
  max-width: 1240px;
}

/* Text and cards keep a comfortable reading width; a section marked wide,
   the film, may use the whole of main on a large screen. */
main > * { max-width: 772px; }
main > section.wide { max-width: none; }

/* On a phone the rail becomes a bar across the top. */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  nav.rail {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 12px;
    gap: 4px;
  }
  .brand { padding: 4px 8px 8px 6px; width: 100%; }
  nav.rail a.item { padding: 7px 14px; font-size: 15px; }
  nav.rail a.item.sub { padding-left: 14px; font-size: 15px; }
  nav.rail .spacer, nav.rail .foot { display: none; }
  main { padding: 26px 16px 48px; }
}

/* --- type ------------------------------------------------------------- */

h1 {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 12px;
}

.lead {
  font-size: 18.5px;
  color: var(--on-surface-variant);
  margin: 0 0 34px;
  max-width: 40rem;
}

p { margin: 0 0 14px; max-width: 40rem; }

section { margin-bottom: 30px; }

section > h2 {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 10px 4px;
}

/* --- cards and rows, as in the settings window ------------------------- */

.card {
  background: var(--surface-container);
  border-radius: var(--radius);
  padding: 6px 22px;
}

.card.text { padding: 18px 22px 6px; }

.row {
  padding: 15px 0;
  border-bottom: 1px solid var(--outline-variant);
}

.row:last-child { border-bottom: 0; }

.row .k { font-size: 16.5px; font-weight: 600; }

.row .d {
  color: var(--muted);
  font-size: 15px;
  margin-top: 3px;
  max-width: 40rem;
}

.row.link { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }

.btn {
  display: inline-block;
  border-radius: 999px;
  padding: 9px 20px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.btn.filled { background: var(--primary); color: var(--on-primary); }
.btn.tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn:hover { filter: brightness(1.08); }

.email {
  display: inline-block;
  font-size: 17px;
  font-weight: 600;
  background: var(--surface-high);
  padding: 8px 18px;
  border-radius: 999px;
  text-decoration: none;
  margin: 4px 0 14px;
}

/* --- the Veilio lockup ------------------------------------------------ */

.lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 14px;
}

.lockup .mark { width: 60px; height: 60px; flex: none; }

.wordmark {
  font: 600 46px/1 "Wordmark", var(--font);
  letter-spacing: -.02em;
  color: var(--on-surface);
  white-space: nowrap;
}

.wordmark .io { color: var(--brand-teal); }

.dotless { position: relative; display: inline-block; }

.dotless svg {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -.02em;
  width: .3em;
  height: .3em;
}

/* --- the StackNine name as a heading ---------------------------------- */

h1.wordname {
  font: 600 44px/1.1 "Wordmark", var(--font);
  letter-spacing: -.02em;
}

h1.wordname .nine { color: var(--brand-teal); }

/* --- the demonstration film ------------------------------------------- */

.film {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.film iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.film-note { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* --- the aperture demonstration ---------------------------------------- */

/* The painting is as large as the screen allows while staying whole in
   view: its width is capped by the page and by 80% of the screen height
   (the painting is 1.49 times taller than wide). The explanation sits
   beside it on a wide screen and below it on a narrow one. */
.card.try {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
  padding: 22px;
  align-items: flex-start;
}

.try-canvas {
  display: block;
  flex: none;
  width: min(100%, 600px, calc(80vh / 1.49));
  border-radius: 12px;
  cursor: none;
  background: #000;
  touch-action: manipulation;
}

.try-text { flex: 1 1 260px; max-width: 36rem; }
.try-text p:first-child { margin-top: 2px; }
.try-text .credit { color: var(--muted); font-size: 13.5px; }

@media (hover: none) { .try-canvas { cursor: default; } }

/* The company details the Companies Act requires on a company's website. */
.legal { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 40px 0 8px; }

/* --- pictures on the sector pages --------------------------------------- */

/* A caption under a picture or a drawing, in the film note's voice. */
.fig-note { color: var(--muted); font-size: 14px; margin: 10px 4px 0; }
.fig-note.credit { font-size: 13px; margin-top: 4px; }
.fig-note a { color: var(--on-surface-variant); }

/* A document shown as a page: the welfare report, light on the dark site. */
.page-shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #fff;
}

/* A claims system, drawn light so it reads as someone else's application
   with Veilio working over it, not as part of this site. */
.mock {
  background: #f3f4f6;
  color: #1f2328;
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}

.mock .bar {
  background: #e2e5e9;
  color: #3d434a;
  padding: 9px 16px;
  font-size: 13px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.mock .bar b { font-weight: 600; }

.mock .body {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
}

.mock dl { margin: 0; }
.mock dt { color: #69707a; font-size: 12px; }
.mock dd { margin: 0 0 10px; font-weight: 600; }

.mock .photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mock .photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 3px; }
.mock .photo .cap { font-size: 12.5px; color: #5b626b; margin-top: 5px; }

/* Veilio's own label under a cover: the caption panel's grey, near-white
   ink and a teal hairline along the edge that touches the cover. The
   colours are the product's (overlay/src/captions.rs). */
.veilio-label {
  display: inline-block;
  margin-top: 0;
  background: #2b2e34;
  color: #f0f2f5;
  border-top: 2px solid #6fb3b4;
  font: 12.5px/1.3 "Segoe UI", system-ui, sans-serif;
  padding: 3px 9px 4px;
}

@media (max-width: 560px) {
  .mock .body { grid-template-columns: 1fr; }
  .mock dl { display: flex; flex-wrap: wrap; gap: 0 18px; }
}

/* --- where it runs: a drawing made of boxes ----------------------------- */

/* The dashed line is the edge of the customer's estate. Everything inside
   it is theirs; StackNine sits outside it and receives nothing. On a phone
   the boxes stack and the arrows turn to point down and up. */
.estate {
  border: 1.5px dashed var(--outline);
  border-radius: var(--radius);
  padding: 14px 18px 18px;
}

.estate .tag, .away .tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.flow { display: flex; align-items: center; gap: 14px; }

.node {
  flex: 1 1 0;
  background: var(--surface-high);
  border-radius: 12px;
  padding: 12px 16px;
}

.node .k { font-weight: 600; }
.node .d { color: var(--muted); font-size: 14.5px; margin-top: 2px; }

.wire {
  flex: 0 0 170px;
  display: grid;
  gap: 6px;
  font-size: 13.5px;
  color: var(--on-surface-variant);
  text-align: center;
}

.wire .arrow { color: var(--primary); font-weight: 600; }
.wire .v { display: none; }

.away {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 0;
  padding: 0 18px;
}

.away .node { flex: 0 1 auto; background: transparent; border: 1px solid var(--outline-variant); }
.away .none { color: var(--muted); font-size: 14px; }

@media (max-width: 640px) {
  .flow { flex-direction: column; align-items: stretch; }
  .wire { flex: none; }
  .wire .h { display: none; }
  .wire .v { display: inline; }
  .away { padding: 0; flex-wrap: wrap; }
}
