/* xity.dev — Terminal Command Line Design */

/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: #0D1117;
    color: #C9D1D9;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
}

/* === Typography === */
.section-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 26px;
    color: #C9D1D9;
    margin-bottom: 1.25rem;
}
.group-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: #C9D1D9;
    margin-bottom: 0.5rem;
}

/* === Terminal Chrome === */
.terminal {
    border: 1px solid #30363D;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.term-header {
    background: #161B22;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #30363D;
}
.term-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.term-dot.red { background: #F85149; }
.term-dot.yellow { background: #D29922; }
.term-dot.green { background: #3FB950; }
.term-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-feature-settings: 'liga' 0;
    color: #8B949E;
    margin-left: 0.5rem;
}
.term-body {
    background: #161B22;
    padding: 1rem 1.25rem;
}
.term-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    font-feature-settings: 'liga' 0;
    color: #C9D1D9;
    margin-bottom: 0.15rem;
    white-space: pre-wrap;
}
.term-output {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    font-feature-settings: 'liga' 0;
    color: #8B949E;
    margin-bottom: 0.1rem;
    white-space: pre-wrap;
}

/* === JSON Syntax Highlighting === */
.prompt { color: #3FB950; margin-right: 0.5rem; }
.comment { color: #8B949E; }
.json-key { color: #58A6FF; }
.json-str { color: #3FB950; }
.json-num { color: #D29922; }
.json-bracket { color: #8B949E; }

/* === Cursor Blink === */
.cursor {
    animation: blink 1s steps(1) infinite;
    color: #C9D1D9;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* === API Status Bar === */
.api-status-bar {
    margin-bottom: 1rem;
}
.status-indicator {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-feature-settings: 'liga' 0;
    color: #3FB950;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.status-dot-live {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3FB950;
    display: inline-block;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* === Hero Section === */
.hero {
    max-width: 740px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
}
.hero-badges {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
}
.badge-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-feature-settings: 'liga' 0;
    color: #3FB950;
    display: block;
}
.badge-label {
    font-size: 0.75rem;
    color: #8B949E;
}

/* === Reference Section === */
.reference {
    max-width: 740px;
    margin: 0 auto;
    padding: 1.5rem 2rem 2rem;
}
.endpoint-group {
    margin-bottom: 1.5rem;
}

/* === Endpoint rows with details/summary === */
.endpoint-details {
    border-bottom: 1px solid #21262D;
}
.endpoint-details[open] {
    border-bottom-color: #30363D;
}
.endpoint-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    cursor: pointer;
    list-style: none;
}
.endpoint-row::-webkit-details-marker { display: none; }
.endpoint-row::marker { display: none; content: ''; }

/* === Method Badges === */
.method {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    font-feature-settings: 'liga' 0;
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 4.5rem;
    text-align: center;
    text-transform: uppercase;
    display: inline-block;
}
.method.get { background: rgba(88,166,255,0.15); color: #58A6FF; }
.method.post { background: rgba(63,185,80,0.15); color: #3FB950; }
.method.put { background: rgba(210,153,34,0.15); color: #D29922; }
.method.delete { background: rgba(248,81,73,0.15); color: #F85149; }

/* === Endpoint Path === */
.path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-feature-settings: 'liga' 0;
    color: #C9D1D9;
}

/* === Collapsible Response === */
.endpoint-response {
    padding: 0.5rem 0 0.75rem 0;
    margin-left: calc(4.5rem + 0.75rem);
}
.response-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8B949E;
    margin-bottom: 0.4rem;
}
.code-block {
    background: #0D1117;
    border: 1px solid #21262D;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    overflow-x: auto;
}
.code-block pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    font-feature-settings: 'liga' 0;
    color: #8B949E;
    margin: 0;
}

/* === SDK Quickstart === */
.quickstart {
    max-width: 740px;
    margin: 0 auto;
    padding: 1.5rem 2rem 2rem;
}
.sdk-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
}
.sdk-tab {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-feature-settings: 'liga' 0;
    color: #8B949E;
    background: #0D1117;
    border: 1px solid #30363D;
    border-bottom: none;
    padding: 0.4rem 1rem;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: color 0.2s, background 0.2s;
}
.sdk-tab:hover {
    color: #C9D1D9;
}
.sdk-tab.active {
    color: #C9D1D9;
    background: #161B22;
    border-bottom-color: #161B22;
}
.sdk-terminal {
    border-top-left-radius: 0;
    margin-top: 0;
}
.sdk-terminal .term-header {
    border-radius: 0;
}

/* === Playground Section === */
.playground {
    max-width: 740px;
    margin: 0 auto;
    padding: 1.5rem 2rem 2rem;
}
.playground-controls {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.control-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.control-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8B949E;
}
.city-selector {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-feature-settings: 'liga' 0;
    color: #C9D1D9;
    background: #0D1117;
    border: 1px solid #30363D;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238B949E'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.5rem;
}
.city-selector:focus {
    border-color: #3FB950;
    outline: none;
}
.city-selector option {
    background: #0D1117;
    color: #C9D1D9;
}
.run-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-feature-settings: 'liga' 0;
    color: #C9D1D9;
    background: #161B22;
    border: 1px solid #30363D;
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: border-color 0.2s, background 0.2s;
}
.run-btn:hover {
    border-color: #58A6FF;
    background: rgba(88,166,255,0.08);
}
.playground-terminal .term-body {
    min-height: 120px;
}

/* === Map Widget === */
.map-widget {
    border: 1px solid #30363D;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 1.5rem;
}
.map-header {
    background: #161B22;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #30363D;
}
.map-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-feature-settings: 'liga' 0;
    color: #8B949E;
}
.map-layers {
    display: flex;
    gap: 0.25rem;
}
.layer-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-feature-settings: 'liga' 0;
    color: #8B949E;
    background: transparent;
    border: 1px solid #30363D;
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.layer-btn:hover {
    color: #C9D1D9;
}
.layer-btn.active {
    color: #3FB950;
    border-color: #3FB950;
}
.map-canvas {
    background: #0D1117;
    padding: 1rem;
    display: flex;
    justify-content: center;
}
.map-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
}
.map-grid {
    stroke: #21262D;
    stroke-width: 0.5;
}
.map-point {
    fill: #58A6FF;
    transition: r 0.3s ease;
}
.map-point.transit-point { fill: #58A6FF; }
.map-route {
    stroke: #58A6FF;
    stroke-width: 1;
    opacity: 0.4;
}
.density-zone {
    opacity: 0.3;
    transition: opacity 0.3s;
}
.density-zone.high { fill: #F85149; }
.density-zone.med { fill: #D29922; }
.density-zone.low { fill: #3FB950; }
.infra-node {
    transition: fill 0.3s;
}
.infra-node.operational { fill: #3FB950; }
.infra-node.degraded { fill: #D29922; }
.infra-link {
    stroke: #30363D;
    stroke-width: 1;
    opacity: 0.5;
}
.map-city-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    fill: #8B949E;
}

/* === Cities Section === */
.cities {
    max-width: 740px;
    margin: 0 auto;
    padding: 1.5rem 2rem 2rem;
}
.city-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.city-pin {
    font-size: 0.85rem;
    color: #3FB950;
    padding: 0.3rem 0.75rem;
    border: 1px solid #21262D;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: border-color 0.2s;
}
.city-pin:hover {
    border-color: #3FB950;
}
.city-pin.more {
    color: #8B949E;
    border-style: dashed;
}
.pin-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* === Connect Section === */
.connect {
    max-width: 740px;
    margin: 0 auto;
    padding: 1.5rem 2rem 2rem;
}
.connect-desc {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #8B949E;
    margin-bottom: 1.25rem;
}

/* === Footer === */
.footer {
    max-width: 740px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
    text-align: center;
}
.footer-terminal {
    max-width: 400px;
    margin: 0 auto 1.25rem;
}
.footer-inner {
    margin-top: 0.5rem;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}
.flink {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #8B949E;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s;
}
.flink:hover {
    color: #58A6FF;
}
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3FB950;
    display: inline-block;
}
.footer-copy {
    font-size: 0.7rem;
    color: #8B949E;
}

/* === Fade-in Animations === */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 640px) {
    .hero-badges { flex-direction: column; gap: 0.75rem; }
    .playground-controls { flex-direction: column; align-items: stretch; }
    .run-btn { justify-content: center; }
    .endpoint-response { margin-left: 0; }
    .sdk-tabs { flex-wrap: wrap; }
    .map-layers { flex-wrap: wrap; }
}