/* ============================================
   Landing Page - Dimasqi Ramadhani
   Sidebar Rail layout. No scroll (100dvh + clamp).
   Consistent with cyberfolio-cms design system.
   ============================================ */

/* --- CSS Variables --- */
:root,
[data-theme="dark"] {
    --bg: #020617;
    --bg-rail: #0b1120;
    --bg-card: #0f172a;
    --bg-card-hover: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --text-faint: #475569;
    --border: #1e293b;
    --accent: #10b981;
    --accent-hover: #34d399;
    --accent-subtle: rgba(16, 185, 129, 0.1);
    --accent-border: rgba(16, 185, 129, 0.3);
    --radius: 16px;
    --radius-sm: 9px;
    --shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-heading: 'Sora', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
    --bg: #f8fafc;
    --bg-rail: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

/* --- Body: lock to viewport, no scroll --- */
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    transition: background 0.4s ease, color 0.4s ease;
    position: relative;
    overflow: hidden;
}

html[data-theme] * {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

/* --- Grid background --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(16, 185, 129, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* --- Glow effect --- */
body::after {
    content: '';
    position: fixed;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 700px;
    max-width: 120vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.07) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* --- Shell: full-bleed, fills the entire viewport --- */
.shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: clamp(96px, 9vw, 140px) 1.15fr 0.85fr;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    border: none;
    border-radius: 0;
    overflow: hidden;
    animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   SIDEBAR RAIL
   ============================================ */
.rail {
    background: var(--bg-rail);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(1rem, 2.5vh, 1.5rem) 0;
    gap: clamp(0.6rem, 1.4vh, 1rem);
}

/* Profile photo */
.rail-photo {
    width: clamp(52px, 5.5vw, 72px);
    height: clamp(52px, 5.5vw, 72px);
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-card-hover);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.rail-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback initials (shown when no image) */
.rail-photo .initials {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
}

/* Online status dot under photo */
.rail-status {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50%       { opacity: 0.8; transform: scale(0.9); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

.rail-spacer {
    flex: 1 1 auto;
    min-height: 0;
}

/* Rail icon buttons (social + toggle) */
.rail-btn {
    width: clamp(40px, 3vw, 46px);
    height: clamp(40px, 3vw, 46px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.05rem;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.2s, transform 0.15s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.rail-btn:hover {
    color: var(--accent);
    background: transparent;
    border: none;
    transform: translateY(-2px);
}

.rail-divider {
    width: 30px;
    height: 1px;
    background: var(--border);
    flex-shrink: 0;
    margin: 2px 0;
}

/* Theme toggle — icon only, no border or background */
.theme-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    transform: none;
}
.theme-btn:hover {
    background: transparent;
    border: none;
    color: var(--accent);
    transform: translateY(-2px);
}

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ============================================
   CONTENT AREA
   ============================================ */
.content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: clamp(1.5rem, 5vh, 3.5rem) clamp(1.5rem, 4vw, 4rem);
    min-width: 0;
    overflow: hidden;
}

/* Subtle grid + glow inside the content area */
.content::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(16, 185, 129, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
    z-index: 0;
}

.content::after {
    content: '';
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 700px;
    max-width: 90%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.content-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent);
    margin-bottom: clamp(0.8rem, 2vh, 1.25rem);
    letter-spacing: 0.5px;
}

.status-badge .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    animation: statusPulse 2s ease-in-out infinite;
}

/* Name */
.name {
    font-family: var(--font-heading);
    font-size: clamp(1.7rem, 3.4vw, 2.9rem);
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
    margin-bottom: 0.4rem;
    line-height: 1.12;
}

/* Tagline */
.tagline {
    font-family: var(--font-mono);
    font-size: clamp(0.8rem, 1.3vw, 1rem);
    color: var(--accent);
    margin-bottom: clamp(0.9rem, 2vh, 1.4rem);
    letter-spacing: 0.3px;
    min-height: 1.2em;
}

/* Bio */
.bio {
    font-size: clamp(0.86rem, 1.1vw, 1.02rem);
    color: var(--text-muted);
    line-height: 1.75;
    max-width: 520px;
    margin-bottom: clamp(1.2rem, 3vh, 2rem);
}

/* Primary button */
.btn-portfolio {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: clamp(0.7rem, 1.4vh, 0.95rem) clamp(1.6rem, 2vw, 2.2rem);
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    color: #fff;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(0.86rem, 1vw, 0.98rem);
    margin-bottom: clamp(1.2rem, 3vh, 2rem);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-portfolio:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

/* Skills */
.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    max-width: 560px;
}

.skill-tag {
    padding: 0.3rem 0.8rem;
    background: var(--accent-subtle);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 50px;
    font-size: clamp(0.68rem, 0.8vw, 0.78rem);
    font-weight: 500;
    color: var(--accent);
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
}

/* ============================================
   TERMINAL PANEL (right column)
   ============================================ */
.panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* padding: clamp(1.5rem, 4vh, 3rem) clamp(1.5rem, 3vw, 3rem) clamp(1.5rem, 4vh, 3rem) 0; */
    border-left: 1px solid var(--border);
    min-width: 0;
}

