/* Hammerwalk — holding page.
   Palette and geometry both derive from the identity: a cold mineral field,
   ink, and a single oxide accent used in exactly one place. */

:root {
  --field:      #d9d7d1;
  --field-edge: #bfbcb4;
  --field-lit:  #e3e1dc;
  --ink:        #161513;
  --ink-soft:   #6b6862;
  --oxide:      #6e2d1f;

  --stride: 8.05px;   /* must match STRIDE in tools/gen_logo.py */
  --pad: clamp(1.25rem, 4vw, 2.25rem);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

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

html, body { height: 100%; }

body {
  background: var(--field);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- field --------------------------------------------------------------- */

.field {
  position: relative;
  display: grid;
  place-items: center;
  height: 100dvh;
  width: 100%;
  background: radial-gradient(
    120% 90% at 50% 46%,
    var(--field-lit) 0%,
    var(--field) 42%,
    var(--field-edge) 100%
  );
  will-change: transform;
}

/* mineral dust — stops the pale field reading as a flat grey div */
.field::after {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("/assets/dust.svg");
}

.field.strike { animation: shudder 220ms cubic-bezier(0.2, 0.9, 0.3, 1); }

@keyframes shudder {
  0%   { transform: translate3d(0, 0, 0); }
  14%  { transform: translate3d(0, 3px, 0) scale(1.0035); }
  38%  { transform: translate3d(0, -2px, 0) scale(0.9992); }
  64%  { transform: translate3d(0, 1px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

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

.lockup {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 5vh, 3rem);
}

.mark {
  height: clamp(3.25rem, 13vh, 6.5rem);
  width: auto;
  opacity: 0;
  animation: rise 1500ms cubic-bezier(0.22, 0.61, 0.36, 1) 200ms forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}

/* the legs alternate: one plants, the other lifts */
.mark #legL,
.mark #legR { transition: transform 300ms cubic-bezier(0.34, 1.2, 0.44, 1); }

.mark.stepped #legL { transform: translateY(calc(var(--stride) * -1)); }
.mark.stepped #legR { transform: translateY(var(--stride)); }

.lost {
  color: var(--ink);
  text-decoration: none;
  opacity: 0;
  animation: rise 1200ms cubic-bezier(0.22, 0.61, 0.36, 1) 150ms forwards;
  transition: opacity 240ms ease;
}

.lost:hover,
.lost:focus-visible { opacity: 0.7; }

.word {
  width: clamp(13rem, 62vw, 34rem);
  height: auto;
  opacity: 0;
  animation: surface 2400ms cubic-bezier(0.22, 0.61, 0.36, 1) 620ms forwards;
}

@keyframes surface {
  from { opacity: 0; filter: blur(6px); }
  to   { opacity: 1; filter: blur(0); }
}

/* ---- shockwave ----------------------------------------------------------- */

.wave {
  position: absolute;
  z-index: 1;
  top: 54%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 1px solid var(--oxide);
  border-radius: 50%;
  pointer-events: none;
  animation: wave 1450ms cubic-bezier(0.13, 0.72, 0.26, 1) forwards;
}

/* positions live here, not in a style attribute, so the CSP stays strict */
.wave.left  { left: 42%; }
.wave.right { left: 58%; }

@keyframes wave {
  from { transform: scale(1);   opacity: 0.5; }
  to   { transform: scale(112); opacity: 0; }
}

/* ---- utility text -------------------------------------------------------- */

.utility {
  position: absolute;
  z-index: 2;
  bottom: calc(var(--pad) + env(safe-area-inset-bottom));
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  opacity: 0;
  animation: fade 1200ms ease 2000ms forwards;
}

@keyframes fade { to { opacity: 0.62; } }

.count {
  right: var(--pad);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.contact {
  left: var(--pad);
  text-transform: uppercase;
  text-decoration: none;
  transition: color 240ms ease;
}

.contact:hover,
.contact:focus-visible { color: var(--oxide); }

:focus-visible {
  outline: 1px solid var(--oxide);
  outline-offset: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .mark, .word  { opacity: 1; animation: none; }
  .utility      { opacity: 0.62; animation: none; }
  .mark #legL,
  .mark #legR   { transition: none; }
  .field.strike { animation: none; }
  .wave         { display: none; }
}
