/* Home page. Same language as the rest of the site: bone paper, forest ink, one green accent, thin lines.
   Loaded on the home page only. No build step: edit and reload. */

/* Text links are easy to hit with a thumb: the clickable area is at least 44 px tall. */
.home-actions-link, .home-head--row .text-link, .designer-head .text-link, .home-feature .text-link, .home-closing .text-link, .home-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

/* The link to the demo: only the words are underlined; the arrow is an icon, spaced from them, that nudges on hover. */
.home-link { gap: 8px; font-size: .9375rem; font-weight: 600; text-decoration: none; }
.home-link-text { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.home-link:hover .home-link-text { text-decoration-color: var(--accent); }
.home-link-icon { flex: none; transition: transform .15s ease; }
.home-link:hover .home-link-icon { transform: translateY(3px); }

/* ── Hero ────────────────────────────────────────────────────── */

/* Two equal halves with room above and below, so the live design on the right can be large. */
.home-hero { padding-block: clamp(56px, 7vw, 104px) clamp(52px, 6.5vw, 96px); }
.home-hero .hero-grid:not(.hero-grid--solo) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 72px); }
.home-hero .hero-text { gap: clamp(16px, 1.8vw, 24px); }
.home-hero h1 { max-width: 15em; font-size: clamp(1.875rem, 1rem + 2.2vw, 2.75rem); }

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-strong);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.home-eyebrow--light { color: #a9d8bd; }

.home-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 0; }
.home-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin: 0;
    padding: 0;
    color: var(--ink-2);
    font-size: .9375rem;
    font-weight: 500;
    list-style: none;
}
.home-facts li { position: relative; padding-left: 20px; }
.home-facts li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: .42em;
    width: 11px;
    height: 6px;
    border-left: 2px solid var(--accent-strong);
    border-bottom: 2px solid var(--accent-strong);
    transform: rotate(-45deg);
}

/* The hero's picture: a real public design with its own controls, the same live personalizer as the design's page. */
.hero-grid--solo { grid-template-columns: minmax(0, 1fr); }
.hero-visual {
    /* The picture fills the card's width, level with the fields below it; this only stops a very tall design from growing without limit. */
    --stage-h: 760px;
    justify-self: end;
    align-self: center;
    width: min(100%, 600px);
    padding: clamp(20px, 2.4vw, 32px);
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper-2);
}
/* The reset button exists for the personalizer script; the hero never shows it. */
.hero-visual [data-personalizer-reset] { display: none; }
/* The picture is as wide as the card (flush with the fields) unless its shape would make it taller than --stage-h; the fields sit two to a row. */
.hero-visual .personalizer-stage { width: min(100%, calc(var(--stage-h) * var(--design-w, 1) / var(--design-h, 1))); margin-inline: auto; }
.hero-visual .personalizer-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin-top: 16px; }
.hero-visual .personalizer-form > *:not(.personalizer-field), .hero-visual .personalizer-field:has(.personalizer-thumbs), .hero-visual .personalizer-field:has(.personalizer-image-filters), .hero-visual .personalizer-field:has(.personalizer-style), .hero-visual .personalizer-field:has(textarea[rows="3"]) { grid-column: 1 / -1; }
.hero-visual .personalizer-form textarea.personalizer-text { min-height: 44px; padding: 10px 12px; }
.hero-visual .personalizer-field-heading { margin-bottom: 5px; }
/* Background choices: one tile per column across the whole card, four to a row, instead of a small loose row. */
.hero-visual .personalizer-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-height: none; overflow: visible; padding: 0; }
.hero-visual .personalizer-thumb { width: auto; height: auto; aspect-ratio: 5 / 4; padding: 8px; }
/* The chosen tile's ring is drawn inside the tile, so the row stays flush with the fields above it; the field's legend has no browser indent. */
.hero-visual .personalizer-thumb[aria-pressed="true"] { outline-offset: -2px; }
.hero-visual .personalizer-field legend { padding: 0; }
/* ── The live demo ───────────────────────────────────────────── */

