/* Homepage sections. Tokens, header, buttons and footer are shared (locus.css, site.css). */

.home-wrap { max-width: 1360px; margin: 0 auto; padding: 0 40px; }

.home-heading {
    margin: 0;
    font: 500 clamp(2.4rem, 5.2vw, 4.8rem)/1 var(--font-heading);
    font-stretch: 115%;
    letter-spacing: -0.025em;
    color: var(--text-color);
}

.home-intro { margin: 0; max-width: 34rem; font-size: 1.08rem; color: var(--text-muted); }

/* ---- Hero: the drawing sheet ----------------------------------------------- */

.home-hero { padding-top: 72px; padding-bottom: 104px; }

.home-title {
    margin: 0;
    font: 500 clamp(2.6rem, 8.4vw, 7.8rem)/0.96 var(--font-heading);
    font-stretch: 115%;
    letter-spacing: -0.03em;
    color: var(--text-color);
}

.home-title span { display: block; }

.home-hero-body {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 48px;
    align-items: start;
    margin-top: 56px;
}

.home-lead { margin: 8px 0 28px; font-size: 1.2rem; line-height: 1.5; color: var(--text-color); }
.home-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.home-hint { font-size: 0.94rem; color: var(--text-muted); }

/* The sheet: editor beside the object, a row of controls, a title block. */
.home-sheet { margin: 0; background: var(--surface); border: 1px solid var(--border-color); }

.home-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    height: min(540px, 68vh);
    min-height: 420px;
}

.home-panel { position: relative; min-width: 0; min-height: 0; }
.home-panel + .home-panel { border-left: 1px solid var(--border-color); }

/* Absolutely placed so the canvas never sizes its own panel: the renderer resizes on
   panel changes, and an in-flow canvas would feed that back into the row height. */
.home-profile,
.home-view { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.home-profile { touch-action: none; }

.home-stage.no-webgl .home-view { display: none; }
.home-stage.no-webgl .home-object::after {
    content: 'Your browser could not start 3D here, but the silhouette still works.';
    position: absolute;
    inset: auto 24px 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.home-profile .axis { stroke: var(--construction); stroke-width: 0.75; stroke-dasharray: 14 4 2 4; }
.home-profile .ground { stroke: var(--border-color); stroke-width: 1; }
.home-profile .mirror { fill: none; stroke: var(--text-color); stroke-opacity: 0.28; stroke-width: 1; stroke-dasharray: 3 3; }
.home-profile .dim { fill: none; stroke: var(--construction); stroke-width: 0.7; }
.home-profile .dim-text { font: 400 11px var(--font-mono); fill: var(--text-color); }
.home-profile .outline { fill: none; stroke: var(--pen); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.home-profile .handle { cursor: grab; outline: none; }
.home-profile .handle:active { cursor: grabbing; }
.home-profile .handle .hit { fill: transparent; }
.home-profile .handle .dot { fill: var(--surface); stroke: var(--pen); stroke-width: 1.75; transition: r 0.15s; }
.home-profile .handle:hover .dot,
.home-profile .handle:focus-visible .dot { r: 7; }
.home-profile .handle:focus-visible .dot { fill: var(--pen); }
.home-profile .handle .pulse { fill: var(--pen); fill-opacity: 0.12; stroke: none; opacity: 0; }
.home-profile .handle.hint .dot { fill: var(--pen); }
.home-profile .handle.hint .pulse { animation: home-pulse 2.4s ease-out infinite; }

@keyframes home-pulse {
    0% { r: 6; opacity: 1; }
    100% { r: 22; opacity: 0; }
}

.home-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
}

.home-chips { display: flex; flex-wrap: wrap; }

.home-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px;
    margin: 0 -1px -1px 0;
    border: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    font: 400 0.86rem var(--font-body);
    cursor: pointer;
    transition: background var(--motion-duration), color var(--motion-duration);
}

.home-chip:hover { color: var(--text-color); background: var(--hover-bg); }
.home-chip[aria-pressed='true'] { position: relative; z-index: 1; background: var(--text-color); border-color: var(--text-color); color: var(--surface); }
.home-swatch { width: 10px; height: 10px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }

/* Title block: what the drawing shows. */
.home-titleblock { display: flex; flex-wrap: wrap; margin: 0; border-top: 1px solid var(--border-color); font-size: 0.82rem; line-height: 1.35; }
.home-titleblock > div { flex: 1 1 140px; padding: 11px 16px; border-right: 1px solid var(--border-color); }
.home-titleblock > div:last-child { flex: 2 1 220px; border-right: 0; }
.home-titleblock dt { color: var(--text-muted); }
.home-titleblock dd { margin: 0; color: var(--text-color); }
.home-titleblock .mono { font-family: var(--font-mono); }

/* ---- How it works: three drawings in one ruled row -------------------------- */

.home-how { padding-top: 104px; padding-bottom: 104px; border-top: 1px solid var(--border-color); }
.home-how-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 64px; margin-bottom: 64px; }
.home-how-head .home-heading { max-width: 17ch; }

