/* kahloon.com.au — engraved brass on near-black. Palette source of truth: /assets SVGs. */

:root {
  --bg: #0E0D0B;
  --bg-deep: #0A0908;
  --bg-warm: #141210;
  --bone: #E7E0D2;
  --stone: #8F897B;
  --brass: #A98F5F;
  --brass-bright: #C9A96A;
  --lapis: #4E6FA8;
  --lapis-bright: #5F7FBE;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

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

body {
  background: radial-gradient(120% 90% at 58% 44%, var(--bg-warm) 0%, var(--bg) 62%, var(--bg-deep) 100%);
  color: var(--bone);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

/* ---------- the instrument ---------- */

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
  cursor: crosshair;
  outline: none;
}

#field:focus-visible {
  outline: 1px solid rgba(201, 169, 106, 0.45);
  outline-offset: -8px;
}

/* no-JS fallback: the reference artwork itself */
.static-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  z-index: 0;
}

/* ---------- identity ---------- */

.identity {
  position: fixed;
  z-index: 2;
  left: 50%;
  top: clamp(36px, 9vh, 110px);
  transform: translateX(-50%);
  width: 100%;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.4vw, 3.4rem);
  letter-spacing: 0.42em;
  color: var(--bone);
  animation: settle 2.2s cubic-bezier(0.22, 1, 0.36, 1) 1.1s both;
}

.line {
  margin: 1.6em 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--stone);
  animation: settle 2.2s cubic-bezier(0.22, 1, 0.36, 1) 1.7s both;
}

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

/* first visit: the wordmark waits for the instrument to settle (class set by JS) */
.first .wordmark { animation-delay: 2.6s; }
.first .line { animation-delay: 3.2s; }

/* ---------- engravings ---------- */

.hint {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: clamp(16px, 3vh, 34px);
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.62rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--stone);
  opacity: 0;
  transition: opacity 1.6s ease;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.hint.show { opacity: 0.55; }
.hint.gone { opacity: 0; transition-duration: 0.9s; }

.engraving {
  position: fixed;
  z-index: 2;
  margin: 0;
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--stone);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

.domain {
  left: clamp(28px, 7vw, 110px);
  bottom: max(22px, env(safe-area-inset-bottom, 22px));
}

.local {
  right: clamp(28px, 5vw, 80px);
  bottom: max(22px, env(safe-area-inset-bottom, 22px));
  font-variant-numeric: tabular-nums;
}

/* ---------- 404 ---------- */

.lost {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
}
.lost svg {
  width: min(52vmin, 420px);
  height: auto;
  opacity: 0.5;
}

/* ---------- mobile recomposition ---------- */

@media (max-width: 720px) {
  .wordmark {
    font-size: clamp(1.4rem, 7.6vw, 2.1rem);
    letter-spacing: 0.34em;
  }
  .line { font-size: 0.66rem; }
  .domain {
    left: 50%;
    transform: translateX(-50%);
  }
  .local { display: none; }
}

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

@media (prefers-reduced-motion: reduce) {
  .wordmark, .line { animation: none; }
  .hint { transition: opacity 0.3s ease; }
}
