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

:root {
    --font-size: 16px;
    --background: #ffffff;
    --foreground: #0f1724;
    --card: #fbfdfe;
    --card-foreground: #0f1724;
    --popover: #ffffff;
    --popover-foreground: #0f1724;
    --primary: #0f1724;
    --primary-foreground: #ffffff;
    --secondary: #f1f5f9;
    --secondary-foreground: #475569;
    --muted: #f1f5f9;
    --muted-foreground: #6b7280;
    --accent: #0ea5a4;
    --accent-foreground: #ffffff;
    --destructive: #d4183d;
    --destructive-foreground: #ffffff;
    --border: #e6eef3;
    --input: transparent;
    --input-background: #f3f3f5;
    --switch-background: #cbced4;
    --ring: oklch(0.708 0 0);
    --radius: 0.625rem;
}

.dark {
    --background: #071016;
    --foreground: #e6f2f2;
    --card: #0b1620;
    --card-foreground: #e6f2f2;
    --popover: #0b1620;
    --popover-foreground: #e6f2f2;
    --primary: #e6f2f2;
    --primary-foreground: #04263a;
    --secondary: #404040;
    --secondary-foreground: #dbeef5;
    --muted: #0b1620;
    --muted-foreground: #94a3b8;
    --accent: #38bdf8;
    --accent-foreground: #04263a;
    --destructive: oklch(0.396 0.141 25.723);
    --destructive-foreground: oklch(0.637 0.237 25.331);
    --border: #10202a;
    --input: oklch(0.269 0 0);
    --input-background: #0b1620;
    --ring: oklch(0.439 0 0);
}

html {
    font-size: var(--font-size);
}

.morph {
    transform-origin: 50% 50%;
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .morph,
    .morph * {
        animation: none !important;
    }
}

.terminal-window {
    width: 380px;
    max-width: 36vw;
    border-radius: 0.625rem;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--card) 85%, transparent);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--muted) 50%, transparent);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-title {
    margin-left: auto;
    font-size: 0.75rem;
}

.terminal-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.6;
}

.terminal-line {
    white-space: nowrap;
}

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

.blinking-cursor {
    animation: blink 1s step-end infinite;
}

input[type="checkbox"],
input[type="radio"] {
    padding: 0;
    width: auto;
    accent-color: var(--primary);
    scale: 1.15;
}

input[type="range"] {
    --track-height: 14px;
    --thumb-size: 22px;
    --bg-track: var(--secondary);
    --fill: var(--primary);
    --thumb-border: 2px;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: var(--track-height);
    background: transparent;
    cursor: pointer;
    --value: 18;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: var(--track-height);
    border-radius: 999px;
    background: linear-gradient(to right, var(--fill) 0 0);
    background-size: calc(var(--value) * 1%) 100%;
    background-repeat: no-repeat;
    box-shadow: none;
    border: none;
    background-color: var(--bg-track);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--thumb-size);
    height: var(--thumb-size);
    border-radius: 50%;
    background: #ffffff;
    margin-top: calc((var(--track-height) - var(--thumb-size)) / 2);
    box-shadow: 0 0 0 var(--thumb-border) rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.12);
    transition: transform 0.12s ease;
}

input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.03);
}

input[type="range"]::-moz-range-track {
    height: var(--track-height);
    border-radius: 999px;
    background: var(--bg-track);
}

input[type="range"]::-moz-range-progress {
    height: var(--track-height);
    border-radius: 999px;
    background: var(--fill);
}

input[type="range"]::-moz-range-thumb {
    width: var(--thumb-size);
    height: var(--thumb-size);
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 0 0 var(--thumb-border) rgba(0, 0, 0, 0.06);
}

input[type="range"]:focus {
    outline: none;
}

input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(11, 11, 11, 0.06);
}

.article-content {
    padding: 0 2rem 2rem;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--foreground);
}

.article-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 2.5rem 0 1.5rem;
    color: var(--foreground);
    line-height: 1.2;
}

.article-content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--foreground);
    line-height: 1.3;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
    color: var(--foreground);
    line-height: 1.4;
}

.article-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--foreground);
}

.article-content h5 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--foreground);
}

.article-content h6 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--foreground);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.article-content p:first-of-type {
    font-size: 1.25rem;
    font-weight: 500;
    font-style: italic;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--muted-foreground);
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.article-content ul li {
    list-style-type: disc;
}

.article-content ol li {
    list-style-type: decimal;
}

.article-content ul ul,
.article-content ol ol,
.article-content ul ol,
.article-content ol ul {
    margin: 0.5rem 0;
}

.article-content blockquote {
    background: var(--muted);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    margin: 2rem 0;
    font-size: 1.25rem;
    font-style: italic;
    border-radius: 0 var(--radius) var(--radius) 0;
    position: relative;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content pre {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin: 2rem 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.article-content code {
    background: var(--muted);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 1rem;
}

.article-content th,
.article-content td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.article-content th {
    background: var(--muted);
    font-weight: 600;
    color: var(--foreground);
}

.article-content tr:hover {
    background: var(--muted);
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 2rem 0;
    display: block;
}

.article-content figure {
    margin: 2rem 0;
    text-align: center;
}

.article-content figcaption {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    font-style: italic;
    margin-top: 0.5rem;
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.article-content a:hover {
    color: var(--foreground);
    text-decoration: none;
}

.article-content strong,
.article-content b {
    font-weight: 600;
    color: var(--foreground);
}

.article-content em,
.article-content i {
    font-style: italic;
}

.article-content mark {
    background: var(--accent);
    padding: 0.125rem 0.25rem;
    border-radius: 2px;
}

.article-content hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 3rem 0;
}

.article-content dl {
    margin: 1.5rem 0;
}

.article-content dt {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.article-content dd {
    margin-left: 1rem;
    margin-bottom: 1rem;
    color: var(--muted-foreground);
}

@media (max-width: 768px) {
    .article-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .article-content h1 {
        font-size: 2rem;
    }

    .article-content h2 {
        font-size: 1.75rem;
    }

    .article-content h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .article-content {
        font-size: 1rem;
    }

    .article-content h1 {
        font-size: 1.75rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-content h3 {
        font-size: 1.25rem;
    }
}