/* containers landing — bright, blocky, supermemory-inspired */

:root {
    --bg: #ffffff;
    --bg-alt: #f6f7f9;
    --bg-card: #ffffff;
    --border: #e4e6ea;
    --border-strong: #111111;
    --text: #111111;
    --muted: #5c6570;
    --accent: #2b5bf5;
    --accent-soft: #eef2ff;
    --hatch: repeating-linear-gradient(
        -45deg,
        #f1f2f4,
        #f1f2f4 4px,
        #e8eaee 4px,
        #e8eaee 8px
    );
    --radius: 7px;
    --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.wrap-narrow { max-width: 780px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent); color: #fff; }

code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.1em 0.4em;
    color: var(--text);
}

/* ---- nav ---- */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.brand:hover { text-decoration: none; }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--accent);
    color: #fff;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 6px;
}

.nav nav { display: flex; align-items: center; gap: 1.6rem; }
.nav nav a { color: var(--muted); font-size: 0.92rem; }
.nav nav a:hover { color: var(--text); text-decoration: none; }
.nav nav a.btn { color: var(--text); }

/* ---- buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.7rem 1.3rem;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}
.btn:hover {
    text-decoration: none;
    transform: translate(-2px, -2px);
    box-shadow: 3px 3px 0 var(--border-strong);
}
.btn:active { transform: translate(0, 0); box-shadow: none; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-primary:hover { box-shadow: 3px 3px 0 var(--border-strong); }

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

.btn-small { padding: 0.45rem 0.9rem; font-size: 0.72rem; }

/* ---- hero ---- */

.hero {
    padding: 5rem 0 4rem;
    background:
        linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
}

.hero-compact { padding: 3.5rem 0 2.5rem; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.35rem 0.9rem;
    margin-bottom: 1.4rem;
}
.eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

.hero h1 {
    font-size: clamp(2.4rem, 5.4vw, 3.8rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    max-width: 20ch;
    margin-bottom: 1.3rem;
}

.accent { color: var(--accent); }

.hero .sub {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 60ch;
    margin-bottom: 2rem;
}

.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 2.4rem; }

.terminal {
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 680px;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.9rem;
    background: var(--hatch);
    border-bottom: 1.5px solid var(--border-strong);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.terminal-bar span {
    display: none;
}
.terminal-bar em {
    font-style: normal;
}

.terminal pre, .code-block pre {
    padding: 1.1rem 1.3rem;
    overflow-x: auto;
}
.terminal code, .code-block code {
    font-family: var(--mono);
    font-size: 0.9rem;
    background: none;
    border: none;
    padding: 0;
    color: var(--text);
    white-space: pre;
}

/* ---- sections ---- */

.section { padding: 4.5rem 0; }
.section-alt {
    background: var(--bg-alt);
    border-block: 1px solid var(--border);
}

.section > .wrap > h2 {
    font-size: 2rem;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.lead { color: var(--muted); font-size: 1.1rem; max-width: 68ch; margin-bottom: 2rem; }
.lead.outro { margin-top: 1.6rem; margin-bottom: 0; color: var(--text); font-weight: 500; }

.problem-list {
    list-style: none;
    display: grid;
    gap: 0.7rem;
}
.problem-list li {
    padding-left: 1.8rem;
    position: relative;
    color: var(--muted);
}
.problem-list li::before {
    content: "✕";
    position: absolute;
    left: 0;
    color: #d43c3c;
    font-family: var(--mono);
    font-weight: 700;
}

/* ---- stats band ---- */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    background: #fff;
    margin-bottom: 1.2rem;
    overflow: hidden;
}

.stat {
    padding: 1.3rem 1.5rem;
    border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }

.stat-label {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-unit { font-size: 1.3rem; font-weight: 600; color: var(--accent); }

.stat-sub { font-size: 0.82rem; color: var(--muted); }

/* ---- bento grid ---- */

.bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.2rem;
}

.bento-cell { display: flex; flex-direction: column; }
.bento-cell p { flex: 1; }

/* 10 features — alternating wide/narrow rhythm */
.span-1 { grid-column: span 7; }
.span-2 { grid-column: span 5; }
.span-3 { grid-column: span 4; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 4; }
.span-6 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 4; }
.span-9 { grid-column: span 4; }
.span-10 { grid-column: span 4; }

