/* ==========================================================================
   Commergent: holding page
   Tokens -> fonts -> base -> atmosphere -> lockup -> footer -> motion
   ========================================================================== */

:root {
  color-scheme: dark;

  --ground: #0A0807;
  --ember: #FA4B0C;          /* the mark: fills and glows only, never text */

  --ink-1: #F6F1EC;          /* 17.8:1 on --ground */
  --ink-2: #D9D0C9;          /* 13.1:1 */
  --ink-3: #B3AAA3;          /*  8.7:1; 5.3:1 inside the pill at the glow peak */
  --ink-4: #8C847E;          /*  5.4:1, the floor: no text is dimmer than this */

  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;

  --mark: clamp(112px, 30vw, 176px);
  --fs-word: clamp(2.5rem, 1.75rem + 3.6vw, 4.5rem);
  --fs-line: clamp(1.375rem, 1.1rem + 1.2vw, 2rem);

  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

/* ----------------------------------------------------------------- fonts */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/instrument-sans.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
}

/* ------------------------------------------------------------------ base */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--ink-1);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(120% 70% at 50% -10%, #1C1411 0%, rgba(28, 20, 17, 0) 62%),
    radial-gradient(90% 60% at 50% 112%, rgba(120, 30, 6, .26) 0%, rgba(120, 30, 6, 0) 70%),
    var(--ground);
}

h1,
p { margin: 0; }

::selection {
  background: rgba(250, 75, 12, .38);
  color: #FFFFFF;
}

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

.atmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.atmos::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 75% 70% at 50% 44%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .55) 100%);
}

.atmos__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 245, 238, .16) 1px, rgba(255, 245, 238, 0) 1.6px);
  background-size: 30px 30px;
  background-position: 50% 50%;
  opacity: .42;
  -webkit-mask-image: radial-gradient(ellipse 52% 46% at 50% 42%, #000 0%, rgba(0, 0, 0, .35) 45%, transparent 78%);
  mask-image: radial-gradient(ellipse 52% 46% at 50% 42%, #000 0%, rgba(0, 0, 0, .35) 45%, transparent 78%);
}

.atmos__spot {
  position: absolute;
  top: 0;
  left: 0;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(250, 75, 12, .085), rgba(250, 75, 12, 0));
  opacity: 0;
  transform: translate3d(-9999px, -9999px, 0);
  transition: opacity .8s ease;
  will-change: transform;
}

.atmos__spot.is-on { opacity: 1; }

.atmos__grain {
  position: absolute;
  inset: 0;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ---------------------------------------------------------------- lockup */

.stage {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  display: grid;
  place-items: center;
  overflow-x: clip;
  padding:
    max(56px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    clamp(40px, 8vh, 96px)
    max(16px, env(safe-area-inset-left));
}

.lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.emblem {
  position: relative;
  width: var(--mark);
  height: var(--mark);
  margin-bottom: clamp(30px, 5vh, 46px);
}

.emblem__glow {
  position: absolute;
  inset: calc(var(--mark) * -1.6);
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(250, 75, 12, .40) 0%,
    rgba(250, 75, 12, .15) 34%,
    rgba(211, 58, 0, .055) 60%,
    rgba(211, 58, 0, 0) 100%);
}

.emblem__rings {
  position: absolute;
  inset: calc(var(--mark) * -1.3);
  width: calc(var(--mark) * 3.6);
  height: calc(var(--mark) * 3.6);
  overflow: visible;
}

.ring {
  fill: none;
  stroke: var(--ember);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}

.emblem__tilt {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 1.2s var(--ease-out);
}

.emblem__mark {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 16px 36px rgba(250, 75, 12, .30)) drop-shadow(0 2px 6px rgba(0, 0, 0, .45));
}

.wordmark {
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--fs-word);
  line-height: 1.1;
  letter-spacing: -.04em;
  padding: 0 .04em .1em 0;    /* background-clip:text paints only inside the box: keep the last glyph and the g's descender in it */
  color: var(--ink-1);
  background: linear-gradient(180deg, #FFFFFF 0%, #F1E9E3 52%, #C4B7AE 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: .75em;
  margin-top: 22px;
  padding: .7em .75em .7em .95em;   /* the right side carries the trailing .2em of tracking */
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: .75rem;
  line-height: 1;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: rgba(255, 245, 238, .035);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 238, .10),
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 12px 32px -14px rgba(0, 0, 0, .8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.status__dot {
  position: relative;
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 10px 1px rgba(250, 75, 12, .7);
}

.status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--ember);
  opacity: 0;
}

.line {
  margin-top: 26px;
  max-width: 24ch;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-line);
  line-height: 1.25;
  letter-spacing: -.005em;
  color: var(--ink-2);
  text-wrap: balance;
}

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

.foot {
  position: relative;
  z-index: 1;
  padding: 24px 16px max(24px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: .75rem;
  line-height: 1.4;
  letter-spacing: .08em;
  color: var(--ink-4);
}

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

@media (prefers-reduced-motion: no-preference) {
  .emblem      { animation: arrive 1.4s var(--ease-out) both; }
  .wordmark    { animation: rise 1.2s var(--ease-out) .18s both; }
  .status      { animation: rise 1.2s var(--ease-out) .32s both; }
  .line        { animation: rise 1.2s var(--ease-out) .46s both; }
  .foot        { animation: fade 1.6s ease .9s both; }

  .emblem__glow { animation: breathe 9s ease-in-out infinite alternate; }
  .emblem__mark { animation: float 8s ease-in-out infinite alternate; }

  .ring              { animation: ripple 7.5s cubic-bezier(.22, .61, .36, 1) 1s infinite; }
  .ring:nth-child(2) { animation-delay: 3.5s; }
  .ring:nth-child(3) { animation-delay: 6s; }

  .status__dot::after { animation: ping 2.8s cubic-bezier(0, 0, .2, 1) 1.2s infinite; }
}

@keyframes arrive {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes breathe {
  from { opacity: .72; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1.04); }
}

@keyframes float {
  from { transform: translateY(-3px); }
  to   { transform: translateY(3px); }
}

@keyframes ripple {
  0%   { opacity: 0; transform: scale(1); }
  10%  { opacity: .5; }
  100% { opacity: 0; transform: scale(3.4); }
}

@keyframes ping {
  0%        { opacity: .65; transform: scale(1); }
  80%, 100% { opacity: 0; transform: scale(3.2); }
}

/* --------------------------------------------------------- accessibility */

@media (forced-colors: active) {
  .wordmark {
    background: none;
    -webkit-text-fill-color: currentColor;
  }
  .atmos { display: none; }
}
