/* Krinoks Ltd — "Nightfall"
   One hand-written stylesheet, no build step, no JavaScript.
   Dark only by design: the page is the night sky of the 2003 banner,
   and the brand cobalt is its horizon. */

/* ---------- Fonts ---------- */

@font-face {
  font-family: "Mona Sans";
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url("../fonts/mona-sans-latin-wdth-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Mona Sans";
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url("../fonts/mona-sans-latin-ext-wdth-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Arial scaled to Mona Sans's width, so the swap does not reflow the text. */
@font-face {
  font-family: "Mona Sans Fallback";
  src: local("Arial"), local("ArialMT");
  size-adjust: 104%;
  ascent-override: 105%;
  descent-override: 31%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: dark;

  --sky-top: #070D24;   /* top of the sky; also the browser chrome colour */
  --night: #0A1230;     /* the ground: banner navy pushed dark */
  --dusk: #14275E;      /* the sky just above the horizon */
  --cobalt: #1F419B;    /* the brand colour: the horizon */
  --text: #F2F5FC;
  --muted: #B7C3E0;
  --accent: #9CC3FA;    /* banner sky blue, lightened: links and focus */
  --line: #2A3B70;      /* hairlines (decorative) */

  --font: "Mona Sans", "Mona Sans Fallback", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --wide: 125%;         /* the display width of Mona Sans */

  --gutter: clamp(1.25rem, -0.5rem + 5.5vw, 5rem);
  --page: 80rem;
  --section: clamp(4.5rem, 3rem + 7vw, 8.5rem);
  --figure: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);   /* company number and email address */

  /* The header is laid over the top of the sky; the hero reserves its height. */
  --header-pad: 1rem;
  --header-pad: max(1rem, env(safe-area-inset-top));
  --header-h: calc(var(--header-pad) + 5.5rem);    /* logo row + navigation row on phones */
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--sky-top);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--night);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  font-weight: 380;      /* a little under regular: light text on dark reads heavier */
  font-stretch: 100%;
  line-height: 1.6;
  letter-spacing: 0.005em;
  font-kerning: normal;
  font-synthesis: none;
  hyphens: manual;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
dl,
dd,
ul {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3 {
  font-weight: 500;
  font-stretch: var(--wide);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

ul[role="list"] {
  list-style: none;
}

address {
  font-style: normal;
}

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--text);
  text-decoration-thickness: 2px;
}

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

::selection {
  background-color: var(--cobalt);
  color: #FFFFFF;
}

/* Company number and postcode: tabular figures, never broken across lines. */
.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Full-width block whose side padding is the gutter, the safe area, or whatever
   centres an 80rem column - so it also works as a grid item. */
.wrap {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left), (100% - var(--page)) / 2);
  padding-right: max(var(--gutter), env(safe-area-inset-right), (100% - var(--page)) / 2);
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: var(--gutter);
  z-index: 10;
  padding: 0.625rem 1rem;
  border-radius: 2px;
  background-color: var(--text);
  color: var(--night);
  font-weight: 500;
  transform: translateY(-300%);
}

.skip-link:focus {
  transform: none;
  color: var(--night);
}

/* ---------- Header ---------- */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding-top: var(--header-pad);
}

.site-header__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Lock-up: the wordmark's x-height is the height of one pane and its baseline is the foot of
   the lower pane, so the K of the mark hangs below the line exactly as it does in the mark. */
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  min-height: 2.75rem;
  padding-bottom: 0.25em;
  color: #FFFFFF;
  font-size: 1.375rem;
  font-weight: 600;
  font-stretch: var(--wide);
  line-height: 1;
  letter-spacing: -0.015em;
  text-decoration-line: none;
}

.logo:hover {
  color: #FFFFFF;
}

.logo__mark {
  flex: none;
  width: auto;
  height: 1.5455em;                 /* pane height (0.343 of the mark) = x-height (0.53em) */
  transform: translateY(22.35%);    /* the part of the K that overhangs the panes */
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
  margin-left: -0.625rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.625rem;
  color: var(--text);
  font-weight: 450;
  text-decoration-line: none;
}

.site-nav a:hover {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
}

@media (min-width: 34rem) {
  :root {
    --header-pad: 1.125rem;
    --header-pad: max(1.125rem, env(safe-area-inset-top));
    --header-h: calc(var(--header-pad) + 4.375rem);   /* one row */
  }

  .site-header__inner {
    flex-direction: row;
    align-items: baseline;          /* wordmark and navigation share one baseline */
    justify-content: space-between;
  }

  .site-nav ul {
    gap: 0 0.75rem;
    margin-left: 0;
    margin-right: -0.625rem;
  }
}

/* ---------- Hero: the sky ---------- */

