:root {
    --jako-bg: #f4f5f7;
    --jako-text: #0d0d0d;
    --jako-border: rgba(0, 0, 0, 0.12);
    --jako-glass: rgba(255, 255, 255, 0.92);
    --gradient-start: rgba(0, 0, 0, 0.02);
    --gradient-mid: rgba(244, 245, 247, 0.85);
    --gradient-end: #f4f5f7;
    --icon-hover: #000;
}

body.dark-mode {
    --jako-bg: #111315;
    --jako-text: #f4f5f7;
    --jako-border: rgba(255, 255, 255, 0.16);
    --jako-glass: rgba(25, 28, 31, 0.92);
    --gradient-start: rgba(255, 255, 255, 0.04);
    --gradient-mid: rgba(17, 19, 21, 0.86);
    --gradient-end: #111315;
    --icon-hover: #fff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

html,
body {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background-color: var(--jako-bg);
    color: var(--jako-text);
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    position: relative;
    letter-spacing: 0.02em;
}

::selection {
    background-color: var(--jako-text);
    color: var(--jako-bg);
}

button,
span,
div {
    -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   BACKGROUND SYSTEM
   ========================================================= */

#page-bg-overlay,
.ambient-gradient {
    position: fixed;
    inset: 0;
}

#page-bg-overlay {
    background:
        radial-gradient(
            circle at 50% 30%,
            var(--gradient-start) 0%,
            var(--gradient-mid) 65%,
            var(--gradient-end) 100%
        );
    z-index: -1;
}

.ambient-gradient {
    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.03),
            transparent,
            rgba(0, 0, 0, 0.03)
        );
    z-index: 0;
    pointer-events: none;
}

/* =========================================================
   BUTTONS
   ========================================================= */

button {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--jako-text);
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    opacity: 0.8;
}

button:active {
    transform: scale(0.92);
}

.icon-stroke {
    width: 1.1rem;
    height: 1.1rem;
    stroke: var(--jako-text);
    transition: stroke 0.3s ease;
}

button:hover .icon-stroke {
    stroke: var(--icon-hover);
}

/* =========================================================
   FOOTER / CONTROL BAR
   ========================================================= */

.header-style-bar {
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 1.2rem;
    z-index: 100;
    border-top: 1px solid var(--jako-border);
    background: var(--jako-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    gap: 0.5rem;
}

.header-style-bar.site-header {
    height: auto;
    min-height: 42px;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.3rem 0.8rem;
    border-top: 0;
    border-bottom: 1px solid var(--jako-border);
}

.site-brand {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    white-space: nowrap;
}

.site-brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.site-brand-mark {
    display: block;
    width: 22px;
    height: 22px;
    fill: var(--jako-text);
    flex: 0 0 auto;
}

.site-header .header-controls {
    max-width: 100%;
    height: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.2rem;
}

.language-options {
    display: flex;
    align-items: center;
    gap: 0.05rem;
}

.header-control {
    height: 28px;
    min-width: 28px;
    padding: 0 0.4rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 7px;
    text-decoration: none;
}

.header-github-button {
    display: flex;
    align-items: center;
    justify-content: center;
}

.github-icon {
    display: block;
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.language-option[aria-pressed="true"] {
    border-color: var(--jako-border);
}

body.dark-mode .theme-switch-knob {
    transform: translateX(6px);
}

.pdf-footer {
    justify-content: center;
}

.pdf-footer .actions-group {
    margin-left: 0;
    justify-content: center;
}

.actions-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    height: 100%;
    margin-left: auto;
}

.btn-control-action {
    padding: 0 0.6rem;
    height: 100%;
    font-family: 'Orbitron', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* =========================================================
   MAIN VIEWPORT
   ========================================================= */

.vision-scroll-viewport {
    width: 100%;
    max-width: 560px;
    padding: 0.3rem 0.8rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
    justify-content: flex-start;
    align-items: center;
}

.profile-section-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
}

/* =========================================================
   CARDS
   ========================================================= */

.vision-card {
    background: var(--jako-glass);
    border: 1px solid var(--jako-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.015);
    width: 100%;
}

.vision-card h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 8px;
    letter-spacing: 0.15em;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--jako-border);
    padding-bottom: 0.12rem;
    text-transform: uppercase;
}

