/* Homepage v2: local progressive enhancement and the Agent Trace Lab. */

/* Shared visual language with /blog/: same ink, violet, cyan and reading width. */
html, body {
    background: #151020;
    color: #f7f3ff;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body {
    background:
        radial-gradient(circle at 12% 8%, rgba(139, 92, 246, .15), transparent 27rem),
        radial-gradient(circle at 88% 32%, rgba(117, 230, 218, .08), transparent 25rem),
        #151020;
}
.main-container { width: min(1180px, calc(100vw - 40px)); margin-inline: auto; }

.skip-link {
    position: fixed;
    left: 1rem;
    top: 1rem;
    z-index: 300;
    padding: 0.7rem 1rem;
    border-radius: 0.8rem;
    background: #fff;
    color: #25163f;
    font-weight: 700;
    transform: translateY(-160%);
    transition: transform 0.2s ease;
}

.skip-link:focus { transform: translateY(0); }

a:focus-visible,
button:focus-visible {
    outline: 3px solid #d5c3ff;
    outline-offset: 4px;
}

/* Align with the visible content inside the 1280px container's 24px gutters.
   It stays visually centered because it is intentionally excluded from
   the transform-based content reveal animation. */
.cyber-nav {
    width: min(calc(100% - 3rem), 1232px);
    min-height: 64px;
    justify-content: space-between;
    gap: clamp(1rem, 2.4vw, 2rem);
    padding: 0.62rem 0.72rem 0.62rem 1rem;
    border-radius: 1.3rem;
    background: linear-gradient(115deg, rgba(71, 48, 108, 0.86), rgba(37, 27, 69, 0.82));
    box-shadow: 0 18px 55px rgba(7, 3, 20, 0.24), inset 0 1px rgba(255, 255, 255, 0.08);
    transition: top 0.24s ease, background 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.cyber-nav.is-scrolled {
    top: 0.75rem;
    background: linear-gradient(115deg, rgba(49, 31, 82, 0.96), rgba(25, 18, 48, 0.94));
    border-color: rgba(171, 136, 255, 0.32);
    box-shadow: 0 16px 42px rgba(7, 3, 20, 0.38), inset 0 1px rgba(255, 255, 255, 0.09);
}

.nav-brand {
    flex: 0 0 auto;
    color: inherit;
    text-decoration: none;
}

.nav-brand:hover .nav-icon { transform: rotate(-7deg) scale(1.04); }

.nav-icon { transition: transform 0.22s ease, box-shadow 0.22s ease; }

.nav-identity { min-width: 0; }

.nav-role {
    margin-top: 0.05rem;
    color: rgba(255, 255, 255, 0.42);
    font-family: "Space Mono", monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    line-height: 1.2;
    text-transform: uppercase;
}

.nav-context {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    min-width: 0;
    color: rgba(255, 255, 255, 0.48);
    font-family: "Space Mono", monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-context__signal {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
}

.nav-context__signal i {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: #66f4b7;
    box-shadow: 0 0 0 4px rgba(102, 244, 183, 0.09), 0 0 16px rgba(102, 244, 183, 0.58);
}

.nav-context__divider {
    width: 1px;
    height: 1.15rem;
    background: rgba(255, 255, 255, 0.12);
}

.nav-links {
    flex: 0 0 auto;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
}

.nav-links .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    padding: 0.7rem 0.75rem;
    border-radius: 0.8rem;
    color: rgba(255, 255, 255, 0.58);
    line-height: 1;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-links .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-1px);
}

