/* ==========================================================================
   BBQ Stylesheet (Homepage + Testnet Console)
   Depends on /tokens.css
   ========================================================================== */

main {
  padding-top: var(--nav-h);
}

html:not(.i18n-loading) main {
  animation: bbq-main-settle 260ms var(--ease) both;
}

/* Scroll-Triggered Architectural Reveals (GPU transform settle — never blank opacity:0) */
.reveal-ready {
  opacity: 1;
  transform: translateY(10px);
}

.is-revealed {
  opacity: 1;
  transform: translateY(0);
  transition: transform 260ms var(--ease) var(--reveal-delay, 0ms);
}

@media print {
  .reveal-ready,
  .is-revealed {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Subtle SVG Protocol Connector Signal Flow */
@keyframes svg-flow-fwd {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}

@keyframes svg-flow-rev {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: 24; }
}

.svg-flow-fwd {
  stroke-dasharray: 6 6;
  animation: svg-flow-fwd 2.2s linear infinite;
}

.svg-flow-rev {
  stroke-dasharray: 4 4;
  animation: svg-flow-rev 2.6s linear infinite;
}

@keyframes tab-panel-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Buttons & Interactive Controls
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 90ms var(--ease);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn-gold {
  background-color: var(--gold);
  border: 1px solid var(--gold);
  color: var(--ink-on-gold);
}

.btn-gold:hover:not(:disabled) {
  background-color: var(--gold-hover);
  border-color: var(--gold-hover);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-sm {
  padding: 7px 13px;
  font-size: var(--text-mono);
}

.text-action {
  border: none;
  background: transparent;
  padding: 0;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 150ms var(--ease);
}

.text-action:hover {
  color: var(--gold-hover);
}

/* ==========================================================================
   Homepage: Hero (Full-bleed architectural opening + quiet lattice canvas)
   ========================================================================== */

.hero {
  position: relative;
  padding: 76px 0 84px;
  border-bottom: 1px solid var(--line);
  background-color: var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: center;
}

.hero-content {
  min-width: 0;
}

.hero-eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 150ms var(--ease);
}

.hero-eyebrow:hover {
  color: var(--ink);
}

.hero-visual {
  position: relative;
  width: 100%;
  height: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  overflow: hidden;
  min-width: 0;
  transition: border-color 180ms var(--ease);
}

.hero-visual:hover {
  border-color: var(--line-strong);
}

.hero-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 3.8vw, 3.45rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.032em;
  color: var(--ink);
  text-wrap: balance;
}

:lang(zh-CN) .hero h1,
:lang(zh-TW) .hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 3.1rem);
}

.hero-lead {
  margin: 22px 0 32px;
  max-width: 580px;
  font-size: var(--text-body);
  line-height: 1.7;
  color: var(--ink-secondary);
  text-wrap: pretty;
}

:lang(zh-CN) .hero-lead,
:lang(zh-TW) .hero-lead {
  max-width: 620px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Subpage Minimalist Intro Header (/architecture, /roadmap) */
.page-intro {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
}

.page-intro h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.page-intro p {
  margin: 0;
  max-width: 680px;
  font-size: var(--text-body);
  color: var(--ink-secondary);
  text-wrap: pretty;
}

/* Homepage 3-Column Explore Directory */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.directory-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 24px 32px 0;
  border-right: 1px solid var(--line);
  min-width: 0;
  transition: background-color 150ms var(--ease);
}

.directory-link:not(:first-child) {
  padding-left: 24px;
}

.directory-link:last-child {
  border-right: none;
  padding-right: 0;
}

.directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--ink-muted);
}

.directory-link h3 {
  margin: 4px 0 0;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink);
  transition: color 150ms var(--ease);
}

.directory-link p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--ink-secondary);
}

.directory-link:hover h3,
.directory-link:hover .directory-arrow {
  color: var(--gold);
}

/* Dual-Column Architectural Cards (Track 1 vs Track 2, L1 Forced Exit) */
.split-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.split-panel {
  padding: 28px 28px 30px 0;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.split-panel:last-child {
  padding-left: 28px;
  padding-right: 0;
  border-right: none;
}

.split-panel h3 {
  margin: 0 0 8px;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink);
}

.split-panel p {
  margin: 0 0 14px;
  font-size: var(--text-body);
  color: var(--ink-secondary);
}

