/* ===========================================================
   Highest Order Bit — A Player Labs
   Brand: Black Hole ground, Photosynth accent, Calcium type.
   A Player Sans is a single-weight workhorse: hierarchy is
   SIZE, never weight. Pliant italic carries the annotations.
   Mobile-first: base styles are the phone layout.
   =========================================================== */

@font-face {
  font-family: 'A Player Sans';
  src: url('fonts/APlayerSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Pliant';
  src: url('fonts/Pliant-Regular.woff2') format('woff2');
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Pliant';
  src: url('fonts/Pliant-Italic.woff2') format('woff2');
  font-style: italic;
  font-display: swap;
}

:root {
  --black-hole: #0b0d0b;
  --basalt: #151815;
  --grey-matter: #8c9088;
  --calcium: #fafafa;
  --photosynth: #3dfa51;
  --verdant: #10ba3d;
  --inflorescence: #d9e0ed;
  --rule: color-mix(in oklab, var(--calcium) 14%, transparent);
  --measure: 42rem;
}

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

html { font-synthesis-weight: none; }

body {
  background: var(--black-hole);
  color: var(--calcium);
  font-family: 'A Player Sans', 'Helvetica Neue', sans-serif;
  font-weight: 400;
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--photosynth); color: var(--black-hole); }

a { color: inherit; text-decoration-color: var(--verdant); text-underline-offset: 3px; }
a:hover { color: var(--photosynth); }

em, .annot { font-family: 'Pliant', serif; font-style: italic; }
strong, b { font-weight: 400; color: var(--calcium); }

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
}
.masthead .tool-name { color: var(--grey-matter); letter-spacing: 0.02em; }

main {
  width: min(100%, var(--measure));
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
  flex: 1;
}

footer {
  border-top: 1px solid var(--rule);
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  color: var(--grey-matter);
}

/* ---------- intro ---------- */
#intro { padding-top: 3rem; }

h1 {
  font-size: clamp(2.1rem, 8vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  max-width: 16ch;
}
h1 em { color: var(--photosynth); }

h2 {
  font-size: clamp(1.5rem, 5.5vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.lede {
  margin: 1.5rem 0 2rem;
  max-width: 54ch;
  color: var(--grey-matter);
  font-size: clamp(1rem, 4vw, 1.125rem);
}
.lede strong { color: var(--calcium); font-weight: 400; }

.definition {
  border-left: 3px solid var(--verdant);
  padding: 0.25rem 0 0.25rem 1rem;
  margin-bottom: 2rem;
  max-width: 54ch;
}
.definition .annot { color: var(--inflorescence); font-size: 1.02rem; }

.label {
  color: var(--grey-matter);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.skeleton-wrap, .preview-wrap { margin: 0 0 2rem; }
.preview-wrap { margin: 2.5rem 0 0; border-top: 1px solid var(--rule); padding-top: 1.5rem; }

.skeleton {
  background: var(--basalt);
  border: 1px solid var(--rule);
  padding: 1rem 1.1rem;
  font-size: 0.98rem;
  line-height: 1.7;
}
.slot {
  color: var(--grey-matter);
  border-bottom: 1px dashed var(--grey-matter);
  padding-bottom: 1px;
  white-space: normal;
}
.slot.filled { color: var(--photosynth); border-bottom-color: transparent; }
.slot.current { border-bottom: 1px solid var(--photosynth); color: var(--calcium); }

#intro .hint { margin-top: 0.9rem; }

/* ---------- buttons ---------- */
button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: var(--photosynth);
  color: var(--black-hole);
  padding: 0.85rem 2rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s;
  width: 100%;
}
button:hover { background: var(--verdant); color: var(--calcium); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: default; }

button.ghost {
  background: transparent;
  color: var(--calcium);
  border: 1px solid var(--rule);
}
button.ghost:hover { border-color: var(--photosynth); color: var(--photosynth); background: transparent; }

.hint { color: var(--grey-matter); font-size: 0.85rem; }

/* ---------- steps ---------- */
#steps { padding-top: 2rem; }

.progress-row { margin-bottom: 1.75rem; }
.progress-bar {
  display: flex;
  gap: 4px;
  margin-top: 0.5rem;
}
.progress-bar i {
  flex: 1;
  height: 3px;
  background: var(--rule);
}
.progress-bar i.done { background: var(--photosynth); }

.step-hint { color: var(--grey-matter); margin: 0.75rem 0 0.35rem; max-width: 50ch; }
.step-example { color: var(--inflorescence); font-size: 0.95rem; margin-bottom: 1.5rem; }

textarea, input[type="text"] {
  width: 100%;
  background: transparent;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--photosynth);
  color: var(--calcium);
  font: inherit;
  font-size: 1.1rem;
  padding: 0.9rem 1rem;
  resize: vertical;
}
textarea { min-height: 5.5rem; }
input[type="text"] { margin-bottom: 0.6rem; }
textarea:focus, input[type="text"]:focus { outline: none; border-color: var(--verdant); border-left-color: var(--photosynth); }
textarea::placeholder, input::placeholder { color: color-mix(in oklab, var(--grey-matter) 70%, transparent); }

.form-row {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ---------- result ---------- */
#result { padding-top: 2.5rem; }

blockquote {
  background: var(--basalt);
  border-left: 3px solid var(--photosynth);
  padding: 1.25rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.next-step { color: var(--grey-matter); margin: 1.5rem 0 2.5rem; max-width: 52ch; }
.next-step strong { color: var(--calcium); }

.edit-wrap { margin-bottom: 2.5rem; }
#edit-list { list-style: none; }
#edit-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}
#edit-list .answer { color: var(--inflorescence); overflow-wrap: anywhere; }
#edit-list a { color: var(--photosynth); font-size: 0.85rem; white-space: nowrap; cursor: pointer; }

/* ---------- larger screens ---------- */
@media (min-width: 40rem) {
  .masthead, footer { padding-left: 2rem; padding-right: 2rem; }
  main { padding-left: 2rem; padding-right: 2rem; }
  #intro { padding-top: 4.5rem; }
  button { width: auto; }
  .form-row { flex-direction: row; justify-content: space-between; align-items: center; }
}
