/* ===== Custom Properties ===== */
:root {
  --bg:          #0a0a0a;
  --bg-card:     #1a1a1a;
  --bg-card-alt: #222222;
  --border:      #2a2a2a;
  --yellow:      #FFD100;
  --yellow-dark: #CCAA00;
  --yellow-bg:   #2a1f00;
  --white:       #ffffff;
  --gray:        #999999;
  --gray-light:  #cccccc;
  --green:       #00c896;
  --green-bg:    #002a1f;
}

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

button {
  font-family: inherit;
}

/* ===== Base ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--white);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== Container ===== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 600px) {
  .container {
    padding: 0 32px;
  }
}

/* ===== Tag ===== */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

/* ===== Hero ===== */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
  animation: heroIn 0.6s ease both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: 16px;
}

@media (min-width: 600px) {
  .hero-title { font-size: 48px; }
}

.hero-subtitle {
  font-size: 16px;
  color: var(--gray);
  line-height: 1.65;
  margin-bottom: 28px;
  max-width: 520px;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--gray);
}

.hero-meta strong {
  color: var(--white);
  font-weight: 600;
}

.meta-sep { color: var(--border); }

/* ===== Section ===== */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 600px) {
  .section { padding: 96px 0; }
}

.section-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

@media (min-width: 600px) {
  .section-title { font-size: 30px; }
}

.section-text {
  color: var(--gray-light);
  margin-bottom: 20px;
}

.section-text:last-child { margin-bottom: 0; }

.section-text--note {
  color: var(--gray);
  font-size: 15px;
  margin-top: 24px;
  margin-bottom: 0;
}

.subsection-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  margin-top: 36px;
  margin-bottom: 14px;
}

/* ===== Cards Grid ===== */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.card p {
  font-size: 14px;
  color: var(--gray-light);
  line-height: 1.6;
  margin: 0;
}

/* ===== Pills ===== */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-block;
  border: 1px solid rgba(255, 209, 0, 0.4);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 100px;
  background: transparent;
}

.pill--green {
  border-color: rgba(0, 200, 150, 0.4);
  color: var(--green);
}

/* ===== Compare Grid ===== */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

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

.compare-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--yellow);
  border-radius: 8px;
  padding: 20px;
}

.compare-card--green { border-top-color: var(--green); }

.compare-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--yellow);
  margin-bottom: 12px;
}

.compare-title--green { color: var(--green); }

.compare-text {
  font-size: 14px;
  color: var(--gray-light);
  line-height: 1.65;
  margin-bottom: 12px;
}

/* ===== Source Note ===== */
.source-note {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--gray);
  line-height: 1.6;
}

.source-note strong {
  font-weight: 500;
  color: var(--gray-light);
}

/* ===== Flow Component ===== */
.flow-component {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin: 32px 0;
}

/* ===== Tabs ===== */
.flow-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 12px;
  margin-bottom: -1px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray);
  cursor: pointer;
  text-align: center;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1.3;
}

.tab-btn:hover { color: var(--gray-light); }

.tab-btn.active {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}

/* ===== Flow Hint ===== */
.flow-hint {
  font-size: 12px;
  color: var(--gray);
  margin-top: 14px;
  margin-bottom: 14px;
  transition: opacity 0.3s ease;
}

.flow-hint.hint-hidden {
  opacity: 0;
  pointer-events: none;
  height: 0;
  margin: 0;
  overflow: hidden;
}

/* ===== Progress Row ===== */
.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.progress-track {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--yellow);
  border-radius: 1px;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 11px;
  color: var(--gray);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== Flow Stage ===== */
.flow-stage {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0;
  padding-bottom: 4px;
}

/* ===== Flow Diagram ===== */
.flow-diagram {
  display: none;
}

.flow-diagram.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0 8px;
}

@media (min-width: 600px) {
  .flow-diagram.active {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    min-width: max-content;
    padding: 8px 0;
  }
}

/* ===== Flow Nodes ===== */
.flow-node {
  /* Reset button defaults */
  -webkit-appearance: none;
  appearance: none;

  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--gray-light);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.flow-node:hover {
  border-color: #665500;
  color: var(--white);
}

.flow-node:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.flow-node.node--active {
  background: var(--yellow-bg);
  border: 1.5px solid var(--yellow);
  color: var(--white);
  font-weight: 600;
}

@media (min-width: 600px) {
  .flow-node {
    width: auto;
    white-space: nowrap;
  }
}

/* ===== Connectors ===== */
.connector {
  flex-shrink: 0;
  background: var(--border);
  transition: background 0.2s ease;
  /* Mobile: vertical line */
  width: 2px;
  height: 32px;
}

.connector.connector--active {
  background: var(--yellow);
}

@media (min-width: 600px) {
  /* Desktop: horizontal line */
  .connector {
    width: auto;
    height: 2px;
    flex: 1;
    min-width: 16px;
  }
}

/* ===== Explanation Box ===== */
.explanation-box {
  margin-top: 20px;
  background: var(--bg-card-alt);
  border-left: 3px solid var(--yellow);
  border-radius: 8px;
  padding: 16px 20px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  visibility: hidden;
}

.explanation-box.exp-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.exp-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 10px;
}

.exp-text {
  font-size: 14px;
  color: var(--white);
  line-height: 1.7;
}

/* ===== Completion Message ===== */
.completion-msg {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--green);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.completion-msg.msg-visible {
  opacity: 1;
  visibility: visible;
}

/* ===== Reset Button ===== */
.btn-reset {
  display: block;
  margin-top: 16px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--gray);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, opacity 0.3s ease, visibility 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.btn-reset.reset-visible {
  opacity: 1;
  visibility: visible;
}

.btn-reset:hover {
  border-color: #555;
  color: var(--gray-light);
}

.btn-reset:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

/* ===== Footer ===== */
.footer {
  padding: 52px 0 60px;
}

.footer-note {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 12px;
}

.footer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--gray);
}

.footer-meta strong {
  color: var(--white);
  font-weight: 600;
}

/* ===== Section Header com número decorativo ===== */
.section-header {
  position: relative;
  margin-bottom: 24px;
  padding-top: 8px;
}

.section-deco {
  position: absolute;
  top: -24px;
  right: -8px;
  font-size: 120px;
  font-weight: 700;
  line-height: 1;
  color: var(--yellow);
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
  letter-spacing: -4px;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 600px) {
  .section-deco {
    font-size: 180px;
    top: -40px;
    right: -16px;
  }
}

.section-header .tag {
  margin-bottom: 8px;
}

.section-header .section-title {
  margin-bottom: 0;
}

/* ===== Fade-in on scroll ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
