/* Landing page. Built on the app tokens in styles.css so it follows the
   same light and dark themes as the rest of the product. */

.lp {
    --lp-done: #15803d;
    --lp-working: #d97706;
    --lp-waiting: #94a3b8;
    --lp-booked: #0e7490;
    --lp-todo: #475569;
    --lp-high: #dc2626;
    --lp-medium: #d97706;
    --lp-low: #65a30d;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
}

.lp-wrap {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 32px;
}

/* Shared status colours for fills, swatches and miniature bars */
.lp .is-done { background-color: var(--lp-done); }
.lp .is-working { background-color: var(--lp-working); }
.lp .is-waiting { background-color: var(--lp-waiting); }
.lp .is-booked { background-color: var(--lp-booked); }
.lp .is-todo { background-color: var(--lp-todo); }
.lp .is-high { background-color: var(--lp-high); }
.lp .is-medium { background-color: var(--lp-medium); }
.lp .is-low { background-color: var(--lp-low); }

/* ---------- Hero ---------- */
.lp-hero {
    padding-top: 96px;
    padding-bottom: 64px;
}

.lp-title {
    font-size: clamp(2.5rem, 1.1rem + 5vw, 4.75rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
    max-width: 18ch;
    text-wrap: balance;
}

.lp-hero-foot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 32px 48px;
    margin-top: 32px;
}

.lp-lede {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--gray-600);
    max-width: 58ch;
}

.lp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- Example board ---------- */
.lp-board {
    padding-bottom: 96px;
}

.lb {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    color: var(--gray-800);
}

.lb-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.lb-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lb-crumb {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.lb-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--gray-900);
}

.lb-tabs {
    display: flex;
    flex-shrink: 0;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
}

.lb-tabs span {
    padding: 8px 12px;
    line-height: 1;
}

.lb-tabs span + span {
    border-left: 1px solid var(--gray-300);
}

.lb-tabs .is-active {
    background: var(--accent);
    color: #fff;
}

.lb-group + .lb-group {
    border-top: 8px solid var(--gray-50);
}

.lb-group-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.lb-group-head::before {
    content: "";
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: var(--accent);
}

.lb-group-b .lb-group-head::before {
    background: var(--lp-booked);
}

.lb-count {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--gray-500);
}

.lb-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px 136px 112px 96px;
    min-height: 40px;
    border-top: 1px solid var(--gray-200);
}

.lb-row > span {
    display: flex;
    align-items: center;
    min-width: 0;
    padding-inline: 16px;
    border-left: 1px solid var(--gray-200);
}

.lb-row > span:first-child {
    padding-left: 20px;
    border-left: 0;
}

