/* Home page — Structured Personal Lab / D3 */

.home-page {
    --home-bg: #f1f2ed;
    --home-paper: #ffffff;
    --home-ink: #20231c;
    --home-body: #55584f;
    --home-muted: #777b70;
    --home-line: #cfd2c7;
    --home-line-soft: #e1e3dc;
    --home-accent: #e8a11a;
    --home-dark: #23251d;
    --home-yellow: #fbf3ce;
    --home-blue: #e6eef6;
    --home-green: #e4f0e7;
    --home-lilac: #eee8f5;

    max-width: none;
    margin: 0;
    padding: 0;
    background: var(--home-bg);
    color: var(--home-ink);
    font-size: 16px;
}

.home-page a {
    color: inherit;
}

.home-page a:hover {
    text-decoration: none;
}

.home-shell {
    width: min(100% - 24px, 1080px);
    margin: 0 auto;
}

.home-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(207, 210, 199, 0.88);
    background: rgba(241, 242, 237, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.home-topbar-inner {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.home-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.home-brand-mark {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--home-accent);
    box-shadow: 0 0 0 4px rgba(232, 161, 26, 0.14);
}

.home-nav {
    margin: 0;
}

.home-nav ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-nav a {
    color: var(--home-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.home-nav a:hover {
    color: var(--home-ink);
}

.home-hero {
    position: relative;
    padding: 54px 0 28px;
    overflow: hidden;
}

.home-path,
.home-label,
.home-card-label,
.home-item-type,
.home-experiment-tag {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.home-path {
    margin-bottom: 12px;
    color: var(--home-muted);
    font-size: 0.68rem;
    text-transform: none;
}

.home-hero h1 {
    max-width: 720px;
    margin: 0 88px 14px 0;
    padding: 0;
    border: 0;
    color: var(--home-ink);
    font-size: clamp(2.35rem, 9vw, 5.4rem);
    font-weight: 760;
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.home-hero-copy {
    max-width: 650px;
    margin: 0 84px 20px 0;
    color: var(--home-body);
    font-size: 0.96rem;
    line-height: 1.75;
}

.home-orbit {
    position: absolute;
    top: 56px;
    right: 6px;
    width: 66px;
    height: 66px;
    border: 1px solid #9ba096;
    border-radius: 50%;
    transform: rotate(-10deg);
    pointer-events: none;
}

.home-orbit::before,
.home-orbit::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
}

.home-orbit::before {
    width: 9px;
    height: 9px;
    margin: -4.5px;
    background: var(--home-dark);
    animation: home-orbit-a 6s linear infinite;
}

.home-orbit::after {
    width: 7px;
    height: 7px;
    margin: -3.5px;
    background: var(--home-accent);
    animation: home-orbit-b 8s linear infinite;
}

/* Matching endpoints keep infinite iterations visually continuous. */
@keyframes home-orbit-a {
    from { transform: rotate(0deg) translateX(32px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(32px) rotate(-360deg); }
}

@keyframes home-orbit-b {
    from { transform: rotate(180deg) translateX(25px) rotate(-180deg); }
    to { transform: rotate(-180deg) translateX(25px) rotate(180deg); }
}

.home-filters {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin: 0;
    padding: 0 0 4px;
    list-style: none;
    scrollbar-width: none;
}

.home-filters::-webkit-scrollbar {
    display: none;
}

.home-filters a {
    display: inline-flex;
    white-space: nowrap;
    border: 1px solid var(--home-line);
    border-radius: 999px;
    background: rgba(255,255,255,0.64);
    padding: 7px 10px;
    color: var(--home-body);
    font-size: 0.72rem;
    font-weight: 650;
    text-decoration: none;
}

.home-filters li:first-child a {
    border-color: var(--home-dark);
    background: var(--home-dark);
    color: #fff;
}

.home-page main {
    padding: 4px 0 18px;
}

.home-section {
    margin: 0 0 30px;
}

.home-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 0 2px 10px;
}

.home-section-head h2 {
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--home-ink);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.3;
}

.home-section-head p {
    margin: 0;
    color: #85887e;
    font-size: 0.68rem;
    line-height: 1.4;
}

.home-collection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.home-collection-card {
    position: relative;
    min-height: 142px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 11px;
    padding: 13px;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.home-collection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(31, 34, 27, 0.08);
}

.home-collection-card.knowledge { background: var(--home-yellow); }
.home-collection-card.learning { background: var(--home-blue); }
.home-collection-card.tools { background: var(--home-green); }
.home-collection-card.projects { background: var(--home-lilac); }

.home-card-label {
    position: absolute;
    top: 13px;
    left: 13px;
    color: #71746c;
    font-size: 0.58rem;
    font-weight: 750;
}

.home-collection-card strong {
    display: block;
    margin-bottom: 4px;
    color: var(--home-ink);
    font-size: 0.98rem;
    line-height: 1.35;
}

.home-collection-card p {
    margin: 0;
    color: #5d6058;
    font-size: 0.76rem;
    line-height: 1.55;
}

.home-resource-list {
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 11px;
    background: var(--home-paper);
}

.home-resource-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    border-bottom: 1px solid var(--home-line-soft);
    text-decoration: none;
}

.home-resource-item:last-child {
    border-bottom: 0;
}

.home-resource-item:hover {
    background: #fafaf7;
}

.home-resource-item strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.home-resource-item small {
    display: block;
    color: var(--home-body);
    font-size: 0.7rem;
    line-height: 1.45;
}

.home-item-type {
    color: #83867d;
    font-size: 0.57rem;
    white-space: nowrap;
}

.home-experiment {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin-top: 9px;
    border-radius: 11px;
    background: var(--home-dark);
    padding: 16px;
    color: #fff;
    text-decoration: none;
}

.home-experiment:hover {
    background: #2b2e26;
}

.home-experiment-tag {
    color: #efbd55;
    font-size: 0.58rem;
}

.home-experiment strong {
    display: block;
    margin: 5px 0 4px;
    font-size: 0.96rem;
}

.home-experiment p {
    margin: 0;
    color: #c8cbc3;
    font-size: 0.73rem;
    line-height: 1.55;
}

.home-experiment-arrow {
    color: #efbd55;
    font-size: 1.35rem;
}

.home-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
}

.home-detail-card {
    border: 1px solid var(--home-line);
    border-radius: 11px;
    background: var(--home-paper);
    padding: 15px;
}

.home-detail-card h3 {
    margin: 0 0 8px;
    color: var(--home-ink);
    font-size: 0.95rem;
    line-height: 1.4;
}

.home-detail-card p {
    margin: 0 0 11px;
    color: var(--home-body);
    font-size: 0.78rem;
    line-height: 1.65;
}

.home-detail-card a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--home-ink);
    font-size: 0.76rem;
    font-weight: 750;
    text-decoration: none;
}

