/* ── DYF Landing Page — scoped under .landing ── */

/* ── Hide Quarto title block on landing page ── */
#title-block-header { display: none !important; }

/* ── Force body background when landing page is present ── */
body.quarto-dark:has(.landing) {
  background: #0a0a0a !important;
}
body.quarto-light:has(.landing) {
  background: #fafafa !important;
}
.page-layout-custom:has(.landing) {
  background: var(--landing-bg) !important;
}

/* ── Shrink Quarto navbar on landing page ── */
body:has(.landing) .navbar {
  min-height: 0 !important;
  padding-top: 0.1rem !important;
  padding-bottom: 0.1rem !important;
}
body:has(.landing) .navbar .navbar-brand img {
  height: 18px !important;
}
body:has(.landing) .navbar .nav-link {
  font-size: 0.8rem !important;
  padding-top: 0.2rem !important;
  padding-bottom: 0.2rem !important;
}

/* ── Nuclear reset: kill ALL Quarto borders/lines inside .landing ── */
.landing *:not(svg *) {
  border-color: var(--landing-border) !important;
}

.landing h1, .landing h2, .landing h3, .landing h4 {
  border: none !important;
  border-image: none !important;
  padding-bottom: 0 !important;
  color: var(--landing-fg) !important;
}

.landing section {
  border: none !important;
  border-top: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.landing hr {
  border-color: var(--landing-border) !important;
  opacity: 1 !important;
}

.landing a {
  text-decoration: none !important;
}

.landing p, .landing li, .landing span, .landing div {
  color: inherit;
}

/* ── CSS Custom Properties ── */
.landing {
  --landing-bg:           #0a0a0a;
  --landing-panel:        #111111;
  --landing-surface:      #171717;
  --landing-border:       #262626;
  --landing-border-soft:  rgba(255,255,255,0.08);
  --landing-fg:           #e5e5e5;
  --landing-fg-muted:     #a3a3a3;
  --landing-fg-dim:       #737373;
  --landing-accent:       #e95a0f;
  --landing-accent-glow:  rgba(233, 90, 15, 0.15);
  --landing-radius-sm:    0.375rem;
  --landing-radius-md:    0.5rem;
  --landing-radius-lg:    0.75rem;
  --landing-radius-xl:    1rem;
  --landing-max-w:        1100px;
}

/* ── Light-mode overrides ── */
body.quarto-light .landing {
  --landing-bg:           #fafafa;
  --landing-panel:        #f0f0f0;
  --landing-surface:      #e8e8e8;
  --landing-border:       #d4d4d4;
  --landing-border-soft:  rgba(0,0,0,0.06);
  --landing-fg:           #1a1a1a;
  --landing-fg-muted:     #525252;
  --landing-fg-dim:       #737373;
  --landing-accent:       #e95a0f;
  --landing-accent-glow:  rgba(233,90,15,0.08);
}

/* ── Base ── */
.landing {
  background: var(--landing-bg);
  color: var(--landing-fg);
  font-family: "Geist", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.landing *, .landing *::before, .landing *::after {
  box-sizing: border-box;
}

.landing ::selection {
  background: rgba(233, 90, 15, 0.3);
  color: #fff;
}

/* ── Container ── */
.landing .container {
  max-width: var(--landing-max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Isoline patterns ── */
.landing .isoline-bg {
  position: relative;
}

.landing .isoline-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── Hero ── */
.landing .hero {
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  /* Break out of any parent container to full viewport width */
  width: 100vw;
  max-width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

.landing .hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center top, rgba(233,90,15,0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.landing .hero-logo {
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 2;
}

.landing .hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.landing .hero p {
  font-size: 1.0625rem;
  color: var(--landing-fg-muted);
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

.landing .hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  position: relative;
  z-index: 2;
}

/* ── Buttons ── */
.landing .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: var(--landing-radius-md);
  border: 1px solid var(--landing-border);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.landing .btn-primary {
  background: var(--landing-fg);
  color: var(--landing-bg);
  border-color: var(--landing-fg);
}

.landing .btn-primary:hover {
  background: #d4d4d4;
}

body.quarto-light .landing .btn-primary:hover {
  background: #333;
}

.landing .btn-secondary {
  background: transparent;
  color: var(--landing-fg-muted);
}

.landing .btn-secondary:hover {
  background: var(--landing-border-soft);
  color: var(--landing-fg);
  border-color: var(--landing-border);
}

/* ── Grid divider ── */
.landing .divider {
  border: none;
  border-top: 1px solid var(--landing-border);
  margin: 0;
}

/* ── Feature grid ── */
.landing .feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--landing-border);
  border: 1px solid var(--landing-border);
  border-radius: var(--landing-radius-lg);
  overflow: hidden;
  margin: 3rem 0;
}

.landing .feature-card {
  background: var(--landing-bg);
  padding: 1.75rem;
}

.landing .feature-card h3 {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  color: var(--landing-fg);
}

.landing .feature-card p {
  font-size: 0.8125rem;
  color: var(--landing-fg-muted);
  line-height: 1.55;
}

.landing .feature-card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--landing-radius-sm);
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

/* ── Section ── */
.landing .section {
  padding: 3.5rem 0;
}

.landing .section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--landing-accent);
  margin-bottom: 0.75rem;
}

.landing .section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.landing .section > p {
  color: var(--landing-fg-muted);
  max-width: 600px;
  margin-bottom: 2rem;
}

/* ── Code block card ── */
.landing .code-card {
  position: relative;
  background: var(--landing-panel);
  border: 1px solid var(--landing-border);
  border-radius: var(--landing-radius-lg);
  overflow: hidden;
}

.landing .code-card-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--landing-border);
  font-size: 0.75rem;
  color: var(--landing-fg-dim);
}

