/* RISKQY — one-page mark
   layers: 0 canvas · 2 content · 3 grain */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-latin.woff2') format('woff2');
}

:root {
  --bg: #050505;
  --text: #EDEAE6;
  --text-muted: #B5AFA8;
  --text-faint: #948E87;
  --accent: #9E100F;
  --hairline: #3B3835;
  --ease-out-strong: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  background-color: var(--bg);
  /* composed even before (or without) WebGL */
  background-image:
    radial-gradient(58% 42% at 50% 46%, #171514 0%, rgba(10, 9, 9, 0) 68%),
    radial-gradient(70% 32% at 50% 108%, rgba(88, 12, 11, 0.14) 0%, rgba(5, 5, 5, 0) 70%);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

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

/* ---- atmosphere ---- */

#smoke {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
}

.gl-live #smoke {
  opacity: 1;
  transition: opacity 2.6s ease-out 0.2s;
}

.grain {
  position: fixed;
  inset: -120px;
  z-index: 3;
  background: url('../assets/grain.png');
  background-size: 160px;
  opacity: 0.07;
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: grain-shift 1.1s steps(6) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  17%  { transform: translate(-28px, 14px); }
  33%  { transform: translate(16px, -22px); }
  50%  { transform: translate(-10px, 26px); }
  67%  { transform: translate(24px, 8px); }
  83%  { transform: translate(-18px, -16px); }
  100% { transform: translate(0, 0); }
}

/* ---- centre ---- */

main {
  position: relative;
  z-index: 2;
  place-self: center;
  display: grid;
  justify-items: center;
  padding: 48px 24px;
  width: 100%;
}

.mark {
  margin: 0;
  line-height: 0;
}

.mark img {
  width: clamp(250px, 58vw, 660px);
  height: auto;
  filter:
    drop-shadow(0 0 22px rgba(237, 234, 230, 0.10))
    drop-shadow(0 2px 80px rgba(237, 234, 230, 0.05));
  animation:
    materialize 2.2s var(--ease-out-strong) 0.55s backwards,
    breathe 11s ease-in-out 3s infinite;
}

@keyframes materialize {
  from {
    opacity: 0;
    filter: blur(16px)
      drop-shadow(0 0 22px rgba(237, 234, 230, 0))
      drop-shadow(0 2px 80px rgba(237, 234, 230, 0));
    transform: scale(0.964);
  }
}

@keyframes breathe {
  50% { transform: scale(1.0075); }
}

.rule {
  width: 148px;
  height: 1px;
  margin-top: clamp(30px, 4.6vh, 46px);
  background: linear-gradient(90deg, transparent, var(--hairline) 22%, var(--hairline) 78%, transparent);
  transform-origin: center;
  animation: draw-rule 1.5s var(--ease-out-strong) 1.55s backwards;
}

@keyframes draw-rule {
  from { transform: scaleX(0); opacity: 0; }
}

.tagline {
  --ls: clamp(0.26em, 0.17em + 0.55vw, 0.44em);
  margin: clamp(22px, 3.4vh, 34px) 0 0;
  font-family: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  font-weight: 500;
  font-size: clamp(0.78rem, 0.62rem + 0.72vw, 1.06rem);
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: var(--ls);
  padding-left: var(--ls); /* recentre: trailing tracking space */
  color: var(--text-muted);
  text-align: center;
  text-wrap: balance;
  animation: rise-in 1.7s var(--ease-out-strong) 1.95s backwards;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(7px); }
}

/* ---- footer ---- */

footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px 24px calc(22px + env(safe-area-inset-bottom, 0px));
  animation: fade-in 2s ease 2.8s backwards;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.legal {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  line-height: 1.8;
  color: var(--text-faint);
}

.legal.sub {
  margin-top: 2px;
  color: #757067;
  color: color-mix(in srgb, var(--text-faint) 78%, var(--bg));
}

.legal .dot {
  margin: 0 0.55em;
  color: var(--hairline);
}

.legal a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(158, 16, 15, 0.45);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding-bottom: 1px;
  transition: color 180ms ease, border-color 180ms ease;
}

.legal a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.legal a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
  border-radius: 1px;
}

/* ---- small / short screens ---- */

@media (max-width: 560px) {
  .legal .dot { display: none; }
  .legal span, .legal a {
    display: block;
    line-height: 2;
  }
  .legal a {
    width: fit-content;
    margin-inline: auto;
  }
  .legal.sub { margin-top: 6px; }
}

@media (max-width: 420px) {
  .legal { font-size: 0.68rem; }
}

@media (max-height: 480px) {
  main { padding-block: 24px; }
  .mark img { width: clamp(220px, 34vw + 20vh, 520px); }
  .rule { margin-top: 18px; }
  .tagline { margin-top: 14px; }
  footer { padding-block: 10px 14px; }
  .legal { line-height: 1.6; }
}

/* ---- deterministic still mode for visual testing (?snap) ---- */

html.snap *, html.snap *::before, html.snap *::after {
  animation: none !important;
  transition: none !important;
}

html.snap #smoke { opacity: 1; }

/* ---- reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .grain { animation: none; }
  .mark img { animation: none; }
}