.lb-head {
    min-height: 32px;
    background: var(--gray-50);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.lb-name {
    gap: 8px;
    font-weight: 500;
    color: var(--gray-900);
}

.lb-date {
    white-space: nowrap;
    color: var(--gray-600);
    font-variant-numeric: tabular-nums;
}

.lb-row > .lb-c-owner {
    justify-content: center;
    padding-inline: 0;
}

.lb-av {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.625rem;
    font-style: normal;
    font-weight: 600;
    color: #fff;
}

.lb-av-1 { background: #41698c; }
.lb-av-2 { background: #7a5c9e; }
.lb-av-3 { background: #3e7a5e; }
.lb-av-4 { background: #a34f6d; }

.lb-row > .lb-fill {
    position: relative;
    justify-content: center;
    padding-inline: 8px;
    font-weight: 500;
    color: #fff;
}

.lb-next {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    opacity: 1;
}

.lb-lock {
    flex-shrink: 0;
    width: 0;
    opacity: 0;
    color: var(--gray-500);
}

/* The one moving part: a status flips to done and its dependent unlocks. */
@media (prefers-reduced-motion: no-preference) {
    .lb-next {
        animation: lb-reveal 0.45s ease-out 1.4s both;
    }

    .lb-row-blocked .lb-next {
        animation-delay: 2.2s;
    }

    .lb-row-blocked .lb-name {
        animation: lb-unblock 0.45s ease-out 2.2s both;
    }

    .lb-lock {
        animation: lb-unlock 0.45s ease-out 2.2s both;
    }
}

@keyframes lb-reveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lb-unblock {
    from { color: var(--gray-500); }
    to { color: var(--gray-900); }
}

@keyframes lb-unlock {
    from { width: 14px; opacity: 1; }
    to { width: 0; opacity: 0; margin-right: -8px; }
}

.lp-board-note {
    margin-top: 16px;
    max-width: 68ch;
    font-size: 0.9375rem;
    color: var(--gray-600);
}

/* ---------- Section headings ---------- */
.lp-h2 {
    font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

/* ---------- Features ---------- */
.lp-features {
    padding-bottom: 96px;
    scroll-margin-top: 88px;
}

.lp-features .lp-h2 {
    margin-bottom: 32px;
}

.lp-feature {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    gap: 32px 64px;
    padding-block: 40px;
    border-top: 1px solid var(--gray-200);
}

.lp-feature:last-child {
    border-bottom: 1px solid var(--gray-200);
}

.lp-feature-text h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 12px;
}

.lp-feature-text p {
    color: var(--gray-600);
    max-width: 46ch;
}

/* Column types */
.lp-columns {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.lp-columns li {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-800);
    box-shadow: 1px 0 0 var(--gray-200), 0 1px 0 var(--gray-200);
}

.lp-col-sample {
    display: flex;
    align-items: center;
    height: 24px;
    color: var(--gray-500);
}

.lp-col-text {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.lp-swatch {
    width: 48px;
    height: 20px;
    border-radius: var(--radius-sm);
}

.lp-bar {
    width: 64px;
    height: 8px;
    border-radius: 4px;
    background: var(--accent);
}

/* Automation rule */
.lp-rule {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 20px;
    border-left: 2px solid var(--accent);
}

.lp-rule li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-700);
}

.lp-rule-verb {
    width: 48px;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--gray-900);
}

.lp-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--gray-900);
}

.lp-chip.is-done {
    border-color: transparent;
    color: #fff;
}

/* Dependency chain */
.lp-deps {
    display: flex;
    align-items: center;
}

.lp-dep {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 56px;
    padding: 8px 16px;
    background: var(--white);
    border: 1px solid var(--gray-400);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--gray-900);
    white-space: nowrap;
}

.lp-dep.is-complete {
    border-color: var(--lp-done);
    box-shadow: inset 4px 0 0 var(--lp-done);
}

.lp-dep.is-cross {
    border-style: dashed;
}

.lp-dep small {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gray-500);
}

.lp-dep-link {
    flex: 1;
    min-width: 16px;
    height: 0;
    border-top: 2px solid var(--gray-400);
}

.lp-dep-link.is-cross {
    border-top-style: dashed;
}

/* ---------- Views ---------- */
.lp-views {
    padding-bottom: 96px;
}

.lp-view-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.lp-view figcaption {
    margin-top: 12px;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--gray-600);
}

