/* ============================================================
   RAMANPREET SINGH — Personal Site
   Aesthetic: Off-white + deep teal
   Type: Inter (body) + JetBrains Mono (accent/meta)
   ============================================================ */

:root {
    /* Off-white + deep teal palette. Warm off-white background,
       deep forest ink, rich teal as the brand accent. */
    --c-bg: #f7f8f6;             /* warm off-white */
    --c-bg-elevated: #eef2ee;    /* soft green-white for cards / chips */
    --c-ink: #1a2820;            /* deep forest — primary text */
    --c-ink-700: #2d4038;        /* dark green-ink body text */
    --c-ink-500: #4d6358;        /* muted teal-green — secondary */
    --c-ink-300: #7a9488;        /* light sage — meta / labels */
    --c-rule: #c8d8d0;           /* soft sage hairlines */
    --c-accent: #0f766e;         /* deep teal — brand */
    --c-accent-soft: #d0e9e4;    /* teal tint — chip fills, hover bg */

    /* Type */
    --f-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --f-mono: 'JetBrains Mono', ui-monospace, monospace;

    /* Rhythm */
    --space-section: clamp(5rem, 10vw, 8rem);
}

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

html {
    scroll-behavior: smooth;
    /* Prevent horizontal scrollbar if any element accidentally overshoots
       the viewport width (e.g., animated canvas, long unbreakable strings). */
    overflow-x: hidden;
}

/* ============================================================
   HIDDEN SCROLLBARS
   Scrolling still works (mouse wheel, trackpad, keyboard); only the
   visible track is hidden. Note: some users rely on the scrollbar as
   a cue that content extends beyond the viewport.
   ============================================================ */

/* Firefox */
html { scrollbar-width: none; }

/* Chrome, Safari, Edge */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

body {
    background: var(--c-bg);
    color: var(--c-ink);
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

::selection {
    background: var(--c-accent);
    color: white;
}

/* ============================================================
   NEURAL NETWORK BACKGROUND CANVAS
   Fixed behind content; content sits above via z-index.
   ============================================================ */

#neural-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.75;
}

/* Layer content above canvas */
.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 5vw, 2rem);
    /* No background — canvas is visible through the content column.
       Stars are drawn at low opacity so text stays readable. */
}

/* Subtle glass effect on content sections so they "float" above the network */
.hero, .section, .footer {
    position: relative;
}

/* ============================================================
   SECTION STRUCTURE
   ============================================================ */

.section {
    padding: var(--space-section) 0 0;
}

.section__label {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-ink-500);
    margin-bottom: 2.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--c-rule);
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
    padding-top: clamp(2.5rem, 6vw, 5rem);
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--c-accent);
    background-image: linear-gradient(135deg, #0d9488 0%, #0a2e28 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    box-shadow:
        0 4px 20px rgba(15, 118, 110, 0.25),
        0 0 0 1px rgba(15, 118, 110, 0.08);
}

.avatar__text {
    font-family: var(--f-body);
    font-weight: 500;
    font-size: 1.95rem;
    color: white;
    letter-spacing: -0.02em;
    line-height: 1;
}

.hero__name {
    font-family: var(--f-body);
    font-size: clamp(2.4rem, 6vw, 3.4rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin-bottom: 1.25rem;
    color: var(--c-ink);
}

/* ----- Typewriter ----- */
.hero__tagline {
    font-family: var(--f-mono);
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    font-weight: 500;
    color: var(--c-accent);
    min-height: 2.4em;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

.typewriter { display: inline; }

#typed-text { color: var(--c-accent); }

.cursor {
    display: inline-block;
    color: var(--c-accent);
    margin-left: 2px;
    font-weight: 400;
    animation: blink 1.05s steps(1) infinite;
    transform: translateY(-1px);
}

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

.hero__bio {
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--c-ink-700);
    max-width: 36em;
    margin-bottom: 2.5rem;
	text-align: justify;
}

.hero__status {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: var(--c-ink-500);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    letter-spacing: 0.01em;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22); }
    50%      { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.08); }
}

