/*
  Landing page layout. One block per section id, in page order:
    header, hero (with the chat demo), steps, capabilities, control, faq, footer.
  Shared tokens and primitives are in theme.css.
*/

/* layout --------------------------------------------------------------- */

main {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.section {
    padding: 4.5rem 0;
}

.lead {
    max-width: 42rem;
    font-size: 1.15rem;
    color: var(--text-muted);
}

/* header --------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 650;
    text-decoration: none;
}

.brand-logo {
    display: block;
    height: 28px;
    width: auto;
}

.brand-tag {
    display: inline-flex;
    align-items: center;
    height: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0 0.55rem;
    border-radius: 6px;
    background: var(--accent);
    color: var(--accent-ink);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.9rem;
}

.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
}
.site-nav a:hover {
    color: var(--text);
}

.site-nav .lang-picker a:hover {
    color: var(--text-muted);
}

.site-nav .lang-picker a[aria-current='true']:hover {
    color: var(--bg);
}

/* hero ----------------------------------------------------------------- */

#hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
    align-items: center;
    gap: 3rem 4rem;
    padding-top: 4rem;
}

@media (max-width: 56rem) {
    #hero {
        grid-template-columns: minmax(0, 1fr);
    }
}

#hero h1 {
    margin-bottom: 0.4em;
    font-size: clamp(2.75rem, 7vw, 5rem);
    line-height: 1;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

#hero .lead {
    margin: 0 0 2rem;
    text-wrap: pretty;
}

.how-to-connect {
    font-weight: 600;
    color: var(--accent-2);
    text-underline-offset: 0.2em;
}

.client-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
}

.client-pills .pill {
    background: transparent;
    border: none;
    padding: 0;
}

.server-url {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    max-width: 36rem;
    margin: 0 0 1.25rem;
    padding: 0.6rem 0.6rem 0.6rem 1rem;
}

.server-url-label {
    flex-basis: 100%;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.server-url code {
    flex: 1 1 0;
    min-width: 0;
    font-size: 1rem;
    overflow-wrap: break-word;
}

/* chat (iPhone carousel) ------------------------------------------------ */

.phone-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}

/* Colors come from the secondary .button style in theme.css. */
.phone-nav {
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    /* Tapping quickly through examples should not double-tap zoom on phones. */
    touch-action: manipulation;
}

.phone-nav svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
}

#chat-next svg {
    transform: scaleX(-1);
}

.phone {
    width: min(300px, 100%);
    /* Lets landing.js read horizontal swipes while vertical scroll still works. */
    touch-action: pan-y;
    height: 620px;
    padding: 3px;
    border-radius: 44px;
    background: linear-gradient(180deg, #f4f4f6 0%, #c4c4c8 16%, #8e8e93 100%);
    box-shadow:
        0 0 0 1px #6e6e73,
        inset 0 0 0 1px rgba(255, 255, 255, 0.65),
        0 22px 48px rgba(40, 24, 16, 0.16);
}

.phone-bezel {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: 41px;
    background: #fff;
    color: #1c1917;
}

.phone-island {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 1;
    width: 64px;
    height: 18px;
    border-radius: 12px;
    background: #1c1917;
    transform: translateX(-50%);
}

.phone-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 36px;
    padding: 6px 14px 0;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.phone-status-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.phone-screen {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.6rem 0.9rem 0.8rem;
    overflow-y: auto;
    font-size: 0.92rem;
    line-height: 1.35;
}

.phone-msg {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-width: 88%;
    animation: phone-pop 320ms ease both;
}

.phone-msg-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #8a847c;
}

.phone-msg-body {
    padding: 0.6rem 0.75rem;
}

.phone-photo {
    display: block;
    width: 7.5rem;
    height: 9rem;
    margin-bottom: 0.4rem;
    border-radius: 12px;
    object-fit: cover;
}

.phone-msg p {
    margin: 0;
}

.phone-msg ul,
.phone-msg ol {
    margin: 0.45rem 0 0;
    padding-left: 1.15rem;
}

.phone-msg li + li {
    margin-top: 0.3rem;
}

.phone-msg-user {
    align-self: flex-end;
    align-items: flex-end;
}

.phone-msg-user .phone-msg-body {
    border-radius: 16px 16px 4px 16px;
    background: #eceae6;
}

.phone-msg-agent {
    align-self: flex-start;
    align-items: flex-start;
}

.phone-msg-agent .phone-msg-body {
    border-radius: 16px 16px 16px 4px;
    background: #f3eee6;
}

.delivery-track {
    margin-top: 0.65rem;
}

.delivery-track-bar {
    height: 6px;
    border-radius: 99px;
    background: #e4e0da;
    overflow: hidden;
}

.delivery-track-fill {
    width: var(--progress);
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transform-origin: left center;
    animation: delivery-grow 700ms ease;
}

.delivery-track-ends {
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
    font-size: 0.68rem;
    color: #6b6560;
}

