:root {
  --ink: #f6f0df;
  --muted: #b9b09a;
  --panel: #181713;
  --panel-2: #242118;
  --line: #49422f;
  --black: #090907;
  --accent: #ffbf3f;
  --accent-2: #51d6a7;
  --danger: #ff5f57;
  --shadow: rgba(0, 0, 0, .42);
  --space: clamp(18px, 2.4vw, 32px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(255, 191, 63, .08), transparent 34%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 5px),
    var(--black);
  font-family: "IBM Plex Mono", monospace;
}

button, input, select, textarea { font: inherit; }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.hero {
  min-height: 36vh;
  padding: var(--space) 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent);
  box-shadow: inset 0 0 0 4px var(--black);
  background: var(--accent-2);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space);
  align-items: end;
  margin-top: clamp(36px, 8vw, 90px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: .78rem;
  text-transform: uppercase;
  font-weight: 700;
}

h1, h2 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0;
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.45rem, 6.6vw, 5.8rem);
  line-height: .92;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.8rem);
}

.lead {
  max-width: 710px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.status-panel,
.control-panel,
.transcript,
.meta {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: 10px 10px 0 var(--shadow);
}

.status-panel {
  padding: 22px;
}

.signal {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 8px;
  height: 64px;
  margin-bottom: 24px;
}

.signal span {
  display: block;
  background: var(--accent);
}

.signal span:nth-child(1) { height: 25%; }
.signal span:nth-child(2) { height: 45%; }
.signal span:nth-child(3) { height: 70%; }
.signal span:nth-child(4) { height: 100%; background: var(--accent-2); }

dl { margin: 0; }
dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; }
dd { margin: 4px 0 16px; font-weight: 700; }

.console {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: var(--space);
  padding: var(--space) 0;
  align-items: stretch;
}

.left-rail {
  display: grid;
  gap: 18px;
}

.talk-button {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 430px);
  aspect-ratio: 1;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--black);
  background: radial-gradient(circle at 35% 30%, #ffe39a, var(--accent) 52%, #a75e12);
  box-shadow: 0 24px 60px var(--shadow), inset 0 -18px 38px rgba(0,0,0,.22);
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.talk-button:focus-visible {
  outline: 4px solid var(--accent-2);
  outline-offset: 6px;
}

.talk-button .ring {
  position: absolute;
  inset: 28px;
  border: 2px dashed rgba(9, 9, 7, .5);
  border-radius: 50%;
}

.talk-label {
  z-index: 1;
  max-width: 72%;
  text-align: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.45rem, 4vw, 2.7rem);
  font-weight: 700;
  line-height: 1;
}

.talk-sub {
  position: absolute;
  bottom: 29%;
  z-index: 1;
  max-width: 70%;
  color: rgba(9, 9, 7, .72);
  font-size: .82rem;
  font-weight: 700;
  text-align: center;
}

.talk-button[data-state="Transmitindo..."] {
  background: radial-gradient(circle at 35% 30%, #ffd0cc, var(--danger) 52%, #6b1414);
  color: white;
  animation: pulse 1s infinite;
}

.talk-button[data-state="Processando..."] {
  background: radial-gradient(circle at 35% 30%, #daf9ec, var(--accent-2) 52%, #16704f);
}

@keyframes pulse {
  50% { transform: scale(.985); box-shadow: 0 12px 40px rgba(255, 95, 87, .25); }
}

.meter {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  height: 44px;
}

.meter span {
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.talk-button[data-state="Transmitindo..."] + .meter span:nth-child(odd) {
  background: var(--danger);
}

.control-panel {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  font-weight: 700;
}

select, textarea {
  width: 100%;
  color: var(--ink);
  background: var(--black);
  border: 1px solid var(--line);
  padding: 13px 14px;
  border-radius: 0;
}

textarea { min-height: 110px; resize: vertical; text-transform: none; }

.file-drop {
  min-height: 124px;
  place-content: center;
  text-align: center;
  border: 1px dashed var(--accent);
  background: rgba(255, 191, 63, .06);
}

.file-drop input { width: min(100%, 310px); margin: 0 auto 6px; }
.file-drop span { color: var(--ink); font-size: 1rem; }
.file-drop small { color: var(--muted); }

.send-button,
.actions button,
.docs-link {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--black);
  padding: 13px 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.send-button:hover,
.actions button:hover,
.docs-link:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: var(--space);
}

.transcript,
.meta {
  padding: 22px;
}

.transcript header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.actions { display: flex; gap: 10px; }

pre {
  min-height: 230px;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  line-height: 1.7;
  font-size: 1rem;
}

.docs-link {
  display: inline-block;
  margin-top: 16px;
}

@media (max-width: 860px) {
  .hero-grid,
  .console,
  .result-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .console { padding-top: 18px; }
  .talk-button { width: min(100%, 360px); margin: 0 auto; }
  .transcript header { flex-direction: column; }
}