/* ============================================================
   SKILLS
   ============================================================ */

.skills {
    display: grid;
    gap: 2rem;
}

.skill-group__title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--c-ink);
    margin-bottom: 0.75rem;
    letter-spacing: -0.005em;
}

/* Horizontal row of skill pills, wrapping to multiple lines as needed.
   Each <li> renders as a small tag with a subtle bullet dot prefix. */
.skill-group__tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0;
    margin: 0;
}

.skill-group__tags li {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    background: var(--c-bg-elevated);
    border: 1px solid var(--c-rule);
    border-radius: 16px;
    font-size: 0.85rem;
    color: var(--c-ink-700);
    line-height: 1.3;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.skill-group__tags li:hover {
    border-color: var(--c-accent);
    background: var(--c-accent-soft);
    color: var(--c-ink);
}

/* Legacy paragraph version kept for safety in case any skill list
   hasn't been migrated to the tag format yet. */
.skill-group__list {
    color: var(--c-ink-500);
    font-size: 0.94rem;
    line-height: 1.65;
}

/* ============================================================
   EXPERIENCE
   ============================================================ */

.experience {
    display: grid;
    gap: 3rem;
}

.role {
    padding-top: 2rem;
    border-top: 1px solid var(--c-rule);
}

.role:first-child {
    padding-top: 0;
    border-top: none;
}

.role__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.role__company {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--c-ink);
    letter-spacing: -0.015em;
    margin-bottom: 0.15rem;
}

.role__title {
    font-size: 0.88rem;
    color: var(--c-ink-500);
    font-weight: 400;
}

.role__date {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: var(--c-ink-500);
    letter-spacing: 0.01em;
    padding-top: 0.3rem;
    white-space: nowrap;
}

.role__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.role__metrics span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: var(--c-accent-soft);
    border: 1px solid var(--c-rule);
    border-radius: 6px;
    font-family: var(--f-mono);
    font-size: 0.78rem;
    color: var(--c-ink-700);
    letter-spacing: -0.01em;
}

.role__metrics strong {
    color: var(--c-accent);
    font-weight: 600;
}

.role__summary {
    color: var(--c-ink-700);
    font-size: 0.98rem;
    line-height: 1.7;
    max-width: 42em;
	text-align: justify;
}

/* ============================================================
   AWARDS + EDUCATION
   ============================================================ */

.awards, .education {
    list-style: none;
    display: grid;
    gap: 1rem;
}

.awards li, .education li {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 1.5rem;
    align-items: baseline;
    padding-bottom: 1rem;
}

.awards li:last-child, .education li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.awards__year, .education__year {
    font-family: var(--f-mono);
    font-size: 0.8rem;
    color: var(--c-ink-500);
    letter-spacing: 0.01em;
}

.awards li > span:last-child {
    color: var(--c-ink);
    font-size: 0.96rem;
}

.education__detail {
    display: grid;
    gap: 0.25rem;
}

.education__detail strong {
    color: var(--c-ink);
    font-weight: 600;
    font-size: 1rem;
}

.education__detail span {
    color: var(--c-ink-500);
    font-size: 0.9rem;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    padding: var(--space-section) 0 3rem;
}

/* Top row of footer — headline on left, social icons on right */
.footer__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.footer__headline {
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--c-ink);
    max-width: 14em;
    margin: 0;
}

/* Bottom row — centered copyright + location, with breathing room above */
.footer__bottom {
    padding-top: 2.5rem;
    border-top: 1px solid var(--c-rule);
    text-align: center;
    font-family: var(--f-mono);
    font-size: 0.78rem;
    color: var(--c-ink-500);
    letter-spacing: 0.02em;
}

.footer__bottom p {
    margin: 0;
}

/* Footer icon row */
.footer__links {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.footer__links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--c-ink-700);
    border: 1px solid var(--c-rule);
    border-radius: 50%;
    background: var(--c-bg-elevated);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer__links a svg {
    width: 18px;
    height: 18px;
}

