@import url('https://fonts.googleapis.com/css2?family=Balsamiq+Sans:wght@400;700&display=swap');

:root {
    --bg-color: #ffffff;
    --text-color: #333;
    --secondary-color: #555;
    --link-color: #8b5cf6;
    --border-color: #e0e0e0;
    --underline-color: #8b5cf6;
    --pattern-color: rgba(0, 0, 0, 0.03);
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0a0a0a;
        --text-color: #e0e0e0;
        --secondary-color: #b0b0b0;
        --link-color: #a78bfa;
        --border-color: #1a1a1a;
        --underline-color: #a78bfa;
        --pattern-color: rgba(255, 255, 255, 0.03);
    }
}

* {
    font-family: 'Balsamiq Sans', cursive;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

p, a {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body {
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    color: var(--text-color);
    background: 
        radial-gradient(
            circle at 1px 1px, 
            var(--pattern-color) 1px, 
            transparent 0
        ),
        var(--bg-color);
    background-size: 40px 40px;
    transition: background-color 0.3s ease, color 0.3s ease;
    animation: fadeIn 0.8s ease-out;
}

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

h1, h2 {
    font-weight: 700;
    margin-bottom: 16px;
    transition: transform 0.3s ease, color 0.3s ease;
}

h1:hover, h2:hover {
    transform: translateX(5px);
    color: var(--link-color);
}

h2 {
    font-size: 24px;
    margin-top: 40px;
}

p {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--secondary-color);
    transition: transform 0.3s ease, color 0.3s ease;
    animation: slideIn 0.6s ease-out backwards;
}

p:nth-child(1) { animation-delay: 0.1s; }
p:nth-child(2) { animation-delay: 0.2s; }
p:nth-child(3) { animation-delay: 0.3s; }
p:nth-child(4) { animation-delay: 0.4s; }
p:nth-child(5) { animation-delay: 0.5s; }

p:hover, p.touched {
    transform: translateX(3px);
    color: var(--text-color);
}

p.touched {
    transition: transform 0.3s ease, color 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

ul {
    margin-bottom: 24px;
    list-style: none;
    padding-left: 0;
}

li {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--secondary-color);
    transition: all 0.3s ease;
    transform: translateX(0);
}

li:hover {
    transform: translateX(10px);
    color: var(--text-color);
}

li::before {
    content: '▸';
    margin-right: 8px;
    color: var(--link-color);
    transition: transform 0.3s ease;
    display: inline-block;
}

li:hover::before {
    transform: translateX(5px) rotate(90deg);
}

iframe {
    margin: 16px 0;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

iframe:hover {
    opacity: 1;
}

nav, footer {
    margin: 20px 0;
}

nav p, footer p {
    font-size: 14px;
    color: var(--secondary-color);
}

article h1 {
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--text-color);
}

.article-date {
    font-size: 14px;
    color: var(--secondary-color);
    font-style: italic;
    margin-bottom: 32px;
}

article h2 {
    font-size: 20px;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--text-color);
}

a {
    color: var(--link-color);
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--underline-color);
    transition: width 0.3s ease;
}

a:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

a:hover::after {
    width: 100%;
}

strong {
    font-weight: 700;
}

.fun-name {
    display: inline-block;
    position: relative;
    cursor: default;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: bounceIn 1s ease-out;
}

.fun-name:hover {
    transform: rotate(-2deg) scale(1.1);
    color: var(--link-color);
}

.fun-name::after {
    content: '🦀';
    position: absolute;
    right: -50px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 24px;
}

.fun-name:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1) rotate(360deg);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media screen and (min-width: 768px) {
    body {
        padding: 60px;
    }
}

.share-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin: 16px 0 24px 0;
    animation: fadeIn 0.8s ease-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.share-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    background: var(--text-color);
    border: 2px solid var(--border-color);
    animation: float 3s ease-in-out infinite;
}

.share-button:nth-child(1) { animation-delay: 0s; }
.share-button:nth-child(2) { animation-delay: 0.2s; }
.share-button:nth-child(3) { animation-delay: 0.4s; }
.share-button:nth-child(4) { animation-delay: 0.6s; }
.share-button:nth-child(5) { animation-delay: 0.8s; }

.share-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--text-color);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    opacity: 0.2;
}

.share-button:hover::before {
    width: 100%;
    height: 100%;
}

.share-button:hover {
    transform: scale(1.15) rotate(5deg) translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--text-color);
}

