/* ============================================================
   AnkhCorp — modernized theme
   Same identity: dark, IBM Plex Sans, green accent, mono details.
   ============================================================ */

:root {
    color-scheme: dark;

    /* palette */
    --bg: #121316;
    --bg-raised: #17181c;
    --surface: #1e2025;
    --surface-hover: #23252b;
    --border: #2a2d34;
    --border-strong: #3d4149;
    --text: #e9eaee;
    --text-soft: #d7d9de;
    --text-muted: #9aa0a8;
    --text-faint: #6b717b;
    --accent: #d7d9de;
    --accent-soft: rgba(255, 255, 255, 0.07);
    --accent-border: rgba(255, 255, 255, 0.25);
    --link-hover: #ffffff;
    --link-hover-bg: #1e2025;
    --code-bg: #1b1d22;

    /* layout */
    --content-width: 720px;
    --nav-height: 60px;
    --radius: 10px;
    --radius-lg: 14px;

    --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

#shadowBox {
    background-color: rgb(0, 0, 0);
    /* Fallback color */
    background-color: rgba(0, 0, 0, 0.2);
    /* Black w/opacity/see-through */
    border: 3px solid;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("/fonts/ibm.woff2") format('woff2'),
         url("/fonts/ibm.ttf") format('truetype');
    font-display: swap;
}

