@import url("https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap");

:root {
    --background: #faf9f6;
    --paper: #ffffff;
    --foreground: #1f1f1f;
    --muted: #6a6a6a;
    --border: #e2e2e2;
    --accent: #111111;
}

* {
    box-sizing: border-box;
}

strong,
b {
    font-weight: inherit;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--foreground);
    font-family:
        "Geist",
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: -20vh -20vw;
    pointer-events: none;
    z-index: -1;
}

body::before {
    background:
        radial-gradient(
            circle at 22% 28%,
            rgba(18, 82, 255, 0.035),
            transparent 54%
        ),
        radial-gradient(
            circle at 78% 70%,
            rgba(255, 211, 61, 0.04),
            transparent 52%
        );
    filter: blur(82px);
    animation: driftAura 96s ease-in-out infinite alternate;
}

body::after {
    background:
        radial-gradient(
            circle at 72% 22%,
            rgba(26, 97, 255, 0.03),
            transparent 48%
        ),
        radial-gradient(
            circle at 34% 84%,
            rgba(255, 225, 115, 0.035),
            transparent 50%
        );
    filter: blur(96px);
    animation: driftAura 128s ease-in-out infinite alternate-reverse;
}

@keyframes driftAura {
    0% {
        transform: translate3d(-0.2%, -0.12%, 0) scale(1);
    }
    50% {
        transform: translate3d(0.25%, 0.18%, 0) scale(1.005);
    }
    100% {
        transform: translate3d(0.45%, -0.18%, 0) scale(1.01);
    }
}

a {
    position: relative;
    color: #0b39ff;
    text-decoration: none;
    font-weight: 500;
    background-image: linear-gradient(
        120deg,
        rgba(255, 225, 115, 0.7),
        rgba(255, 225, 115, 0.7)
    );
    background-repeat: no-repeat;
    background-size: 0% 55%;
    background-position: 0 50%;
    transition:
        background-size 0.25s ease,
        color 0.2s ease;
}

a:hover,
a:focus-visible {
    background-size: 100% 55%;
    color: #061d88;
}

a[href*="youtube.com"],
a[href*="youtu.be"] {
    background-image: none;
}

.loading-text {
    color: red;
}

.monthly-entry a[href*="youtube.com"]::after,
.daily-entry a[href*="youtube.com"]::after,
.monthly-entry a[href*="youtu.be"]::after,
.daily-entry a[href*="youtu.be"]::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 3px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23FF0000' d='M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z'/%3E%3C/svg%3E")
        no-repeat center/contain;
    vertical-align: -0.1em;
}

.monthly-entry a[href*="imdb.com"]::after,
.daily-entry a[href*="imdb.com"]::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 3px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23E5B400' d='M4 4h4v16H4V4zm6 0h10v16h-10V4zm2 2v12h6V6H12z'/%3E%3C/svg%3E")
        no-repeat center/contain;
    vertical-align: -0.1em;
}

.monthly-entry a[href*="x.com"]::after,
.daily-entry a[href*="x.com"]::after,
.monthly-entry a[href*="twitter.com"]::after,
.daily-entry a[href*="twitter.com"]::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 3px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000000' d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E")
        no-repeat center/contain;
    vertical-align: -0.1em;
}

.monthly-entry a[href*="instagram.com"]::after,
.daily-entry a[href*="instagram.com"]::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 3px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23E4405F' d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z'/%3E%3C/svg%3E")
        no-repeat center/contain;
    vertical-align: -0.1em;
}

.monthly-entry a[href*="linkedin.com"]::after,
.daily-entry a[href*="linkedin.com"]::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 3px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230A66C2' d='M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z'/%3E%3C/svg%3E")
        no-repeat center/contain;
    vertical-align: -0.1em;
}

.monthly-entry
    a[href^="http"]:not([href*="youtube.com"]):not([href*="youtu.be"]):not(
        [href*="x.com"]
    ):not([href*="twitter.com"]):not([href*="instagram.com"]):not(
        [href*="imdb.com"]
    ):not([href*="linkedin.com"])::after,