.hero {
  --peek: clamp(2.5rem, 7vh, 4.5rem);   /* a strip of ground stays visible under the horizon */
  position: relative;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: minmax(calc(var(--header-h) + 7.5rem), 1fr) auto;   /* open sky | statement */
  min-height: calc(100vh - var(--peek));
  min-height: calc(100svh - var(--peek));
  padding-bottom: clamp(3rem, 10.5vh, 7.5rem);
  overflow: hidden;
  background-color: var(--night);
  background-image: linear-gradient(to bottom, var(--sky-top) 0%, var(--night) 55%, var(--dusk) 86%, var(--cobalt) 100%);
}

.hero__title {
  margin-left: -0.04em;   /* optical: the K's stem lines up with the mark and the text below */
  font-size: 2.25rem;
  font-size: clamp(1.25rem, min(10.4vw - 0.25rem, 2.1375rem + 3.18vw, 1rem + 7.5vh), 5rem);
  line-height: 1.04;
}

.hero__title span {
  display: block;
}

.hero__lead {
  max-width: 35em;
  margin-top: clamp(1.125rem, 0.8rem + 1.2vw, 1.75rem);
  color: var(--muted);
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.3125rem);
  line-height: 1.5;
}

.hero__contact {
  margin-top: clamp(0.5rem, 0.3rem + 0.8vw, 1rem);
  font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.3125rem);
}

.hero__contact a {
  display: inline-block;
  padding: 0.5rem 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* The star field: one inline SVG that fills the open sky between the header and the
   statement. Positions are authored - percentages inside the open sky, pixels above it
   (the header band) and below it (beside the headline) - so no star ever sits on text.
   Larger skies switch on further sets, which keeps the density even. */

.sky {
  position: relative;
  margin-top: var(--header-h);
}

.sky__stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sky .m2 { opacity: 0.97; }
.sky .m3 { opacity: 0.9; }
.sky .m4 { opacity: 0.74; }

.stars--row,
.stars--row-40,
.stars--row-64,
.stars--row-120,
.stars--tall,
.stars--40,
.stars--40-tall,
.stars--100,
.stars--120,
.stars--beside,
.plough--large {
  display: none;
}

@media (min-height: 41.25rem) {
  .stars--tall { display: inline; }
}

@media (min-width: 34rem) {
  .stars--stack { display: none; }
  .stars--row { display: inline; }
}

@media (min-width: 40rem) {
  .stars--row-40,
  .stars--40 { display: inline; }
}

@media (min-width: 40rem) and (min-height: 50rem) {
  .stars--40-tall { display: inline; }
}

@media (min-width: 40rem) and (min-height: 60rem) {
  .plough--large { display: inline; }
  .plough--small { display: none; }
  .plough__lift { transform: translateY(-78px); }   /* on tablets the Plough hangs above the headline */
}

@media (min-width: 64rem) {
  .stars--row-64,
  .stars--beside,
  .plough--large { display: inline; }
  .plough--small { display: none; }
  .plough__lift { transform: none; }                /* on wide screens it sits beside the first line */
}

@media (min-width: 100rem) {
  .stars--100 { display: inline; }
}

@media (min-width: 120rem) {
  .stars--row-120,
  .stars--120 { display: inline; }
}

/* The one authored motion: at nightfall the brightest stars come out first.
   A few low ones then twinkle slowly. Without motion the sky is simply there. */

@media (prefers-reduced-motion: no-preference) {
  a {
    transition: color 150ms ease, text-decoration-color 150ms ease;
  }

  .sky .m1 { animation: star-out 1000ms ease-out both; }
  .sky .m2 { animation: star-out 1000ms ease-out 250ms both; }
  .sky .m3 { animation: star-out 1000ms ease-out 550ms both; }
  .sky .m4 { animation: star-out 1100ms ease-out 900ms both; }

  .sky .twinkle { animation: twinkle 7s ease-in-out -2s infinite; }
  .sky .twinkle--b { animation-duration: 8.5s; animation-delay: -5s; }
  .sky .twinkle--c { animation-duration: 6.5s; animation-delay: -1s; }
  .sky .twinkle--d { animation-duration: 9s; animation-delay: -6.5s; }
  .sky .twinkle--e { animation-duration: 7.5s; animation-delay: -3.5s; }
}

@keyframes star-out {
  from { opacity: 0; }
}

@keyframes twinkle {
  50% { opacity: 0.25; }
}

/* ---------- Sections on the night ground ---------- */

.section {
  padding-top: var(--section);
  scroll-margin-top: calc(4rem - var(--section));
}

.section__title {
  margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.75rem);
  font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.75rem);
}

/* Rows divided by hairlines: a title on the left edge, the text on the second edge.
   Used for the three services and for the sections of the privacy notice. */
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: baseline;
  gap: 0.5rem;
  padding: clamp(1.375rem, 1rem + 1.4vw, 2.25rem) 0;
  border-top: 1px solid var(--line);
}

.row:last-child {
  border-bottom: 1px solid var(--line);
}