.share-button:active {
    transform: scale(0.95);
}

.share-button svg {
    width: 18px;
    height: 18px;
    fill: var(--bg-color);
    position: relative;
    z-index: 1;
    transition: fill 0.3s ease;
}

.share-button:hover svg {
    fill: var(--bg-color);
}

.share-button .tooltip {
    position: absolute;
    right: 60px;
    background: var(--text-color);
    color: var(--bg-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.share-button:hover .tooltip {
    opacity: 1;
}

.share-button.copied .tooltip {
    opacity: 1;
}

.share-button.copied {
    animation: copySuccess 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes copySuccess {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.3) rotate(-10deg);
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    75% {
        transform: scale(1.3) rotate(-5deg);
    }
}

.share-button.copied::after {
    content: '✓';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: var(--text-color);
    animation: checkmarkPop 0.6s ease-out;
    pointer-events: none;
}

@keyframes checkmarkPop {
0% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0);
}
50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px) scale(1.2);
}
100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-15px) scale(0.8);
}
}

@media screen and (max-width: 768px) {
    .share-buttons {
        gap: 8px;
    }
    
    .share-button {
        width: 32px;
        height: 32px;
    }
    
    .share-button svg {
        width: 16px;
        height: 16px;
    }
    
    .share-button .tooltip {
        display: none;
    }
}

/* Screenshot feature styles */
article p {
    position: relative;
}

.screenshot-icon {
    display: none;
    width: 18px;
    height: 18px;
    background: var(--text-color);
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
    margin-left: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}

.screenshot-icon svg {
    width: 11px;
    height: 11px;
    fill: var(--bg-color);
}

article p:hover .screenshot-icon,
article p.touched .screenshot-icon {
    display: inline-flex;
    animation: fadeIn 0.2s ease;
}

.screenshot-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.screenshot-icon:active {
    transform: scale(0.95);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* Screenshot modal */
.screenshot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.screenshot-modal.active {
    display: flex;
}

.screenshot-content {
    background: var(--bg-color);
    border-radius: 20px;
    padding: 40px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.screenshot-preview {
    background: 
        radial-gradient(
            circle at 1px 1px, 
            var(--pattern-color) 1px, 
            transparent 0
        ),
        var(--bg-color);
    background-size: 40px 40px;
    border-radius: 24px;
    padding: 80px 60px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.screenshot-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
}

.screenshot-text {
    font-size: 28px;
    line-height: 1.75;
    color: #ffffff;
    text-align: left;
    position: relative;
    z-index: 1;
    font-weight: 400;
    max-width: 900px;
    margin: 0 auto;
    white-space: normal;
    word-spacing: normal;
    letter-spacing: -0.01em;
}

.screenshot-attribution {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid #333333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.screenshot-author {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.screenshot-logo {
    color: #b0b0b0;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.screenshot-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.screenshot-btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-family: 'Balsamiq Sans', cursive;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.screenshot-btn-primary {
    background: var(--text-color);
    color: var(--bg-color);
}

.screenshot-btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.screenshot-btn-secondary {
    background: var(--border-color);
    color: var(--text-color);
}

.screenshot-btn-secondary:hover {
    background: var(--secondary-color);
    color: var(--bg-color);
}

.screenshot-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 20px;
    color: var(--text-color);
}

.screenshot-close:hover {
    background: var(--text-color);
    color: var(--bg-color);
    transform: rotate(90deg);
}

/* Screenshot icon styles */
.screenshot-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    background: var(--text-color);
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-left: 8px;
    vertical-align: middle;
}

.screenshot-icon svg {
    width: 12px;
    height: 12px;
    fill: var(--bg-color);
}

p:hover .screenshot-icon {
    opacity: 0.7;
}

.screenshot-icon:hover {
    opacity: 1 !important;
    transform: scale(1.1);
    background: var(--text-color);
}

@media screen and (max-width: 768px) {
    .screenshot-preview {
        padding: 50px 35px;
        border-radius: 20px;
    }
    
    .screenshot-text {
        font-size: 22px;
        line-height: 1.7;
    }
    
    .screenshot-attribution {
        flex-direction: column;
        gap: 12px;
    }
    
    .screenshot-actions {
        flex-direction: column;
    }
    
    .screenshot-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile screenshot icon adjustments */
    .screenshot-icon {
        width: 18px;
        height: 18px;
        margin-left: 6px;
    }
    
    .screenshot-icon svg {
        width: 10px;
        height: 10px;
    }
}