/* Home page. Shared tokens and components come from css/site.css. */

#main {
    display: flex;
    flex-direction: column;
    gap: 72px;
}

#work,
#factory,
#about {
    scroll-margin-top: 24px;
}

/* Hero */
.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 40px;
}

.hero-name {
    flex: 1 1 520px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero-title {
    font-size: clamp(48px, 7.6vw, 96px);
    line-height: 0.95;
    letter-spacing: -0.03em;
}

.hero-side {
    flex: 1 1 380px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero-tagline {
    font-size: 19px;
    color: var(--text-soft);
    max-width: 46ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Featured projects: a list on the left, the selected project's panel on the right */
.featured {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.featured-stage {
    flex: 2 1 520px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 24px 12px;
    background: var(--stage);
    border: 1px solid var(--line);
}

.featured-list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.featured-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 20px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
}

.featured-list li:first-child .featured-item {
    border-top: none;
}

.featured-number {
    flex: 0 0 28px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
}

.featured-title {
    flex: 1 1 220px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.featured-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--node);
}

.featured-item:hover .featured-title,
.featured-item[aria-current="true"] .featured-title {
    color: var(--accent);
}

.featured-item[aria-current="true"] .featured-number {
    color: var(--accent);
}

.featured-panels {
    flex: 1 1 300px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.featured-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 260px;
    scroll-margin-top: 24px;
}

.featured-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--node);
}

.featured-panel h3 {
    font-size: 30px;
    line-height: 1.1;
}

.featured-panel > p:not(.featured-tag) {
    color: var(--text-soft);
}

.featured-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
    margin-top: auto;
}

.featured-links a {
    padding: 12px 0;
    font-weight: 600;
}

.featured-links .featured-primary {
    color: var(--accent);
}

/* One panel at a time: the one the address points at, or the first. Browsers without :has()
   skip this block and show every panel, which still reads fine. */
@supports selector(:has(*)) {
    .featured-panel {
        display: none;
    }

    .featured-panel:target,
    .featured-panels:not(:has(:target)) .featured-panel:first-child {
        display: flex;
    }
}

/* With featured.js running, the script decides which panel shows (no jump to an anchor). */
.featured.js-select .featured-panels .featured-panel:not(.is-current) {
    display: none;
}

.featured.js-select .featured-panels .featured-panel.is-current {
    display: flex;
}

/* With orbit.js running: the canvas on top, the list underneath as a compact row of choices. */
.orbit-canvas {
    display: block;
    width: 100%;
    height: 520px;
    touch-action: pan-y;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.orbit-canvas.grabbing {
    cursor: grabbing;
}

.featured.has-orbit .featured-stage {
    gap: 0;
    padding: 0;
}

.featured.has-orbit .featured-stage > .mono-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.featured.has-orbit .featured-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
}

.featured.has-orbit .featured-item {
    gap: 8px;
    padding: 8px 12px;
    min-height: 36px;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line-strong);
}

.featured.has-orbit .featured-list li:first-child .featured-item {
    border-top: 1px solid var(--line-strong);
}

.featured.has-orbit .featured-item:hover {
    border-color: var(--node);
}

.featured.has-orbit .featured-item[aria-current="true"],
.featured.has-orbit .featured-list li:first-child .featured-item[aria-current="true"] {
    border-color: var(--accent);
}

.featured.has-orbit .featured-number {
    flex: none;
    font-size: 12px;
}

.featured.has-orbit .featured-title {
    flex: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
}

.featured.has-orbit .featured-meta {
    display: none;
}

.orbit-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 0 16px 12px;
}

.orbit-hint {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

.orbit-reset {
    min-height: 36px;
    padding: 8px 12px;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.orbit-reset:hover {
    border-color: var(--node);
}

@media (max-width: 600px) {
    .orbit-canvas {
        height: 400px;
    }
}

/* How I ship with AI: the pipeline panel. Built to look right while nothing is running. */
.factory {
    background: var(--panel);
    border: 1px solid var(--line);
}

.factory-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
}

.factory-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.factory-status i {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
}

.factory-status.is-working i {
    background: var(--accent);
}

.factory-stages-wrap {
    position: relative;
    padding: 24px 20px;
}

/* A dot travels the rail while each stage lights in turn: one 12 second loop. */
.factory-rail {
    position: absolute;
    left: 20px;
    right: 20px;
    top: 12px;
    height: 2px;
    background: var(--line);
}

.factory-rail-dot {
    position: absolute;
    top: -3px;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: factory-travel 12s linear infinite;
}

.factory-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.factory-stages li {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--line);
    background-color: var(--ground);
    animation: factory-lit 12s linear infinite;
}

.factory-stages li:nth-child(2) { animation-delay: 2s; }
.factory-stages li:nth-child(3) { animation-delay: 4s; }
.factory-stages li:nth-child(4) { animation-delay: 6s; }
.factory-stages li:nth-child(5) { animation-delay: 8s; }
.factory-stages li:nth-child(6) { animation-delay: 10s; }

.factory-stage-number {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

.factory-stage-name {
    font-size: 17px;
    font-weight: 600;
}

.factory-stage-what {
    font-size: 14px;
    color: var(--muted);
}

.factory-queues {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 1px;
    background: var(--line);
    border-top: 1px solid var(--line);
    font-size: 15px;
}

.factory-queue {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 20px;
    background: var(--panel);
}

.factory-queue h3 {
    margin-bottom: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.factory-queue a {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
}

.factory-item-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.factory-queue a:hover .factory-item-title {
    color: var(--accent);
}

.factory-item-number,
.factory-item-wait {
    color: var(--muted);
}

.factory-item-done {
    color: var(--node);
}

.factory-item-done,
.factory-item-wait {
    flex: none;
}

.factory-updated {
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}

@keyframes factory-travel {
    from { left: 0; opacity: 0; }
    6% { opacity: 1; }
    94% { opacity: 1; }
    to { left: calc(100% - 8px); opacity: 0; }
}

@keyframes factory-lit {
    0% { border-color: var(--line); background-color: var(--ground); }
    2% { border-color: var(--accent); background-color: #1d1a12; }
    15% { border-color: var(--accent); background-color: #1d1a12; }
    18% { border-color: var(--line); background-color: var(--ground); }
    100% { border-color: var(--line); background-color: var(--ground); }
}

/* About */
.about {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 64px;
}

.about .section-title {
    flex: 1 1 240px;
}

.about-body {
    flex: 3 1 420px;
    min-width: 0;
    max-width: 65ch;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--text-soft);
}