.landing .code-card-header .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--landing-fg-dim);
  opacity: 0.4;
}

.landing .code-card-header .filename {
  font-family: "Geist Mono", monospace;
  color: var(--landing-fg-muted);
}

.landing .code-card pre {
  position: relative;
  z-index: 2;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.landing .code-card pre code {
  font-family: "Geist Mono", ui-monospace, "SF Mono", monospace;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--landing-fg);
  background: transparent;
  border: none;
  padding: 0;
}

/* ── Syntax highlighting (dark) ── */
.landing .kw { color: #ff7b72; }
.landing .fn { color: #d2a8ff; }
.landing .st { color: #a5d6ff; }
.landing .cm { color: #6e7681; }
.landing .nb { color: #79c0ff; }
.landing .dv { color: #79c0ff; }
.landing .op { color: #c9d1d9; }
.landing .im { color: #ff7b72; }

/* ── Syntax highlighting (light) ── */
body.quarto-light .landing .kw { color: #cf222e; }
body.quarto-light .landing .fn { color: #8250df; }
body.quarto-light .landing .st { color: #0a3069; }
body.quarto-light .landing .cm { color: #6e7781; }
body.quarto-light .landing .nb { color: #0550ae; }
body.quarto-light .landing .dv { color: #0550ae; }
body.quarto-light .landing .op { color: #24292f; }
body.quarto-light .landing .im { color: #cf222e; }

/* ── Inline code ── */
.landing code {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.8125em;
  color: var(--landing-fg-muted);
  background: var(--landing-surface);
  padding: 0.15em 0.4em;
  border-radius: var(--landing-radius-sm);
  border: 1px solid var(--landing-border);
}

/* ── Stats bar ── */
.landing .stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--landing-border);
  border: 1px solid var(--landing-border);
  border-radius: var(--landing-radius-lg);
  overflow: hidden;
  margin: 2rem 0;
}

.landing .stat {
  background: var(--landing-bg);
  padding: 1.5rem;
  text-align: center;
}

.landing .stat-value {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--landing-fg);
}

.landing .stat-label {
  font-size: 0.75rem;
  color: var(--landing-fg-dim);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Two-col layout ── */
.landing .two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.landing .two-col .text h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.landing .two-col .text p {
  font-size: 0.875rem;
  color: var(--landing-fg-muted);
  line-height: 1.6;
}

/* ── Step list ── */
.landing .steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}

.landing .steps li {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--landing-border);
  align-items: flex-start;
}

.landing .steps li::before {
  content: counter(step);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--landing-fg-muted);
}

.landing .steps li strong {
  color: var(--landing-fg);
  font-weight: 600;
}

.landing .steps li span {
  color: var(--landing-fg-muted);
  font-size: 0.875rem;
}

/* ── Footer ── */
.landing .footer {
  border-top: 1px solid var(--landing-border);
  padding: 2rem 0;
  margin-top: 3rem;
}

.landing .footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.landing .footer-text {
  font-size: 0.75rem;
  color: var(--landing-fg-dim);
}

.landing .footer-links {
  display: flex;
  gap: 1.5rem;
}

.landing .footer-links a {
  font-size: 0.75rem;
  color: var(--landing-fg-dim);
  text-decoration: none;
  transition: color 0.15s;
}

.landing .footer-links a:hover {
  color: var(--landing-fg-muted);
}

/* ── Install banner ── */
.landing .install-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: var(--landing-radius-md);
  font-family: "Geist Mono", monospace;
  font-size: 0.8125rem;
  color: var(--landing-fg-muted);
  margin: 2rem auto;
  max-width: 320px;
}

.landing .install-banner .prompt {
  color: var(--landing-accent);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .landing .feature-grid { grid-template-columns: 1fr; }
  .landing .stats-bar { grid-template-columns: 1fr; }
  .landing .two-col { grid-template-columns: 1fr; }
  .landing .hero { padding: 3rem 0 2.5rem; }
}
