/*
 * Page styles. Every brand value comes from tokens.css (the Polynomial
 * design system); only the semantic --color-* tokens are used here.
 */

/*
 * Dark mode follows the visitor's system setting, without JavaScript.
 * This mirrors the [data-theme="dark"] block in tokens.css.
 */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:             var(--poly-navy-950);
    --color-bg-subtle:      var(--poly-navy-900);
    --color-bg-inverse:     var(--poly-white);
    --color-surface:        var(--poly-navy-900);
    --color-surface-raised: var(--poly-navy-800);
    --color-border:         var(--poly-navy-700);
    --color-border-strong:  var(--poly-navy-500);
    --color-text:           var(--poly-white);
    --color-text-muted:     var(--poly-navy-300);
    --color-text-subtle:    var(--poly-navy-400);
    --color-text-inverse:   var(--poly-navy-950);
    --color-brand:          var(--poly-white);
    --color-accent:         var(--poly-curve-300);
    --color-accent-hover:   var(--poly-curve-100);
    --color-accent-subtle:  var(--poly-navy-800);
    --color-link:           var(--poly-curve-300);
    --color-focus:          var(--poly-curve-300);
    --color-field:          var(--poly-white);
  }
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-text);
}

/* The Polynomial Field (guidelines §6.2), drawn by field.js. */
.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Clear space around the lockup is well above one stem width. */
  padding: var(--space-7) var(--space-5);
}

/*
 * Soft halo in the background colour keeps the Field's curves clear of
 * the lockup (well beyond its clear space).
 */
main::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(40rem, 96vw);
  height: min(24rem, 80vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--color-bg) 55%, transparent);
  z-index: -1;
}

h1 {
  margin: 0;
  line-height: 0;
}

.lockup {
  display: block;
  /* Above the 96 px minimum at every viewport. */
  width: clamp(200px, 40vw, 400px);
  height: auto;
}