.nav-links .nav-link--primary {
    padding-inline: 0.95rem;
    background: linear-gradient(135deg, #8c55ef, #6d36cf);
    color: #fff;
    box-shadow: 0 8px 22px rgba(104, 48, 210, 0.28);
}

.nav-links .nav-link--primary:hover { background: linear-gradient(135deg, #9f6bfa, #7a43df); }
.nav-links .nav-link--project { color: #d8c4ff; border: 1px solid rgba(166,120,255,.35); }
.private-preview-note { display:flex; flex-wrap:wrap; gap:.5rem .85rem; margin:.9rem 0; padding:.8rem 1rem; border:1px solid rgba(117,230,218,.22); border-radius:.8rem; color:#d8d0e7; background:rgba(117,230,218,.06); }
.private-preview-note strong { color:#75e6da; }

.work-item {
    position: relative;
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.work-item:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.075);
    border-color: rgba(190, 157, 255, 0.2);
}

.work-copy { min-width: 0; flex: 1 1 auto; }

.work-arrow {
    align-self: center;
    color: rgba(255, 255, 255, 0.3);
    font-family: "Space Mono", monospace;
    font-size: 0.85rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.work-item:hover .work-arrow { color: #c9adff; transform: translate(2px, -2px); }

.status-dot {
    width: 0.52rem;
    height: 0.52rem;
    border-radius: 50%;
    background: #66f4b7;
    box-shadow: 0 0 0 5px rgba(102, 244, 183, 0.12), 0 0 20px rgba(102, 244, 183, 0.65);
}

.trace-lab {
    display: grid;
    grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.42fr);
    gap: clamp(1.4rem, 3vw, 3rem);
    margin: 2rem 0 2.5rem;
    padding: clamp(1.5rem, 3.4vw, 3rem);
    border: 1px solid rgba(202, 177, 255, 0.22);
    border-radius: 2rem;
    background:
        radial-gradient(circle at 68% 10%, rgba(49, 210, 255, 0.12), transparent 34%),
        linear-gradient(135deg, rgba(13, 10, 31, 0.92), rgba(36, 20, 65, 0.88));
    box-shadow: 0 30px 90px rgba(7, 4, 18, 0.35);
    overflow: clip;
    position: relative;
    isolation: isolate;
    scroll-margin-top: 6.5rem;
}

.trace-lab::before {
    content: "";
    position: absolute;
    width: 18rem;
    height: 18rem;
    left: -8rem;
    bottom: -10rem;
    border-radius: 50%;
    background: rgba(152, 92, 255, 0.18);
    filter: blur(60px);
    z-index: -1;
}

.trace-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.trace-copy h2 {
    margin: 0.55rem 0 0.9rem;
    color: #fff;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.trace-copy > p {
    max-width: 35rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.94rem;
    line-height: 1.75;
}

.trace-pipeline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin: 1.35rem 0 0;
    padding: 0;
    list-style: none;
}

.trace-pipeline li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.72rem 0.78rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.8);
    font-family: "Space Mono", monospace;
    font-size: 0.69rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.trace-pipeline span { color: #8eeaff; }

.trace-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.35rem;
}

.trace-button {
    padding: 0.64rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-family: "Space Mono", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.trace-button:hover { transform: translateY(-2px); color: #fff; }
.trace-button.is-active { background: #8f50ff; border-color: #b88aff; color: #fff; }
.trace-button--reset { margin-left: auto; }

.trace-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin: 1.35rem 0 0;
}

.trace-metrics div {
    min-width: 0;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.trace-metrics dt {
    color: #fff;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
}

.trace-metrics dd {
    margin: 0.2rem 0 0;
    color: rgba(255, 255, 255, 0.42);
    font-family: "Space Mono", monospace;
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.trace-visual {
    min-width: 0;
    align-self: center;
    border: 1px solid rgba(145, 218, 255, 0.16);
    border-radius: 1.5rem;
    background: #0b0919;
    box-shadow: inset 0 0 60px rgba(126, 90, 220, 0.1), 0 24px 60px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.trace-visual__bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.42);
    font-family: "Space Mono", monospace;
    font-size: 0.57rem;
    letter-spacing: 0.08em;
}

.trace-visual__bar span:first-child { color: rgba(255, 255, 255, 0.72); }
.trace-visual__bar i {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    margin-right: 0.45rem;
    border-radius: 50%;
    background: #61f0bb;
    box-shadow: 0 0 12px rgba(97, 240, 187, 0.8);
}

#agent-trace-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 5.2;
    min-height: 300px;
    touch-action: manipulation;
    cursor: crosshair;
}

.trace-hint {
    margin: 0;
    padding: 0.7rem 1rem 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.38);
    font-family: "Space Mono", monospace;
    font-size: 0.6rem;
    text-align: center;
}

.card-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-base.card-base--blog {
    --card-hover: linear-gradient(145deg, #171326, #342064);
    background: linear-gradient(145deg, #0d0c17, #211536);
}

.card-base.card-base--agent {
    --card-hover: linear-gradient(145deg, #482692, #6242b6);
    background: linear-gradient(145deg, #29164f, #55339a);
}

.card-base.card-base--trace {
    --card-hover: linear-gradient(145deg, #07384b, #562c96);
    background: linear-gradient(145deg, #082b3c, #351b67 72%);
}

.card-base.card-base--github {
    --card-hover: linear-gradient(145deg, #263249, #59389a);
    background: linear-gradient(145deg, #111827, #282044);
}

.card-base.card-base--studio {
    --card-hover: linear-gradient(145deg, #3a243d, #4d2b63);
    background: linear-gradient(145deg, #171218, #2b1a30);
}

.card-base.card-base--explore {
    --card-hover: linear-gradient(145deg, #311b62, #7042bd);
    background: linear-gradient(145deg, #151023, #372060);
}

.card-wrapper:hover .card-base { background: var(--card-hover, #6d28d9) !important; }

.card-disabled { opacity: 0.62; }
.card-disabled .card-wrapper { cursor: default; }
.card-disabled .card-anchor { box-shadow: none; }
.card-disabled .card-glass { display: none; }
.card-disabled .card-wrapper:hover .card-base { transform: translateZ(0); }
.card-disabled .card-wrapper:hover .card-content { transform: translateZ(10px); }

.reveal-ready {
    opacity: 0;
    transform: translateY(32px) scale(0.985);
    transition: opacity 0.72s ease, transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-ready.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (max-width: 960px) {
    .nav-context { display: none; }
    .nav-links { display: flex; }
    .trace-lab { grid-template-columns: 1fr; }
    .trace-copy > p { max-width: 48rem; }
}

@media (max-width: 1150px) {
    .nav-context { display: none; }
}

@media (max-width: 600px) {
    .cyber-nav {
        top: 0.75rem;
        width: calc(100% - 1.5rem);
        min-height: 58px;
        gap: 0.5rem;
        padding: 0.5rem 0.55rem 0.5rem 0.7rem;
        border-radius: 1.1rem;
    }
    .nav-icon { width: 32px; height: 32px; font-size: 16px; }
    .nav-title { font-size: 0.94rem; }
    .nav-role { display: none; }
    .nav-links { display: flex; gap: 0.1rem; }
    .nav-links .nav-link { padding: 0.62rem 0.5rem; font-size: 0.875rem; }
    .nav-links .nav-link--github { display: none; }
    .nav-links .nav-link--primary { padding-inline: 0.72rem; }
    .trace-lab { margin-top: 1.25rem; padding: 1.15rem; border-radius: 1.5rem; }
    .trace-copy h2 { font-size: 2.25rem; }
    .trace-pipeline { grid-template-columns: 1fr 1fr; }
    .trace-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .trace-button { width: 100%; }
    .trace-button--reset { margin-left: 0; }
    .trace-metrics { grid-template-columns: 1fr 1fr 1fr; }
    .trace-metrics dt { font-size: 0.78rem; }
    .trace-visual__bar span:last-child { display: none; }
    #agent-trace-canvas { min-height: 230px; }
    .hero-panel .panel-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hero-panel .stat-card { padding: 0.75rem 0.65rem; }
    .hero-panel .stat-value { font-size: 1.05rem; }
    .hero-panel .stat-label { font-size: 0.58rem; }
}

/* Readable type, content-sized cards, and motion controls. */
.hero p, .trace-copy > p { color: #d6cde5; font-size: 1rem; line-height: 1.8; }
.hero .panel-text { font-size: 1rem; max-width: none; }
.hero-topline { font-size: 0.75rem; letter-spacing: 0.035em; flex-wrap: wrap; }
.hero-tag { font-size: 0.875rem; color: #e2d9f0; }
.hero-tags { gap: 0.5rem; margin-top: 1.15rem; }
.hero-card { padding: clamp(1.25rem, 3vw, 2.2rem); }
.hero-avatar { width: 72px; height: 72px; font-size: 32px; animation: none; }
.panel-title, .section-title { font-size: 1.5rem; }
.work-desc, .card-desc { font-size: 1rem; color: #d6cde5; line-height: 1.65; }
.stat-label, .hero-panel .stat-label, .section-kicker, .card-kicker { font-size: 0.75rem; color: #c8b7e4; }
.section-subtitle { font-size: 0.9375rem; color: #d6cde5; }
.nav-role { color: #c8b7e4; }
.nav-links .nav-link { color: #e1d6f2; }
.trace-actions { display: flex; flex-wrap: wrap; }
.trace-button { min-height: 44px; font-size: 0.875rem; color: #e2d9f0; }
.trace-button--reset { margin-left: 0; }
.trace-pipeline li { font-size: 0.8125rem; letter-spacing: 0; text-transform: none; }
.trace-feedback { margin-top: 0.85rem; min-height: 3.2em; color: #d6cde5; font-size: 0.875rem; line-height: 1.6; }
.trace-metrics dd, .trace-hint, .trace-visual__bar { font-size: 0.75rem; color: #bfb2d4; line-height: 1.6; }
.trace-metrics dt, .hero-panel .stat-value { font-size: 1rem; }
.trace-lab.is-paused .trace-visual__bar i { background: #e8c77f; box-shadow: none; }
.trace-visual:focus-within { outline: 3px solid #d5c3ff; outline-offset: 4px; }
.bento-grid { grid-auto-flow: row; }
.card-content { height: auto; min-height: 100%; }
.card-base { position: absolute; }
.bento-grid > a { border-radius: 1.5rem; }
.bento-grid > a:focus-visible { outline-offset: 6px; }
.card-disabled { opacity: 1; }
.card-disabled .card-kicker { color: #f0cf92; }
.hero-tag:hover { transform: none; }
.contact-heading { margin: 3rem auto 1rem; text-align: center; }
.contact-heading h2 { font-size: 1.5rem; color: #fff; }
.contact-heading p { margin-top: 0.65rem; font-size: 1rem; color: #d6cde5; }
.social-links { flex-wrap: wrap; }
.contact-email { color: #e2d9f0; text-underline-offset: 0.3em; overflow-wrap: anywhere; }
footer { font-size: 0.8125rem; }
.main-container { padding-top: max(96px, calc(var(--nav-height, 64px) + 4rem)); }
[id] { scroll-margin-top: calc(var(--nav-height, 64px) + 3rem); }
@media (max-width: 768px) {
    .main-container { padding-top: max(96px, calc(var(--nav-height, 64px) + 2rem)); }
    .cyber-nav { width: calc(100% - 2rem); }
    .hero-card, .hero-panel { min-width: 0; }
    .hero h1 { font-size: clamp(2rem, 8vw, 3rem); overflow-wrap: anywhere; }
    .hero-topline { font-size: 0.75rem; }
    .hero p, .card-desc { font-size: 1rem; }
    .card-content { padding: 1.4rem; }
    .card-row { flex-wrap: wrap; }
    .panel-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .cyber-nav { width: calc(100% - 1.5rem); }
    .trace-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .trace-button--reset { grid-column: 1 / -1; }
    .trace-metrics dt { font-size: 0.875rem; }
    .nav-title { font-size: 0.875rem; }
    .nav-brand { gap: 0.35rem; }
}
@media (max-width: 360px) {
    .nav-icon { display: none; }
    .nav-links .nav-link { padding-inline: 0.35rem; }
    .trace-pipeline { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .cyber-nav { flex-wrap: wrap; }
    .nav-links { flex-shrink: 1; flex-wrap: wrap; }
}
@media (hover: none), (prefers-reduced-motion: reduce) {
    .card-wrapper:hover .card-content { transform: translateZ(10px); }
    .card-wrapper:hover .card-base { transform: none; }
    .card-wrapper:hover .card-glass { opacity: 0; }
    .work-item:hover, .nav-brand:hover .nav-icon { transform: none; }
}

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

    .reveal-ready { opacity: 1; transform: none; }
    #agent-trace-canvas { cursor: default; }
}
/* Section actions remain usable without JavaScript. */
[hidden] { display: none !important; }
.section-jumps { display:flex; gap:.75rem; flex-wrap:wrap; margin:1.5rem 0; }
.section-jumps a, .back-top { color:#e6d7ff; padding:.7rem 1rem; border:1px solid #76628f; border-radius:2rem; text-decoration:none; }
.section-jumps a[aria-current] { background:#643aa1; border-color:#c6a0ff; }
.stat-card { text-decoration:none; color:inherit; }
.stat-card:hover { background:rgba(255,255,255,.12); }
.project-notes { padding:1.2rem; margin-top:1.5rem; border:1px solid #76628f; border-radius:1rem; }
.project-notes summary { cursor:pointer; font-weight:700; min-height:44px; }
.project-notes p { line-height:1.8; margin:.75rem 0; }
.project-notes a { color:#dec9ff; }
.trace-pipeline li { padding:0; border:0; background:none; }
.trace-pipeline button { width:100%; min-height:44px; padding:.6rem; border:1px solid #625476; border-radius:.8rem; background:#241a37; color:#e9e0f6; font:inherit; text-align:left; cursor:pointer; }
.trace-pipeline button[aria-pressed=true] { border-color:#c9a6ff; background:#493164; }
.node-detail { color:#d6cde5; line-height:1.7; font-size:.875rem; margin-top:.8rem; min-height:4em; }
.trace-speed { display:flex; align-items:center; gap:1rem; margin-top:1rem; font-size:.875rem; }
.trace-speed input { min-width:0; width:100%; flex:1; accent-color:#b48aff; min-height:44px; }
.contact-feedback { min-height:2em; text-align:center; color:#d6cde5; line-height:1.7; }
.back-top { display:inline-block; margin-bottom:1rem; }
.trace-button:disabled { opacity:.5; cursor:not-allowed; }
