/* ============================
   JAYORU PORTFOLIO — DESIGN SYSTEM
   Brutalist, monochrome, industrial
   ============================ */

/* --- RESET & BASE --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
    background: #fff;
    color: #000;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: #e5e5e5;
}

/* --- APP CONTAINER --- */
.app-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    touch-action: none;
}

/* --- DOT GRID BACKGROUND --- */
.dot-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.05;
    background-image: radial-gradient(#000 2px, transparent 2px);
    background-size: 30px 30px;
}

/* --- BACKGROUND TEXT --- */
.bg-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 15vw;
    font-weight: 800;
    opacity: 0.02;
    pointer-events: none;
    user-select: none;
    letter-spacing: -0.05em;
    white-space: nowrap;
}

/* --- GRAPH LAYER --- */
.graph-layer {
    position: absolute;
    inset: 0;
}

.edges-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.edges-svg line {
    transition: opacity 0.3s, stroke-width 0.3s;
}

/* --- NODES --- */
.node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    cursor: grab;
    z-index: 10;
    transition: transform 0.2s;
    animation: nodeAppear 0.5s ease both;
}

.node:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.node.active {
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 40;
}

.node.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 50;
}

/* Hover ring */
.node-ring {
    position: absolute;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 1px dashed #aaa;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.node:hover .node-ring,
.node.hover-ring .node-ring {
    opacity: 1;
}

.node.active .node-ring {
    opacity: 0;
}

/* Node shapes */
.node-shape {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 3px solid #000;
    transition: all 0.2s;
}

.node-shape.core {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    transform: rotate(45deg);
    box-shadow: 4px 4px 0 0 #000;
}

.node-shape.core .node-icon-inner {
    transform: rotate(-45deg);
}

.node-shape.info,
.node-shape.folder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 4px 4px 0 0 #000;
}

.node-shape.project {
    width: 40px;
    height: 40px;
    border-radius: 0;
    box-shadow: 4px 4px 0 0 #000;
}

.node-shape.project:hover {
    background: #000;
    color: #fff;
}

.node-shape.paper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border-style: dashed;
    box-shadow: 4px 4px 0 0 #000;
}

.node-shape.paper:hover {
    background: #000;
    color: #fff;
}

/* Active state */
.node.active .node-shape {
    background: #000;
    color: #fff;
    box-shadow: 8px 8px 0 0 #000;
}

/* Node label */
.node-label {
    margin-top: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    padding: 2px 8px;
    background: #fff;
    border: 2px solid transparent;
    transition: all 0.2s;
    user-select: none;
    pointer-events: none;
    white-space: nowrap;
    font-size: 13px;
}

.node:hover .node-label {
    border-color: #e0e0e0;
}

.node.active .node-label {
    border-color: #000;
    box-shadow: 4px 4px 0 0 #000;
}

/* --- ICON PLACEHOLDERS (Lucide) --- */
.node-icon-inner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-icon-inner svg {
    width: 20px;
    height: 20px;
}

.node-shape.core .node-icon-inner svg {
    width: 32px;
    height: 32px;
}

.node-shape.project .node-icon-inner {
    width: 12px;
    height: 12px;
    background: #000;
    border-radius: 2px;
}

.node-shape.project:hover .node-icon-inner {
    background: #fff;
}

.node.active .node-shape.project .node-icon-inner {
    background: #fff;
}

/* --- CLI BAR --- */
.cli-bar-wrapper {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90vw;
    z-index: 60;
    pointer-events: none;
}

.cli-bar {
    background: #fff;
    border: 4px solid #000;
    box-shadow: 8px 8px 0 0 #000;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.cli-dot {
    color: #16a34a;
    font-weight: 800;
    animation: pulse 2s ease-in-out infinite;
}

.cli-time {
    color: #aaa;
    font-size: 0.85rem;
    white-space: nowrap;
}

.cli-text {
    font-weight: 700;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
}