.home-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.home-step { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 32px 32px 36px; }
.home-step + .home-step { border-left: 1px solid var(--border-color); }
.home-step:first-child { padding-left: 0; }
.home-step:last-child { padding-right: 0; }

/* The drawing is absolutely placed so it never sizes its column: WebKit (every iOS browser)
   otherwise lets the viewBox-only SVG inflate the aspect-ratio box and widen the column. */
.home-step-art { position: relative; height: 220px; margin-bottom: 18px; color: var(--construction); }
.home-step-art svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.home-step-art .ink { stroke: var(--text-color); }
.home-step-art .pen { stroke: var(--pen); }
.home-step-art .pen-fill { fill: var(--pen); }
.home-step-art .knot { fill: var(--page-bg); stroke: var(--pen); }
.home-step-art text { font: 400 11px var(--font-mono); fill: var(--text-muted); }

.home-step h3 { margin: 0; font-size: 1.2rem; font-weight: 500; color: var(--text-color); }
.home-step p { margin: 0; color: var(--text-muted); }

.home-formats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; margin: 28px 0 0; color: var(--text-muted); font-size: 0.94rem; }
.home-formats ul { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font: 400 0.88rem var(--font-mono); color: var(--text-color); }

/* ---- Who it is for: two plain columns under a rule ------------------------- */

.home-who { padding-top: 0; padding-bottom: 104px; }
.home-who-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px 64px; }
.home-who .home-heading { font-size: clamp(2rem, 3.6vw, 3.2rem); max-width: 16ch; }
.home-audiences { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.home-audience { padding-top: 20px; border-top: 1px solid var(--text-color); }
.home-audience-for { margin: 0 0 10px; font-size: 0.94rem; color: var(--text-muted); }
.home-audience h3 { margin: 0 0 10px; font-size: 1.35rem; font-weight: 500; line-height: 1.25; }
.home-audience p { margin: 0; color: var(--text-muted); }

/* ---- Objects: a ruled specimen grid ---------------------------------------- */

.home-objects { padding-top: 104px; padding-bottom: 112px; border-top: 1px solid var(--border-color); }
.home-objects-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 64px; align-items: end; margin-bottom: 56px; }

.home-collection {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
}

.home-piece { margin: 0; border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.home-piece-frame { position: relative; aspect-ratio: 5 / 6; overflow: hidden; }

.home-piece-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s var(--motion-ease);
}

.home-piece-frame img.is-ready { opacity: 1; }
.home-piece figcaption { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px 18px; border-top: 1px solid var(--border-color); }
.home-piece-name { font-weight: 500; color: var(--text-color); }
.home-piece-meta { font-size: 0.9rem; color: var(--text-muted); }
.home-piece-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.home-piece-size { font: 400 0.8rem var(--font-mono); color: var(--text-color); white-space: nowrap; text-align: right; }
.home-piece-download { font: 400 0.8rem var(--font-mono); color: var(--accent); white-space: nowrap; text-underline-offset: 3px; }
.home-piece-download:hover { color: var(--accent-hover); }
.home-collection-note { margin: 24px 0 0; max-width: 44rem; font-size: 0.94rem; color: var(--text-muted); }

/* ---- Prove: the viewport --------------------------------------------------- */

.home-prove { padding-top: 112px; padding-bottom: 104px; }
.home-prove-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 64px; }
.home-prove-head .home-heading { max-width: 12ch; }
.home-prove-head .home-intro { flex: 0 1 30rem; }

.home-proofs {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 1px;
    margin-top: 72px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
}