.span-1, .span-7 { background: var(--accent-soft); }

.mini-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 48px;
    margin-top: 1.1rem;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--border);
}
.mini-bars span {
    flex: 1;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
    opacity: 0.85;
}
.mini-bars span:nth-child(3n)   { height: 30%; opacity: 0.35; }
.mini-bars span:nth-child(3n+1) { height: 65%; }
.mini-bars span:nth-child(4n)   { height: 85%; }
.mini-bars span:nth-child(5n)   { height: 45%; opacity: 0.55; }
.mini-bars span:nth-child(7n)   { height: 100%; }
.mini-bars span:nth-child(11n)  { height: 20%; opacity: 0.3; }
.mini-bars span:nth-child(13n)  { height: 55%; }

/* ---- feature cards ---- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.2rem;
}

.card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: transform 0.12s, box-shadow 0.12s;
}
.card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 5px 5px 0 var(--border-strong);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

.card-id { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

.tag {
    font-family: var(--mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 5px;
    padding: 0.15rem 0.55rem;
    white-space: nowrap;
}

.card h3 { font-size: 1.08rem; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.93rem; }

/* ---- category cards ---- */

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.2rem;
}

.cat-card {
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: transform 0.12s, box-shadow 0.12s;
}
.cat-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 5px 5px 0 var(--border-strong);
}
.cat-card h3 { font-size: 1.08rem; margin-bottom: 0.4rem; }
.cat-card > p { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.1rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--text);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.22rem 0.6rem;
}

/* ---- how it works: animated flow figure ---- */

.flow-panel {
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 1.6rem;
    margin-bottom: 1.4rem;
}

.flow-title {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--muted);
    text-align: center;
    margin-bottom: 0.6rem;
}

/* ---- lifecycle graph (anime.js, n8n-style) ---- */

.flow-graph {
    position: relative;
    height: 460px;
    margin-bottom: 1.4rem;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.flow-graph.panning { cursor: grabbing; }
.flow-graph.panning .gnode { pointer-events: none; }

.zoom-controls {
    position: absolute;
    right: 0.8rem;
    bottom: 0.8rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.zoom-controls button {
    width: 30px;
    height: 30px;
    font-family: var(--mono);
    font-size: 1rem;
    line-height: 1;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.zoom-controls button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* fixed design surface, panned/zoomed by JS so ports and curves always align */
.flow-canvas {
    position: relative;
    width: 1900px;
    height: 560px;
    transform-origin: 0 0;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
}

.flow-graph svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.flow-path {
    fill: none;
    stroke: #6b7280;
    stroke-width: 1.5;
}
.flow-path.is-dashed { stroke-dasharray: 5 5; }

.flow-group {
    fill: rgba(255, 255, 255, 0.65);
    stroke: var(--border-strong);
    stroke-width: 1.2;
    stroke-dasharray: 7 6;
}

.flow-group-title {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    fill: var(--text);
}

.flow-section {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    fill: var(--muted);
}

.flow-edge-label {
    font-family: var(--mono);
    font-size: 11px;
    fill: var(--muted);
    text-anchor: middle;
    dominant-baseline: central;
    paint-order: stroke;
    stroke: var(--bg, #ffffff);
    stroke-width: 4px;
    stroke-linejoin: round;
}

.flow-pulse {
    fill: var(--accent);
}

.gnode {
    position: absolute;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 190px;
    padding: 0.7rem 0.8rem;
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: 0 1px 0 rgba(17, 17, 17, 0.08);
}

.gnode-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    font-size: 1rem;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: 8px;
}

.gnode-text { display: flex; flex-direction: column; min-width: 0; }
.gnode-text strong {
    font-size: 0.85rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.gnode-text em {
    font-style: normal;
    font-family: var(--mono);
    font-size: 0.55rem;
    letter-spacing: 0.05em;
    color: var(--muted);
    white-space: nowrap;
}

/* small square nodes (inputs / outputs) */
.gsq {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    width: 96px;
    text-align: center;
}

.gsq-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    font-size: 1.25rem;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
}

.gsq-label {
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--muted);
    white-space: nowrap;
}

/* JS sets this only when anime.js is available, to avoid content flashing */
.js-anim .gnode { opacity: 0; }

.fig-caption {
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 76ch;
    margin-bottom: 0.6rem;
}
.fig-caption::before {
    content: "Figure 1. ";
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text);
    font-weight: 600;
}

.tool-credits { color: var(--muted); font-size: 0.92rem; }

/* ---- code blocks ---- */

.code-block {
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.2rem;
    max-width: 780px;
}

.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1rem;
    background: var(--hatch);
    border-bottom: 1.5px solid var(--border-strong);
    font-family: var(--mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
}

.copy {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: 5px;
    padding: 0.25rem 0.7rem;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.copy:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.copy.copied { background: var(--accent); border-color: var(--accent); color: #fff; }

#quickstart .wrap {
    max-width: 880px;
}

#quickstart p { color: var(--muted); margin-bottom: 1rem; max-width: 68ch; }
#quickstart h2 { text-align: center; }
#quickstart .lead { text-align: center; margin-inline: auto; }
#quickstart .code-block {
    margin-inline: auto;
    max-width: 100%;
}
#quickstart > .wrap > p:not(.lead) { text-align: center; margin-inline: auto; }

/* ---- catalog page: single unified directory table ---- */

.catalog-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.4rem;
}

