/* =========================================================
   lpatil.dev — shared stylesheet
   Clean terminal aesthetic
   ========================================================= */

:root {
    --bg:        #0d0f12;
    --bg-soft:   #12151a;
    --fg:        #e6e6e6;
    --fg-soft:   #b8bec7;
    --fg-muted:  #6c7380;
    --prompt:    #7ee787;
    --link:      #f0b26b;
    --dir:       #7aa2f7;
    --string:    #f0b26b;
    --comment:   #6c7380;
    --rule:      #1d2029;
}

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

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

body {
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--fg-soft);
    font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', 'Menlo', monospace;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

::selection {
    background: var(--prompt);
    color: var(--bg);
}

a {
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px dashed transparent;
    transition: border-color .15s ease, color .15s ease;
}

a:hover { border-bottom-color: var(--link); }

/* ============ TOPBAR ============ */
header.topbar {
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    padding: 1.6rem 1.8rem 0.6rem;
    color: var(--fg-muted);
    font-size: 0.82rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--rule);
    position: relative;
    z-index: 1;
}

.topbar .title a {
    color: var(--fg);
    border-bottom: none;
    transition: color .15s ease;
}

.topbar .title a:hover { color: var(--prompt); }

.topbar-nav {
    display: flex;
    gap: 1.2rem;
    font-size: 0.82rem;
}

.topbar-nav a {
    color: var(--dir);
    border-bottom: 1px dashed transparent;
    padding-bottom: 1px;
}

.topbar-nav a:hover,
.topbar-nav a[aria-current="page"] {
    border-bottom-color: var(--dir);
}

.topbar-nav a[aria-current="page"] {
    color: var(--fg);
    border-bottom-color: var(--fg);
}

/* ============ TERMINAL BODY ============ */
main.term {
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    padding: 2.4rem 1.8rem 3rem;
    flex: 1;
    position: relative;
    z-index: 1;
}

.line {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 1.4rem;
}

.line:first-child { margin-top: 0; }

.prompt {
    color: var(--prompt);
    user-select: none;
    font-weight: 600;
}

.host {
    color: var(--fg-muted);
    user-select: none;
}

.cmd { color: var(--fg); }
.cmd .flag { color: var(--fg-muted); }
.cmd .str { color: var(--string); }

.out {
    color: var(--fg-soft);
    margin: 0.35rem 0 0;
    padding-left: 0;
}

.out.name {
    color: var(--fg);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.out.muted {
    color: var(--fg-muted);
    font-style: italic;
}

.out em {
    color: var(--fg);
    font-style: normal;
    font-weight: 500;
}

.back {
    color: var(--link);
    border-bottom: 1px dashed transparent;
}

.back:hover { border-bottom-color: var(--link); }

/* Blinking cursor */
.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1em;
    background: var(--fg);
    vertical-align: text-bottom;
    animation: blink 1.05s steps(2, end) infinite;
    margin-left: 0.15em;
}

@keyframes blink {
    to { background: transparent; }
}

/* Staggered fade-in */
.stagger > * {
    opacity: 0;
    transform: translateY(4px);
    animation: appear .5s ease-out forwards;
}
.stagger > *:nth-child(1)  { animation-delay: .05s; }
.stagger > *:nth-child(2)  { animation-delay: .22s; }
.stagger > *:nth-child(3)  { animation-delay: .39s; }
.stagger > *:nth-child(4)  { animation-delay: .56s; }
.stagger > *:nth-child(5)  { animation-delay: .73s; }
.stagger > *:nth-child(6)  { animation-delay: .90s; }
.stagger > *:nth-child(7)  { animation-delay: 1.05s; }
.stagger > *:nth-child(8)  { animation-delay: 1.20s; }
.stagger > *:nth-child(9)  { animation-delay: 1.35s; }
.stagger > *:nth-child(n+10) { animation-delay: 1.50s; }

@keyframes appear {
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .stagger > * { opacity: 1; transform: none; animation: none; }
    .cursor { animation: none; }
}

/* ============ LINKS LIST (social with icons) ============ */
.links {
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--fg-soft);
}

.links .row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.links a {
    color: var(--link);
    border-bottom: 1px dashed transparent;
}

.links a:hover { border-bottom-color: var(--link); }

.links .icon {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    color: var(--fg-muted);
    transition: color .15s ease, transform .15s ease;
}

.links .row:hover .icon {
    color: var(--link);
    transform: translateX(1px);
}

/* ============ PHOTO FRAME ============ */
.photo-frame {
    margin-top: 0.55rem;
    display: inline-block;
}

.photo {
    width: 170px;
    height: 170px;
    object-fit: cover;
    display: block;
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: var(--bg-soft);
    filter: saturate(0.95);
    transition: filter .25s ease, transform .25s ease;
}

