/* Root Variables */
:root {
  color-scheme: dark;
  --bg: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460, #53354a);
  --card: rgba(255, 255, 255, 0.05);
  --text: #ffffff;
  --muted: #b8b8c0;
  --primary: #f39c12;
  --primary-dark: #e67e22;
  --border: rgba(243, 156, 18, 0.2);
  --shadow: 0 15px 25px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

/* Body and Animations */
body {
  margin: 0;
  font-family: 'Roboto', 'Open Sans', sans-serif;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460, #53354a);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: var(--text);
  line-height: 1.6;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
    background-position: 50% 50%;
  }
}

/* Site Header Navigation */
.site-header {
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.8);
  border-bottom: 4px solid #f39c12;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.site-title h1 {
  margin: 0;
  font-size: 2rem;
  font-family: 'Montserrat', 'Verdana', sans-serif;
  font-weight: 700;
}

.site-title h1 a {
  color: #f39c12;
  text-decoration: none;
  text-shadow: 2px 2px 5px #000;
  transition: color 0.3s ease;
}

.site-title h1 a:hover {
  color: #e67e22;
}

.site-title p {
  margin: 5px 0 0 0;
  font-size: 1rem;
  color: #fff;
  font-weight: 300;
  letter-spacing: 2px;
}

.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.site-nav ul li {
  display: inline-block;
}

.site-nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(243, 156, 18, 0.2);
  transition: all 0.3s ease;
  display: inline-block;
}

.site-nav ul li a:hover,
.site-nav ul li a:focus {
  background: rgba(231, 76, 60, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.site-nav ul li a.nav-back {
  background: rgba(52, 152, 219, 0.3);
  border: 1px solid rgba(52, 152, 219, 0.5);
}

.site-nav ul li a.nav-back:hover {
  background: rgba(52, 152, 219, 0.6);
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* Hero Section */
.hero {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 40px 16px;
  border-bottom: 2px solid rgba(243, 156, 18, 0.3);
}

.hero__content {
  max-width: 960px;
  margin: 0 auto;
}

.hero h2 {
  margin: 0 0 12px;
  font-size: 2rem;
  font-family: 'Montserrat', 'Verdana', sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 2px 2px 5px #000;
  color: #f39c12;
}

.hero p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

/* Container and Cards */
.container {
  max-width: 1100px;
  margin: -32px auto 64px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  backdrop-filter: blur(5px);
}

.card h2 {
  font-family: 'Montserrat', 'Verdana', sans-serif;
  color: #f39c12;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 2px 2px 5px #000;
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.card h3 {
  font-size: 1.3rem;
  margin-top: 20px;
  margin-bottom: 12px;
  font-family: 'Montserrat', 'Verdana', sans-serif;
}

.card p {
  margin-bottom: 12px;
  line-height: 1.8;
}

.card ul,
.card ol {
  margin: 12px 0;
  padding-left: 24px;
}

.card ul li,
.card ol li {
  margin-bottom: 8px;
}

.card code {
  background: rgba(243, 156, 18, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Consolas", "Courier New", monospace;
  color: #f39c12;
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.card sup {
  font-size: 0.7em;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

/* Form Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  border: 1px solid var(--border);
  background: rgba(243, 156, 18, 0.2);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  color: var(--text);
}

.btn:hover {
  background: rgba(243, 156, 18, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(243, 156, 18, 0.3);
  border-color: var(--primary);
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn--primary:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.btn--ghost {
  background: rgba(231, 76, 60, 0.2);
  border-color: rgba(231, 76, 60, 0.3);
}

.btn--ghost:hover {
  background: rgba(231, 76, 60, 0.4);
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* Hints and Dividers */
.hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

/* Results Section */
.summary {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
}

.results-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.result {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  min-height: 120px;
}

.result h3 {
  color: var(--primary);
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.result div {
  margin-bottom: 6px;
}

.result strong {
  color: var(--primary);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 24px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0;
  border: 1px solid var(--border);
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3498db, #2980b9);
  border-radius: 12px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Visuals Section */
.visuals {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.visual {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.visual h3 {
  font-family: 'Montserrat', 'Verdana', sans-serif;
  color: #f39c12;
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 12px;
  text-shadow: 1px 1px 3px #000;
}

/* Bar Chart */
.bar-chart {
  display: grid;
  gap: 8px;
}

.bar-chart__row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.bar-chart__bar {
  position: relative;
  flex: 1;
  height: 14px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  overflow: hidden;
}

.bar-chart__fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  border-radius: 8px;
  transition: width 0.25s ease;
}

.bar-chart__fill--a {
  background: linear-gradient(90deg, #f39c12, #e67e22);
}

.bar-chart__fill--b {
  background: linear-gradient(90deg, #3498db, #2980b9);
}

/* Steps Display */
.steps {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--muted);
}

.steps code {
  background: rgba(243, 156, 18, 0.2);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #f39c12;
  border: 1px solid rgba(243, 156, 18, 0.3);
}

/* Workload Display */
.workload {
  display: grid;
  gap: 8px;
  font-family: "Consolas", "Courier New", monospace;
  color: var(--text);
}

.workload__bar {
  height: 14px;
  background: linear-gradient(90deg, #f39c12, #e67e22);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.workload__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  mix-blend-mode: screen;
}

/* Speed Display */
.speed {
  padding: 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.5);
  color: #e2e8f0;
  font-family: "Consolas", "Courier New", monospace;
  border: 1px solid rgba(243, 156, 18, 0.3);
  white-space: pre-wrap;
  line-height: 1.8;
}

/* Footer */
.site-footer {
  background: rgba(0, 0, 0, 0.8);
  padding: 40px 20px;
  text-align: center;
  border-top: 4px solid #f39c12;
  box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.8);
  margin-top: 60px;
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(243, 156, 18, 0.2);
  color: #fff;
  font-size: 1.5rem;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid rgba(243, 156, 18, 0.3);
}

.social-link:hover,
.social-link:focus {
  background: rgba(243, 156, 18, 0.4);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.footer-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 10px 0;
  font-style: italic;
}

.site-footer p {
  color: var(--muted);
  margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    text-align: center;
  }
  
  .site-nav ul {
    justify-content: center;
  }
  
  .site-title h1 {
    font-size: 1.5rem;
  }
  
  .hero h2 {
    font-size: 1.5rem;
  }
}