/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    line-height: 1.8;
    color: #1a1a1a;
    background-color: #fefefe;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Smooth page load */
body {
    animation: fadeInPage 1.2s ease-out;
}

@keyframes fadeInPage {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Container */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Typography */
p {
    margin-bottom: 0.6em;
}

p:last-child {
    margin-bottom: 0;
}

p.spacer {
    height: 1.5em;
    margin-bottom: 0;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.swarm-canvas {
    position: absolute;
    top: 160px;
    left: 0;
    width: 100%;
    height: calc(100% - 160px);
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0 32px;
}

.hero .container .headline,
.hero .container .tagline {
    max-width: 480px;
}

.logo {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin-bottom: 4rem;
    color: #1a1a1a;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.3s forwards;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 14px;
    border-radius: 4px;
    display: inline-block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.headline {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 2.4rem;
    font-weight: 400;
    line-height: 1.35;
    max-width: 600px;
    letter-spacing: -0.01em;
    min-height: 4.5em;
    visibility: hidden;
}

.tagline {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 400;
    color: #666;
    margin-top: 3rem;
    max-width: 500px;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Typewriter cursor */
.headline::after {
    content: '|';
    font-weight: 300;
    opacity: 1;
    animation: blink 0.8s infinite;
    margin-left: 2px;
}

.headline.typing-done::after {
    opacity: 0;
    transition: opacity 0.5s ease;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CTA */
.cta {
    display: inline-block;
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 400;
    color: #1a1a1a;
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cta::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #1a1a1a;
    transform: scaleX(0.3);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cta:hover {
    letter-spacing: 0.05em;
}

.cta:hover::after {
    transform: scaleX(1);
}

/* Sections */
.section {
    padding: 180px 0;
    position: relative;
}

.section p {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.5rem;
    color: #1a1a1a;
    line-height: 1.6;
    letter-spacing: -0.005em;
}

/* Emphasis text */
.emphasis {
    font-size: 1.9rem !important;
    margin-top: 0.5em;
}

/* Closing */
.closing {
    padding: 200px 0;
    text-align: center;
}

.closing-text {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Agent Card Section */
.agent-section {
    padding: 120px 0 180px;
}

.container-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
}

.agent-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.agent-text {
    padding-left: 20px;
}

.section-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 2rem;
}

.agent-text p {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 2rem;
    color: #1a1a1a;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin-bottom: 0.4em;
}

.agent-text p:last-child {
    margin-bottom: 0;
}

/* Agent Stack */
.agent-stack {
    position: relative;
    width: 432px;
    height: 436px;
}

.agent-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.02),
        0 4px 16px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.agent-card-front {
    position: relative;
    z-index: 3;
}

.agent-card-back-1 {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 400px;
    height: 420px;
    z-index: 2;
    opacity: 0.7;
}

.agent-card-back-2 {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 400px;
    height: 420px;
    z-index: 1;
    opacity: 0.4;
}

.agent-stack:hover .agent-card-front {
    transform: translateY(-4px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 8px 32px rgba(0, 0, 0, 0.08);
}

.agent-stack:hover .agent-card-back-1 {
    transform: translate(-2px, -2px);
}

.agent-stack:hover .agent-card-back-2 {
    transform: translate(-4px, -4px);
}

.agent-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.agent-status-group {
    display: flex;
    gap: 6px;
}

.agent-status {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.agent-status:nth-child(2) {
    animation-delay: 0.3s;
}

.agent-status:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.agent-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
}

.agent-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 32px;
}

.agent-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    opacity: 0.4;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.agent-step.active {
    opacity: 1;
}

.agent-step.active .step-icon {
    color: #1a1a1a;
    transform: scale(1.1);
}

.step-icon {
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: all 0.3s ease;
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-label {
    font-family: 'Instrument Serif', serif;
    font-size: 1.1rem;
    color: #1a1a1a;
}

.step-detail {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #999;
    letter-spacing: 0.01em;
}

.agent-connector {
    width: 1px;
    height: 24px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.02));
    margin-left: 15px;
    position: relative;
    overflow: hidden;
}

.agent-connector::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, #1a1a1a, transparent);
    animation: flowDown 2s ease-in-out infinite;
}

@keyframes flowDown {
    0% {
        top: -100%;
    }

    50% {
        top: 100%;
    }

    100% {
        top: 100%;
    }
}

.agent-output {
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.output-line {
    height: 8px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.02) 100%);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.output-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.08), transparent);
    animation: shimmer 2.5s ease-in-out infinite;
}