.footer__links a:hover {
    background: var(--c-accent);
    color: white;
    border-color: var(--c-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.25);
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */

[data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hero.is-visible .avatar       { animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both; }
.hero.is-visible .hero__name   { animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both; }
.hero.is-visible .hero__tagline{ animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both; }
.hero.is-visible .hero__bio    { animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both; }
.hero.is-visible .hero__status { animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both; }

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    [data-reveal] { opacity: 1; transform: none; }
    .cursor      { animation: none; opacity: 1; }
    .dot         { animation: none; }
    #neural-bg   { display: none; } /* hide animated bg entirely */
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 560px) {
    .role__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .role__date {
        padding-top: 0.25rem;
    }

    .awards li, .education li {
        grid-template-columns: 55px 1fr;
        gap: 1rem;
    }

    .hero__tagline {
        min-height: 3em;
    }

    /* On narrow screens there are no side margins to display the
       pipeline diagram in — hide it entirely so it doesn't appear
       behind and disrupt content legibility. */
    #neural-bg { display: none; }
}

/* Also hide when the viewport is too narrow to fit content + diagram
   comfortably side-by-side. 900px is roughly the point where the
   content column (720px) starts touching the diagram branches. */
@media (max-width: 900px) {
    #neural-bg { opacity: 0.25; }
}

/* ============================================================
   PRINT
   ============================================================ */

@media print {
    body { background: white; color: black; }
    #neural-bg { display: none; }
    [data-reveal] { opacity: 1; transform: none; }
    .cursor, .dot { display: none; }
}

/* ============================================================
   EXPLAINER BUTTON + MODAL
   ============================================================ */

/* Fixed ? button — bottom-right corner, always visible */
.explainer-btn {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    z-index: 100;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--c-rule);
    background: var(--c-bg-elevated);
    color: var(--c-ink-500);
    font-family: var(--f-mono);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 12px rgba(15, 118, 110, 0.12);
}

.explainer-btn:hover {
    background: var(--c-accent);
    color: white;
    border-color: var(--c-accent);
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(15, 118, 110, 0.28);
}

/* Full-screen overlay — hidden by default */
.explainer-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(26, 40, 32, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.explainer-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

/* Modal card */
.explainer-modal {
    position: relative;
    background: var(--c-bg-elevated);
    border: 1px solid var(--c-rule);
    border-radius: 16px;
    padding: 2.5rem 2.5rem 2rem;
    max-width: 560px;
    width: 100%;
    box-shadow: 0 24px 48px rgba(26, 40, 32, 0.18);
    transform: translateY(12px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.explainer-overlay.is-open .explainer-modal {
    transform: translateY(0);
}

/* Close button */
.explainer-close {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--c-rule);
    background: transparent;
    color: var(--c-ink-500);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.explainer-close:hover {
    background: var(--c-accent-soft);
    color: var(--c-ink);
    border-color: var(--c-accent);
}

.explainer-eyebrow {
    font-family: var(--f-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-accent);
    margin-bottom: 0.5rem;
}

.explainer-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--c-ink);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.explainer-body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--c-ink-700);
    margin-bottom: 1rem;
}

.explainer-body strong { color: var(--c-ink); font-weight: 600; }
.explainer-body em { font-style: italic; color: var(--c-ink-500); }

.explainer-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    gap: 0.6rem;
}

.explainer-list li {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--c-ink-700);
    padding-left: 1.1rem;
    position: relative;
}

.explainer-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--c-accent);
}

.explainer-list li strong { color: var(--c-ink); font-weight: 600; }

