/* The Oreskai brand site. Dark only. */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --abyss: #02060d;
  --abyss-edge: #000102;
  --line: #243444;
  /* Round the small words of the first screen, once the moving picture is behind them (below). */
  --halo: none;
  --text-primary: #eaf4ff;
  --text-body: #c5d2df;
  --text-secondary: #9eafc3;
  --text-overline: #9ebbd0;
  --text-muted: #8a9db3;
  --text-link: #acd1ee;
  --focus: #c7e7fa;
  --gutter: clamp(16px, 4vw, 40px);
  /* The square the mark is drawn in: as large as the screen allows with the name and the
     lines under it still on the first screen. */
  --stage: clamp(176px, min(90vw, 100vh - 290px), 720px);
}

/* Where the picture is drawn, light passes behind the first screen's small words, and they must
   stay readable against it: each carries a halo of the picture's own black, which does not show
   until something bright is behind it. */
.gl {
  --halo: 0 0 2px #000, 0 0 4px #000, 0 0 8px #000, 0 0 14px #000;
}

/* The small viewport (a phone's with its bars showing), where the browser knows it. */
@supports (height: 100svh) {
  :root {
    --stage: clamp(176px, min(90vw, 100svh - 290px), 720px);
  }
}

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

html {
  background: var(--abyss);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  /* What shows before the scene draws, and all that shows where it cannot. */
  background:
    radial-gradient(120% 80% at 50% 38%, rgb(9 28 56 / 55%) 0%, rgb(9 28 56 / 0%) 60%),
    linear-gradient(var(--abyss), var(--abyss-edge));
  background-attachment: fixed;
  color: var(--text-body);
  font-family:
    'Inter Variable',
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  font-size: 0.9375rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

/* The scene: one canvas behind everything, the size of the screen. It takes no input itself. */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
}

.gl .scene {
  opacity: 1;
}

.page,
.foot {
  position: relative;
  z-index: 1;
}

/* First screen: the mark, the name, two lines, and the way to the rest. */
.hero {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(var(--gutter), env(safe-area-inset-top))
    max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}

.hero-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--stage);
  height: var(--stage);
  border-radius: 50%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Where the mark can be turned: a drag on it turns it whichever way it goes, and does not scroll
   the page (the page scrolls from anywhere off the mark); a pinch still zooms. */
.gl .stage {
  cursor: grab;
  touch-action: pinch-zoom;
}

.gl .stage:active {
  cursor: grabbing;
}

.stage:focus-visible {
  border-radius: 50%;
  outline-offset: -6px;
}

/* The mark as a still picture: shown until the scene draws, and wherever it cannot. */
.stage-still {
  width: 94%;
  height: 94%;
  opacity: 0.94;
  filter: drop-shadow(0 0 42px rgb(159 212 255 / 28%));
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.gl .stage-still {
  opacity: 0;
}

/* Not the muted colour: light passes behind this line. It sits just clear of the mark, which
   fills its square nearly to the edge. */
.hint {
  margin: 2px 0 0;
  min-height: 1.45em;
  color: var(--text-overline);
  text-shadow: var(--halo);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.8s ease,
    visibility 0s linear 0.8s;
}

/* Only where the mark can be turned, and only until someone has. The line keeps its place
   either way, so nothing below it moves. */
.gl:not(.turned) .hint {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease;
}

.wordmark {
  margin: clamp(10px, 2.2vh, 22px) 0 0;
  line-height: 0;
}

.wordmark img {
  display: block;
  width: clamp(148px, 24vw, 228px);
  height: auto;
}

.lede {
  margin: clamp(14px, 2.4vh, 22px) 0 0;
  color: var(--text-secondary);
  text-shadow: var(--halo);
  font-size: clamp(0.9375rem, 0.85rem + 0.4vw, 1.0625rem);
  letter-spacing: -0.005em;
}

.status {
  margin: 10px 0 0;
  color: var(--text-overline);
  text-shadow: var(--halo);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.6;
  text-transform: uppercase;
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 28px;
  padding: 18px 0 max(18px, env(safe-area-inset-bottom));
  font-size: 0.8125rem;
  text-shadow: var(--halo);
}

.hero-foot a,
.foot a,
.motion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--text-secondary);
  text-decoration: none;
}

.hero-foot a:hover,
.foot a:hover,
.motion:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* "Pause motion": a plain text control beside the links, there only while the mark moves. */
.motion {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  /* A button does not take this from the line it sits in unless told to. */
  text-shadow: inherit;
  cursor: pointer;
}

.motion[hidden] {
  display: none;
}

/* Below the first screen: what Oreskai is, in plain words. The words keep to a column in the
   middle; behind them a dark band runs the width of the screen and comes in gently at its top,
   so that nothing in the scene competes with them. */
.about,
.foot {
  /* The space either side of the column, where the screen is wider than it. */
  --side: calc(50% - 22rem + var(--gutter));
}

.about {
  padding: clamp(48px, 10vh, 96px) max(var(--gutter), env(safe-area-inset-right), var(--side))
    clamp(40px, 8vh, 72px) max(var(--gutter), env(safe-area-inset-left), var(--side));
  background: linear-gradient(to bottom, rgb(2 6 13 / 0%), rgb(2 6 13 / 80%) 140px);
  scroll-margin-top: 12px;
}

.about h2,
.doc h1 {
  margin: 0 0 16px;
  color: var(--text-primary);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.about h3,
.doc h2 {
  margin: 36px 0 10px;
  color: var(--text-primary);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
}

.about p,
.doc p,
.doc li {
  margin: 0 0 14px;
}

/* How the name is said: a quiet line under the heading. */
.about .said {
  margin-top: -6px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

.about strong,
.doc strong {
  color: var(--text-primary);
  font-weight: 600;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  padding: 8px max(var(--gutter), env(safe-area-inset-right), var(--side))
    max(20px, env(safe-area-inset-bottom))
    max(var(--gutter), env(safe-area-inset-left), var(--side));
  border-top: 1px solid var(--line);
  background: rgb(2 6 13 / 80%);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.foot p {
  margin: 0;
}

/* The privacy policy: a page of text, with the mark as the way home. */
.doc-head {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 0
    max(var(--gutter), env(safe-area-inset-left));
}

.home {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
}

.home img:first-child {
  width: 32px;
  height: 32px;
}

.home img:last-child {
  width: 96px;
  height: auto;
}

.doc {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(32px, 7vh, 64px) max(var(--gutter), env(safe-area-inset-right))
    clamp(40px, 8vh, 72px) max(var(--gutter), env(safe-area-inset-left));
}

.doc .dated {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* A page not yet in force says so, in words, at the top, and marks what is still to be
   supplied where it goes. */
.draft {
  margin: 0 0 28px;
  padding: 12px 16px;
  border: 1px solid #f2c879;
  border-radius: 14px;
  color: #f2c879;
}

.draft strong {
  color: inherit;
}

.slot {
  padding: 1px 6px;
  border: 1px dashed #f2c879;
  border-radius: 6px;
  color: #f2c879;
}

.doc ul {
  margin: 0 0 14px;
  padding-left: 1.25em;
}

.doc li {
  margin-bottom: 8px;
}

.doc li::marker {
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scene,
  .stage-still,
  .hint {
    transition: none;
  }
}
