:root {
  --night: #090706;
  --ink: #f6efe5;
  --ink-soft: rgba(246, 239, 229, 0.64);
  --ink-faint: rgba(246, 239, 229, 0.4);
  --line: rgba(255, 236, 210, 0.1);
  --gold: #f1c97a;
  --ember: #ff7a2f;
  --deep: #7a1d06;
  --sans: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
}

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

html, body { height: 100%; }

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

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.stage {
  /* the reflection of the metal on the type, set from the script on every [data-lit] element */
  --lx: 50%;
  --ly: 120%;
  --lg: 0.3;
  --cast: 0;
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  /* what is left without WebGL: a still pool of warm gold low on the page */
  background:
    radial-gradient(ellipse 60% 26% at 50% 96%, rgba(241, 201, 122, 0.34), transparent 70%),
    radial-gradient(ellipse 40% 18% at 30% 84%, rgba(255, 122, 47, 0.22), transparent 70%),
    radial-gradient(ellipse 36% 16% at 72% 80%, rgba(241, 201, 122, 0.16), transparent 70%),
    var(--night);
}

.melt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  display: block;
  opacity: 0;
}

/* a soft dark veil behind the words, so the headline always reads over the brightest metal */
.veil {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(ellipse min(46vw, 520px) min(30vh, 260px) at 50% 46%, rgba(9, 7, 6, 0.66), transparent 74%);
}