.photo-frame:hover .photo {
    filter: saturate(1.08);
    transform: translateY(-1px);
}

.photo-meta {
    color: var(--fg-muted);
    font-size: 0.76rem;
    margin-top: 0.4rem;
    letter-spacing: 0.02em;
}

/* ============ TICKER / tail -f ============ */
.ticker-wrap {
    margin-top: 0.55rem;
    padding: 0.35rem 0;
    border-top: 1px dashed var(--rule);
    border-bottom: 1px dashed var(--rule);
    position: relative;
}

.ticker {
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.ticker-track {
    display: inline-flex;
    align-items: center;
    gap: 1.8rem;
    white-space: nowrap;
    padding-right: 1.8rem;
    animation: ticker-scroll 42s linear infinite;
    will-change: transform;
}

.ticker-wrap:hover .ticker-track { animation-play-state: paused; }

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.ticker .post {
    color: var(--fg-soft);
    display: inline-flex;
    align-items: baseline;
    gap: 0.6rem;
}

.ticker .date {
    color: var(--fg-muted);
    font-size: 0.82rem;
}

.ticker .tag {
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0 0.3rem;
    border: 1px solid currentColor;
    border-radius: 2px;
}

.tag.travel   { color: #f0b26b; }
.tag.tech     { color: #7aa2f7; }
.tag.thoughts { color: #bb9af7; }

.ticker .sep {
    color: var(--fg-muted);
    opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
    .ticker-track { animation: none; }
}

/* ============ TIMELINE (about page) ============ */
.timeline {
    margin-top: 0.8rem;
    padding: 0.2rem 0 0.2rem 1.2rem;
    border-left: 1px dashed var(--rule);
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}

.timeline .entry {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 1.2rem;
    align-items: baseline;
}

.timeline .year {
    color: var(--dir);
    font-weight: 600;
    font-size: 0.92rem;
}

.timeline .where {
    color: var(--fg);
    font-size: 1rem;
    margin-bottom: 0.1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.timeline .mark {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: var(--fg-muted);
    transition: color .2s ease, transform .2s ease;
}

.timeline .entry:hover .mark {
    color: var(--fg);
    transform: translateY(-1px);
}

.timeline .role {
    color: var(--fg-muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

/* ============ COMING SOON (section stubs) ============ */
.coming-soon {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    color: var(--fg-muted);
    font-style: italic;
    vertical-align: bottom;
    animation: type-cycle 5s steps(14) infinite alternate;
    width: 14ch;
}

@keyframes type-cycle {
    from { width: 0; }
    to   { width: 14ch; }
}

@media (prefers-reduced-motion: reduce) {
    .coming-soon { animation: none; width: auto; }
}

/* ============ GALLERY (thumbnail grid) ============ */
.gallery {
    margin-top: 1.1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.9rem;
}

.gallery figure {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.gallery figure a {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: var(--bg-soft);
    cursor: zoom-in;
}

.gallery figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s cubic-bezier(.22,.61,.36,1), filter .3s ease;
}

.gallery figure:hover img {
    transform: scale(1.05);
    filter: saturate(1.08) brightness(1.04);
}

.gallery figcaption {
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 0.76rem;
    color: var(--fg-muted);
}

.gallery .title {
    color: var(--fg);
    font-weight: 500;
}

.gallery .where {
    color: var(--fg-muted);
    text-align: right;
    letter-spacing: 0.02em;
}

@media (max-width: 520px) {
    .gallery { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
}

/* ============ LIGHTBOX ============ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(5, 6, 8, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 2rem;
}

.lightbox.open { display: flex; flex-direction: column; gap: 1rem; }

.lightbox img {
    max-width: 94vw;
    max-height: 84vh;
    border: 1px solid var(--rule);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
    background: var(--bg);
    object-fit: contain;
}

.lightbox-meta {
    color: var(--fg-muted);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    display: flex;
    gap: 1rem;
    align-items: baseline;
}

.lightbox-meta .title { color: var(--fg); font-weight: 500; }

.lightbox-close {
    position: absolute;
    top: 1.4rem;
    right: 1.8rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--fg-muted);
    cursor: pointer;
    z-index: 1001;
}

.lightbox-close:hover { color: var(--link); }

/* ============ FOOTER ============ */
footer.bottombar {
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    padding: 1rem 1.8rem 1.4rem;
    color: var(--fg-muted);
    font-size: 0.72rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1px solid var(--rule);
    position: relative;
    z-index: 1;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 560px) {
    body { font-size: 0.9rem; }
    header.topbar, main.term, footer.bottombar {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
    }
    .topbar { flex-wrap: wrap; gap: 0.6rem 1rem; }
    .topbar-nav { gap: 0.9rem; font-size: 0.78rem; }
    .line { gap: 0.45rem; }
    .timeline .entry { grid-template-columns: 78px 1fr; gap: 0.9rem; }
}