.output-line:nth-child(1)::after {
    animation-delay: 0s;
}

.output-line:nth-child(2)::after {
    animation-delay: 0.3s;
}

.output-line:nth-child(3)::after {
    animation-delay: 0.6s;
}

.output-line.short {
    width: 60%;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    50% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* Approach Section */
.approach-section {
    padding: 120px 0 180px;
}

.approach-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.approach-text {
    padding-right: 20px;
}

.approach-text p {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.5rem;
    color: #1a1a1a;
    line-height: 1.6;
    letter-spacing: -0.005em;
    margin-bottom: 0.6em;
}

.approach-text p:last-child {
    margin-bottom: 0;
}

.approach-visual {
    display: flex;
    justify-content: center;
}

/* System Card - Sophisticated Design */
.system-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 32px;
    width: 380px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.02),
        0 4px 16px rgba(0, 0, 0, 0.04),
        0 16px 48px rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.system-card:hover {
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 8px 32px rgba(0, 0, 0, 0.06),
        0 24px 64px rgba(0, 0, 0, 0.04);
    transform: translateY(-6px);
}

.system-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.system-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #666;
}

.system-status {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.system-diagram {
    padding: 20px 0;
}

.system-boundary {
    position: relative;
    width: 100%;
    height: 140px;
    border: 2px dashed rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boundary-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #1a1a1a;
}

.corner-tl {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
    border-radius: 4px 0 0 0;
}

.corner-tr {
    top: -2px;
    right: -2px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 4px 0 0;
}

.corner-bl {
    bottom: -2px;
    left: -2px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 4px;
}

.corner-br {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 4px 0;
}

.system-core {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.core-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.ring-1 {
    width: 100%;
    height: 100%;
    animation: ringPulse 3s ease-in-out infinite;
}

.ring-2 {
    width: 70%;
    height: 70%;
    animation: ringPulse 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

@keyframes ringPulse {

    0%,
    100% {
        border-color: rgba(0, 0, 0, 0.1);
        transform: scale(1);
    }

    50% {
        border-color: rgba(34, 197, 94, 0.4);
        transform: scale(1.05);
    }
}

.core-center {
    width: 16px;
    height: 16px;
    background: #1a1a1a;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    animation: coreGlow 3s ease-in-out infinite;
}

@keyframes coreGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }

    50% {
        box-shadow: 0 0 20px 4px rgba(34, 197, 94, 0.3);
    }
}

.io-port {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
}

.port-in {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.port-out {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.port-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
}

.port-dot {
    width: 8px;
    height: 8px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    animation: portPulse 2s ease-in-out infinite;
}

.port-in .port-dot {
    animation-delay: 0s;
}

.port-out .port-dot {
    animation-delay: 1s;
}

@keyframes portPulse {

    0%,
    100% {
        background: rgba(0, 0, 0, 0.15);
    }

    50% {
        background: #22c55e;
        box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    }
}

.flow-lines {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.flow-path {
    fill: none;
    stroke: rgba(0, 0, 0, 0.08);
    stroke-width: 2;
    stroke-dasharray: 8 4;
    stroke-dashoffset: 0;
    animation: flowDash 2s linear infinite;
}

.path-in {
    animation-direction: normal;
}

.path-out {
    animation-direction: normal;
}

@keyframes flowDash {
    to {
        stroke-dashoffset: -24;
    }
}

.system-metrics {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.metric-value {
    font-family: 'Instrument Serif', serif;
    font-size: 1.8rem;
    color: #1a1a1a;
    line-height: 1;
}

.metric-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
}

@media (max-width: 900px) {
    .approach-layout {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .approach-text {
        padding-right: 0;
        text-align: center;
    }

    .system-card {
        margin: 0 auto;
    }
}

/* Footer */
.footer {
    padding: 60px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer p {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 0.9rem;
    color: #999;
    letter-spacing: 0.02em;
}

/* Fade-in animation for sections - bidirectional */
.fade-in {
    opacity: 0;
    transform: translateY(80px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in.fade-out {
    opacity: 0;
    transform: translateY(-40px);
}

/* Individual text fade - bidirectional */
.fade-text {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-text.text-visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-text.text-hidden {
    opacity: 0;
    transform: translateY(-20px);
}

/* Stagger children delays */
.section .fade-text:nth-child(1) {
    transition-delay: 0s;
}

.section .fade-text:nth-child(2) {
    transition-delay: 0.1s;
}

.section .fade-text:nth-child(3) {
    transition-delay: 0.2s;
}

.section .fade-text:nth-child(4) {
    transition-delay: 0.3s;
}

/* Silk texture background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(245, 245, 250, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(250, 248, 245, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(248, 250, 252, 0.4) 0%, transparent 60%);
    background-size: 200% 200%;
    animation: silkFlow 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.02) 50%, transparent 100%),
        linear-gradient(225deg, transparent 0%, rgba(0, 0, 0, 0.01) 50%, transparent 100%);
    background-size: 400% 400%;
    animation: silkShimmer 15s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

@keyframes silkFlow {

    0%,
    100% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
    }

    25% {
        background-position: 100% 50%, 0% 50%, 75% 25%;
    }

    50% {
        background-position: 50% 100%, 50% 0%, 25% 75%;
    }

    75% {
        background-position: 0% 50%, 100% 50%, 50% 50%;
    }
}

@keyframes silkShimmer {

    0%,
    100% {
        background-position: 0% 0%, 100% 100%;
        opacity: 0.3;
    }

    50% {
        background-position: 100% 100%, 0% 0%;
        opacity: 0.6;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .agent-layout {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .agent-text {
        padding-right: 0;
        text-align: center;
    }

    .agent-stack {
        margin: 0 auto;
        width: 100%;
        max-width: 400px;
        height: auto;
    }

    .agent-card-back-1,
    .agent-card-back-2 {
        display: none;
    }

    .system-card {
        width: 100%;
        max-width: 380px;
    }
}

@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    .container {
        padding: 0 20px;
    }

    .container-wide {
        padding: 0 20px;
    }

    .hero {
        min-height: auto;
        padding: 120px 0 80px;
    }

    .hero .container {
        padding: 0 20px;
    }

    .hero .container .headline,
    .hero .container .tagline {
        max-width: 100%;
    }

    .headline {
        font-size: 1.7rem;
        line-height: 1.4;
        min-height: auto;
    }

    .tagline {
        margin-top: 1.5rem;
        font-size: 1rem;
        max-width: 100%;
    }

    .logo {
        margin-bottom: 3rem;
    }

    .section {
        padding: 80px 0;
    }

    .section p {
        font-size: 1.15rem;
    }

    .agent-section {
        padding: 60px 0 80px;
    }

    .agent-text p {
        font-size: 1.35rem;
    }

    .approach-section {
        padding: 60px 0 80px;
    }

    .approach-text p {
        font-size: 1.15rem;
    }

    .emphasis {
        font-size: 1.35rem !important;
    }

    .closing {
        padding: 80px 0;
    }

    .closing-text {
        font-size: 1.1rem;
    }

    .page-header {
        padding: 120px 0 48px;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 0 48px;
    }

    .headline {
        font-size: 2.6rem;
    }

    .section p {
        font-size: 1.6rem;
    }
}

@media (min-width: 1024px) {
    .headline {
        font-size: 2.8rem;
    }
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 32px;
    opacity: 0;
    transform: translateY(-10px);
    animation: navSlideIn 0.8s ease-out 0.3s forwards;
}

.nav.nav-immediate {
    animation: navSlideIn 0.6s ease-out 0.3s forwards;
}

@keyframes navSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 32px;
    padding: 20px 0;
}

.nav-brand {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #1a1a1a;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.04);
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.nav-brand:hover {
    background: rgba(0, 0, 0, 0.08);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #666;
    text-decoration: none;
    position: relative;
    padding: 4px 0;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #1a1a1a;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-links a:hover {
    color: #1a1a1a;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: #1a1a1a;
}

.nav-links a.active::after {
    width: 100%;
}

.nav-scrolled {
    background: rgba(254, 254, 254, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* ===== Page Header (for sub-pages) ===== */
.page-header {
    padding: 180px 0 80px;
    text-align: center;
}

.page-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 3rem;
    font-weight: 400;
    color: #1a1a1a;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    opacity: 0;
    transform: translateY(30px);
    animation: revealUp 0.8s ease-out 0.5s forwards;
}

.page-intro {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.1rem;
    color: #666;
    line-height: 1.7;
    max-width: 600px;
    margin: 0.5rem auto 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: revealUp 0.8s ease-out 0.6s forwards;
}

.page-subtitle {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.15rem;
    color: #999;
    opacity: 0;
    transform: translateY(20px);
    animation: revealUp 0.8s ease-out 0.7s forwards;
}

@keyframes revealUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Work Page ===== */

/* Filter Bar */
.filter-bar {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px 64px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    animation: revealUp 0.8s ease-out 0.9s forwards;
}

.filter-pill {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #888;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 100px;
    padding: 8px 20px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
}

.filter-pill:hover {
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.25);
    background: rgba(0, 0, 0, 0.02);
}

.filter-pill.active {
    color: #fff;
    background: #1a1a1a;
    border-color: #1a1a1a;
}

/* Card filtered-out state */
.project-card.hidden-card {
    opacity: 0 !important;
    transform: scale(0.95) translateY(30px) !important;
    pointer-events: none;
    position: absolute;
    visibility: hidden;
    height: 0;
    margin: 0;
    overflow: hidden;
}

.work-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px 160px;
    display: flex;
    flex-direction: column;
    gap: 120px;
}

.project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:nth-child(even) {
    direction: rtl;
}

.project-card:nth-child(even)>* {
    direction: ltr;
}

.project-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover .project-image img {
    transform: scale(1.03);
}

.project-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 3rem;
    color: rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
}

.project-name {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 2.4rem;
    font-weight: 400;
    color: #1a1a1a;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.project-description {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.1rem;
    color: #666;
    line-height: 1.7;
    max-width: 440px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    margin-top: 8px;
    position: relative;
    padding-bottom: 2px;
    transition: gap 0.3s ease;
}

.project-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #1a1a1a;
    transform: scaleX(0.3);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-link:hover {
    gap: 12px;
}

.project-link:hover::after {
    transform: scaleX(1);
}

.project-link-arrow {
    transition: transform 0.3s ease;
    font-size: 1rem;
}

.project-link:hover .project-link-arrow {
    transform: translateX(2px);
}

@media (max-width: 900px) {

    .filter-bar {
        padding: 0 20px 48px;
        gap: 8px;
    }

    .filter-pill {
        font-size: 0.65rem;
        padding: 6px 14px;
    }

    .project-card,
    .project-card:nth-child(even) {
        grid-template-columns: 1fr;
        direction: ltr;
        gap: 32px;
    }

    .project-name {
        font-size: 1.8rem;
    }

    .page-title {
        font-size: 2.2rem;
    }
}

/* ===== Team Page ===== */
.team-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px 160px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.team-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(40px);
}

.team-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.team-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 8px 32px rgba(0, 0, 0, 0.06),
        0 24px 64px rgba(0, 0, 0, 0.04);
}

.team-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
    position: relative;
}

.team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.team-card:hover .team-avatar img {
    transform: scale(1.08);
}

.team-name {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: #1a1a1a;
    line-height: 1.3;
}

.team-username {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #999;
    letter-spacing: 0.01em;
}

.team-bio {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.6;
    max-width: 280px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.team-link {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    text-decoration: none;
    padding: 6px 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    transition: all 0.3s ease;
    margin-top: 4px;
}

.team-link:hover {
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.02);
}

/* Team card skeleton loading */
.team-card.skeleton .team-avatar {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

.team-card.skeleton .team-name,
.team-card.skeleton .team-username,
.team-card.skeleton .team-bio {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    color: transparent;
    border-radius: 4px;
    min-height: 1em;
    min-width: 80px;
}

.team-card.skeleton .team-name {
    min-width: 120px;
    min-height: 1.4em;
}

.team-card.skeleton .team-bio {
    min-width: 100%;
    min-height: 3em;
}

.team-card.skeleton .team-link {
    opacity: 0;
}

@keyframes skeletonShimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@media (max-width: 900px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 600px) {
    .team-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 20px 100px;
    }

    .team-card {
        padding: 24px 20px;
    }

    .work-grid {
        padding: 0 20px 100px;
        gap: 64px;
    }

    .project-description {
        font-size: 1rem;
    }

    .project-name {
        font-size: 1.6rem;
    }

    .nav {
        padding: 0 16px;
    }

    .nav-inner {
        gap: 16px;
        padding: 14px 0;
    }

    .nav-brand {
        font-size: 0.85rem;
        padding: 4px 10px;
    }

    .nav-links {
        gap: 12px;
    }

    .nav-links a {
        font-size: 0.6rem;
        letter-spacing: 0.04em;
    }

    .agent-stack {
        max-width: 100%;
    }

    .agent-card {
        padding: 24px;
        border-radius: 12px;
    }

    .system-card {
        padding: 24px;
        width: 100%;
        max-width: 100%;
        border-radius: 16px;
    }

    .footer {
        padding: 40px 0;
    }
}

@media (max-width: 380px) {
    .nav-inner {
        gap: 10px;
    }

    .nav-links {
        gap: 8px;
    }

    .nav-links a {
        font-size: 0.55rem;
    }

    .nav-brand {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .headline {
        font-size: 1.5rem;
    }
}

/* Selection */
::selection {
    background: rgba(0, 0, 0, 0.08);
}

/* Smooth scroll for the whole page */
html {
    scroll-behavior: smooth;
}

/* Custom cursor */
.has-custom-cursor {
    cursor: none !important;
}

.has-custom-cursor * {
    cursor: none !important;
}

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: #1a1a1a;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    margin-left: -4px;
    margin-top: -4px;
    transition: width 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        height 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        margin 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        background 0.25s ease,
        opacity 0.25s ease;
    mix-blend-mode: difference;
    opacity: 0.85;
}

.custom-cursor.cursor-hover {
    width: 48px;
    height: 48px;
    margin-left: -24px;
    margin-top: -24px;
    background: rgba(34, 197, 94, 0.12);
    opacity: 1;
}

.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 4px;
    height: 4px;
    background: #1a1a1a;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    margin-left: -2px;
    margin-top: -2px;
    transition: width 0.15s ease, height 0.15s ease, margin 0.15s ease, background 0.15s ease, opacity 0.15s ease;
    opacity: 1;
}

.cursor-dot.dot-hover {
    width: 6px;
    height: 6px;
    margin-left: -3px;
    margin-top: -3px;
    background: #22c55e;
}

/* Hide custom cursor on mobile */
@media (max-width: 768px) {

    .custom-cursor,
    .cursor-dot {
        display: none !important;
    }
}