/* a still grain over everything, so the warm gradients never band */
.grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.1;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---- the top bar */
.top {
  position: absolute;
  top: clamp(12px, 3vh, 26px);
  left: clamp(14px, 3.4vw, 34px);
  right: clamp(14px, 3.4vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: clamp(12px, min(1.5vw, 2.6vh), 14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 620;
  font-variation-settings: "wdth" 108;
  letter-spacing: -0.01em;
}
.brand__mark { width: 1.25em; height: 1.25em; }
.brand__mark path { fill: var(--gold); }
.brand__mark .brand__cut { fill: none; stroke: var(--night); stroke-width: 1.3; stroke-linecap: round; }
.top__link {
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--line) inset;
}

/* ---- the hero */
.hero {
  width: min(620px, 100% - 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(9px, 2.4vh, 20px);
  margin-top: clamp(10px, 3vh, 30px);
}

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: rgba(24, 18, 14, 0.55);
  box-shadow: 0 0 0 1px var(--line) inset, 0 1px 0 rgba(255, 240, 220, 0.07) inset, 0 10px 24px -16px #000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: clamp(10.5px, min(1.6vw, 2.6vh), 13px);
  letter-spacing: 0.01em;
}
/* the rim of the pill catches the metal where it is hottest */
.pill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: radial-gradient(120px 60px at var(--lx) var(--ly), rgba(255, 214, 150, calc(0.75 * var(--lg))), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.pill__tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f8e2b0, var(--gold) 55%, #c8913f);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 -1px 0 rgba(90, 50, 10, 0.35) inset;
  color: #2a1906;
  font-weight: 650;
}
.pill__text { color: var(--ink-soft); }

/* the headline: pale champagne type that takes the colour of the metal under it, where the metal is hottest */
.title {
  font-weight: 540;
  font-variation-settings: "wdth" 106;
  font-size: clamp(28px, min(7.4vw, 10.2vh), 80px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  padding-bottom: 0.06em;
  background:
    radial-gradient(calc(160px + 240px * var(--lg)) calc(120px + 160px * var(--lg)) at var(--lx) var(--ly), rgba(255, 238, 200, calc(0.95 * var(--lg))) 0%, rgba(255, 150, 72, calc(0.75 * var(--lg))) 34%, transparent 72%),
    linear-gradient(180deg, #fbf6ee 0%, #e7dccd 52%, #a8957f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 18px rgba(0, 0, 0, 0.5));
}

.line {
  max-width: 34em;
  color: var(--ink-soft);
  font-size: clamp(12px, min(1.9vw, 2.9vh), 17px);
  line-height: 1.45;
  text-wrap: balance;
}

/* ---- the prompt field: dark glass, a 1 px rim that catches the metal, a warm glow rising from under it */
.prompt {
  position: relative;
  width: min(540px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: clamp(5px, 0.9vh, 7px) clamp(5px, 0.9vh, 7px) clamp(5px, 0.9vh, 7px) clamp(14px, 2.4vh, 20px);
  margin-top: clamp(2px, 1vh, 10px);
  border-radius: 999px;
  background: rgba(16, 12, 10, 0.62);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  box-shadow:
    0 1px 0 rgba(255, 240, 220, 0.08) inset,
    0 0 0 1px rgba(255, 236, 210, 0.07) inset,
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 18px 40px -18px rgba(0, 0, 0, 0.9),
    0 30px 70px -30px rgba(255, 122, 47, calc(0.35 * var(--lg)));
  text-align: left;
}
.prompt__rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 226, 168, calc(0.9 * var(--cast))), rgba(255, 140, 60, calc(0.8 * var(--cast)))),
    radial-gradient(calc(140px + 120px * var(--lg)) 70px at var(--lx) var(--ly), rgba(255, 220, 160, calc(0.25 + 0.7 * var(--lg))), rgba(255, 122, 47, calc(0.35 * var(--lg))) 40%, transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.85;
}
.prompt__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(180px 40px at var(--lx) 112%, rgba(255, 150, 72, calc(0.22 * var(--lg) + 0.3 * var(--cast))), transparent 75%);
}
.prompt__input {
  position: relative;
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: clamp(13px, min(1.9vw, 2.9vh), 16px);
  caret-color: var(--gold);
}
.prompt__input::placeholder { color: var(--ink-faint); }

/* the button: a small ingot of polished gold, lit from the metal below */
.forge {
  position: relative;
  flex: none;
  border: 0;
  padding: 0;
  background: none;
  color: #2a1906;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}
.forge__face {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: clamp(34px, 6vh, 42px);
  padding: 0 clamp(13px, 2.4vh, 17px) 0 clamp(15px, 2.6vh, 19px);
  border-radius: inherit;
  overflow: hidden;
  font-size: clamp(12.5px, min(1.8vw, 2.8vh), 15px);
  font-weight: 640;
  font-variation-settings: "wdth" 104;
  background:
    radial-gradient(90px 50px at var(--lx) var(--ly), rgba(255, 250, 235, calc(0.85 * var(--lg))), transparent 70%),
    linear-gradient(180deg, #fbe6b8 0%, var(--gold) 46%, #c48a3a 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 -1px 0 rgba(96, 52, 10, 0.4) inset,
    0 0 0 1px rgba(120, 70, 20, 0.35),
    0 6px 16px -6px rgba(255, 122, 47, 0.55),
    0 2px 3px rgba(0, 0, 0, 0.35);
}
.forge__sheen {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  transform: translateX(-160%) skewX(-18deg);
  pointer-events: none;
}
.forge__label { position: relative; }
.forge__arrow, .forge__tick {
  position: relative;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.forge__tick {
  position: absolute;
  right: clamp(13px, 2.4vh, 17px);
  opacity: 0;
}
.forge__tick path { stroke-dasharray: 14; stroke-dashoffset: 14; }

.status {
  min-height: 1.4em;
  color: var(--ink-faint);
  font-size: clamp(11px, min(1.5vw, 2.5vh), 13px);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 8px rgba(9, 7, 6, 0.9);
}
.status span {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(12, 9, 7, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 236, 210, 0.05) inset;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.status span { display: inline-block; }

/* the drawn pointer of the preview */
.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}
.ghost path { fill: #fff; stroke: #1a120c; stroke-width: 1.1; stroke-linejoin: round; }

@media (hover: hover) {
  .forge:hover .forge__face { filter: brightness(1.05); }
  .top__link:hover { color: var(--ink); }
}

/* phones: the same, the type a little tighter */
@media (max-width: 520px) {
  .hero { width: calc(100% - 24px); }
  .title { letter-spacing: -0.03em; }
  .line { max-width: 26em; }
  .veil { background: radial-gradient(ellipse 70vw 32vh at 50% 46%, rgba(9, 7, 6, 0.7), transparent 74%); }
}