.delivery-track-stops {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    font-weight: 600;
}

.phone-composer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0.55rem 0.6rem;
    padding: 0.4rem 0.45rem 0.4rem 0.55rem;
    border: 1px solid #e4e0da;
    border-radius: 22px;
    color: #8a847c;
    font-size: 0.82rem;
}

.phone-composer-text {
    flex: 1;
    min-width: 0;
}

.phone-attach,
.phone-mic,
.phone-voice {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    color: #1c1917;
}

.phone-attach,
.phone-mic {
    width: 1.7rem;
    height: 1.7rem;
}

.phone-voice {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    background: #1c1917;
    color: #fff;
}

.chat-caption {
    margin: 1rem 0 0.6rem;
    text-align: center;
    font-weight: 600;
}

.chat-dots {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
}

.chat-dot {
    touch-action: manipulation;
    width: 0.55rem;
    height: 0.55rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--border-strong);
    cursor: pointer;
}

.chat-dot[aria-current='true'] {
    background: var(--accent);
}

@keyframes phone-pop {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes delivery-grow {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .phone-msg,
    .delivery-track-fill {
        animation: none;
    }
}

@media (max-width: 640px) {
    .phone-carousel {
        gap: 0.75rem;
    }

    .phone {
        height: 560px;
    }
}

/* steps ---------------------------------------------------------------- */

.steps-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0 2rem;
}

.steps-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition:
        background 120ms ease,
        border-color 120ms ease,
        color 120ms ease;
}

.steps-tab:hover {
    border-color: color-mix(in srgb, var(--accent-2) 45%, var(--border-strong));
    color: var(--text);
}

.steps-tab[aria-selected='true'] {
    border-color: var(--accent-2);
    background: color-mix(in srgb, var(--accent-2) 10%, var(--surface));
    color: var(--text-display);
}

.steps-tab .pill-logo {
    width: 1rem;
    height: 1rem;
}

.steps-panels {
    margin-top: 0.25rem;
}

.steps-panel[hidden] {
    display: none;
}

.steps-list {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

/* Same numbered list as the main shop site: a small number in its own column. */
.step {
    display: grid;
    grid-template-columns: 1.75rem 1fr;
    align-content: start;
    counter-increment: step;
}

.step::before {
    content: counter(step);
    grid-row: span 2;
    font-size: 1.125rem;
    font-weight: 650;
    line-height: 1.4;
    color: var(--text-display);
    font-variant-numeric: tabular-nums;
}

.step h3 {
    margin: 0 0 0.25rem;
    font-size: 1.125rem;
    line-height: 1.4;
}

.step p {
    margin: 0;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

/* capabilities --------------------------------------------------------- */

.card-grid {
    display: grid;
    gap: 2rem 1.75rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

#capabilities .capabilities-lead {
    margin: 0 0 2.5rem;
}

.capability-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
    .capability-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 56rem) {
    .capability-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.feature p {
    margin: 0;
    color: var(--text-muted);
}

#capabilities .capability h3 {
    margin-bottom: 0.3rem;
    font-size: 1rem;
}

#capabilities .capability p {
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
    line-height: 1.45;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tool-tag {
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: var(--surface-inset);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--text-muted);
    word-break: break-all;
}

.capabilities-beyond {
    margin-top: 4.5rem;
}

.capabilities-beyond h3 {
    margin-bottom: 0.5rem;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.capabilities-beyond-lead {
    margin: 0 0 2rem;
    max-width: 42rem;
    color: var(--text-muted);
}

.beyond-list {
    display: grid;
    gap: 2rem 1.75rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.beyond-item h4 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--text-display);
}

.beyond-item p {
    margin: 0;
    color: var(--text-muted);
}

/* control -------------------------------------------------------------- */

.section-control {
    margin: 2rem 0;
    padding: 4rem clamp(1.5rem, 5vw, 4rem);
    border-radius: var(--radius-l);
    background: var(--text-display);
    color: var(--bg);
}

.section-control h2 {
    color: var(--bg);
}

.section-control .lead {
    color: color-mix(in srgb, var(--bg) 80%, transparent);
}

.control-list {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
}

.control-list .feature h3 {
    color: var(--accent);
}

.control-list .feature p {
    color: color-mix(in srgb, var(--bg) 88%, transparent);
}

.control-link {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
}

.control-link a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.control-link a:hover {
    color: var(--bg);
}

.section-control :focus-visible {
    outline-color: var(--accent);
}

/* faq ------------------------------------------------------------------ */

.faq-list {
    max-width: 48rem;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item summary {
    padding: 1rem 0;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    float: right;
    color: var(--accent-2);
}

.faq-item[open] summary::after {
    content: '–';
}

.faq-item p {
    padding-bottom: 1rem;
    color: var(--text-muted);
}

/* footer --------------------------------------------------------------- */

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    padding: 3rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-faint);
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
}
.site-footer a:hover {
    color: var(--text);
}