.daily-entry
    a[href^="http"]:not([href*="youtube.com"]):not([href*="youtu.be"]):not(
        [href*="x.com"]
    ):not([href*="twitter.com"]):not([href*="instagram.com"]):not(
        [href*="imdb.com"]
    ):not([href*="linkedin.com"])::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 3px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230b39ff' d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.96z'/%3E%3C/svg%3E")
        no-repeat center/contain;
    vertical-align: -0.1em;
}

.wrapper {
    max-width: 760px;
    margin: 0 auto;
    padding: 120px 24px 72px;
    position: relative;
}

.site-header {
    display: flex;
    gap: 32px;
    align-items: center;
    padding-bottom: 32px;
    margin-bottom: 20px;
}

.avatar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.9rem;
    color: var(--muted);
}

.image-frame {
    position: relative;
    width: 110px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--paper);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    border-radius: 0;
}

.image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    border-radius: 0;
    transform: scale(1.04);
    transition:
        filter 1.2s ease,
        transform 1.2s ease;
}

.image-frame.loaded img {
    filter: grayscale(100%);
    transform: scale(1);
}

.grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    pointer-events: none;
    background: transparent;
}

.grid-item {
    background: rgba(11, 57, 255, 0.35);
    opacity: 0.8;
    transform: scale(1.05);
}

.grid.show .grid-item {
    animation: pixelFade 1s forwards;
    animation-delay: var(--pixel-delay, 0s);
}

@keyframes pixelFade {
    0% {
        opacity: 0.85;
        transform: scale(1.2);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }
    100% {
        opacity: 0;
        transform: scale(0.6);
    }
}

.intro {
    flex: 1;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.intro h1 {
    margin: 0 0 4px;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: inline-block;
    padding: 0;
}

.tagline {
    margin: 0;
    font-size: 0.95rem;
    color: var(--muted);
}

.intro p {
    margin: 0 0 10px;
    max-width: 480px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.hero-links {
    margin: 8px 0 0;
    padding: 0;
}

.hero-links li {
    margin: 0;
}

.site-footer {
    margin-top: 56px;
    padding-top: 20px;
    border-top: 1px solid rgba(106, 106, 106, 0.25);
    color: rgba(106, 106, 106, 0.85);
    font-size: 0.85rem;
}

.site-footer--plain {
    padding-top: 0;
    border-top: 0;
}

.site-footer a {
    color: rgba(106, 106, 106, 0.85);
    font-weight: 400;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--foreground);
}

.site-footer .hero-links {
    margin: 0;
    gap: 10px;
}

.content section {
    margin-bottom: 32px;
    padding: 0;
}

.content article {
    margin-bottom: 28px;
}

.content article h3 {
    margin: 0 0 2px;
    font-size: 1.05rem;
}

.content article p {
    margin: 0 0 10px;
    color: var(--foreground);
    font-size: 0.95rem;
}

h2 {
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 18px;
}

.content ul {
    margin: 0;
    padding-left: 22px;
    list-style: disc;
}

.content ul ul {
    margin-top: 8px;
    padding-left: 20px;
    list-style: circle;
}

.experience-list {
    padding-left: 22px;
    margin: 0;
    list-style: disc;
}

.projects-list {
    padding-left: 22px;
    margin: 0;
    list-style: disc;
}

.site-intro {
    margin-bottom: 20px;
    max-width: 760px;
    padding: 20px 0;
}

.site-intro-label {
    margin: 0 0 6px;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.site-intro-copy {
    margin: 0;
}

.project-item {
    display: list-item;
}

.project-item > * + * {
    margin-left: 12px;
}

.project-time {
    display: inline-block;
    min-width: 120px;
    color: var(--foreground);
    font-weight: 400;
}

.project-name {
    font-weight: 600;
}

#projects strong {
    margin: 0;
    padding: 0;
    display: inline;
}

#projects .project-name {
    white-space: nowrap;
}

.experience-time {
    display: inline-block;
    font-weight: 600;
    color: var(--foreground);
    min-width: 120px;
}

.experience-org {
    font-weight: 600;
}

.experience-role {
    color: var(--muted);
}

.work-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin: 0 0 8px;
}

