/* === DESIGN TOKENS === */
:root {
  --primary: #1e3a5f;
  --primary-light: #2563eb;
  --secondary: #f97316;
  --success: #22c55e;
  --error: #dc2626;
  --text: #374151;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-alt: #f3f4f6;
  --border: #d1d5db;
  --focus: #2563eb;
  --radius: 8px;
  --max-width: 720px;
}

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

/* === BASE === */
html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Sans Pro', system-ui, -apple-system, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* === ACCESSIBILITY === */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

*:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* === LAYOUT === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === HEADER === */
header {
  padding: 1.25rem 0;
  border-bottom: 2px solid var(--primary);
}

.logo {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

.logo-access {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.logo-100 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success);
}

.logo-sub {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === HERO === */
.hero {
  padding: 2.5rem 0 1.5rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hero p {
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.powered-by {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* === FORM === */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.input-row {
  display: flex;
  gap: 0.75rem;
}

input[type="url"] {
  flex: 1;
  padding: 0.875rem 1rem;
  font-size: 1.125rem;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s;
}

input[type="url"]:focus {
  border-color: var(--focus);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

input[type="url"]::placeholder {
  color: var(--text-light);
}

button[type="submit"] {
  padding: 0.875rem 1.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

button[type="submit"]:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hint {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

/* === STATUS === */
.status-region {
  padding: 1rem 0;
  min-height: 2rem;
}

.status-region:not(:empty) {
  padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border-left: 4px solid var(--primary-light);
  margin-bottom: 1rem;
}

.status-region .stage-label {
  font-weight: 600;
  color: var(--primary);
}

/* === ERROR === */
.error-region {
  padding: 1rem 1.25rem;
  background: #fef2f2;
  border: 2px solid var(--error);
  border-radius: var(--radius);
  color: var(--error);
  font-weight: 500;
  margin-bottom: 1rem;
}

/* === RESULTS === */
.results {
  padding: 1.5rem 0 3rem;
}

.results h2 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.video-info {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.video-info h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.video-info .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.video-info .meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.results-controls {
  margin-bottom: 1.25rem;
}

.btn-secondary {
  padding: 0.625rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--primary);
  background: var(--bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: var(--bg-alt);
}

/* === DESCRIPTION LIST === */
.description-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.description-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.description-item:hover {
  border-color: var(--primary-light);
}

.description-item .timestamp {
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  min-width: 3.5rem;
  padding-top: 0.1rem;
}

.description-item .text {
  flex: 1;
}

.description-item .priority {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  align-self: flex-start;
  white-space: nowrap;
}

.priority-critical {
  background: #fef2f2;
  color: #b91c1c;
}

.priority-important {
  background: #fffbeb;
  color: #b45309;
}

.priority-helpful {
  background: #f0fdf4;
  color: #15803d;
}

/* === FOOTER === */
footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-light);
}

footer p {
  margin-bottom: 0.25rem;
}

footer a {
  color: var(--primary-light);
  text-decoration: none;
}

footer a:hover,
footer a:focus {
  text-decoration: underline;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .input-row {
    flex-direction: column;
  }

  button[type="submit"] {
    width: 100%;
  }

  .description-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .description-item .timestamp {
    min-width: auto;
  }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}