.lp-view figcaption strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.lp-frame {
    aspect-ratio: 4 / 3;
    padding: 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.lp-frame-table {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lp-frame-table span {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lp-frame-table i {
    flex: 1;
    height: 8px;
    border-radius: 2px;
    background: var(--gray-200);
}

.lp-frame-table b {
    width: 48px;
    height: 16px;
    border-radius: 2px;
}

.lp-frame-kanban {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.lp-frame-kanban span {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    background: var(--gray-100);
    border-radius: 2px;
}

.lp-frame-kanban i {
    height: 24px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 2px;
}

.lp-frame-kanban span:nth-child(1) { box-shadow: inset 0 2px 0 var(--lp-todo); }
.lp-frame-kanban span:nth-child(2) { box-shadow: inset 0 2px 0 var(--lp-working); }
.lp-frame-kanban span:nth-child(3) { box-shadow: inset 0 2px 0 var(--lp-done); }

.lp-frame-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 2px;
}

.lp-frame-calendar i {
    background: var(--gray-100);
    border-radius: 2px;
}

.lp-frame-calendar .has-item {
    box-shadow: inset 0 -6px 0 var(--accent);
}

.lp-frame-timeline {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-content: space-between;
    background-image: linear-gradient(to right, var(--gray-100) 1px, transparent 1px);
    background-size: calc((100% - 32px) / 6) 100%;
    background-position: 16px 0;
    background-repeat: repeat-x;
    background-color: var(--white);
}

.lp-frame-timeline i {
    height: 12px;
    border-radius: 2px;
}

.lp-frame-timeline .t1 { grid-column: 1 / 4; }
.lp-frame-timeline .t2 { grid-column: 3 / 8; }
.lp-frame-timeline .t3 { grid-column: 7 / 10; }
.lp-frame-timeline .t4 { grid-column: 8 / 13; }
.lp-frame-timeline .t5 { grid-column: 10 / 13; }

.lp-across {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 64px;
}

.lp-across div {
    padding-top: 16px;
    border-top: 1px solid var(--gray-300);
}

.lp-across dt {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.lp-across dd {
    margin-top: 4px;
    color: var(--gray-600);
    max-width: 36ch;
}

/* ---------- Closing ---------- */
.lp-close {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px 48px;
    padding-bottom: 96px;
}

.lp-close-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.lp-close-actions p {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.lp-footer {
    margin-top: auto;
    border-top: 1px solid var(--gray-200);
}

.lp-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-block: 24px;
    font-size: 0.875rem;
}

.lp-footer-brand {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--gray-700);
}

.lp-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--gray-600);
}

.lp-footer a:hover {
    color: var(--accent);
}

[data-theme="dark"] .lp-frame-calendar i,
[data-theme="dark"] .lp-frame-kanban span {
    background: var(--gray-200);
}

/* ---------- Keyboard focus ---------- */
.lp a:focus-visible,
.lp button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Smaller screens ---------- */
@media (max-width: 960px) {
    .lp-hero { padding-top: 64px; padding-bottom: 48px; }
    .lp-hero-foot { grid-template-columns: minmax(0, 1fr); }
    .lp-board, .lp-features, .lp-views { padding-bottom: 64px; }
    .lp-feature { grid-template-columns: minmax(0, 1fr); padding-block: 32px; }
    .lp-view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lb-tabs { display: none; }
}

@media (max-width: 640px) {
    .lp-wrap { padding-inline: 20px; }
    .lp-hero { padding-top: 48px; padding-bottom: 40px; }
    .lp-actions .btn { flex: 1 1 100%; }

    .lb-row { grid-template-columns: minmax(0, 1fr) 88px 80px; }
    .lb-row > .lb-c-owner, .lb-row > .lb-c-pri { display: none; }
    .lb-row > span { padding-inline: 12px; }
    .lb-row > span:first-child { padding-left: 16px; }
    .lb-top, .lb-group-head { padding-inline: 16px; }
    .lb-title { font-size: 1.125rem; }
    .lb-row { min-height: 48px; }
    .lb-name { line-height: 1.3; padding-block: 8px; }

    .lp-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lp-rule-verb { width: 100%; }

    .lp-deps { flex-direction: column; align-items: stretch; }
    .lp-dep-link {
        flex: none;
        align-self: center;
        width: 0;
        height: 16px;
        border-top: 0;
        border-left: 2px solid var(--gray-400);
    }
    .lp-dep-link.is-cross { border-left-style: dashed; }

    .lp-across { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 48px; }
    .lp-close { padding-bottom: 64px; }
    .lp-close-actions .btn { flex: 1 1 100%; }
}