.cli-badge {
    font-size: 0.7rem;
    background: #000;
    color: #fff;
    padding: 4px 8px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    animation: fadeIn 0.3s ease;
}

/* --- PANELS (Side) --- */
.side-panel {
    position: absolute;
    top: 0;
    height: 100%;
    width: 400px;
    max-width: 90vw;
    padding: 32px;
    z-index: 40;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.side-panel.left {
    left: 0;
    background: #fff;
    color: #000;
    border-right: 4px solid #000;
    box-shadow: 15px 0 0 0 rgba(0,0,0,0.1);
    animation: slideInLeft 0.5s cubic-bezier(0.87, 0, 0.13, 1) both;
}

.side-panel.right {
    right: 0;
    background: #000;
    color: #fff;
    border-left: 4px solid #000;
    box-shadow: -15px 0 0 0 rgba(0,0,0,0.1);
    animation: slideInRight 0.5s cubic-bezier(0.87, 0, 0.13, 1) both;
    justify-content: center;
}

.panel-close {
    position: absolute;
    top: 24px;
    padding: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-close svg {
    width: 20px;
    height: 20px;
}

.left .panel-close {
    right: 24px;
    background: #000;
    color: #fff;
}

.left .panel-close:hover {
    background: #333;
}

.right .panel-close {
    left: 24px;
    background: #fff;
    color: #000;
}

.right .panel-close:hover {
    background: #e0e0e0;
}

.panel-icon {
    margin-bottom: 24px;
}

.panel-icon svg {
    width: 48px;
    height: 48px;
}

.panel-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 48px;
    text-transform: uppercase;
    letter-spacing: -0.04em;
}

.panel-content {
    color: #555;
    line-height: 1.65;
    margin-bottom: 32px;
    border-left: 4px solid #000;
    padding-left: 16px;
}

.panel-tags-box {
    background: #f9f9f9;
    border: 2px solid #000;
    padding: 16px;
}

.panel-tags-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #999;
    margin-bottom: 8px;
    display: block;
}

.panel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.panel-tag {
    font-size: 0.75rem;
    font-weight: 700;
    background: #000;
    color: #fff;
    padding: 4px 8px;
}

/* Contact links */
.contact-link {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 2px solid #333;
    padding-bottom: 16px;
    margin-bottom: 24px;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s;
}

.contact-link:hover {
    border-color: #fff;
}

.contact-link svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.contact-link span {
    font-size: 1.1rem;
    font-weight: 700;
    transition: transform 0.2s;
}

.contact-link:hover span {
    transform: translateX(8px);
}

/* --- MODAL (Paper / Blueprint) --- */
.modal-overlay {
    position: absolute;
    inset: 16px;
    z-index: 50;
    animation: zoomIn 0.5s ease both;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .modal-overlay.paper-modal {
        inset: 10%;
    }
    .modal-overlay.blueprint-modal {
        inset: 48px;
    }
}

.modal-overlay {
    background: #fff;
    border: 4px solid #000;
    box-shadow: 20px 20px 0 0 #000;
}

/* --- PAPER MODAL --- */
.paper-header {
    border-bottom: 4px solid #000;
    background: #000;
    color: #fff;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.paper-header-label {
    font-weight: 700;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.paper-header-label .blink-dot {
    width: 12px;
    height: 12px;
    background: #fff;
    display: block;
    animation: pulse 2s ease-in-out infinite;
}

.paper-close,
.blueprint-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.paper-close:hover {
    color: #f87171;
}

.paper-close svg,
.blueprint-close svg {
    width: 24px;
    height: 24px;
}

.paper-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: #fafafa;
    position: relative;
}

@media (min-width: 1024px) {
    .paper-body {
        padding: 48px;
    }
}

.paper-lines-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 39px, #000 39px, #000 40px);
}

.paper-inner {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.paper-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #999;
    margin-bottom: 16px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.paper-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 32px;
    line-height: 1.1;
    border-bottom: 8px solid #000;
    padding-bottom: 32px;
}

