:root {
  --void: #070807;
  --void-2: #0C0E0C;
  --line: #1A1E1A;
  --ink: #E8EDE6;
  --mute: #8A9186;
  --lime: #C6FF3D;
  --lime-dim: #6A8F1F;
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1120px;
  --gutter: clamp(20px, 4vw, 40px);
  --edge: max(var(--gutter), calc(50% - (var(--max) / 2)));
}

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

html {
  color-scheme: dark;
  background: var(--void);
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--lime); color: var(--void); }

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  outline: none;
  width: 100%;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip:focus {
  position: fixed;
  left: 8px;
  top: 8px;
  z-index: 20;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  overflow: visible;
  background: var(--lime);
  color: var(--void);
  padding: 6px 10px;
  font-size: 12px;
  font-family: var(--mono);
  outline: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--edge);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.brand .glyph { display: block; color: var(--mute); }
.brand .glyph .pivot { fill: var(--ink); }
.brand:hover .glyph,
.brand:focus-visible .glyph { color: var(--ink); }
.brand:hover .glyph .pivot,
.brand:focus-visible .glyph .pivot { fill: var(--lime); }
.brand:hover .word .i,
.brand:focus-visible .word .i { color: var(--lime); }

.word {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.22em;
}

.header-right { display: flex; align-items: center; gap: 16px; }

.lang {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.lang button { color: var(--mute); padding: 4px 2px; }
.lang button[aria-pressed="true"] { color: var(--ink); }
.lang button:hover { color: var(--ink); }
.lang-sep { color: var(--line); }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 22px var(--edge) 40px;
  gap: 14px;
}

.progress {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--mute);
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  border: 1px solid var(--line);
  min-height: 420px;
  background: var(--void);
}

.ask {
  padding: 32px 28px 36px;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.q-step {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--mute);
}
.q-step .resume-tag {
  margin-left: 8px;
  color: var(--mute);
  opacity: 0.75;
}

.q-line {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 22ch;
}

.q-hint {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--mute);
  max-width: 38ch;
}

.q-body { margin-top: 26px; }

.line {
  display: flex;
  align-items: stretch;
  background: var(--void-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  min-height: 52px;
}
.line:focus-within { border-color: var(--lime); }
.line.bad { border-color: var(--mute); }

.line input,
.line textarea {
  padding: 14px 14px;
  font-size: 16px;
  color: var(--ink);
}
.line textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.4;
}
.line input::placeholder,
.line textarea::placeholder { color: var(--mute); }

.send {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 0 16px;
  background: var(--lime);
  color: var(--void);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  border-radius: 0 2px 2px 0;
  transition: filter 0.15s ease;
}
.send:hover { filter: brightness(1.07); }
.send:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.cta {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 12px 18px;
  background: var(--lime);
  color: var(--void);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: 2px;
  white-space: nowrap;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.cta:hover { filter: brightness(1.07); }
.cta:active { transform: translateY(1px); }
.cta:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.later {
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  color: var(--mute);
  border-bottom: 1px solid transparent;
}
.later:hover { color: var(--ink); border-bottom-color: var(--ink); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 13px;
  background: var(--void-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 14px;
  color: var(--mute);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] {
  border-color: var(--lime);
  color: var(--ink);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.card {
  text-align: left;
  padding: 14px 12px 12px;
  background: var(--void-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  min-height: 72px;
}
.card .card-name {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--mute);
}
.card .card-sub {
  margin: 0;
  font-size: 13px;
  color: var(--mute);
}
.card[aria-pressed="true"] { border-color: var(--lime); }
.card[aria-pressed="true"] .card-name { color: var(--lime); }
.card[aria-pressed="true"] .card-sub { color: var(--ink); }

.extra { margin-top: 12px; }

.drop {
  border: 1px dashed var(--line);
  background: var(--void);
  border-radius: 2px;
  padding: 32px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--mute);
}
.drop.over {
  border-color: var(--lime);
  color: var(--ink);
}
.drop input[type="file"] { display: none; }
.file-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink);
}
.file-list li { margin: 0 0 4px; }
.drop-label { display: block; cursor: pointer; }

.done-copy {
  margin: 12px 0 0;
  font-size: 16px;
  color: var(--mute);
  max-width: 36ch;
}

.notes-fold {
  margin: 0;
  background: var(--void-2);
  min-width: 0;
}
.notes-fold > summary {
  display: none;
  list-style: none;
}
.notes-fold > summary::-webkit-details-marker { display: none; }

.log {
  padding: 24px 22px 28px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--mute);
}
.log-head {
  margin: 0 0 16px;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  font-size: 11px;
  color: var(--mute);
}
.log-row {
  display: grid;
  grid-template-columns: 11ch 1fr;
  gap: 10px;
  align-items: baseline;
  margin: 0 0 8px;
}
.log-key { color: var(--mute); }
.log-val {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-val.empty { color: var(--mute); }

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .ask {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 24px 18px 28px;
  }
  .notes-fold > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    font-size: 14px;
    color: var(--mute);
    cursor: pointer;
    border-bottom: 1px solid transparent;
  }
  .notes-fold[open] > summary { border-bottom-color: var(--line); }
  .fold-mark { display: inline-block; transition: transform 0.15s ease; }
  .notes-fold[open] .fold-mark { transform: rotate(90deg); }
  .log { padding: 14px 18px 22px; }
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .q-line { font-size: 1.2rem; max-width: none; }
  .log-row { grid-template-columns: 1fr; gap: 0; margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cta { transition: none; }
}