.terminal {
    width: 100%;
    max-width: 420px;
    background: var(--bg-rail);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0.7rem 0.9rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.terminal-bar .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-red   { background: #ef4444; }
.dot-amber { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
    margin-left: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-faint);
}

.terminal-body {
    padding: 1.25rem 1.3rem;
    font-family: var(--font-mono);
    font-size: clamp(0.74rem, 0.9vw, 0.82rem);
    line-height: 2;
}

.term-line { color: var(--text-faint); }
.term-prompt { color: var(--text-faint); }
.term-cmd { color: var(--accent); }

.term-out {
    color: var(--text-muted);
    margin: 0.2rem 0 1rem;
    line-height: 1.65;
}

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

.term-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin: 0.55rem 0 1rem;
}

.term-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.85rem;
}

.term-stat-num {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1.05rem, 1.4vw, 1.3rem);
    color: var(--accent);
    line-height: 1.1;
}

.term-stat-label {
    font-size: clamp(0.58rem, 0.7vw, 0.64rem);
    color: var(--text-muted);
    line-height: 1.3;
}

.term-projects {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.55rem 0 1rem;
}

.term-project {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.75rem;
    text-decoration: none;
    color: var(--text-muted);
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
}

.term-project i:first-child {
    color: var(--accent);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.term-project-name {
    font-size: clamp(0.68rem, 0.85vw, 0.76rem);
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.term-project-arrow {
    margin-left: auto;
    color: var(--text-faint);
    font-size: 0.72rem;
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}

.term-project:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
    transform: translateX(2px);
}

.term-project:hover .term-project-arrow {
    color: var(--accent);
    transform: translateX(3px);
}

.term-caret {
    color: var(--accent);
    animation: blink 1.1s step-end infinite;
}

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

/* Copyright */
.copyright {
    font-family: var(--font-mono);
    font-size: clamp(0.62rem, 0.75vw, 0.7rem);
    color: var(--text-faint);
    white-space: nowrap;
    letter-spacing: 0.3px;
    margin-top: clamp(1rem, 3vh, 1.75rem);
}

/* ============================================
   RESPONSIVE — Tablet & Mobile
   ============================================ */

/* Mobile photo: hidden on desktop, shown on mobile */
.mobile-photo {
    display: none;
}


/* Tablet & small laptop: drop the terminal panel, content fills */
@media (max-width: 1024px) {
    .shell {
        grid-template-columns: clamp(96px, 9vw, 140px) 1fr;
    }
    .panel {
        display: none;
    }
}

@media (max-width: 720px) {
    .shell {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        max-width: 480px;
    }
    .content {
        order: 1;
        text-align: center;
        align-items: center;
        padding: clamp(1rem, 3vh, 1.5rem) clamp(1.25rem, 5vw, 2rem) clamp(1rem, 3vh, 1.5rem);
    }
    .bio { margin-left: auto; margin-right: auto; }
    .skills { justify-content: center; }
    .mobile-photo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 130px;
        height: 130px;
        border-radius: 50%;
        border: 2px solid var(--border);
        background: var(--bg-card-hover);
        overflow: hidden;
        margin-bottom: 1rem;
        flex-shrink: 0;
    }
    .mobile-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    .mobile-photo .initials {
        font-family: var(--font-heading);
        font-weight: 700;
        font-size: 1.3rem;
        color: var(--accent);
    }

    /* Rail becomes a footer bar */
    .rail {
        order: 2;
        flex-direction: row;
        justify-content: center;
        border-right: none;
        border-top: 1px solid var(--border);
        padding: clamp(0.8rem, 2vh, 1.1rem) 1rem;
        gap: 0.6rem;
    }

    .rail-photo,
    .rail-status,
    .rail-spacer {
        display: none;
    }

    .rail-divider {
        width: 1px;
        height: 30px;
        margin: 0 2px;
    }

    .copyright { display: none; }
    .status-badge {
        font-size: 0.62rem;
        padding: 0.25rem 0.7rem;
    }

    .name {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .bio {
        font-size: 0.82rem;
        margin-left: auto;
        margin-right: auto;
    }

    .btn-portfolio {
        font-size: 0.82rem;
        padding: 0.65rem 1.4rem;
    }

    .skill-tag {
        font-size: 0.62rem;
        padding: 0.25rem 0.65rem;
    }
}

@media (max-width: 380px) {
    .name { font-size: 1.4rem; }
    .rail-btn {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
    .rail { gap: 0.45rem; }
}

/* Short landscape screens: tighten vertical rhythm */
@media (max-height: 560px) and (min-width: 721px) {
    .status-badge { margin-bottom: 0.6rem; }
    .bio { margin-bottom: 0.8rem; -webkit-line-clamp: 3; line-clamp: 3; }
    .btn-portfolio { margin-bottom: 0.8rem; }
}