:root {
  --primary: #17171c;
  --cohere-black: #000000;
  --ink: #212121;
  --deep-green: #003c33;
  --dark-navy: #071829;
  --canvas: #ffffff;
  --soft-stone: #eeece7;
  --hairline: #d9d9dd;
  --border-light: #e5e7eb;
  --card-border: #f2f2f2;
  --muted: #93939f;
  --slate: #75758a;
  --body-muted: #616161;
  --action-blue: #1863dc;
  --coral: #ff7759;
  --coral-soft: #ffad9b;

  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Arial", system-ui, -apple-system, sans-serif;
  --font-mono: "Fira Code", "Consolas", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.announcement-bar {
  background-color: var(--cohere-black);
  color: var(--canvas);
  font-size: 12px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.2px;
}

header {
  background-color: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 20px;
  height: 20px;
  background-color: var(--cohere-black);
  border-radius: 4px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.48px;
  color: var(--cohere-black);
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

button, .file-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

button.primary, .file-btn.primary {
  background-color: var(--primary);
  color: var(--canvas);
  border-radius: 32px;
  padding: 10px 20px;
}

button.primary:hover, .file-btn.primary:hover {
  background-color: var(--cohere-black);
}

button.secondary, .file-btn.secondary {
  background-color: transparent;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

button.secondary:hover, .file-btn.secondary:hover {
  color: var(--action-blue);
}

button.pill-outline {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--hairline);
  border-radius: 30px;
  padding: 8px 16px;
}

button.pill-outline:hover {
  border-color: var(--primary);
  background-color: var(--soft-stone);
}

input[type="file"] {
  display: none;
}

main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background-color: var(--soft-stone);
  position: relative;
}

canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 22px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  object-fit: contain;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  background: var(--canvas);
  padding: 48px;
  border-radius: 22px;
  border: 1px solid var(--border-light);
}

.upload-placeholder h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.32px;
}

.upload-placeholder p {
  color: var(--body-muted);
  font-size: 14px;
}

.video-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--canvas);
  padding: 12px 24px;
  border-radius: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  width: 80%;
  max-width: 600px;
  border: 1px solid var(--hairline);
}

.video-controls input[type="range"] {
  flex: 1;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.28px;
  text-transform: uppercase;
  color: var(--slate);
}

.sidebar {
  width: 380px;
  background-color: var(--canvas);
  border-left: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 24px 16px 24px;
  border-bottom: 1px solid var(--card-border);
}

.sidebar-header h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  margin-top: 4px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--hairline);
  padding: 0 16px;
}

.tab-btn {
  flex: 1;
  padding: 14px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--slate);
  font-size: 14px;
}

.tab-btn.active {
  color: var(--cohere-black);
  border-bottom-color: var(--cohere-black);
  font-weight: 600;
}

.tab-content {
  padding: 24px;
  display: none;
  flex-direction: column;
  gap: 20px;
}

.tab-content.active {
  display: flex;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--ink);
}

.val-input {
  width: 55px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--soft-stone);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 2px 4px;
  text-align: right;
  outline: none;
}

.val-input:focus {
  border-color: var(--action-blue);
  background: var(--canvas);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  background: var(--hairline);
  height: 4px;
  border-radius: 2px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

.hsl-color-picker {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}

.color-dot.active {
  transform: scale(1.15);
  border-color: var(--primary);
}

.hsl-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--coral);
  margin-top: 4px;
}

.dot-red { background-color: #ef4444; }
.dot-orange { background-color: #f97316; }
.dot-yellow { background-color: #eab308; }
.dot-green { background-color: #22c55e; }
.dot-cyan { background-color: #06b6d4; }
.dot-blue { background-color: #3b82f6; }
.dot-purple { background-color: #a855f7; }
.dot-pink { background-color: #ec4899; }

.progress-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.progress-overlay.active {
  display: flex;
}

.progress-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  padding: 32px;
  width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--soft-stone);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--primary);
  transition: width 0.1s linear;
}

.progress-percent {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background-color: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

pre {
  background-color: var(--soft-stone);
  padding: 16px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  overflow-x: auto;
  border: 1px solid var(--hairline);
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-field label {
  font-size: 13px;
  color: var(--slate);
}

.input-field input {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
}

.input-field input:focus {
  border-color: var(--action-blue);
}