* {
    box-sizing: border-box;
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

body {
    background-color: var(--bg);
    background-image:
        radial-gradient(1000px 500px at 50% -180px, rgba(255, 255, 255, 0.05), transparent 70%);
    background-repeat: no-repeat;
    color: var(--text);
    margin: 0 auto;
    padding: 0 0 3em 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow-y: scroll;
    min-height: 100%;
    height: 100%;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background-color: var(--accent);
    color: #101210;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 8px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-faint);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- base type ---------- */

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.015em;
}

p code {
    background-color: var(--code-bg);
    color: var(--text-soft);
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.875em;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

/* ---------- links ---------- */

a {
    color: var(--text);
    text-decoration: none;
    padding-left: 5px;
    padding-right: 5px;
    transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

a:hover {
    color: var(--link-hover);
    fill: var(--link-hover);
    background-color: var(--link-hover-bg);
}

.pretty-link a {
    border-bottom: none !important;
}

/* ---------- nav ---------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    margin-inline-start: auto;
    margin-inline-end: auto;
    margin: auto;
    max-width: 1024px;
    padding: 0 20px;
    text-align: center;
    background: rgba(18, 19, 22, 0.78);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    min-height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav .logo {
    padding-bottom: 20px;
}

.nav .logo h1 {
    display: inline;
    vertical-align: top;
}

.nav .logo img {
    height: 2.1rem;
    width: 2.1rem;
    vertical-align: center;
}

.nav-dock {
    margin: auto;
    user-select: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 8px 0;
}

.nav-link {
    position: relative;
    display: inline-block;
    padding: 4px 2px;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.nav-link:hover {
    color: var(--text-muted);
    background: none;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 0;
    height: 1px;
    background: var(--link-hover);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 180ms ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* language toggle — physical panel switch, active side lit */
.lang-switch {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    gap: 2px;
    margin-left: 12px;
    padding: 3px;
    background: #0d0e11;
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55);
    text-decoration: none;
}

.ls-opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    border-radius: 999px;
    background: transparent;
    transition: color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

/* ACTIVE side — the live prompt; inactive reads as a commented-out line.
   No animation: attention via terminal grammar, not motion. */
.ls-opt.is-active {
    color: #ffffff;
    background: #26282e;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.32),
        0 0 14px rgba(255, 255, 255, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ls-opt.is-active::before {
    content: "$ ";
    opacity: 0.55;
}

.ls-opt:not(.is-active)::before {
    content: "# ";
    opacity: 0.5;
}

/* hovering the INACTIVE side = it's the action available */
.lang-switch:hover .ls-opt:not(.is-active) {
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.06);
}

.lang-switch:active .ls-opt:not(.is-active) {
    transform: translateY(1px);
}

.lang-switch:focus-visible {
    outline: 2px solid var(--border-strong);
    outline-offset: 3px;
}

/* ---------- layout ---------- */

.main {
    max-width: var(--content-width);
    margin: auto;
    padding: 32px 20px 20px 20px;
}

.warn-text {
    color: var(--text-faint);
    font-size: .75rem;
}

/* ---------- home / profile ---------- */

.profile-header {
    text-align: center;
    padding-top: 12px;
}

.profile-title {
    font-size: 1.1rem;
}

.profile-title img {
    width: 75%;
    max-width: 400px;
    border-radius: var(--radius-lg);
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
}

.profile-title h1 {
    padding-top: 15px;
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    letter-spacing: -0.02em;
}

.rainbow {
    animation: colorRotate 6s linear 0s infinite;
}

@keyframes colorRotate {
    from {color: #6666ff;}
    10% {color: #0099ff;}
    50% {color: #00ff00;}
    75% {color: #ff3399;}
    100% {color: #6666ff;}
}

.profile-icon {
    position: relative;
    width: 100%;
}

.profile-icon-float {
    position: absolute;
    width: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-43%, -51%);
    transform-origin: 0 0;
}

.floating {
    animation: floating-animation 3s infinite ease-in-out;
}

@keyframes floating-animation {
    from {
        rotate: 1deg;
    }
    50% {
        rotate: -1deg;
    }
    to {
        rotate: 1deg;
    }
}

.social-list {
    padding: 12px;
    padding-bottom: 0px;
    display: inline-flex;
}

.social-list a {
    padding-top: 2px;
    padding-bottom: 2px;
    color: var(--text-muted);
}

.social-list a:not(:last-of-type) {
    margin-inline-end: 12px;
}

.social-list a:hover {
    color: var(--link-hover);
    transform: translateY(-2px);
}

.social-list a {
    transition: color 140ms ease, transform 140ms ease;
}

.social-list a svg {
    display: inline-flex;
    height: 26px;
    width: 30px;
    vertical-align: bottom;
    text-align: center;
}

.social-list a img {
    display: inline-flex;
    height: 26px;
    width: 26px;
    vertical-align: bottom;
    text-align: center;
}

.web-list {
    list-style: none;
    text-align: center;
    flex: 0 1 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 0;
    margin: 1.5rem 0 0 0;
}

.web-list li {
    text-align: center;
    margin: 0;
}

/* responsive web list, yippeee */
@media (min-width: 180px) {
    .web-list {
        grid-template-columns: repeat(auto-fit, 90px);
    }
}

.web-list li a {
    border-bottom: none !important;
    display: inline-block;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--text-soft);
}

.web-list li a:hover {
    background: var(--link-hover-bg);
    border-color: var(--link-hover);
    color: var(--link-hover);
}

.web-list li a img {
    padding: 2px;
}

/* ---------- featured / banner images ---------- */

.post-featured-image {
    display: block;
    margin: 0 auto 20px auto;
    max-width: 400px;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
}

.featured-header {
    display: block;
    margin: 0 auto 24px auto;
    max-width: 400px;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
}

/* ---------- post header ---------- */

.post-header {
    text-align: left;
    line-height: 1.5rem;
    padding-bottom: 10px;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.post-header .link {
    font-size: 1rem;
    color: var(--text-muted);
}

.post-header .link a {
    color: var(--text-soft);
}

.post-header .link a:hover {
    color: var(--link-hover);
}

.post-header .link svg, .post-header .link a svg {
    height: 1rem;
    width: 1rem;
    vertical-align: top;
}

.post-header .date {
    text-align: center;
    margin: 0 0 10px 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.post-header h1 {
    font-size: clamp(1.7rem, 4.5vw, 2.3rem);
    margin: 0.6rem 0 0.9rem 0;
}

.post-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 0 0 0.4rem 0;
    text-wrap: pretty;
}

/* ---------- post tags ---------- */

.post-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: auto;
    padding-left: 0;
    padding-bottom: 1rem;
    list-style: none;
}

.post-tags li {
    margin-inline-end: 6px;
}

.post-tags a {
    display: block;
    padding: 2px 12px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 20px;
    font-family: var(--font-mono);
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-raised);
}

.post-tags a:hover {
    color: var(--link-hover);
    border-color: var(--link-hover);
    background: var(--link-hover-bg);
}

/* ---------- post body ---------- */

.post-content {
    color: var(--text-soft);
    font-size: 1.02rem;
}

.post-content code {
    background-color: var(--code-bg) !important;
    padding: 2px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.875em;
}

.post-content pre {
    border-radius: var(--radius);
    background-color: var(--code-bg) !important;
    border: 1px solid var(--border);
    overflow-x: auto;
    line-height: 1.5;
}

.post-content pre code {
    display: block;
    margin: auto 0;
    padding: 14px 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    background-color: transparent !important;
    font-size: 0.9rem;
    line-height: 1.6;
}

.post-content pre code span {
    background-color: transparent !important;
}

.post-content a {
    color: var(--text);
    border-bottom: 1px solid var(--border-strong);
    padding: 0 1px;
    transition: color 140ms ease, border-color 140ms ease;
}

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

.post-content strong {
    color: #ffffff;
    font-weight: 600;
}

.post-content img {
    display: block;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.post-content blockquote {
    margin: 1.25rem 0;
    padding: 0.75rem 1.25rem;
    border-inline-start: 3px solid var(--accent);
    background: var(--bg-raised);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-muted);
}

.post-content blockquote p {
    margin: 0;
}

.post-content h1, .post-content h2 {
    padding-top: 24px;
    color: #ffffff;
}

.post-content h2 {
    font-size: 1.45rem;
    margin-top: 1.5rem;
}

.post-content h2::before {
    content: "#";
    color: var(--accent);
    opacity: 0.55;
    position: relative;
    left: -1rem;
    font-weight: bold;
    padding-left: 1rem;
}

.post-content h1::before {
    content: "#";
    color: var(--accent);
    opacity: 0.55;
    position: relative;
    left: -1rem;
    font-weight: bold;
    padding-left: 1rem;
}

.post-content ul:not(.web-list), .post-content ol {
    list-style-type: none;
    padding-left: 0;
    margin-left: 0;
}

.post-content ul li:not(.web-list-li) {
    margin-top: 5px;
    position: relative;
    padding-left: 1em;
}

.post-content ul li:not(.web-list-li):before {
    content: "*";
    color: var(--accent);
    opacity: 0.7;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.post-content ol {
    counter-reset: item;
    padding-left: 0;
}

.post-content ol > li {
    counter-increment: item;
    position: relative;
    padding-left: 1.6em;
    margin-top: 5px;
}

.post-content ol > li::before {
    content: counter(item) ".";
    color: var(--accent);
    opacity: 0.7;
    position: absolute;
    left: 0;
    font-weight: bold;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.95rem;
}

.post-content th, .post-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}

.post-content th {
    background: var(--surface);
    color: var(--text);
}

.post-content tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

/* ---------- post footer ---------- */

.post-footer {
    text-align: left;
    line-height: 1rem;
    padding: 18px 0 6px 0;
    margin-top: 2.5rem;
    border-top: 1px solid var(--border);
}

.post-footer .last-updated {
    text-align: center;
    margin-top: 0px;
    color: var(--text-faint);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

/* ---------- archive / post list ---------- */

.archive {
    color: var(--text-soft);
}

.main > h1 {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 1.25rem 0;
}

/* list templates nest a second .main inside the base one */
.main .main {
    max-width: none;
    padding: 0;
}

.archive-year {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 2.5rem 0 0.35rem 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.archive-year:first-child {
    margin-top: 0.25rem;
}

.post-list {
    display: flex;
    flex-direction: column;
}

.post-list-item {
    display: block;
    padding: 14px 16px;
    margin: 2px 0;
    border-radius: var(--radius);
    border-bottom: none;
    transition: background-color 140ms ease;
}

.post-list-item:hover {
    background: var(--surface);
}

.post-list-item:hover .post-list-title {
    color: var(--link-hover);
}

.post-list-meta {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 3px;
}

.post-list-title {
    display: block;
    color: var(--text-soft);
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.45;
}

.post-list-desc {
    display: block;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.55;
    margin-top: 4px;
    text-wrap: pretty;
}

/* ---------- terms / tag pages ---------- */

.terms-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0 0;
    display: grid;
    gap: 4px;
}

.terms-list li a {
    display: block;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text);
    border: 1px solid transparent;
}

.terms-list li a:hover {
    background: var(--link-hover-bg);
    border-color: var(--border);
    color: var(--link-hover);
}

/* ---------- footer ---------- */

.footer {
    max-width: 1024px;
    margin: auto;
    padding: 24px 20px;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 0.9rem;
}

.footer a {
    padding: 0;
    color: var(--text-muted);
}

.footer a:hover {
    color: var(--link-hover);
}

/* ---------- skip link (a11y) ---------- */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--link-hover);
    color: #121316 !important;
    padding: 8px 16px;
    border-radius: 0 0 var(--radius) 0;
    z-index: 999;
}

.skip-link:focus {
    left: 0;
}/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
    .rainbow,
    .floating {
        animation: none;
    }

    * {
        transition: none !important;
    }
}

/* ---------- small screens ---------- */

@media (max-width: 480px) {
    .main {
        padding: 24px 16px 20px 16px;
    }

    .profile-title img {
        width: 90%;
    }

    .post-list-item {
        padding: 12px;
    }

    .post-list-item:hover {
        transform: none;
    }
}