.row__title {
  font-size: clamp(1.3125rem, 1.2rem + 0.5vw, 1.625rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.row p {
  max-width: 35em;
  color: var(--muted);
}

/* Company and Contact: a short paragraph on the left edge, the facts on the second edge. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
}

.split__intro {
  max-width: 35em;
  color: var(--muted);
}

.facts__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.125rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--line);
}

.facts__row:last-child {
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* The company number and the email address are the two things a visitor comes for. */
.facts__figure {
  display: block;
  font-size: var(--figure);
  font-weight: 500;
  font-stretch: var(--wide);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

/* Links in the facts get a 44px hit area without changing the spacing of the rows. */
a.facts__figure {
  display: inline-block;
  margin: -0.5rem 0;
  padding: 0.5rem 0;
}

.facts__link {
  display: inline-block;
  margin: -0.125rem 0 -0.375rem;
  padding: 0.625rem 0;
  font-size: 0.9375rem;
}

.facts address span {
  display: block;
}

.facts address span span {
  display: inline;
}

@media (min-width: 30rem) {
  .facts__row {
    grid-template-columns: 10.5rem minmax(0, 1fr);
    column-gap: 1.5rem;
    align-items: baseline;
  }
}

@media (min-width: 60rem) {
  .row,
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 2rem;
  }

  /* One rule opens the block across both columns; the paragraph then sits on the
     same baseline as the first row of facts. */
  .split {
    border-top: 1px solid var(--line);
  }

  .split__intro {
    padding-top: 0.875rem;
  }

  /* ...and in Contact, where the first row is the large email address, on its baseline. */
  .section--contact .split__intro {
    padding-top: calc(0.875rem + 0.96 * var(--figure) - 1.185em);
  }

  .facts__row:first-child {
    border-top: 0;
  }
}

/* ---------- Privacy notice: a short band of the same sky, then a reading column ---------- */

.hero--page {
  grid-template-rows: calc(var(--header-h) + 6.5rem) auto;
  min-height: 0;
  padding-bottom: clamp(2.75rem, 2.25rem + 2.5vw, 4rem);
}

.hero--page .hero__title {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
}

.hero--page .hero__lead {
  margin-top: 0.5rem;
  font-size: 1em;
}

/* In the short band the Plough sits beside the title on wide screens, above it otherwise. */
.hero--page .plough--large {
  display: none;
}

.hero--page .plough--small {
  display: inline;
}

@media (min-width: 64rem) {
  .hero--page .plough--large {
    display: inline;
  }

  .hero--page .plough--small {
    display: none;
  }
}

.notice {
  padding-top: clamp(1.5rem, 1rem + 3vw, 3.5rem);
}

.notice .row:first-child {
  border-top: 0;
}

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

/* ---------- The closing horizon: the ground climbs back to the cobalt, and the
   statutory footer sits on it ---------- */

.horizon {
  padding-bottom: 7rem;
  padding-bottom: max(7rem, var(--section));   /* the last climb to cobalt stays clear of text */
  background-image: linear-gradient(to bottom, var(--night) calc(100% - 28rem), var(--dusk) calc(100% - 7rem), var(--cobalt) 100%);
}

.section--contact {
  --line: #3A4F8E;   /* hairlines stay visible as the ground brightens */
}

.site-footer {
  padding-top: 0.5rem;
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  background-color: var(--cobalt);
  color: var(--text);
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: grid;
  gap: 0.75rem;
}

.site-footer__legal {
  max-width: 44em;
}

.site-footer a {
  display: inline-block;
  padding: 0.625rem 0;
  color: #FFFFFF;
}

.site-footer :focus-visible {
  outline-color: #FFFFFF;
}

.site-footer ::selection,
.horizon ::selection {
  background-color: var(--text);
  color: var(--dusk);
}

@media (min-width: 60rem) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 2rem;
    align-items: baseline;
  }
}

/* ---------- Print: a one-sheet company fact file, ink on white ---------- */

@media print {
  :root {
    color-scheme: light;
    --text: #000000;
    --muted: #333333;
    --accent: #000000;
    --line: #999999;
  }

  html,
  body,
  .hero,
  .horizon,
  .site-footer {
    background: #FFFFFF none;
  }

  body {
    font-size: 11pt;
    font-weight: 400;
  }

  .skip-link,
  .site-nav,
  .sky {
    display: none;
  }

  .site-header {
    position: static;
    padding-top: 0;
  }

  .logo {
    color: #1F419B;   /* the mark in its own cobalt */
  }

  .hero {
    display: block;
    min-height: 0;
    padding: 1.5rem 0 0;
  }

  .hero__title {
    font-size: 26pt;
  }

  .section {
    padding-top: 1.75rem;
  }

  .section--contact {
    --line: #999999;
  }

  .horizon {
    padding-bottom: 1.75rem;
  }

  .section__title {
    margin-bottom: 0.75rem;
    font-size: 16pt;
  }

  .row,
  .facts__row {
    break-inside: avoid;
    padding: 0.5rem 0;
  }

  .site-footer {
    padding: 0.75rem 0 0;
    border-top: 1px solid #000000;
  }

  a,
  .site-footer a {
    color: #000000;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    overflow-wrap: anywhere;
  }
}
