:root {
  color-scheme: light;
  --bg: #f5f0e8;
  --ink: #1e1a16;
  --muted: #5a5148;
  --accent: #f4a259;
  --accent-dark: #d57d2a;
  --accent-cool: #3a6ea5;
  --card: #fff7ee;
  --border: rgba(30, 26, 22, 0.12);
  --shadow: 0 20px 60px rgba(32, 24, 18, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #ffe9d3 0%, var(--bg) 45%, #f8efe4 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.18;
  z-index: -1;
  animation: float 12s ease-in-out infinite;
}

.bg-orb--one {
  background: radial-gradient(circle, #f4a259 0%, transparent 70%);
  top: -120px;
  right: -80px;
}

.bg-orb--two {
  background: radial-gradient(circle, #3a6ea5 0%, transparent 70%);
  bottom: -160px;
  left: -120px;
  animation-delay: -3s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(20px);
  }
}

header,
main,
footer {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 48px 0 24px;
  animation: reveal 0.8s ease-out both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  font-family: "Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
}

.status-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  min-width: 220px;
  box-shadow: var(--shadow);
  text-align: left;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 20px;
}


.status-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.status-text {
  font-weight: 600;
  margin: 0;
}

.spinner {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  opacity: 0;
  animation: spin 1s linear infinite;
}

.spinner.is-active {
  opacity: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.card {
  background: var(--card);
  border-radius: 22px;
  padding: 26px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: reveal 0.9s ease-out both;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card h2 {
  margin: 0;
  font-size: 1.4rem;
}

.card-text {
  margin: 0;
  color: var(--muted);
}

.badge {
  font-size: 0.8rem;
  background: rgba(58, 110, 165, 0.12);
  color: var(--accent-cool);
  padding: 6px 12px;
  border-radius: 999px;
}

.record-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timer {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.audio-preview {
  width: 100%;
  border-radius: 12px;
}

.file-input {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 162, 89, 0.14);
  border: 1px dashed rgba(213, 125, 42, 0.6);
  padding: 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.file-input input {
  display: none;
}

.file-input:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(213, 125, 42, 0.18);
}

.file-meta {
  font-size: 0.9rem;
  color: var(--muted);
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.btn-primary {
  background: var(--accent);
  color: #1d130a;
  box-shadow: 0 12px 24px rgba(244, 162, 89, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--accent-dark);
}

.btn-dark {
  background: var(--ink);
  color: #fff5ea;
  box-shadow: 0 10px 24px rgba(30, 26, 22, 0.28);
}

.btn-dark:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.btn-ghost:hover:not(:disabled) {
  transform: translateY(-2px);
}

.settings {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin-bottom: 30px;
}

.settings h3 {
  margin: 0 0 6px;
}

.settings p {
  margin: 0;
  color: var(--muted);
}

.settings select {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 1rem;
  background: #fff;
}

.results {
  margin-bottom: 40px;
}

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

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

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.result-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 22px;
  min-height: 200px;
  box-shadow: var(--shadow);
}

.result-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.result-body {
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.6;
}

.footer {
  padding: 18px 0 36px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 820px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-card {
    width: 100%;
  }

  .settings {
    flex-direction: column;
    align-items: flex-start;
  }
}
