/* Familiar landing page — pixel-retro theme.
   Retro look via chunky hard-offset shadows, square corners, thick borders,
   monospace font stack and pixelated images. No external fonts/CDNs so it
   renders identically offline and in regions where Google Fonts is blocked. */

:root {
    --bg: #fdf6ec;
    --bg-alt: #f4e9d8;
    --bg-card: #fffdf8;
    --text: #3a2e1f;
    --text-muted: #6b5b48;
    --accent: #e0562f;
    --accent-strong: #c04020;
    --border: #3a2e1f;
    --shadow: 4px 4px 0 var(--border);
    --shadow-sm: 2px 2px 0 var(--border);
    --max-width: 1040px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Menlo, Monaco, "SFMono-Regular", Consolas, "Liberation Mono", "PingFang SC", "Microsoft YaHei", monospace;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header — chunky bottom border */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 4px solid var(--border);
    box-shadow: 0 4px 0 rgba(58, 46, 31, 0.15);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.brand-logo {
    width: 34px;
    height: 34px;
    image-rendering: pixelated;
    border: 3px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.brand-name {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    gap: 4px;
}

.site-nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 10px;
    border: 3px solid transparent;
    letter-spacing: 1px;
}

.site-nav a:hover {
    border-color: var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.lang-toggle {
    border: 3px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-family: inherit;
    font-weight: 700;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lang-toggle:hover {
    transform: translate(1px, 1px);
    box-shadow: none;
    background: var(--accent);
    color: #fff;
}

/* Hero */
.hero {
    padding: 72px 0 68px;
    background:
        repeating-linear-gradient(45deg, transparent 0 14px, rgba(58, 46, 31, 0.03) 14px 28px),
        var(--bg);
    border-bottom: 4px solid var(--border);
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(520px, 1.18fr);
    align-items: center;
    gap: 58px;
}

.hero-copy { text-align: left; }

.hero-eyebrow {
    display: inline-block;
    margin-bottom: 15px;
    padding: 5px 10px;
    border: 2px solid var(--border);
    background: #f7c95c;
    box-shadow: var(--shadow-sm);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hero-title {
    margin: 0 0 10px;
    font-size: 52px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    text-shadow: 4px 4px 0 var(--border);
}

.hero-tagline {
    margin: 0 0 14px;
    font-size: 20px;
    color: var(--accent-strong);
    font-weight: 700;
    max-width: 640px;
}

.hero-sub {
    margin: 0 0 34px;
    max-width: 560px;
    color: var(--text-muted);
    font-size: 15px;
}

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

.hero-note {
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Agent event demo */
.agent-demo {
    display: grid;
    grid-template-columns: 174px 84px minmax(230px, 1fr);
    align-items: center;
    min-height: 386px;
}

.agent-stack { display: grid; gap: 22px; }

.agent-card {
    position: relative;
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 9px 12px 9px 9px;
    background: var(--bg-card);
    border: 3px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
}

.agent-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 2px solid var(--border);
    background: #fff;
    color: #20211f;
}

.agent-mark img { width: 26px; height: 26px; }
.agent-card-claude .agent-mark img { width: 28px; height: 28px; }

.agent-pulse {
    position: absolute;
    right: -8px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--border);
    background: #7ee3b8;
    animation: agent-blink 1.8s steps(2, end) infinite;
}

.agent-card:nth-child(2) .agent-pulse { animation-delay: .6s; }
.agent-card:nth-child(3) .agent-pulse { animation-delay: 1.2s; }

.event-flow { position: relative; height: 252px; overflow: hidden; }
.flow-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.flow-svg path {
    fill: none;
    stroke: var(--border);
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
}
.flow-packet-svg {
    fill: var(--accent);
    stroke: var(--border);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}
.flow-node {
    position: absolute;
    right: -14px;
    top: 107px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    background: #f7c95c;
    font-weight: 900;
    z-index: 2;
}
.familiar-stage {
    overflow: hidden;
    background: #26312f;
    border: 4px solid var(--border);
    box-shadow: 8px 8px 0 var(--border);
    color: #dff7e8;
}
.stage-topbar,
.stage-foot {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background: #151b1a;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
}
.stage-lights { color: #e0562f; letter-spacing: 2px; }
.desktop-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-height: 276px;
    background:
        linear-gradient(rgba(126, 227, 184, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(126, 227, 184, .08) 1px, transparent 1px),
        #26312f;
    background-size: 18px 18px;
    padding: 15px 12px 11px;
}
.task-bubble {
    width: 168px;
    padding: 8px 11px;
    border: 2px solid #333;
    border-radius: 16px 16px 0 16px;
    background: rgba(255, 255, 255, .96);
    color: #333;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, .12);
    font-family: system-ui, sans-serif;
    z-index: 3;
    margin-bottom: 12px;
    animation: bubble-float 2.4s ease-in-out infinite;
}
.bubble-head { display: flex; align-items: center; gap: 4px; overflow: hidden; }
.bubble-badge {
    flex: 0 0 auto;
    padding: 1px 4px;
    border-radius: 4px;
    background: #10a37f;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
}
.bubble-badge[data-source="claude"] { background: #d97706; }
.bubble-badge[data-source="dsh"] { background: #4d6bfe; }
.bubble-prompt {
    overflow: hidden;
    color: #666;
    font-size: 9px;
    font-style: italic;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.bubble-activity { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; font-weight: 600; }
.bubble-spinner {
    width: 11px;
    height: 11px;
    border: 2px solid #c9d0ce;
    border-top-color: #10a37f;
    border-radius: 50%;
    animation: spin .9s linear infinite;
}
.bubble-spinner[data-complete="true"] { border: 0; border-radius: 0; animation: none; }
.bubble-spinner[data-complete="true"]::after { content: "✓"; color: #22c55e; font-weight: 900; }
.pet-stage-real { display: flex; align-items: flex-end; gap: 7px; }
.pet-sprite {
    width: 142px;
    height: 142px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, .28));
    animation: pet-bob .72s steps(2, end) infinite;
}
.mini-dashboard {
    width: 112px;
    margin-bottom: 9px;
    padding: 9px;
    border-radius: 10px;
    background: rgba(20, 20, 22, .82);
    color: rgba(255, 255, 255, .9);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.mini-stat { display: grid; grid-template-columns: 22px 1fr 25px; align-items: center; gap: 5px; margin-bottom: 6px; font-size: 8px; }
.mini-stat:last-child { margin-bottom: 0; }
.mini-stat span { color: rgba(255, 255, 255, .48); }
.mini-stat i { height: 2px; overflow: hidden; background: rgba(255, 255, 255, .12); }
.mini-stat b { display: block; height: 100%; background: rgba(255, 255, 255, .7); animation: meter-pulse 3.6s ease-in-out infinite alternate; }
.mini-stat strong { text-align: right; font-size: 8px; font-weight: 500; }
.mini-stat:nth-child(2) b { animation-delay: .5s; }
.mini-stat:nth-child(3) b { animation-delay: 1s; }
.mini-stat:nth-child(3) strong { color: #e7a94b; }
.mini-stat:nth-child(3) b { background: #e7a94b; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bubble-float { 50% { transform: translateY(-3px); } }
@keyframes meter-pulse { to { width: 78%; } }
.stage-foot { justify-content: center; color: #7ee3b8; }

@keyframes agent-blink { 50% { opacity: .25; } }
@keyframes pet-bob { 50% { transform: translateY(-4px); } }

/* Buttons — hard shadow, press-down on hover */
.btn {
    display: inline-block;
    padding: 12px 26px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border: 3px solid var(--border);
    box-shadow: var(--shadow);
    letter-spacing: 1px;
    transition: transform 0.05s ease, box-shadow 0.05s ease;
}

.btn:hover {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.btn-lg { padding: 15px 34px; font-size: 16px; }

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover { background: var(--accent-strong); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
}

.btn-secondary:hover { background: var(--bg-alt); }

/* Sections */
.section {
    padding: 56px 0;
}

.section-alt {
    background: var(--bg-alt);
    border-top: 4px solid var(--border);
    border-bottom: 4px solid var(--border);
}

.section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.section-title::after {
    content: "";
    display: block;
    width: 72px;
    height: 4px;
    margin: 12px auto 0;
    background: var(--accent);
}

.section-title-sub { margin-top: 56px; }

.section-desc {
    text-align: center;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto 28px;
    font-size: 14px;
}

/* Cat lab — real-life references paired with their pixel companions */
.cat-lab-intro { max-width: 720px; margin: 0 auto; }

.section-kicker {
    display: block;
    margin-bottom: 10px;
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    text-align: center;
}

.cat-comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 36px;
}

.cat-card {
    overflow: hidden;
    background: var(--bg-card);
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
}

.cat-card-wide { grid-column: 1 / -1; }

.cat-card-heading { padding: 20px 22px 0; }

.cat-card-number {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
}

.cat-card-heading h3 {
    margin: 6px 0 4px;
    color: var(--accent-strong);
    font-size: 21px;
    letter-spacing: 1px;
}

.cat-card-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.cat-comparison {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 20px 22px 16px;
}

.cat-view { min-width: 0; margin: 0; }

.cat-image-frame {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 3px solid var(--border);
}

.cat-life-frame { background: #eee4d8; }

.cat-life-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* All life photos use the same square comparison window. */
.cat-natural-life-frame { aspect-ratio: 1 / 1; }

.cat-sprite-frame {
    aspect-ratio: 1 / 1;
    background:
        linear-gradient(45deg, rgba(255, 255, 255, .05) 25%, transparent 25% 75%, rgba(255, 255, 255, .05) 75%),
        #26312f;
    background-size: 14px 14px;
}

.cat-sprite-frame img {
    display: block;
    width: 88%;
    height: 88%;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .3));
}

.cat-arrow {
    align-self: center;
    color: var(--accent);
    font-size: 25px;
    font-weight: 900;
    text-align: center;
}

.cat-card-footer {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px 14px;
    border-top: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
}

.cat-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border: 2px solid var(--border);
    background: #7ee3b8;
}

.cat-pair-life-frame {
    aspect-ratio: 1 / 1;
}

.cat-pair-life-frame img { object-position: center bottom; }

.cat-pair-sprites {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.cat-sprite-frame > span {
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 2px 5px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 9px;
    font-weight: 800;
}

/* Features — pixel cards */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 36px;
}

.feature-card {
    background: var(--bg-card);
    border: 4px solid var(--border);
    padding: 22px;
    box-shadow: var(--shadow);
}

.feature-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent-strong);
}

.feature-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* Integrations table */
.integrations-table {
    width: 100%;
    max-width: 760px;
    margin: 32px auto 0;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 4px solid var(--border);
    box-shadow: var(--shadow);
}

.integrations-table th,
.integrations-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    border: 2px solid var(--border);
}

.integrations-table thead th {
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.integrations-table tbody tr:nth-child(even) { background: var(--bg-alt); }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border: 2px solid var(--border);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-ok { background: rgba(15, 157, 118, 0.22); color: #0a6b4e; }
.badge-warn { background: rgba(224, 86, 47, 0.2); color: var(--accent-strong); }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    max-width: 760px;
    margin: 0 auto;
}

.stat {
    background: var(--bg-card);
    border: 4px solid var(--border);
    padding: 22px 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: var(--accent-strong);
    letter-spacing: 1px;
}

.stat-label {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Privacy */
.privacy-text {
    max-width: 720px;
    margin: 0 auto 16px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

#privacy .btn { display: table; margin: 12px auto 0; }

/* Download */
.download-actions { text-align: center; margin-top: 28px; }
.download-note { text-align: center; color: var(--text-muted); font-size: 13px; margin-top: 18px; }

/* Footer */
.site-footer {
    border-top: 4px solid var(--border);
    background: var(--bg-alt);
    padding: 28px 0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-brand { font-weight: 800; color: var(--text); text-transform: uppercase; letter-spacing: 1px; }

.footer-inner a { color: var(--text-muted); text-decoration: none; }
.footer-inner a:hover { color: var(--accent-strong); }

/* Responsive */
@media (max-width: 700px) {
    .site-nav { display: none; }
    .hero-title { font-size: 38px; }
    .hero { padding: 48px 0 40px; }
    .hero-inner { display: block; }
    .hero-copy { text-align: center; }
    .hero-tagline, .hero-sub { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .agent-demo {
        grid-template-columns: minmax(126px, .85fr) 46px minmax(160px, 1.15fr);
        margin-top: 48px;
        min-height: 300px;
    }
    .agent-stack { gap: 14px; }
    .agent-card { grid-template-columns: 32px 1fr; padding: 7px; font-size: 8px; min-height: 50px; }
    .agent-mark { width: 32px; height: 32px; font-size: 10px; }
    .event-flow { height: 194px; }
    .flow-node { top: 82px; width: 27px; height: 27px; right: -12px; }
    .pet-scene { min-height: 218px; }
    .pet-sprite { width: 118px; height: 157px; }
    .desktop-preview { min-height: 218px; }
    .task-bubble { width: 145px; padding: 6px 8px; }
    .pet-stage-real { gap: 3px; }
    .mini-dashboard { width: 92px; padding: 7px; }
    .mini-stat { grid-template-columns: 18px 1fr 22px; gap: 3px; }
    .cat-comparison-grid { grid-template-columns: 1fr; }
    .cat-card-wide { grid-column: auto; }
    .cat-comparison { grid-template-columns: 1fr; gap: 8px; }
    .cat-arrow { transform: rotate(90deg); }
    .section { padding: 40px 0; }
    .footer-inner { justify-content: center; text-align: center; }
}

@media (min-width: 701px) and (max-width: 980px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-copy { text-align: center; max-width: 680px; margin: 0 auto; }
    .hero-tagline, .hero-sub { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .agent-demo { max-width: 620px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
    .agent-pulse, .pet-sprite, .pet-status::before { animation: none; }
    .flow-packet-svg { display: none; }
}
