:root {
  /* Carbon & Mint Color Palette */
  --bg-slate: #1e222b;
  --text-muted: #5c6370;
  --text-base: #abb2bf;
  --accent-mint: #4ebd9b;

  /* Typography */
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition-speed: 0.25s;
}

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

body {
  background-color: var(--bg-slate);
  color: var(--text-base);
  font-family: var(--font-mono);
  
  /* Spacious Monkeytype feel */
  line-height: 1.6;
  padding: 4rem 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  -webkit-font-smoothing: antialiased;
}

.container {
  /* No longer strictly needed since body is constrained, but kept for legacy html layout compatibility */
}

/* Header & Navigation */
.site-header {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--text-muted);
  margin-bottom: 3rem;
}

.site-header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.site-nav a:hover {
  color: var(--accent-mint);
}

.site-titlebar h1.p-name {
  margin: 0;
}

.site-titlebar h1.p-name a {
  color: var(--text-base);
  text-decoration: none;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.025em;
}

.site-bio {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 600px;
}

/* Typography */
h1, h2, h3 {
  color: var(--text-base);
  margin-bottom: 1rem;
  line-height: 1.2;
  font-weight: 500;
}

p {
  margin-bottom: 1.5rem;
}

a {
  color: var(--accent-mint);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

a:hover {
  color: #fff;
}

/* Dashboard WPM Timeline (Component 2) */
.dashboard {
  display: grid;
  gap: 3rem;
}

.chart-heading {
  text-align: center;
  margin-bottom: 0.5rem;
}

.chart-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-style: italic;
  text-align: center;
}

.chart-wrapper {
  position: relative;
  margin-top: 2rem;
  padding-left: 4.5rem; /* increased space for rotated label + y-axis */
  padding-bottom: 2rem; /* space for x-axis */
}

.y-axis-label {
  position: absolute;
  left: -0.5rem;
  top: calc(50% - 1rem);
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
}

.timeline-container {
  height: 250px;
  position: relative;
  border-left: 1px solid var(--text-muted);
  border-bottom: 1px solid var(--text-muted);
}

.y-axis {
  position: absolute;
  left: 1.5rem;
  top: 0;
  bottom: 2rem;
  width: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  align-items: flex-end;
}

.y-axis span {
  position: relative;
  transform: translateY(-50%); /* Center the label on the line */
  padding-right: 0.75rem;
}

.y-axis span::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 0.5rem;
  height: 1px;
  background-color: var(--text-muted);
}

.x-axis-label {
  position: absolute;
  bottom: 0;
  left: 3.5rem; /* align with the border */
  right: 0;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding-top: 0.5rem;
}

.wpm-timeline {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 12px;
  list-style: none;
  padding: 0 1rem;
  margin: 0;
  height: 100%;
}

.wpm-timeline li {
  width: 28px;
  background: linear-gradient(to top, rgba(78, 189, 155, 0.2), var(--accent-mint));
  border-radius: 4px 4px 0 0;
  height: calc(var(--wpm, 0) * 2.5%); /* 40 WPM = 100% */
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  cursor: pointer;
  opacity: 0.7;
}

.wpm-timeline li:hover {
  opacity: 1;
  box-shadow: 0 0 15px rgba(78, 189, 155, 0.4);
}

.dummy-timeline li {
  background: var(--text-muted);
  opacity: 0.3;
  box-shadow: none;
  cursor: default;
}

.dummy-timeline li:hover {
  background: var(--text-muted);
  opacity: 0.3;
  box-shadow: none;
}

.coming-soon-text {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background-color: var(--bg-slate);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--text-muted);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

/* Post Meta */
.post-list {
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--text-muted);
  margin-bottom: 3rem;
}

.post-list ul {
  list-style: none;
}

.post-list li {
  margin-bottom: 2rem;
}

.post-list h3 {
  margin-bottom: 0.5rem;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.wpm-badge {
  background-color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--bg-slate);
}

.meta-separator {
  margin: 0 0.5rem;
}

/* Component 1: Dual-Layout Focus Mode */
.text-block {
  opacity: 0.35;
  transform: translateX(0);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 2.5rem;
  cursor: default;
}

.text-block:hover,
.text-block:has(.is-playing),
.text-block.playback-active {
  opacity: 1;
  transform: translateX(4px);
}

.english-phrase {
  color: var(--text-base);
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  font-weight: 500;
  white-space: pre-wrap; /* Preserves exact macro pad spacing */
}

.eng-char {
  transition: color 0.1s ease, text-shadow 0.1s ease;
}

.is-playing-eng {
  color: var(--accent-mint);
  text-shadow: 0 0 8px rgba(78, 189, 155, 0.4);
}

.morse-phrase {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin: 0;
  letter-spacing: 0.15em;
}

.english-content {
  white-space: pre-wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition-speed) ease;
}

.btn-play {
  background-color: var(--accent-mint);
  color: var(--bg-slate);
}

.btn-play:hover {
  background-color: #fff;
  transform: translateY(-1px);
}

.btn-stop {
  background-color: #ff6b6b;
  color: #fff;
}

.btn-stop:hover {
  background-color: #ff5252;
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-base);
  border: 1px solid var(--text-muted);
}

.btn-outline:hover {
  border-color: var(--accent-mint);
  color: var(--accent-mint);
}

/* Morse Visualizer Specific Styles */
.morse-section {
  margin-top: 2rem;
}

.morse-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.morse-display {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  font-family: var(--font-mono);
}

.morse-display.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.morse-word {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.morse-word-english {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.morse-word-symbols {
  display: flex;
  gap: 1rem;
}

.morse-char {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.char-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.char-sequence {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.morse-symbol {
  background-color: var(--text-muted);
  border-radius: 2px;
  height: 8px;
  transition: background-color 0.1s ease, box-shadow 0.1s ease;
}

.morse-symbol.type-dit {
  width: 8px;
  border-radius: 50%;
}

.morse-symbol.type-dah {
  width: 24px;
}

.morse-symbol.is-playing {
  background-color: var(--accent-mint);
  box-shadow: 0 0 8px rgba(78, 189, 155, 0.4);
}

/* Footer */
.site-footer {
  margin-top: 5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--text-muted);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Page Layouts & Forms */
.page-header {
  margin-bottom: 2rem;
}

.page-content p {
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.contact-form-wrapper {
  margin-top: 2rem;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--text-muted);
  border-radius: 8px;
  padding: 2rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  color: var(--text-base);
  font-weight: 600;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  background-color: var(--bg-slate);
  border: 1px solid var(--text-muted);
  color: var(--text-base);
  font-family: var(--font-mono);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  width: 100%;
  transition: border-color var(--transition-speed) ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-mint);
}

.form-actions {
  margin-top: 0.5rem;
}

