/* === Global Styles · OpenAI/Apple Light Theme === */

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

a {
  color: inherit;
  text-decoration: none;
}
a:visited {
  color: inherit;
}
a:focus {
  outline: none;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #ffffff;
  color: #0d0d0d;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
  font-size: clamp(14px, 1.5vw, 16px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.5rem) clamp(1.25rem, 4vw, 2rem);
  position: relative;
  z-index: 1;
}

/* --- Navigation --- */
nav {
  background: #ffffff;
  border-bottom: 1px solid #ebebeb;
  padding: clamp(0.5rem, 1.5vw, 0.75rem) 0;
  position: relative;
  z-index: 100;
}

nav .container,
nav .nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

nav h1,
.nav-brand-wrap {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #b8a060;
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.3;
}
.nav-brand-wrap:hover {
  color: #a08940;
}
.nav-brand {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  color: inherit;
}
.nav-tagline {
  font-size: 0.65em;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #999;
  text-transform: uppercase;
}
.nav-brand-wrap:hover .nav-tagline {
  color: #666;
}

nav ul {
  list-style: none;
  display: flex;
  gap: clamp(0.5rem, 2vw, 1.5rem);
}

nav a {
  color: #6e6e80;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
  font-size: 0.9em;
  font-weight: 500;
}

nav a:hover {
  color: #0d0d0d;
  background: #f7f7f8;
}

/* Language switch */
.lang-switch,
.evo-lang-switch {
  display: inline-flex;
  align-items: stretch;
  margin-right: 0.5rem;
  background: #f7f7f8;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  font-family: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
}
.lang-switch button,
.evo-lang-btn {
  background: transparent;
  border: none;
  border-right: 1px solid #e5e5e5;
  color: #6e6e80;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  transition: color 0.15s ease, background 0.15s ease;
}
.lang-switch button:last-of-type,
.evo-lang-switch .evo-lang-btn:last-of-type {
  border-right: none;
}
.lang-switch button:hover,
.evo-lang-btn:hover {
  color: #0d0d0d;
  background: #efefef;
}
.lang-switch button.active,
.evo-lang-btn.active {
  color: #ffffff;
  font-weight: 600;
  background: #b8a060;
}
.lang-switch .sep,
.evo-lang-sep {
  display: none;
}
.lang-switch button:focus,
.evo-lang-btn:focus {
  outline: none;
}

/* --- Hero --- */
.hero {
  background: #f7f7f8;
  border: 1px solid #ebebeb;
  color: #0d0d0d;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  text-align: center;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  border-radius: 12px;
}

.hero h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0d0d0d;
}

.hero p {
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: #6e6e80;
  font-weight: 400;
}

/* --- Content blocks --- */
.content {
  background: #ffffff;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.content h1,
.content h2 {
  color: #0d0d0d;
  margin-bottom: 0.5rem;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.content h1 {
  font-size: clamp(1.25rem, 2.3vw, 1.5rem);
}

.content p {
  color: #6e6e80;
  font-size: 0.93em;
}

/* --- Card grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1rem);
  margin-top: 1.25rem;
}

.card {
  background: #ffffff;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  padding: clamp(1rem, 2vw, 1.35rem);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: #d0d0d0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.card h3 {
  color: #0d0d0d;
  margin-bottom: 0.3rem;
  font-size: 0.95em;
  font-weight: 600;
}

.card p {
  color: #6e6e80;
  font-size: 0.85em;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  background: #ffffff;
  color: #0d0d0d;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  border: 1px solid #d0d0d0;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  font-family: inherit;
}

.btn:hover {
  background: #f7f7f8;
  border-color: #b8a060;
  color: #b8a060;
}

.btn-secondary {
  background: #f7f7f8;
  color: #6e6e80;
  border-color: #e5e5e5;
}

.btn-secondary:hover {
  background: #efefef;
  color: #0d0d0d;
}

/* --- Loading --- */
.loading {
  text-align: center;
  padding: clamp(1.5rem, 3vw, 2rem);
  color: #999;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid #e5e5e5;
  border-top-color: #b8a060;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 0.75rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.4s; }
}

/* --- Status badges --- */
.difficulty-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.82em;
  letter-spacing: 0.01em;
}

.difficulty-badge.completed {
  background: rgba(184, 160, 96, 0.1);
  color: #9a8a5a;
  border: 1px solid rgba(184, 160, 96, 0.25);
}

.difficulty-badge.in-development {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

/* --- Error --- */
.error {
  color: #ef4444;
  text-align: center;
  padding: 1.5rem;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
}

/* --- Home curve section --- */
.home-curve-section.evo-chart-card .home-curve-no-data.no-data {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.93em;
  margin-top: 0.5rem;
}

/* --- Tasks header + search --- */
.tasks-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.tasks-header h2 {
  margin-bottom: 0;
}
.task-search-input {
  min-width: 200px;
  max-width: 320px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9em;
  font-family: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  color: #0d0d0d;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.task-search-input::placeholder {
  color: #999;
}
.task-search-input:focus {
  border-color: #b8a060;
  box-shadow: 0 0 0 3px rgba(184, 160, 96, 0.12);
}
.search-no-results {
  text-align: center;
  padding: 2rem 1rem;
  color: #999;
  font-size: 0.93em;
  border: 1px dashed #d0d0d0;
  border-radius: 8px;
  margin-top: 1rem;
  background: #fafafa;
}
.search-no-results p {
  margin: 0;
  color: inherit;
}

/* --- Task list by domain --- */
.task-list-by-domain {
  margin-top: 0.5rem;
}
.domain-section {
  margin-bottom: 0.5rem;
}
.domain-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0d0d0d;
  background: #f9f9fb;
  border: 1px solid #ebebeb;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.domain-header:hover {
  background: #f0f0f2;
  border-color: #d0d0d0;
}
.domain-header-chevron {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #999;
  border-bottom: 2px solid #999;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  margin-top: -0.1rem;
}
.domain-header[aria-expanded="false"] .domain-header-chevron {
  transform: rotate(-45deg);
  margin-top: 0.1rem;
}
.domain-header-title {
  flex: 1;
  text-align: left;
}
.domain-header-count {
  font-size: 0.82em;
  font-weight: 500;
  color: #999;
}
.domain-tasks {
  margin-top: 0.5rem;
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid #ebebeb;
}
.domain-tasks.is-collapsed {
  display: none;
}

@media (max-width: 640px) {
  .tasks-header {
    flex-direction: column;
    align-items: stretch;
  }
  .task-search-input {
    max-width: none;
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    gap: 0.4rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}