.designer-head { align-items: flex-end; }
.designer-lede { margin-top: 6px; max-width: 40rem; color: var(--ink-2); font-size: 1rem; line-height: 1.5; text-wrap: pretty; }
/* The product itself is a composition (design-products.css, `is-showcase`: the picture large on the left, its name, colors and the second form of the hero's
   design on the right, which stays in view while the tall picture scrolls). Here: the section starts level with its heading, and the form sits under a hairline. */
.designer .design-products { margin-top: 0; }
.designer-form { align-content: start; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }

/* ── Sections ────────────────────────────────────────────────── */

.home-section { padding-block: clamp(56px, 7vw, 104px); }
.home-section--tint { background: var(--paper-2); }

.home-head { max-width: 46rem; margin-bottom: clamp(28px, 3.4vw, 44px); }
.home-head h2 { font-size: clamp(1.5rem, 1.15rem + 1.1vw, 2.125rem); font-weight: 750; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.home-head p { margin-top: 10px; color: var(--ink-2); line-height: 1.55; text-wrap: pretty; }
.home-head--row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; max-width: none; }
.home-head--row > div { max-width: 46rem; }

/* How it works */
.home-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px clamp(24px, 3vw, 44px); margin: 0; padding: 0; list-style: none; counter-reset: home-step; }
.home-step { padding-top: 18px; border-top: 2px solid var(--ink); counter-increment: home-step; }
.home-step::before {
    content: counter(home-step, decimal-leading-zero);
    display: block;
    margin-bottom: 14px;
    color: var(--accent-strong);
    font-size: .875rem;
    font-weight: 750;
    letter-spacing: .06em;
}
.home-step h3 { font-size: 1.25rem; font-weight: 700; font-stretch: 105%; letter-spacing: -.01em; }
.home-step p { margin-top: 8px; max-width: 26em; color: var(--ink-2); font-size: .9688rem; line-height: 1.55; }

/* Capabilities */
.home-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.home-feature {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: clamp(20px, 2.2vw, 28px);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    transition: border-color .15s;
}
.home-feature:hover { border-color: var(--line-strong); }
.home-feature-icon { margin-bottom: 8px; color: var(--accent-strong); }
.home-feature h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; }
.home-feature p { color: var(--ink-2); font-size: .9688rem; line-height: 1.5; }
.home-feature .text-link { margin-top: auto; padding-top: 6px; }

