/* The software page and the Dynamik Agri download page. */

/* The software pages sit closer together than the rest of the site, so more of each is on screen. */
.section-tight {
    padding: var(--space-xl) 0;
}

.section-tight .section-header {
    margin-bottom: var(--space-lg);
}

.page-hero-tight {
    padding: var(--space-2xl) 0 var(--space-xl);
}

.software-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

/* The software page: the program on top and what it holds underneath, joined like an
   org chart. On a phone the branches hang off a rail on the left. */
.org {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.org-root {
    width: min(100%, 380px);
    padding: var(--space-lg);
    overflow: hidden;
}

.org-branches {
    --org-drop: var(--space-lg);
    --org-gap: var(--space-lg);
    position: relative;
    display: flex;
    justify-content: center;
    gap: var(--org-gap);
    width: 100%;
    margin: 0;
    padding: calc(2 * var(--org-drop)) 0 0;
    list-style: none;
}

.org-branches::before,
.org-node::before,
.org-node::after {
    content: "";
    position: absolute;
    background: var(--color-primary-200);
}

/* the trunk, from the program down to the bar */
.org-branches::before {
    top: 0;
    left: calc(50% - 1px);
    width: 2px;
    height: var(--org-drop);
}

.org-node {
    position: relative;
    display: flex;
    flex: 0 1 380px;
}

/* the bar joining the branches, and the drop from it to each one */
.org-node::before {
    top: calc(-1 * var(--org-drop));
    left: calc(-1 * var(--org-gap) / 2);
    right: calc(-1 * var(--org-gap) / 2);
    height: 2px;
}

.org-node:first-child::before {
    left: 50%;
}

.org-node:last-child::before {
    right: 50%;
}

.org-node:only-child::before {
    display: none;
}

.org-node::after {
    top: calc(-1 * var(--org-drop));
    left: calc(50% - 1px);
    width: 2px;
    height: var(--org-drop);
}

.org-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    text-decoration: none;
    overflow: hidden;
}

.org-shot {
    display: block;
    width: calc(100% + 2 * var(--space-lg));
    max-width: none;
    height: auto;
    margin: calc(-1 * var(--space-lg)) calc(-1 * var(--space-lg)) var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.org-card-link {
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.org-card-link:hover {
    border-color: var(--color-primary-400);
    box-shadow: 0 4px 20px rgba(7, 26, 18, 0.08);
}

.org-leaves {
    flex: 1;
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

@media (max-width: 760px) {
    .org-branches {
        flex-direction: column;
        gap: var(--space-md);
        padding: var(--org-drop) 0 0 var(--space-xl);
    }

    .org-branches::before {
        display: none;
    }

    .org-node {
        flex: 0 0 auto;
    }

    .org-node::before,
    .org-node:first-child::before,
    .org-node:last-child::before {
        top: 50%;
        left: calc(-1 * var(--space-xl) / 2);
        right: auto;
        width: calc(var(--space-xl) / 2);
        height: 2px;
    }

    .org-node:only-child::before {
        display: block;
    }

    .org-node::after {
        top: calc(-1 * var(--space-md));
        bottom: 0;
        left: calc(-1 * var(--space-xl) / 2 - 1px);
        height: auto;
    }

    .org-node:first-child::after {
        top: calc(-1 * var(--org-drop));
    }

    .org-node:last-child::after {
        bottom: calc(50% - 2px);
    }
}

.download-box {
    max-width: 640px;
    padding: var(--space-xl);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.download-status {
    margin: var(--space-sm) 0 var(--space-lg);
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.85rem;
}

.tutorial-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: step;
    display: grid;
    gap: var(--space-2xl);
}

.tutorial-step {
    counter-increment: step;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: var(--space-xl);
    align-items: center;
}

.tutorial-step h3::before {
    content: counter(step) ". ";
    color: var(--color-primary-500);
}

.tutorial-step figure {
    margin: 0;
}

.tutorial-step img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(7, 26, 18, 0.12);
}

.tutorial-step-text {
    grid-template-columns: minmax(0, 1fr);
    max-width: 760px;
}

@media (max-width: 860px) {
    .tutorial-step {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-md);
    }
}
