:root {
  --paper: #efe7d6;
  --panel: #e6dcc4;
  --line: #c9b78f;
  --line-soft: rgba(201, 183, 143, 0.45);
  --ink: #26201a;
  --ink-soft: #5c5343;
  --ink-faint: #948a72;
  --wine: #7a2e27;
  --wine-soft: rgba(122, 46, 39, 0.1);
}

* {
  box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

html,
body {
  margin: 0;
  height: 100%;
  background-color: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  overflow: hidden;
}

body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px 28px;
}

.grain {
  position: fixed;
  inset: 0;
  opacity: 0.05;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
}

.seal {
  position: fixed;
  top: 22px;
  left: 26px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 40px;
  border: 1px solid var(--line);
  transform: rotate(-4deg);
  opacity: 0.85;
}
.seal span {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 500;
  font-size: 16px;
  color: var(--wine);
  white-space: nowrap;
}

header {
  text-align: center;
  margin-bottom: 22px;
}

.mark {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.mark svg {
  width: 22px;
  height: 22px;
  stroke: var(--wine);
}

.eyebrow {
  font-family: "Archivo", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}

h1 {
  font-family: "Fraunces", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 10px 0;
}

header p {
  max-width: 420px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 14.5px;
  font-style: italic;
  line-height: 1.55;
}

.layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 44px;
}

.mic-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.mic-wrap {
  position: relative;
  width: 96px;
  height: 96px;
}

.mic-button {
  position: relative;
  z-index: 2;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.6),
    inset 0 -2px 5px rgba(38, 32, 26, 0.12),
    0 1px 1px rgba(255, 255, 255, 0.4);
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.3s ease;
}

.mic-button::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.mic-button:hover {
  transform: scale(1.03);
}
.mic-button:active {
  transform: scale(0.97);
}

.mic-button.recording {
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.5),
    inset 0 -2px 6px rgba(122, 46, 39, 0.22),
    0 1px 1px rgba(255, 255, 255, 0.4);
}
.mic-button.recording::before {
  border-color: var(--wine);
}

.mic-button svg {
  width: 21px;
  height: 21px;
  position: relative;
  z-index: 2;
  stroke: var(--ink);
  transition: stroke 0.3s ease;
}
.mic-button.recording svg {
  stroke: var(--wine);
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(122, 46, 39, 0.45);
  opacity: 0;
  z-index: 1;
}
.mic-button.recording ~ .pulse-ring {
  animation: pulse 2.3s ease-out infinite;
}
.pulse-ring.delay {
  animation-delay: 0.75s !important;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.45;
  }
  100% {
    transform: scale(1.65);
    opacity: 0;
  }
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 15px;
}

.status-text {
  font-family: "Archivo", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.status-row.live .status-text {
  color: var(--wine);
}

.wave {
  display: none;
  align-items: center;
  gap: 3px;
  height: 11px;
}
.status-row.live .wave {
  display: flex;
}
.wave span {
  width: 2px;
  border-radius: 1px;
  background: var(--wine);
  animation: wave 0.9s ease-in-out infinite;
}
.wave span:nth-child(1) {
  height: 4px;
  animation-delay: 0s;
}
.wave span:nth-child(2) {
  height: 9px;
  animation-delay: 0.12s;
}
.wave span:nth-child(3) {
  height: 6px;
  animation-delay: 0.24s;
}
.wave span:nth-child(4) {
  height: 11px;
  animation-delay: 0.36s;
}
.wave span:nth-child(5) {
  height: 5px;
  animation-delay: 0.48s;
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.5);
    opacity: 0.55;
  }
  50% {
    transform: scaleY(1.3);
    opacity: 1;
  }
}

.right-col {
  display: flex;
  flex-direction: column;
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  padding: 22px 26px 20px;
}

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid var(--ink-faint);
  opacity: 0.5;
}
.panel::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}
.panel::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.field-label span {
  font-family: "Archivo", sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--wine);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.field-label .no {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 12px;
  color: var(--ink-faint);
}

textarea {
  width: 100%;
  height: 168px;
  resize: none;
  border: none;
  padding: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 16px;
  font-style: italic;
  line-height: 1.68;
  color: var(--ink);
  background: transparent;
  outline: none;
}

textarea:not(:placeholder-shown) {
  font-style: normal;
}
textarea::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

.actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 16px;
}

.btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: "Archivo", sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 3px 1px;
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}
.btn:hover {
  border-color: var(--ink);
}
.btn.ghost {
  color: var(--ink-faint);
}
.btn.ghost:hover {
  color: var(--wine);
  border-color: var(--wine);
}

.sep {
  color: var(--line);
  font-size: 11px;
}

.note {
  margin-top: 18px;
  text-align: center;
  font-size: 11.5px;
  font-style: italic;
  color: var(--ink-faint);
  line-height: 1.5;
}

.unsupported {
  display: none;
  margin-top: 16px;
  font-size: 13px;
  color: var(--wine);
  background: var(--wine-soft);
  border: 1px solid rgba(122, 46, 39, 0.25);
  padding: 12px;
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 720px), (max-height: 700px) {
  html,
  body {
    overflow: auto;
  }
  body {
    align-items: flex-start;
    padding: 40px 22px 60px;
  }
  .layout {
    grid-template-columns: 1fr;
    gap: 26px;
    justify-items: center;
  }
  .right-col {
    width: 100%;
  }
}
#fixItStatus {
  font-family: "Archivo", sans-serif;
  font-size: 10.5px;
  color: var(--wine);
  margin-left: 8px;
}