/* Design library teaser: the cards are the library's own */
/* As many columns as there are cards (up to four), so the row fills the width; a short row stays card-sized. */
.home-designs { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); max-width: calc(var(--cols, 4) * 380px + (var(--cols, 4) - 1) * 24px); }
.home-designs .design-card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
/* A long name is cut to one line (the full name is in the tooltip and the link's label), so every card keeps the same height. */
.home-designs .design-meta { min-width: 0; }
.home-designs .design-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-designs .design-type { color: var(--ink-2); font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.home-designs .design-card { transition: border-color .15s, transform .15s; }
.home-designs .design-card:hover { border-color: var(--ink); transform: translateY(-2px); }

/* AI design builder */
.btn-paper { border-color: var(--paper); background: var(--paper); color: var(--ink); }
.btn-paper:hover { border-color: #fff; background: #fff; }

.home-ai { padding-block: clamp(56px, 7vw, 96px); background: var(--deep); color: var(--paper); }
.home-ai-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.home-ai h2 { margin-top: 14px; font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem); font-weight: 780; line-height: 1.08; letter-spacing: -.026em; text-wrap: balance; }
.home-ai-text > p:not(.home-eyebrow):not(.home-ai-actions) { margin-top: 16px; max-width: 34em; color: rgba(239, 240, 232, .82); line-height: 1.55; text-wrap: pretty; }
.home-ai-actions { margin-top: 28px; }

.home-looks { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.home-looks li { position: relative; overflow: hidden; border-radius: 12px; background: var(--paper); }
.home-looks img { width: 100%; height: auto; }
.home-looks span {
    position: absolute;
    left: 12px;
    bottom: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(15, 26, 20, .78);
    color: var(--paper);
    font-size: .75rem;
    font-weight: 650;
}

/* Integrations */
.home-integrations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px clamp(24px, 4vw, 64px); }
.home-integration-group h3 { padding-bottom: 12px; border-bottom: 2px solid var(--ink); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.home-integration-group ul { margin: 0; padding: 0; list-style: none; }
.home-integration-group:only-child { grid-column: 1 / -1; }
.home-integration-group:only-child ul { columns: 2; column-gap: clamp(24px, 4vw, 64px); }
.home-integration-group:only-child li { break-inside: avoid; }
.home-integration-group li { padding-block: 16px; border-bottom: 1px solid var(--line); }
.home-integration-name { display: flex; align-items: center; gap: 10px; font-size: 1.0625rem; font-weight: 700; }
.home-integration-text { margin-top: 4px; color: var(--ink-2); font-size: .9688rem; line-height: 1.45; }

/* Pricing */
.home-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, .9fr); gap: 20px; align-items: stretch; }
.home-plan-aside { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; padding: clamp(8px, 1.4vw, 24px) 0 clamp(8px, 1.4vw, 24px) clamp(8px, 2vw, 32px); }
.home-plan-aside h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.home-plan-aside p { color: var(--ink-2); line-height: 1.5; text-wrap: pretty; }
.home-plan { padding: clamp(22px, 2.6vw, 32px); border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); }
.home-plan h3 { font-size: 1.125rem; font-weight: 700; }
.home-plan-price { margin-top: 10px; color: var(--ink-2); font-size: 1rem; }
.home-plan-price strong { color: var(--ink); font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.home-plan-note { margin-top: 6px; min-height: 2.9em; color: var(--ink-2); font-size: .9375rem; line-height: 1.45; }
.home-plan ul { display: grid; gap: 8px; margin: 18px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); list-style: none; font-weight: 500; }
.home-plan li { position: relative; padding-left: 24px; }
.home-plan li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: .42em;
    width: 11px;
    height: 6px;
    border-left: 2px solid var(--accent-strong);
    border-bottom: 2px solid var(--accent-strong);
    transform: rotate(-45deg);
}

/* Closing call to action */
.home-closing { padding-block: clamp(48px, 6vw, 88px); border-top: 1px solid var(--line); }
.home-closing-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; }
.home-closing h2 { font-size: clamp(1.625rem, 1.2rem + 1.5vw, 2.5rem); font-weight: 780; line-height: 1.1; letter-spacing: -.024em; text-wrap: balance; }
.home-closing p:not(.home-actions) { margin-top: 8px; color: var(--ink-2); }

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .home-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-plan-aside { grid-column: 1 / -1; padding: 8px 0 0; }
}
@media (max-width: 900px) {
    /* Stacked: the text first, then the card at the width of the screen (up to 560 px), the picture level with its fields. */
    .home-hero .hero-grid:not(.hero-grid--solo) { grid-template-columns: minmax(0, 1fr); }
    .hero-visual { justify-self: start; width: 100%; max-width: 560px; }
}
@media (max-width: 380px) {
    .hero-visual .personalizer-form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
    .home-steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .home-ai-grid { grid-template-columns: minmax(0, 1fr); }
    .home-looks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .designer-head { align-items: flex-start; }
}
@media (max-width: 960px) {
    .home-designs { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
}
@media (max-width: 720px) {
    .home-integrations { grid-template-columns: minmax(0, 1fr); }
    .home-integration-group:only-child ul { columns: 1; }
    .home-plans { grid-template-columns: minmax(0, 1fr); }
    .home-looks { grid-template-columns: minmax(0, 1fr); }
    .home-designs { gap: 14px; }
    .home-designs .design-thumb img { padding: 8px; }
    .home-designs .design-meta { padding: 10px 12px 12px; }
    .home-designs .design-name { font-size: .9375rem; }
}
@media (max-width: 600px) {
    .home-features { grid-template-columns: minmax(0, 1fr); }
    .home-actions .btn { flex: 1 1 100%; }
    .home-actions-link { margin-inline: auto; }
    .home-closing-row { align-items: stretch; }
    .home-plan-note { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .home-link-icon { transition: none; }
    .home-link:hover .home-link-icon { transform: none; }
    .home-designs .design-card, .home-feature { transition: none; }
    .home-designs .design-card:hover { transform: none; }
}
