/* ChessDepth AI (coming soon) page — uses the header's ink and brass palette */
.ai-hero { background: #f9fafb; border-bottom: 1px solid var(--cd-line, #e5e7eb); overflow: hidden; }
.ai-status { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 600; color: #4f46e5; border: 1px solid #6366f1; border-radius: 9999px; padding: .3rem .85rem; background: #fff; }
.ai-dot { width: .5rem; height: .5rem; border-radius: 9999px; background: #6366f1; }
@media (prefers-reduced-motion: no-preference) { .ai-dot { animation: ai-pulse 2s ease-in-out infinite; } }
@keyframes ai-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.ai-title { font-weight: 600; font-size: clamp(2.8rem, 6vw, 4.2rem); line-height: 1.02; letter-spacing: -.015em; color: #111827; margin-top: 1.1rem; }
.ai-lead { font-size: 1.15rem; line-height: 1.7; color: #374151; margin-top: 1.1rem; max-width: 34rem; }
.ai-ghost { display: inline-flex; align-items: center; padding: .7rem 1.25rem; border: 1px solid #4f46e5; border-radius: 6px; color: #111827; font-weight: 600; font-size: .9rem; }
.ai-ghost:hover { background: #fff; }

/* Before -> after illustration */
.ai-demo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; perspective: 900px; }
.ai-demo img { width: 100%; height: auto; display: block; border-radius: 6px; }
.ai-demo figcaption { text-align: center; font-size: .8rem; color: #6b7280; margin-top: .7rem; font-weight: 500; }
.ai-demo-in img { transform: rotateX(38deg) rotateZ(-9deg) scale(.92); box-shadow: 0 30px 40px -20px rgba(17,24,39,.55); filter: saturate(.95) contrast(.97); }
.ai-demo-out img { box-shadow: 0 10px 30px -12px rgba(17,24,39,.45); }
.ai-demo-arrow { color: #6366f1; font-size: 1.6rem; }

.ai-h2 { font-weight: 600; font-size: 2.2rem; color: #111827; line-height: 1.15; }
.ai-sub { color: #4b5563; margin-top: .6rem; max-width: 40rem; }
.ai-feature { border-top: 2px solid #4f46e5; padding-top: 1.1rem; }
.ai-feature i { color: #6366f1; font-size: 1.3rem; }
.ai-feature h3 { font-weight: 700; color: #111827; margin-top: .7rem; }
.ai-feature p { color: #4b5563; font-size: .92rem; margin-top: .35rem; line-height: 1.6; }
.ai-fen-example { margin-top: 2.5rem; font-size: .88rem; color: #4b5563; overflow-wrap: anywhere; }
.ai-fen-example code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #eef2ff; color: #111827; padding: .15rem .45rem; border-radius: 4px; }

.ai-band { background: #4f46e5; color: #e0e7ff; }
.ai-band .ai-h2 { color: #fff; }
.ai-band .ai-sub { color: #c7d2fe; }
.ai-steps { margin-top: 2.5rem; display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.ai-steps li { display: flex; gap: 1rem; align-items: flex-start; }
.ai-steps span { flex-shrink: 0; width: 2.1rem; height: 2.1rem; border-radius: 9999px; border: 1px solid #6366f1; color: #c7d2fe; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 600; }
.ai-steps h3 { color: #fff; font-weight: 600; }
.ai-steps p { color: #c7d2fe; font-size: .9rem; margin-top: .2rem; line-height: 1.55; }

.ai-note h3 { font-weight: 700; color: #111827; }
.ai-note p { color: #4b5563; font-size: .95rem; margin-top: .4rem; line-height: 1.65; }

.ai-cta { text-align: center; border: 1px solid #e5e7eb; border-radius: 10px; padding: 3rem 1.5rem; background: #fff; }
.ai-cta h2 { font-weight: 600; font-size: 2rem; color: #111827; }
.ai-cta p { color: #4b5563; margin-top: .4rem; }
.ai-cta-btn { display: inline-flex; align-items: center; margin-top: 1.5rem; background: #4f46e5; color: #fff; font-weight: 600; padding: .8rem 1.5rem; border-radius: 6px; }
.ai-cta-btn:hover { background: #4338ca; color: #fff; }

@media (max-width: 767px) {
  .ai-demo { grid-template-columns: 1fr; }
  .ai-demo-arrow { transform: rotate(90deg); justify-self: center; }
  .ai-demo-in, .ai-demo-out { max-width: 300px; margin: 0 auto; width: 100%; }
}

/* Night mode */
html.dark .ai-status { background: transparent; color: #c7d2fe; }
html.dark .ai-title, html.dark .ai-h2, html.dark .ai-feature h3, html.dark .ai-note h3, html.dark .ai-cta h2 { color: #f1f5f9; }
html.dark .ai-lead, html.dark .ai-feature p, html.dark .ai-note p, html.dark .ai-sub, html.dark .ai-cta p, html.dark .ai-fen-example { color: #a8b3c4; }
html.dark .ai-feature { border-color: #a8b3c4; }
html.dark .ai-ghost { border-color: #a8b3c4; color: #f1f5f9; }
html.dark .ai-ghost:hover { background: #162032; }
html.dark .ai-fen-example code { background: #162032; color: #c7d2fe; }
html.dark .ai-cta { background: #162032; border-color: #273449; }
html.dark .ai-cta-btn { background: #6366f1; color: #fff; }

/* ---- Match the main site (About, Courses, Resources): Poppins, indigo/purple, soft cards ---- */
.ai-hero { background-image: linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.06) 75%), linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.06) 75%), linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); background-size: 48px 48px, 48px 48px, auto; background-position: 0 0, 24px 24px, 0 0; border-bottom: 0; }
.ai-status { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.35); color: #fff; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; }
.ai-dot { background: #fcd34d; }
.ai-title { color: #fff; font-weight: 800; font-size: clamp(2.25rem, 5vw, 3rem); line-height: 1.15; letter-spacing: -.01em; }
.ai-lead { color: #e0e7ff; }
.ai-hero .cd-ai-primary, .ai-hero a[class*="bg-"] { }
.ai-ghost { border-color: rgba(255,255,255,.7); color: #fff; border-radius: .5rem; }
.ai-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.ai-demo figcaption { color: #e0e7ff; }
.ai-demo-arrow { color: #fff; }
.ai-h2 { font-weight: 700; font-size: 1.875rem; line-height: 1.25; }
.ai-feature { border-top: 0; background: #fff; border-radius: .75rem; padding: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04); }
.ai-feature i { width: 2.75rem; height: 2.75rem; border-radius: .6rem; background: #eef2ff; color: #4f46e5; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.ai-band { background-image: linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.06) 75%), linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.06) 75%), linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); background-size: 48px 48px, 48px 48px, auto; background-position: 0 0, 24px 24px, 0 0; color: #e0e7ff; }
.ai-band .ai-sub, .ai-steps p { color: #e0e7ff; }
.ai-steps span { border: 0; background: #fff; color: #4f46e5; font-weight: 700; font-size: 1rem; width: 2.5rem; height: 2.5rem; }
.ai-cta { border: 0; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ai-cta h2 { font-weight: 700; font-size: 1.875rem; }
.ai-cta-btn { background: #4f46e5; border-radius: .5rem; }
.ai-cta-btn:hover { background: #4338ca; }
html.dark .ai-feature { background: #162032; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
html.dark .ai-feature i { background: rgba(99,102,241,.18); color: #a5b4fc; }
html.dark .ai-title, html.dark .ai-band .ai-h2, html.dark .ai-steps h3 { color: #fff; }
html.dark .ai-lead, html.dark .ai-band .ai-sub, html.dark .ai-steps p { color: #e0e7ff; }
html.dark .ai-status { background: rgba(255,255,255,.14); color: #fff; }
html.dark .ai-ghost { border-color: rgba(255,255,255,.7); color: #fff; }
html.dark .ai-ghost:hover { background: rgba(255,255,255,.12); }
html.dark .ai-cta-btn { background: #6366f1; color: #fff; }
.ai-hero-btn { display: inline-flex; align-items: center; background: #fff; color: #4338ca; font-weight: 600; font-size: .9rem; padding: .7rem 1.25rem; border-radius: .5rem; box-shadow: 0 4px 14px -4px rgba(0,0,0,.25); }
.ai-hero-btn:hover { background: #eef2ff; color: #3730a3; }

.ai-title { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.15; }
@media (min-width: 768px) { .ai-demo-in, .ai-demo-out { max-width: 230px; } .ai-hero > div { min-height: 20rem; } }
.ai-demo figcaption { margin-top: .4rem; }
@media (max-width: 767px) {
  .ai-demo { grid-template-columns: 1fr auto 1fr; gap: .5rem; }
  .ai-demo-arrow { transform: none; font-size: 1.2rem; }
  .ai-demo-in, .ai-demo-out { max-width: none; margin: 0; }
  .ai-demo figcaption { font-size: .72rem; }
}

/* ---------- ChessDepth AI tool (beta) ---------- */
.ai-lead-c { margin-left: auto; margin-right: auto; max-width: 40rem; }
.ai-tool-wrap { background: #f3f4f6; padding: 2rem 0 2.5rem; }
.ai-drop { background: #fff; border: 2px dashed #a5b4fc; border-radius: 1rem; padding: 2.5rem 1.5rem; text-align: center; transition: border-color .15s, background .15s; }
.ai-drop.is-over { border-color: #4f46e5; background: #eef2ff; }
.ai-drop.hidden, .ai-work.hidden { display: none; }
.ai-drop-ic { font-size: 2.4rem; color: #6366f1; }
.ai-drop-h { font-size: 1.1rem; font-weight: 600; color: #111827; margin: .8rem 0 1rem; }
.ai-drop-small { font-size: .85rem; color: #6b7280; margin: 1rem auto 0; max-width: 36rem; line-height: 1.6; }
.ai-btn { display: inline-flex; align-items: center; gap: .5rem; background: #4f46e5; color: #fff; font-weight: 600; font-size: .95rem; padding: .7rem 1.3rem; border-radius: .55rem; cursor: pointer; border: 0; }
.ai-btn:hover { background: #4338ca; color: #fff; }
.ai-btn.is-disabled { opacity: .45; cursor: not-allowed; }
.ai-ghost-btn { display: inline-flex; align-items: center; gap: .4rem; background: #fff; color: #374151; font-weight: 600; font-size: .85rem; padding: .55rem .9rem; border-radius: .5rem; border: 1px solid #d1d5db; cursor: pointer; }
.ai-ghost-btn:hover { border-color: #818cf8; color: #3730a3; }
.ai-examples { margin-top: 1.1rem; font-size: .85rem; color: #6b7280; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; align-items: center; }
.ai-examples button { border: 1px solid #c7d2fe; background: #eef2ff; color: #4338ca; border-radius: 999px; padding: .3rem .8rem; font-weight: 600; cursor: pointer; }
.ai-work { background: #fff; border-radius: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 1.25rem; }
.ai-status-line { font-weight: 600; color: #4b5563; margin-bottom: 1rem; }
.ai-status-line.ok { color: #047857; } .ai-status-line.bad { color: #b91c1c; }
.ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.ai-col-h { font-weight: 700; color: #111827; margin-bottom: .6rem; } .ai-col-h span { font-weight: 400; color: #6b7280; font-size: .85rem; }
.ai-src-wrap { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: .6rem; padding: .5rem; text-align: center; }
.ai-src { max-width: 100%; height: auto; touch-action: none; }
.ai-src.is-drawing { cursor: crosshair; outline: 2px solid #16a34a; }
.ai-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .8rem; }
.ai-board { width: 100%; max-width: 440px; display: block; margin: 0 auto; }
.ai-unsure { font-size: .85rem; color: #c2410c; margin-top: .5rem; min-height: 1.2em; } .ai-unsure i { margin-right: .3rem; }
.ai-turn span { font-size: .85rem; font-weight: 600; color: #4b5563; }
.ai-turn button[aria-pressed] { border: 1px solid #d1d5db; background: #fff; border-radius: .45rem; padding: .4rem .8rem; font-weight: 600; font-size: .85rem; cursor: pointer; }
.ai-turn button[aria-pressed="true"] { background: #111827; color: #fff; border-color: #111827; }
.ai-fen-l { display: block; font-size: .8rem; font-weight: 700; color: #6b7280; margin-top: .9rem; text-transform: uppercase; letter-spacing: .05em; }
.ai-fen-row { display: flex; gap: .5rem; margin-top: .3rem; }
.ai-fen-row input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; border: 1px solid #d1d5db; border-radius: .45rem; padding: .5rem .6rem; background: #f9fafb; color: #111827; }
.ai-feedback { margin-top: 1rem; font-size: .85rem; color: #6b7280; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ai-feedback.hidden { display: none; }
.ai-feedback button { border: 1px solid #d1d5db; background: #fff; border-radius: 999px; padding: .2rem .8rem; font-weight: 600; cursor: pointer; }
.ai-feedback button:disabled { opacity: .5; cursor: default; }
.ai-beta-note { text-align: center; font-size: .82rem; color: #6b7280; margin-top: 1rem; } .ai-beta-note i { color: #6366f1; margin-right: .3rem; }
@media (max-width: 860px) { .ai-cols { grid-template-columns: 1fr; } .ai-drop { padding: 2rem 1rem; } }
html.dark .ai-tool-wrap { background: #0b1220; }
html.dark .ai-drop, html.dark .ai-work { background: #162032; border-color: #334155; }
html.dark .ai-drop-h, html.dark .ai-col-h { color: #f1f5f9; } html.dark .ai-drop-small, html.dark .ai-col-h span, html.dark .ai-feedback, html.dark .ai-beta-note, html.dark .ai-status-line { color: #a8b3c4; }
html.dark .ai-status-line.ok { color: #6ee7b7; } html.dark .ai-status-line.bad { color: #fca5a5; }
html.dark .ai-src-wrap { background: #0f172a; border-color: #273449; }
html.dark .ai-ghost-btn, html.dark .ai-turn button[aria-pressed], html.dark .ai-feedback button { background: #0f172a; color: #e2e8f0; border-color: #334155; }
html.dark .ai-turn button[aria-pressed="true"] { background: #6366f1; border-color: #6366f1; }
html.dark .ai-fen-row input { background: #0f172a; color: #f1f5f9; border-color: #334155; }
html.dark .ai-examples button { background: rgba(99,102,241,.15); border-color: #4f46e5; color: #c7d2fe; }