.explainer-note {
    font-size: 0.85rem;
    color: var(--c-ink-500);
    font-style: italic;
    border-top: 1px solid var(--c-rule);
    padding-top: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

@media (max-width: 560px) {
    .explainer-modal {
        padding: 2rem 1.5rem 1.5rem;
    }
    .explainer-btn {
        bottom: 1.25rem;
        right: 1.25rem;
    }
}

/* ============================================================
   TIMELINE — vertical line + clickable milestones
   ============================================================ */

.timeline {
    position: relative;
    padding-left: 2rem;
}

/* The vertical line */
.timeline::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--c-rule);
    border-radius: 2px;
}

/* Each timeline item */
.tl-item {
    position: relative;
    margin-bottom: 0;
}

.tl-item + .tl-item {
    margin-top: 0;
}

/* Clickable milestone row */
.tl-milestone {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 0.75rem 1.1rem 0;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.18s ease;
    user-select: none;
    position: relative;
    margin-left: -0.25rem;
    padding-left: 0.25rem;
}

.tl-milestone:hover {
    background: var(--c-accent-soft);
}

/* Dot on the timeline */
.tl-dot {
    position: absolute;
    left: calc(-2rem - 4px);
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--c-bg-elevated);
    border: 2px solid var(--c-rule);
    transition: background 0.2s ease, border-color 0.2s ease,
                transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

/* Active / hover dot state */
.tl-item.is-open .tl-dot,
.tl-milestone:hover .tl-dot {
    background: var(--c-accent);
    border-color: var(--c-accent);
    transform: translateY(-50%) scale(1.35);
    box-shadow: 0 0 0 4px var(--c-accent-soft);
}

/* Header content */
.tl-header {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    min-width: 0;
}

.tl-left {
    min-width: 0;
}

.tl-company {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--c-ink);
    letter-spacing: -0.015em;
    margin-bottom: 0.1rem;
    transition: color 0.18s ease;
}

.tl-item.is-open .tl-company,
.tl-milestone:hover .tl-company {
    color: var(--c-accent);
}

.tl-title {
    font-size: 0.85rem;
    color: var(--c-ink-500);
    font-weight: 400;
}

.tl-date {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: var(--c-ink-500);
    letter-spacing: 0.01em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Chevron indicator */
.tl-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    position: relative;
    opacity: 0.4;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
}

.tl-chevron::before,
.tl-chevron::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 6px;
    height: 1.5px;
    background: var(--c-ink);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tl-chevron::before { left: 2px;  transform: translateY(-50%) rotate(45deg);  }
.tl-chevron::after  { left: 7px;  transform: translateY(-50%) rotate(-45deg); }

.tl-item.is-open .tl-chevron {
    transform: rotate(180deg);
    opacity: 0.7;
}

.tl-milestone:hover .tl-chevron { opacity: 0.7; }

/* Collapsible detail panel */
.tl-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.tl-detail-inner {
    padding: 0.25rem 0.75rem 1.5rem 0;
    border-top: 1px solid var(--c-rule);
    margin-top: 0;
}

/* Divider between items */
.tl-item + .tl-item .tl-milestone {
    border-top: none;
}

@media (max-width: 560px) {
    .tl-header {
        flex-direction: column;
        gap: 0.15rem;
    }
    .tl-date {
        font-size: 0.72rem;
    }
}

/* ============================================================
   TIMELINE — blink animation for current (first) job dot
   ============================================================ */

.tl-item:first-child .tl-dot {
    background: var(--c-accent);
    border-color: var(--c-accent);
    animation: tl-blink 2s ease-in-out infinite;
}

@keyframes tl-blink {
    0%, 100% { box-shadow: 0 0 0 0px rgba(15, 118, 110, 0);
                transform: translateY(-50%) scale(1); }
    50%      { box-shadow: 0 0 0 6px rgba(15, 118, 110, 0.15);
                transform: translateY(-50%) scale(1.25); }
}

/* Keep it solid (no scale jump) when the item is clicked open */
.tl-item:first-child.is-open .tl-dot {
    animation: none;
    background: var(--c-accent);
    border-color: var(--c-accent);
    transform: translateY(-50%) scale(1.35);
    box-shadow: 0 0 0 4px var(--c-accent-soft);
}
