/* —— Đúng Chưa? Warm Tone Practice Lab — Unified Design System —— */

:root {
  /* Canonical warm tokens */
  --paper: #F6F0E6;
  --paper-soft: #FBF7EF;
  --surface: #FFFDF8;
  --surface-warm: #F1E6D4;

  --ink: #171A17;
  --ink-soft: #5F665E;
  --ink-muted: #7A8177;

  --deep-ink: #101614;
  --deep-ink-2: #18201D;

  --teal: #2F766F;
  --teal-deep: #245F59;
  --teal-soft: #DDEDE8;

  --amber: #C98732;
  --amber-soft: #F3DFC2;

  --clay: #A8563A;
  --clay-soft: #E9C7B7;

  --jade: #4D8B6F;

  --border: rgba(23, 26, 23, 0.12);
  --border-strong: rgba(23, 26, 23, 0.22);

  --trace-target: #2F766F;
  --trace-user: #C98732;
  --trace-muted: rgba(23, 26, 23, 0.22);

  --shadow-soft: 0 18px 50px rgba(23, 26, 23, 0.10);
  --shadow-card: 0 10px 30px rgba(23, 26, 23, 0.08);

  /* Semantic aliases (backward compat for inline styles) */
  --bg-base: var(--paper);
  --bg-elevated: var(--paper-soft);
  --bg-card: var(--surface);
  --primary: var(--teal);
  --primary-dim: var(--teal-soft);
  --primary-glow: rgba(47, 118, 111, 0.18);
  --accent-red: var(--clay);
  --accent-red-dim: var(--clay-soft);
  --success: var(--jade);
  --success-dim: rgba(77, 139, 111, 0.12);
  --warning: var(--amber);
  --warning-dim: var(--amber-soft);
  --error: var(--clay);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-soft);
  --text-muted: var(--ink-muted);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --max-width: 1120px;
  --section-pad: clamp(4rem, 10vw, 6rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Outfit", "Inter", "Noto Sans", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1rem;
}

a {
  color: var(--teal-deep);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* —— Typography Helpers —— */
h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

p {
  color: var(--ink-soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Nav —— */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 240, 230, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  gap: 1rem;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.logo-img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.logo-q { color: var(--amber); }

/* Responsive logo-mark styling */
.logo-img-horizontal {
  height: 38px;
  width: auto;
  display: block;
}

.mobile-only-logo-text {
  display: none;
}

@media (max-width: 640px) {
  .logo-img-horizontal {
    height: 36px;
    width: 36px;
    border-radius: 8px;
    object-fit: contain;
  }
  .mobile-only-logo-text {
    display: inline-block;
  }
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a {
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--teal-deep);
  text-decoration: none;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  background: var(--teal-deep);
  color: var(--surface);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.nav-cta:hover {
  text-decoration: none;
  background: var(--teal);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

/* —— Subpage Hero Layout —— */
.sub-hero {
  padding: 5rem 0 3.5rem;
  background: var(--paper-soft);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.sub-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.sub-hero .lead {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 65ch;
  margin-inline: auto;
  line-height: 1.6;
}

.doctrine-pill {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--teal-deep);
  background: var(--teal-soft);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

/* —— Breadcrumbs —— */
.breadcrumbs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.breadcrumbs a {
  color: var(--ink-muted);
}

.breadcrumbs a:hover {
  color: var(--teal-deep);
}

.breadcrumbs span.separator {
  color: var(--border-strong);
}

/* —— Buttons —— */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.75rem;
  background: var(--teal-deep);
  color: var(--surface);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--teal);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
  text-decoration: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.75rem;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 1rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  text-decoration: none;
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--ink-muted);
  background: var(--paper-soft);
  text-decoration: none;
}

/* —— Sections & Structural grids —— */
section {
  padding: var(--section-pad) 0;
}

section.alt {
  background: var(--paper-soft);
  border-block: 1px solid var(--border);
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--teal-deep);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-lead {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

/* —— Warm cards —— */
.warm-card,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.35;
  color: var(--ink);
}

.card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* —— Semantic Cards —— */
.semantic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.semantic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-card);
}

.semantic-card:hover {
  border-color: var(--border-strong);
}

.semantic-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--teal-deep);
  background: var(--teal-soft);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
}