.catalog-search {
    flex: 1;
    max-width: 480px;
    font-family: var(--mono);
    font-size: 0.92rem;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    outline: none;
}
.catalog-search:focus {
    border-color: var(--accent);
    box-shadow: 3px 3px 0 var(--accent-soft);
}
.catalog-search::placeholder { color: var(--muted); }

.catalog-hint {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.catalog-empty {
    text-align: center;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.9rem;
    padding: 2rem 0;
}

.catalog-table {
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.catalog-row {
    display: grid;
    grid-template-columns: 190px 200px 1fr auto;
    align-items: center;
    gap: 1.2rem;
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}
.catalog-row:last-child { border-bottom: none; }
.catalog-row:hover { background: var(--bg-alt); }
.catalog-row[hidden] { display: none; }

/* table header row */
.catalog-head-row {
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--hatch);
    border-bottom: 1.5px solid var(--border-strong);
    padding: 0.55rem 1.2rem;
}
.catalog-head-row:hover { background: var(--hatch); }

.catalog-name a {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
}
.catalog-name a:hover { color: var(--accent); }

.catalog-cat {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--accent);
}

.catalog-desc {
    color: var(--muted);
    font-size: 0.9rem;
    min-width: 0;
}

.catalog-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.catalog-image {
    font-size: 0.74rem;
    color: var(--muted);
    background: var(--bg-alt);
}

@media (max-width: 900px) {
    .catalog-row,
    .catalog-head-row { grid-template-columns: 1fr auto; }
    .catalog-head-row > :nth-child(2),
    .catalog-head-row > :nth-child(3) { display: none; }
    .catalog-cat { display: none; }
    .catalog-desc { grid-column: 1 / -1; order: 3; }
    .catalog-row { gap: 0.4rem; padding: 1rem 1.2rem; }
}

/* ---- faq ---- */

.faq-item {
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 1rem 1.3rem;
    margin-bottom: 0.8rem;
    background: #fff;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    list-style: none;
    position: relative;
    padding-right: 1.8rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: -0.05em;
    color: var(--accent);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.1rem;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { color: var(--muted); margin-top: 0.7rem; font-size: 0.95rem; }

/* ---- cta ---- */

.cta { text-align: center; background: var(--bg-alt); border-top: 1px solid var(--border); }
.cta h2 { letter-spacing: -0.02em; margin-bottom: 0.6rem; }
.cta p { color: var(--muted); margin-bottom: 1.8rem; }

/* ---- footer ---- */

.footer {
    border-top: 1px solid var(--border);
    padding: 2.2rem 0;
    font-size: 0.88rem;
    color: var(--muted);
}
.footer .muted { font-size: 0.82rem; margin-top: 0.4rem; }

/* ---- responsive ---- */

@media (max-width: 900px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(2) { border-right: none; }
    .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
    .bento { grid-template-columns: 1fr; }
    .bento [class*="span-"] { grid-column: auto; }
}

@media (max-width: 640px) {
    .nav nav { display: none; }
    .hero { padding: 3.5rem 0 3rem; }
    .section { padding: 3rem 0; }
    .btn:hover { transform: none; box-shadow: none; }
    .card:hover, .cat-card:hover { transform: none; box-shadow: none; }
}