.work-time {
    display: inline-block;
    font-weight: 400;
    min-width: 120px;
}

.work-org {
    font-weight: 600;
}

.work-role {
    color: var(--muted);
}

.site-header--stacked {
    display: block;
    padding-bottom: 0;
    border-bottom: 0;
    margin-bottom: 32px;
}

.site-header--stacked .intro {
    max-width: 65ch;
}

.monthly-entry {
    width: 100%;
    max-width: 65ch;
}

.monthly-entry p {
    margin: 0 0 16px;
}

.monthly-kicker {
    color: var(--muted);
    font-size: 0.95rem;
}

.monthly-lead-sentence {
    font-weight: 600;
    color: var(--foreground);
}

.monthly-figure {
    margin: 28px 0;
}

.monthly-figure img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--border);
}

.monthly-figure figcaption {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.monthly-inline-image-wrap {
    position: relative;
    display: inline-block;
}

.monthly-inline-popover {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 10;
    width: min(320px, 70vw);
    margin: 0;
    padding: 10px 10px 8px;
    border: 0.5px solid var(--border);
    background: var(--paper);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.08);
}

.monthly-inline-popover[hidden] {
    display: none;
}

.monthly-inline-popover img {
    width: 100%;
    height: auto;
    display: block;
}

.monthly-inline-popover-caption {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.monthly-inline-image-link::after {
    content: "";
    display: inline-block;
    width: 0.5em;
    height: 0.5em;
    margin-left: 0.42em;
    vertical-align: 0.02em;
    background: currentColor;
}

.monthly-inline-image-link:hover::after,
.monthly-inline-image-link:focus-visible::after {
    background: transparent;
    border: 1px solid currentColor;
}

.content li + li {
    margin-top: 8px;
}

footer {
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

footer address {
    font-style: normal;
    color: var(--muted);
    line-height: 1.5;
}

footer a {
    color: #0000ee;
    font-weight: 600;
}

/* Login page styles */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.login-form input {
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 4px;
    font-family: inherit;
}

.login-form button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background: var(--accent-color, #0066cc);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}

.login-form button:hover {
    opacity: 0.9;
}

.error-message {
    color: #cc0000;
    margin-top: 1rem;
}

/* Daily page styles */
.daily-entry {
    width: 100%;
    max-width: 65ch;
}

.daily-date {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.daily-lead-sentence {
    font-weight: 600;
}

.daily-list {
    list-style: none;
    padding: 0;
}

.daily-list li {
    padding: 0.5rem 0;
}

.daily-list a {
    text-decoration: none;
}

.daily-list a:hover {
    text-decoration: underline;
}

/* Reusable highlight block */
.in-short {
    display: block;
    margin: 0.75rem 0 1.25rem;
    padding: 0.75rem 1rem;
    font-style: italic;
    color: var(--foreground);
    line-height: 1.5;
    text-shadow:
        0 0 16px rgba(11, 57, 255, 0.25),
        0 0 32px rgba(11, 57, 255, 0.12);
}

/* Broken / dead link */
a.broken-link {
    color: var(--muted);
    background-image: none;
    cursor: default;
    pointer-events: none;
}

a.broken-link:hover {
    color: var(--muted);
    background-size: 0% 55%;
}

@media (max-width: 640px) {
    .wrapper {
        padding: 32px 20px 56px;
    }

    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 20px;
    }

    .site-intro {
        margin-bottom: 20px;
    }

    .image-frame {
        width: 120px;
    }

    .experience-time {
        display: block;
        min-width: auto;
    }

    .experience-role {
        display: block;
    }

    .project-item {
        display: block;
    }

    .project-time {
        display: block;
        min-width: auto;
    }

    .project-name {
        display: inline;
    }

    #projects .project-name {
        white-space: normal;
    }

    .work-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .work-time {
        display: block;
        min-width: auto;
    }

    .monthly-inline-popover {
        position: fixed;
        top: 50%;
        left: 20px;
        right: 20px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 40px);
        padding: 10px;
        overflow: auto;
        transform: translateY(-50%);
    }

    .monthly-inline-popover img {
        max-height: calc(100vh - 60px);
        object-fit: contain;
    }
}