.split-panel .mono-line {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--gold);
}

/* Homepage 2x2 Hairline Advantage Grid */
.adv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}

.adv-item {
  padding: 28px 32px 30px 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adv-item:nth-child(2n) {
  padding-left: 32px;
  padding-right: 0;
  border-right: none;
}

.adv-item:nth-last-child(-n+2) {
  border-bottom: none;
}

.adv-item h3 {
  margin: 2px 0 0;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink);
}

.adv-item p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--ink-secondary);
  text-wrap: pretty;
}

/* Comparison Table Highlight Column */
.spec-table th.col-bbq {
  color: var(--gold);
}

.spec-table td.col-bbq {
  color: var(--ink);
  font-weight: 500;
}

/* ==========================================================================
   Homepage: Editorial Sections & Swiss Grids
   ========================================================================== */

.home-section {
  padding: 104px 0;
  border-bottom: 1px solid var(--line);
}

.home-section:last-of-type {
  border-bottom: none;
}

.section-title {
  margin: 0 0 48px;
  font-size: var(--text-h2);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
}

/* Two-Column Editorial Thesis */
.thesis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  margin-bottom: 64px;
}

.thesis-col {
  min-width: 0;
}

.thesis-col h3 {
  margin: 0 0 10px;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink);
}

.thesis-col p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--ink-secondary);
  max-width: 560px;
  text-wrap: pretty;
}

/* Minimalist 4-Step Flow Diagram */
.flow-rail {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flow-step {
  padding: 28px 24px 30px 0;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.flow-step:not(:first-child) {
  padding-left: 24px;
}

.flow-step:last-child {
  border-right: none;
  padding-right: 0;
}

.flow-index {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--gold);
}

.flow-step h3 {
  margin: 4px 0 0;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink);
}

.flow-step p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--ink-secondary);
}

/* Architectural Flow Hairline Diagram */
.flow-svg-wrap {
  margin-top: 40px;
  border: 1px solid var(--line);
  background-color: var(--surface);
  padding: 20px 24px;
  transition: border-color 180ms var(--ease);
}

.flow-svg-wrap:hover {
  border-color: var(--line-strong);
}

.flow-svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Swiss Hairline Spec Table */
.spec-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.spec-table th {
  padding: 13px 16px 13px 0;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: 500;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.spec-table td {
  padding: 15px 16px 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-body);
  color: var(--ink-secondary);
  vertical-align: top;
}

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

.spec-table td:first-child {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

.spec-table td.mono-cell {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--ink);
  white-space: nowrap;
}

/* 3-Stage Rollout */
.rollout-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.rollout-item {
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.rollout-item.is-current {
  border-top-color: var(--gold);
}

.rollout-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--ink-muted);
}

.rollout-item.is-current .rollout-meta {
  color: var(--ink);
}

.rollout-item h3 {
  margin: 4px 0 0;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--ink);
}

.rollout-item p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--ink-secondary);
}

/* ==========================================================================
   Responsive Breakpoints (Tablet -> 390px Mobile)
   ========================================================================== */

@media (max-width: 1024px) {
  .flow-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .flow-step:nth-child(2) {
    border-right: none;
    padding-right: 0;
  }
  .flow-step:nth-child(3) {
    padding-left: 0;
  }
  .flow-step:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }
  .thesis-grid,
  .rollout-grid,
  .directory-grid,
  .split-panels,
  .adv-grid {
    grid-template-columns: 1fr;
  }
  .directory-link,
  .directory-link:not(:first-child),
  .split-panel,
  .split-panel:last-child,
  .adv-item,
  .adv-item:nth-child(2n) {
    padding: 22px 0;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .directory-link:last-child,
  .split-panel:last-child,
  .adv-item:last-child {
    border-bottom: none;
  }
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero-visual {
    height: 250px;
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 48px 0 56px;
  }
  .hero-visual {
    height: 220px;
  }
  .hero h1 {
    font-size: clamp(1.9rem, 7.6vw, 2.55rem);
  }
  .home-section {
    padding: 68px 0;
  }
  .flow-rail {
    grid-template-columns: 1fr;
  }
  .flow-step,
  .flow-step:not(:first-child) {
    padding: 20px 0;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .flow-step:last-child {
    border-bottom: none;
  }
}
