/* ───────────────────────────────────────────────────────────
   Private Zone — style.css
   Dark, minimal, quiet archive aesthetic.
─────────────────────────────────────────────────────────── */

:root {
  --bg:            #09090d;
  --surface:       #0d0d13;
  --surface-2:     #111118;
  --border:        #1c1c28;
  --border-mid:    #242432;
  --text:          #b4b4c2;
  --text-dim:      #545464;
  --text-muted:    #2e2e3a;
  --accent:        #4878a0;
  --accent-dim:    #1e3448;
  --accent-glow:   rgba(72, 120, 160, 0.12);
  --error:         #7a4040;
  --error-bg:      rgba(122, 64, 64, 0.12);
  --success:       #4a7a58;
  --mono:          'SF Mono', 'Cascadia Code', 'Fira Mono', 'Consolas', monospace;
  --sans:          -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --radius:        3px;
  --max-w:         680px;
}

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

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255,255,255,0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  min-height: 100vh;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
  border-bottom: 1px solid var(--border);
  padding: 56px 24px 48px;
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.site-title {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
}

.site-subtitle {
  font-size: 0.875rem;
  color: var(--text-dim);
  letter-spacing: 0.01em;
  max-width: 440px;
}

/* Server status */
.server-status {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  cursor: default;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.4s;
}

.status-dot.ok    { background: var(--success); }
.status-dot.error { background: var(--error); }

.status-text {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

/* ── Main ─────────────────────────────────────────────────── */

.main {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding: 0 24px 80px;
}

/* ── Section ──────────────────────────────────────────────── */

.section {
  padding-top: 52px;
  padding-bottom: 8px;
}

.section + .section {
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
}

.section-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.section-title {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  flex: 1;
}

.section-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

/* ── Form ─────────────────────────────────────────────────── */

.form-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field--full {
  grid-column: 1 / -1;
}

.field-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.field-input,
.field-textarea,
.field-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.875rem;
  padding: 9px 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--text-muted);
}

.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  border-color: var(--accent-dim);
}

.field-textarea {
  resize: vertical;
  min-height: 96px;
  font-family: var(--sans);
  line-height: 1.6;
}

.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23545464'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
  cursor: pointer;
}

.field-select option {
  background: var(--surface-2);
  color: var(--text);
}

/* Mood buttons */
.mood-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mood-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.mood-btn:hover {
  border-color: var(--border-mid);
  color: var(--text);
}

.mood-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Recorder ─────────────────────────────────────────────── */

.recorder-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.recorder-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.recorder-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Base button */
.btn {
  align-items: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.75rem;
  gap: 8px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  border-color: var(--border-mid);
  color: var(--text);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Record button */
.btn--record { border-color: var(--border-mid); }
.btn--record:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn--record.recording {
  border-color: var(--error);
  color: var(--error);
}

.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.rec-dot.pulsing {
  animation: pulse-rec 1.4s ease-in-out infinite;
}

@keyframes pulse-rec {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* Stop button */
.stop-sq {
  width: 7px;
  height: 7px;
  background: currentColor;
  flex-shrink: 0;
}

/* Upload button */
.btn--upload {
  border-color: var(--accent-dim);
  color: var(--accent);
}
.btn--upload:hover:not(:disabled) {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--text);
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--text-muted);
  transition: color 0.15s;
}
.btn-link:hover { color: var(--text); }

/* Duration */
.recorder-duration {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-left: auto;
}

.duration-val {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: 0.02em;
  min-width: 42px;
}

.duration-unit {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* Audio preview */
.recorder-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.preview-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

audio {
  width: 100%;
  height: 28px;
  filter: invert(0.85) hue-rotate(180deg) brightness(0.6) saturate(0.4);
  min-width: 0;
}

/* Upload row */
.upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upload-status {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--success);
  letter-spacing: 0.03em;
}

/* Error message */
.error-msg {
  background: var(--error-bg);
  border: 1px solid var(--error);
  border-radius: var(--radius);
  color: var(--error);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 10px 14px;
}

/* ── Logs ─────────────────────────────────────────────────── */

.logs-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.list-placeholder {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding: 16px 0;
}

.log-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 10px;
  background: var(--surface);
  transition: border-color 0.15s;
}

.log-entry:hover {
  border-color: var(--border-mid);
}

.log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.log-title {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.log-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.log-preview {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: 10px;
  padding-left: 1px;
  border-left: 2px solid var(--border-mid);
  padding-left: 10px;
}

.log-audio {
  margin-top: 14px;
}

.log-audio audio {
  width: 100%;
}

.log-no-audio {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 12px;
}

/* ── Stats ────────────────────────────────────────────────── */

.section--stats { padding-bottom: 52px; }

.stats-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  padding: 16px 0;
}

.stat-sep {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 28px;
}

.stat-val {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1;
}

.stat-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Footer ───────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
}

.footer-text {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ── Mobile ───────────────────────────────────────────────── */

@media (max-width: 560px) {
  .hero {
    padding: 36px 18px 32px;
  }

  .main {
    padding: 0 18px 60px;
  }

  .form-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .field--full {
    grid-column: 1;
  }

  .section {
    padding-top: 36px;
  }

  .recorder-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .recorder-duration {
    margin-left: 0;
  }

  .stats-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .stat-sep {
    display: none;
  }

  .stat {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }

  .stat:last-child {
    border-bottom: none;
  }

  .stat-val {
    font-size: 1.2rem;
    min-width: 40px;
  }

  .log-head {
    flex-direction: column;
    gap: 4px;
  }

  .mood-group {
    gap: 6px;
  }
}