/* =========================================================
   PROFILE
   ========================================================= */

.profile-title-block {
    display: flex;
    flex-direction: column;
    font-family: 'Orbitron', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 0.25rem;
}

.profile-title-block span.sub-title {
    font-size: 5.5px;
    opacity: 0.6;
    letter-spacing: 0.15em;
}

.profile-box {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-photo-links {
    display: flex;
    flex: 0 0 60px;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
}

.profile-github-button {
    justify-content: center;
    height: auto;
    padding: 0.15rem 0;
    border: 1px solid var(--jako-border);
    border-radius: 4px;
    font-size: 6px;
    line-height: 1.2;
    text-decoration: none;
}

.profile-text {
    line-height: 1.3;
    font-size: 11px;
    font-weight: 500;
}

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

.checklist-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 11.5px;
    font-weight: 500;
}

.checklist-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px dashed var(--jako-border);
}

.checklist-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.checklist-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 7.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    opacity: 0.7;
    min-width: 120px;
    text-transform: uppercase;
    padding-top: 1px;
}

.checklist-value {
    flex-grow: 1;
    text-align: right;
    font-size: 11px;
}

.project-platform {
    font: inherit;
    overflow-wrap: anywhere;
}

.project-location {
    margin-left: 0.2rem;
    font-size: 8px;
    opacity: 0.5;
    text-transform: uppercase;
}

.checklist-row[data-project-id] [hidden] {
    display: none !important;
}

.experience-tools {
    display: block;
    margin-top: 0.12rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 6px;
    font-weight: 700;
    letter-spacing: 0.08em;
    opacity: 0.6;
}

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

@media print {

    html,
    body {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        background: #fff !important;
    }

    /*
     * Disable all ambient visual layers.
     * These fixed gradients can be rasterized incorrectly
     * by browser PDF/print engines and produce black or
     * transparent blocks.
     */
    #page-bg-overlay,
    .ambient-gradient {
        display: none !important;
    }

    /*
     * Remove the interactive control bar from the PDF.
     */
    .header-style-bar {
        display: none !important;
    }

    /*
     * Disable the scrolling behavior used by the web UI.
     */
    .vision-scroll-viewport {
        overflow: visible !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        background: #fff !important;
    }

    /*
     * Convert glass cards into solid printable cards.
     */
    .vision-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        background: #fff !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /*
     * Ensure the browser preserves the intended print colors
     * without relying on transparency or compositing.
     */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* =========================================================
   PROFILE HEADER
   ========================================================= */

.profile-header {
    width: 100%;
    max-width: 560px;
    padding: 0.3rem 0.8rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 8fr;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* =========================================================
   SCROLL / CERTIFICATIONS
   ========================================================= */

.vision-scroll-viewport {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-width: thin;
}

.certification-toggle {
    cursor: pointer;
}

.certification-preview {
    display: none;
    width: 100%;
    padding: 0.5rem 0;
}

.certification-preview img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.certification-preview.is-open {
    display: block;
}

.certification-gallery.is-open {
    display: flex;
    flex-direction: row;
    gap: 0.4rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}

.certification-gallery .certificate-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
    flex: 0 0 96px;
    padding: 0;
    text-align: center;
}

.certification-gallery .certificate-item img {
    width: 100%;
    height: 72px;
    object-fit: contain;
    border: 1px solid var(--jako-border);
    border-radius: 4px;
    background: #fff;
}

.certification-gallery .certificate-item span {
    font-family: 'Orbitron', sans-serif;
    font-size: 6px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.6;
}

.certification-gallery .certificate-item:focus-visible {
    outline: 1px solid var(--jako-text);
    outline-offset: 2px;
}

@media (max-width: 420px) {
    .checklist-row[data-project-id] {
        flex-wrap: wrap;
    }

    .checklist-row[data-project-id] > .checklist-value {
        flex: 1 1 100%;
    }

    .checklist-row[data-project-id] > .checklist-label {
        flex: 1 1 100%;
        min-width: 0;
        max-width: none;
        text-align: left;
        padding-top: 0;
    }
}