.home-detail-card a::after {
    content: "↗";
    color: var(--home-accent);
}

.home-tool-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.home-tool-card {
    display: block;
    border: 1px solid var(--home-line);
    border-radius: 10px;
    background: var(--home-paper);
    padding: 13px 14px;
    text-decoration: none;
    transition: border-color 160ms ease, transform 160ms ease;
}

.home-tool-card:hover {
    border-color: #aeb2a6;
    transform: translateY(-1px);
}

.home-tool-card .home-label {
    display: block;
    margin-bottom: 5px;
    color: #81857a;
    font-size: 0.55rem;
}

.home-tool-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.84rem;
    line-height: 1.4;
}

.home-tool-card p {
    margin: 0;
    color: var(--home-body);
    font-size: 0.72rem;
    line-height: 1.55;
}

.home-project-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--home-line);
    border-radius: 11px;
    background: var(--home-paper);
    padding: 16px;
}

.home-project-card .home-label {
    color: #81857a;
    font-size: 0.58rem;
}

.home-project-card h3 {
    margin: 0;
    color: var(--home-ink);
    font-size: 1.1rem;
}

.home-project-card p {
    margin: 0;
    color: var(--home-body);
    font-size: 0.78rem;
    line-height: 1.65;
}

.home-project-link {
    width: fit-content;
    border-radius: 999px;
    background: var(--home-dark);
    padding: 8px 11px;
    color: #fff !important;
    font-size: 0.72rem;
    font-weight: 750;
    text-decoration: none;
}

.home-footer {
    margin: 38px 0 0;
    padding: 22px 0 30px;
    border-top: 1px solid var(--home-line);
    color: var(--home-muted);
    font-size: 0.72rem;
    text-align: left;
}

.home-footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 24px;
}

.home-footer p {
    margin: 0;
    color: var(--home-muted);
}

.home-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

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

.home-footer a:hover {
    color: var(--home-ink);
}

@media (min-width: 720px) {
    .home-shell {
        width: min(100% - 48px, 1080px);
    }

    .home-topbar-inner {
        min-height: 60px;
    }

    .home-nav ul {
        gap: 20px;
    }

    .home-nav a {
        font-size: 0.72rem;
    }

    .home-hero {
        padding: 88px 0 42px;
    }

    .home-hero-copy {
        font-size: 1.04rem;
    }

    .home-orbit {
        top: 82px;
        right: 32px;
        width: 86px;
        height: 86px;
    }

    @keyframes home-orbit-a {
        from { transform: rotate(0deg) translateX(42px) rotate(0deg); }
        to { transform: rotate(360deg) translateX(42px) rotate(-360deg); }
    }

    @keyframes home-orbit-b {
        from { transform: rotate(180deg) translateX(32px) rotate(-180deg); }
        to { transform: rotate(-180deg) translateX(32px) rotate(180deg); }
    }

    .home-collection-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .home-collection-card {
        min-height: 172px;
    }

    .home-detail-grid,
    .home-tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-project-card {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .home-project-card .home-label,
    .home-project-card h3,
    .home-project-card p {
        grid-column: 1;
    }

    .home-project-link {
        grid-column: 2;
        grid-row: 1 / span 3;
    }
}

@media (max-width: 520px) {
    .home-nav li:nth-child(2),
    .home-nav li:nth-child(3) {
        display: none;
    }

    .home-hero h1 {
        margin-right: 72px;
    }

    .home-hero-copy {
        margin-right: 0;
    }

    .home-resource-item {
        align-items: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page *,
    .home-page *::before,
    .home-page *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}