.semantic-card.correction .semantic-label {
  color: var(--amber);
  background: var(--amber-soft);
}

.semantic-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.semantic-card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* —— Real World Phrases —— */
.phrase-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.phrase-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--teal-deep);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.phrase-badge.error-mark {
  color: var(--clay);
  border-color: rgba(168, 86, 58, 0.25);
  background: var(--clay-soft);
}

/* —— Trace panel (dark demo surface) —— */
.trace-panel {
  background: var(--deep-ink);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
}

.trace-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.trace-panel-phrase {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--surface);
}

.trace-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: rgba(255, 253, 248, 0.65);
}

.trace-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.trace-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.trace-legend .dot.target { background: var(--trace-target); }
.trace-legend .dot.user { background: var(--trace-user); }

.trace-correction {
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  background: rgba(201, 135, 50, 0.15);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: rgba(255, 253, 248, 0.9);
}

.trace-correction strong {
  color: var(--amber-soft);
  font-weight: 600;
}

/* —— Tables —— */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin: 2rem 0;
  box-shadow: var(--shadow-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
  min-width: 600px;
}

th, td {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--paper-soft);
  font-weight: 600;
  color: var(--ink);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

tr:last-child td {
  border-bottom: none;
}

td strong {
  color: var(--ink);
}

td .checked {
  color: var(--jade);
  font-weight: bold;
}

td .crossed {
  color: var(--ink-muted);
}

/* —— FAQ —— */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.faq-item summary {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  outline: none;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--teal);
  font-weight: 400;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  padding: 0 1.5rem 1.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* —— Waitlist Block —— */
.waitlist-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
  position: relative;
  box-shadow: var(--shadow-soft);
}

.trust-copy {
  font-size: 0.85rem;
  color: var(--ink-muted);
  max-width: 50ch;
  margin: 0.5rem auto 2rem;
}

.form-success {
  display: none;
  text-align: center;
  padding: 2rem 0;
}

.form-success.visible {
  display: block;
}

.form-success h3 {
  color: var(--jade);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.waitlist-status {
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.waitlist-status.is-error {
  color: var(--clay);
}

.waitlist-status.is-ok {
  color: var(--jade);
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 480px;
  margin-inline: auto;
  text-align: left;
}

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

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.form-group label .opt {
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.waitlist-form input[type="text"],
.waitlist-form input[type="email"],
.waitlist-form select,
.waitlist-form textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
}

.waitlist-form input:focus,
.waitlist-form select:focus,
.waitlist-form textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px var(--teal-soft);
}

.waitlist-form textarea {
  min-height: 100px;
  resize: vertical;
}

.form-error {
  display: none;
  padding: 0.75rem 1rem;
  background: var(--clay-soft);
  border: 1px solid rgba(168, 86, 58, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--ink);
}

.form-error.visible {
  display: block;
}

.form-micro {
  font-size: 0.75rem;
  color: var(--ink-muted);
  line-height: 1.4;
  margin-top: 0.5rem;
}

/* —— Content Pages —— */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 900px) {
  .content-grid {
    grid-template-columns: 240px 1fr;
  }
}

.sidebar {
  position: sticky;
  top: 6rem;
  align-self: start;
}

.sidebar h4 {
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--teal-deep);
  margin-bottom: 1rem;
  font-weight: 600;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-nav a {
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.sidebar-nav a:hover {
  color: var(--ink);
  text-decoration: none;
}

.article-content {
  max-width: 680px;
}

.article-content section {
  padding: 0 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.article-content section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.article-content h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.article-content h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
}

.article-content p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--ink-soft);
}

.article-content li {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.article-content strong {
  color: var(--ink);
}

/* —— Compare Hub —— */
.comparison-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.hub-card:hover {
  border-color: var(--border-strong);
}

.hub-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.hub-card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* —— Footer —— */
.footer-logo {
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

.footer-grid a {
  transition: color 0.15s ease;
}

.footer-grid a:hover {
  color: var(--teal-deep) !important;
  text-decoration: none;
}