@media (min-width: 1024px) {
    .paper-title {
        font-size: 3rem;
    }
}

.paper-meta {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 48px;
}

@media (min-width: 1024px) {
    .paper-meta {
        flex-direction: row;
    }
}

.paper-meta-card {
    flex: 1;
    border: 2px solid #000;
    padding: 16px;
    background: #fff;
    box-shadow: 4px 4px 0 0 #000;
}

.paper-meta-label {
    display: block;
    font-size: 0.7rem;
    color: #aaa;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.15em;
}

.paper-meta-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.paper-abstract-box {
    border: 4px solid #000;
    position: relative;
    padding: 32px;
    margin-bottom: 48px;
    background: #fff;
}

@media (min-width: 1024px) {
    .paper-abstract-box {
        padding: 40px;
    }
}

.paper-abstract-label {
    position: absolute;
    top: 0;
    left: 0;
    background: #000;
    color: #fff;
    font-weight: 700;
    padding: 4px 16px;
    transform: translateY(-100%);
    border: 4px solid #000;
    border-bottom: none;
    letter-spacing: 0.15em;
    font-size: 0.85rem;
}

.paper-abstract-text {
    font-size: 1.1rem;
    line-height: 1.7;
    text-align: justify;
    font-weight: 500;
    color: #333;
}

.paper-link-wrap {
    display: flex;
    justify-content: center;
}

.paper-link {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    background: #000;
    color: #fff;
    padding: 20px 32px;
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
    border: 4px solid #000;
    transition: all 0.2s;
}

.paper-link:hover {
    background: #fff;
    color: #000;
    box-shadow: 8px 8px 0 0 #000;
}

.paper-link:active {
    transform: translateY(4px);
    box-shadow: none;
}

.paper-link svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s;
}

.paper-link:hover svg {
    transform: rotate(12deg);
}

/* --- BLUEPRINT MODAL --- */
.blueprint-bg-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.08;
    background-image:
        linear-gradient(#000 1px, transparent 1px),
        linear-gradient(90deg, #000 1px, transparent 1px);
    background-size: 40px 40px;
}

.blueprint-corner {
    position: absolute;
    width: 32px;
    height: 32px;
    pointer-events: none;
    border-color: #000;
    border-style: solid;
    border-width: 0;
}

.blueprint-corner.tl { top: 24px; left: 24px; border-top-width: 4px; border-left-width: 4px; }
.blueprint-corner.tr { top: 24px; right: 24px; border-top-width: 4px; border-right-width: 4px; }
.blueprint-corner.bl { bottom: 24px; left: 24px; border-bottom-width: 4px; border-left-width: 4px; }
.blueprint-corner.br { bottom: 24px; right: 24px; border-bottom-width: 4px; border-right-width: 4px; }

.blueprint-close {
    position: absolute;
    top: 40px;
    right: 40px;
    padding: 8px;
    background: #000;
    color: #fff;
    z-index: 50;
    border: none;
    cursor: pointer;
    box-shadow: 4px 4px 0 0 rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.blueprint-close:hover {
    box-shadow: none;
    transform: translate(4px, 4px);
    background: #333;
}

.blueprint-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    padding: 32px;
    overflow-y: auto;
}

@media (min-width: 1024px) {
    .blueprint-body {
        flex-direction: row;
        padding: 48px;
    }
}

/* Left: Schema visual */
.blueprint-schema {
    flex: 1;
    border: 4px solid #000;
    position: relative;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    min-height: 350px;
    margin-bottom: 32px;
}

@media (min-width: 1024px) {
    .blueprint-schema {
        margin-right: 32px;
        margin-bottom: 0;
    }
}

.blueprint-schema-x {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.1;
}

.blueprint-schema-x line {
    stroke: #000;
    stroke-width: 2;
}

.blueprint-circle-outer {
    width: 256px;
    height: 256px;
    border: 4px solid #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #fff;
    box-shadow: 8px 8px 0 0 #000;
}

.blueprint-circle-dashed {
    position: absolute;
    width: 224px;
    height: 224px;
    border: 2px dashed #000;
    border-radius: 50%;
    animation: spin 30s linear infinite;
}

.blueprint-hex {
    z-index: 1;
}

.blueprint-hex svg {
    width: 96px;
    height: 96px;
    animation: pulse 4s ease-in-out infinite;
}

.blueprint-obj-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 4px 12px;
    font-weight: 800;
    font-size: 1.2rem;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 0 #000;
    z-index: 2;
}

