/* ---------- First fold: dark AI-assistant home screen ---------- */
.ai-hero {
  --bg: #1f1e1c; --panel: #2c2b28; --panel-2: #353430; --edge: #403f3a;
  --txt: #f1efe8; --dim: #a19f97; --dimmer: #77756e;
  position: relative; overflow: hidden;
  min-height: calc(100vh - 72px);
  background: var(--bg); color: var(--txt);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 20px 64px;
}
.ai-stage { width: 100%; max-width: 980px; position: relative; }

/* Home state */
.ai-home { display: flex; flex-direction: column; align-items: center; transition: opacity .5s ease, transform .5s ease; }
.ai-home.out { opacity: 0; transform: translateY(-24px); pointer-events: none; position: absolute; inset: 0 0 auto 0; }
.greet { display: flex; align-items: center; gap: 16px; margin-bottom: 30px; }
.greet .mark { width: 40px; height: 40px; flex: none; }
.greet h1 { color: var(--txt); font-weight: 500; font-size: clamp(32px, 4.4vw, 50px); margin: 0; letter-spacing: -0.5px; }

.ask { width: 100%; max-width: 780px; background: var(--panel); border: 1px solid var(--edge); border-radius: 24px; padding: 20px 22px 14px; box-shadow: 0 30px 60px -40px rgba(0,0,0,.8); }
.ask .field { min-height: 56px; font-size: 18px; line-height: 1.5; color: var(--txt); }
.ask .ph { color: var(--dim); }
.ask .caret { display: inline-block; width: 2px; height: 1.1em; background: var(--gold); vertical-align: -3px; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ask .bar { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.ask .plus { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--dim); font-size: 22px; }
.ask .right { display: flex; align-items: center; gap: 12px; color: var(--dim); }
.ask .send { width: 36px; height: 36px; border-radius: 12px; background: var(--panel-2); color: var(--dimmer); display: grid; place-items: center; font-size: 17px; transition: background .25s, color .25s, transform .25s; }
.ask .send.ready { background: var(--gold); color: var(--navy); }
.ask .send.press { transform: scale(.88); }
.ask-meta { width: 100%; max-width: 780px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding: 0 6px; font-size: 14px; color: var(--dim); }
.ask-meta .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ask-meta .chips span { border: 1px solid var(--edge); border-radius: 999px; padding: 6px 14px; }
.ask-meta .who { color: var(--txt); font-weight: 500; }

.recent { width: 100%; max-width: 780px; margin-top: 48px; }
.recent-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; color: var(--dim); margin-bottom: 14px; padding: 0 6px; }
.recent-head a { color: var(--txt); text-decoration: none; }
.recent-head a:hover { color: var(--gold); }
.recent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rcard { display: block; text-decoration: none; border-radius: 16px; overflow: hidden; border: 1px solid var(--edge); background: var(--panel); transition: transform .2s, border-color .2s; }
.rcard:hover { transform: translateY(-3px); border-color: var(--gold); }
.rcard .thumb { height: 140px; background: #efece4; display: grid; place-items: center; }
.rcard .thumb.a2 { background: #f3e9d2; } .rcard .thumb.a3 { background: #e4f0ee; }
.rcard .thumb svg { height: 94%; width: auto; max-width: 96%; }
.rcard .cap { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; font-size: 14px; color: var(--txt); }
.rcard .cap span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcard .cap span:last-child { color: var(--dim); flex: none; }

/* Conversation state */
.ai-convo { width: 100%; max-width: 780px; margin: 0 auto; display: none; flex-direction: column; gap: 20px; }
.ai-convo.in { display: flex; animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.q-bubble { align-self: flex-end; max-width: 85%; background: var(--panel-2); border-radius: 18px 18px 6px 18px; padding: 12px 18px; font-size: 16px; line-height: 1.5; }
.a-row { display: flex; gap: 14px; align-items: flex-start; }
.a-row .mark { width: 28px; height: 28px; flex: none; margin-top: 2px; }
.a-body { flex: 1; font-size: 16px; line-height: 1.6; }
.steps { list-style: none; margin: 0 0 6px; padding: 0; font-size: 14px; color: var(--dim); }
.steps li { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; opacity: 0; transform: translateY(4px); transition: opacity .35s, transform .35s; }
.steps li.on { opacity: 1; transform: none; }
.steps .st { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--edge); flex: none; position: relative; }
.steps li.done .st { border-color: var(--gold); background: var(--gold); }
.steps li.done .st::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--navy); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.steps li.busy .st { border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.lead-line { margin: 4px 0 14px; opacity: 0; transition: opacity .4s; }
.lead-line.on { opacity: 1; }
.rec { display: grid; grid-template-columns: 120px 1fr; gap: 22px; align-items: center; background: var(--panel); border: 1px solid var(--edge); border-radius: 20px; padding: 20px;
  opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .55s, transform .55s; }
.rec.on { opacity: 1; transform: none; }
.rec img { width: 120px; height: 120px; border-radius: 18px; object-fit: cover; background: var(--cream); }
.rec .nm { font-size: 24px; font-weight: 600; color: var(--txt); line-height: 1.2; }
.rec .rl { font-size: 14px; color: var(--dim); margin: 3px 0 10px; }
.rec ul { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.6; color: #dcd9cf; }
.rec ul li::marker { color: var(--gold); }
.rec-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; opacity: 0; transition: opacity .5s .2s; }
.rec-actions.on { opacity: 1; }
.rec-actions a { font-size: 14px; font-weight: 600; text-decoration: none; padding: 9px 16px; border-radius: 999px; }
.rec-actions .p { background: var(--gold); color: var(--navy); }
.rec-actions .s { border: 1.5px solid var(--edge); color: var(--txt); }
.rec-actions .s:hover { border-color: var(--gold); }

.hero-foot { position: relative; margin-top: 34px; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; justify-content: center; }
.replay { background: none; border: 1px solid var(--edge, #403f3a); color: #d6d3c9; font-family: var(--sans); font-size: 13px; padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.replay:hover { border-color: var(--gold); color: var(--gold); }
.scroll-cue { color: #a19f97; font-size: 13px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.scroll-cue .m { width: 20px; height: 32px; border: 2px solid #a19f97; border-radius: 12px; position: relative; }
.scroll-cue .m::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; background: var(--gold); border-radius: 2px; animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }

/* Dark header on the home page so it blends into the first fold */
.dark-top .site-header { background: rgba(31, 30, 28, 0.94); border-bottom-color: #33322e; }
.dark-top .brand .name { color: #f1efe8; }
.dark-top nav.main-nav a { color: #e9e6dd; }
.dark-top nav.main-nav a.active, .dark-top nav.main-nav a:hover { border-bottom-color: var(--gold); }
.dark-top .nav-cta { background: var(--gold) !important; color: var(--navy) !important; }
.dark-top .menu-btn { color: #f1efe8; }
@media (max-width: 720px) { .dark-top nav.main-nav { background: #1f1e1c; border-bottom-color: #33322e; } }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(150px, auto); gap: 18px; }
.tile { background: var(--paper); border-radius: 24px; padding: 26px; border: 1px solid var(--line); position: relative; overflow: hidden; }
.tile h3 { font-size: 22px; margin-bottom: 8px; }
.tile p { margin: 0; color: var(--muted); font-size: 15px; }
.tile .k { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 10px; display: block; }
.tile.big { grid-column: span 2; grid-row: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: end; background: var(--navy); color: #f1efe8; border: 0; }
.tile.big h3 { color: #fff; font-size: 28px; }
.tile.big p { color: #cfcac0; }
.tile.big img { width: 100%; border-radius: 18px; align-self: stretch; object-fit: cover; aspect-ratio: 1; }
.tile.stat .num { font-size: 44px; color: var(--navy); line-height: 1; font-weight: 700; }
.tile.stat .lbl { margin-top: 10px; color: var(--muted); font-size: 14px; }
.tile.gold { background: var(--gold-soft); border-color: #eadbb8; }
.tile.teal { background: #e4f0ee; border-color: #cfe3df; }
.tile.wide { grid-column: span 2; }
.logos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin-top: 12px; }
.logos span { display: flex; align-items: center; gap: 10px; font-size: 17px; color: var(--navy); font-weight: 600; line-height: 1.3; }
.logos span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
@media (max-width: 640px) { .logos { grid-template-columns: 1fr; } }
.stack-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.stack-row span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--navy); font-weight: 500; }

@media (max-width: 980px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile.big { grid-column: span 2; grid-row: auto; }
}
@media (max-width: 640px) {
  .ai-hero { padding: 36px 16px 48px; }
  .greet .mark { width: 30px; height: 30px; }
  .recent-grid { grid-template-columns: 1fr; }
  .recent-grid .rcard:nth-child(n+2) { display: none; }
  .rec { grid-template-columns: 1fr; }
  .rec img { width: 84px; height: 84px; }
  .q-bubble { max-width: 95%; font-size: 15px; }
  .bento { grid-template-columns: 1fr; }
  .tile.big, .tile.wide { grid-column: auto; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-home, .steps li, .lead-line, .rec, .rec-actions { transition: none; }
  .ai-convo.in { animation: none; }
}