.home-proof { margin: 0; padding: 40px; background: var(--page-bg); display: flex; flex-direction: column; gap: 28px; }
.home-proof svg { display: block; width: 100%; height: auto; margin: 0 auto; }
.home-proof-curvature svg { max-width: 420px; }
.home-proof-wall svg { max-width: 290px; }
.home-proof-side { display: grid; gap: 1px; grid-template-rows: auto auto; }
.home-proof figcaption { display: flex; flex-direction: column; gap: 6px; max-width: 32rem; }
.home-proof-title { margin: 0; font-size: 1.05rem; font-weight: 500; color: var(--text-color); }
.home-proof-text { margin: 0; color: var(--text-muted); }

.home-proof .axis { fill: none; stroke: var(--construction); stroke-width: 0.75; stroke-dasharray: 14 4 2 4; }
.home-proof .ghost { fill: none; stroke: var(--text-color); stroke-opacity: 0.22; stroke-width: 1; stroke-dasharray: 3 3; }
.home-proof .line { fill: none; stroke: var(--text-color); stroke-width: 1.5; }
.home-proof .comb { fill: none; stroke: var(--pen); stroke-width: 0.75; stroke-opacity: 0.75; }
.home-proof .envelope { fill: none; stroke: var(--pen); stroke-width: 1.5; }
.home-proof .hatch { stroke: var(--text-muted); stroke-width: 0.8; }
.home-proof .wall { fill: url(#home-hatch); stroke: var(--text-color); stroke-width: 1.1; }
.home-proof .lead { fill: none; stroke: var(--text-muted); stroke-width: 0.75; }
.home-proof .note { font: 400 11px var(--font-mono); fill: var(--text-muted); }

.home-checks { margin: 0; border-collapse: collapse; width: 100%; font-size: 0.96rem; }
.home-checks tr { border-top: 1px solid var(--border-color); }
.home-checks tr:last-child { border-bottom: 1px solid var(--border-color); }
.home-checks th { width: 32%; padding: 11px 16px 11px 0; text-align: left; font-weight: 400; color: var(--text-muted); }
.home-checks td { padding: 11px 0; color: var(--text-color); }
.home-checks .mono { font: 400 0.84rem var(--font-mono); word-spacing: 0.6em; }

.home-prove-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 40px; margin-top: 36px; }
.home-prove-foot p { margin: 0; color: var(--text-muted); font-size: 0.96rem; }

.home-more { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text-color); text-underline-offset: 4px; }
.home-more:hover { color: var(--accent); }

/* ---- Closing ask, still in the viewport ----------------------------------- */

.home-ask { padding-top: 96px; padding-bottom: 120px; border-top: 1px solid var(--border-color); }
.home-ask-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px 64px; align-items: end; }
.home-ask-body { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }
.home-ask-body p { margin: 0; color: var(--text-muted); font-size: 1.08rem; }

/* ---- Smaller screens -------------------------------------------------------- */

@media (max-width: 1024px) {
    .home-hero-body,
    .home-who-grid,
    .home-objects-head,
    .home-ask-grid { grid-template-columns: minmax(0, 1fr); }
    .home-hero-body { gap: 32px; }
    .home-lead { max-width: 36rem; }
    .home-proofs { grid-template-columns: minmax(0, 1fr); }
    .home-collection { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .home-wrap { padding: 0 20px; }
    .home-hero { padding-top: 40px; padding-bottom: 72px; }
    .home-hero-body { margin-top: 36px; }
    .home-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: 300px 300px; height: auto; min-height: 0; }
    .home-panel + .home-panel { border-left: 0; border-top: 1px solid var(--border-color); }
    .home-steps { grid-template-columns: minmax(0, 1fr); }
    .home-step,
    .home-step:first-child,
    .home-step:last-child { padding: 28px 0; }
    .home-step + .home-step { border-left: 0; border-top: 1px solid var(--border-color); }
    .home-step-art { max-width: 360px; }
    .home-audiences { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .home-how, .home-objects, .home-prove { padding-top: 72px; padding-bottom: 72px; }
    .home-who { padding-bottom: 72px; }
    .home-how-head { margin-bottom: 40px; }
    .home-proofs { margin-top: 48px; }
    .home-proof { padding: 28px 20px; }
    .home-ask { padding-top: 72px; padding-bottom: 88px; }
}

@media (max-width: 560px) {
    .home-collection { grid-template-columns: minmax(0, 1fr); }
    .home-piece figcaption { flex-direction: column; gap: 4px; }
    .home-piece-side { align-items: flex-start; }
    .home-piece-size { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    .home-profile .handle.hint .pulse { animation: none; }
    .home-piece-frame img { transition: none; }
}