.blueprint-schema-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #000;
    color: #fff;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.blueprint-schema-badge .green-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Right: Info */
.blueprint-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255,255,255,0.9);
}

@media (min-width: 1024px) {
    .blueprint-info {
        width: 450px;
        border-left: 4px solid #000;
        padding-left: 32px;
    }
}

.blueprint-title {
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    line-height: 1;
    margin-bottom: 8px;
    word-break: break-word;
}

@media (min-width: 1024px) {
    .blueprint-title {
        font-size: 3.5rem;
    }
}

.blueprint-type {
    color: #999;
    font-weight: 700;
    margin-bottom: 32px;
    border-bottom: 4px solid #000;
    padding-bottom: 16px;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
}

.blueprint-desc {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 32px;
    border-left: 4px solid #000;
    padding-left: 16px;
}

.blueprint-specs-box {
    background: #fafafa;
    border: 2px solid #000;
    padding: 20px;
    margin-bottom: 32px;
    box-shadow: 4px 4px 0 0 #000;
}

.blueprint-specs-title {
    font-weight: 800;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.blueprint-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 8px;
    margin-top: 12px;
}

.blueprint-spec-key {
    color: #999;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
}

.blueprint-spec-val {
    font-weight: 700;
    font-size: 0.85rem;
    background: #fff;
    padding: 0 4px;
}

.blueprint-stack-label {
    font-weight: 800;
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 12px;
}

.blueprint-stack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.blueprint-stack-tag {
    border: 2px solid #000;
    background: #fff;
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 2px 2px 0 0 #000;
}

.blueprint-footer {
    margin-top: 32px;
    border: 4px solid #000;
    padding: 20px;
    background: #000;
    color: #fff;
}

@media (min-width: 1024px) {
    .blueprint-footer {
        margin-top: 48px;
    }
}

.blueprint-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
    margin-bottom: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
}

.blueprint-footer-label {
    color: #999;
    display: block;
    margin-bottom: 4px;
}

.blueprint-footer-status {
    color: #4ade80;
}

.blueprint-deploy-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #fff;
    color: #000;
    padding: 16px;
    font-weight: 800;
    font-size: 1.1rem;
    text-decoration: none;
    border: 2px solid transparent;
    transition: background 0.2s;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
}

.blueprint-deploy-btn:hover {
    background: #e0e0e0;
}

.blueprint-deploy-btn:active {
    transform: scale(0.97);
}

.blueprint-deploy-btn svg {
    width: 24px;
    height: 24px;
}

/* --- ANIMATIONS --- */
@keyframes nodeAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- UTILITY --- */
.hidden {
    display: none !important;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .side-panel {
        width: 100%;
        max-width: 100%;
    }

    .cli-bar {
        font-size: 0.75rem;
    }

    .paper-title {
        font-size: 1.8rem;
    }

    .blueprint-title {
        font-size: 2rem;
    }

    .blueprint-circle-outer {
        width: 180px;
        height: 180px;
    }

    .blueprint-circle-dashed {
        width: 155px;
        height: 155px;
    }

    .blueprint-hex svg {
        width: 64px;
        height: 64px;
    }
}

/* --- DARK THEME OVERRIDES --- */
html.dark-theme {
    filter: invert(1) hue-rotate(180deg);
}

