/* =========================================================
   THEME TOKENS (colors, schemes)
   --------------------------------------------------------- */
:root {
    --bg: #0b0c0f;
    --surface: #12141a;
    --text: #e8ecf1;
    --muted: #9aa4b2;
    --accent: #6ae3ff;
    color-scheme: light dark;
}

/* System preference: light */
@media (prefers-color-scheme: light) {
    :root {
        --bg: #ffffff;
        --surface: #f6f7f9;
        --text: #0b0c0f;
        --muted: #5b6572;
        --accent: #0066ff;
    }
}

/* Explicit theme toggles via data attribute */
[data-theme="light"] {
    --bg: #ffffff;
    --surface: #f6f7f9;
    --text: #0b0c0f;
    --muted: #5b6572;
    --accent: #0066ff;
}
[data-theme="dark"] {
    --bg: #0b0c0f;
    --surface: #12141a;
    --text: #e8ecf1;
    --muted: #9aa4b2;
    --accent: #6ae3ff;
}


/* =========================================================
   BASE / RESET
   --------------------------------------------------------- */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Mono font for code-like UI bits */
code, pre, .tagline, .chip {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Skip link for accessibility */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
    left: 1rem; top: 1rem;
    background: var(--accent); color: #000;
    padding: .5rem 1rem;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }


/* =========================================================
   LAYOUT PRIMITIVES
   --------------------------------------------------------- */
.section {
    padding: 3rem 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.hero {
    display: grid;
    place-items: center;
    gap: .5rem;
    padding: 4rem 1rem;
    text-align: center;
}

/* Headings centered for main sections */
#about h2,
#skills h2,
#projects h2,
#github h2,
#exp h2 {
    text-align: center;
    margin: 0 auto .75rem;
}

/* Centered intro paragraph in About */
#about > p {
    text-align: center;
    max-width: 70ch;
    margin: 0 auto 1rem;
}

/* Extra spacing for section headings when needed */
.section > h2 { margin-bottom: .75rem; }


/* =========================================================
   HEADER & NAV
   --------------------------------------------------------- */
.header {
    position: sticky; top: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 1rem;
    background: color-mix(in oklab, var(--surface) 80%, transparent);
    border-bottom: 1px solid color-mix(in oklab, var(--muted) 30%, transparent);
    backdrop-filter: saturate(120%) blur(10px);
}

.nav a {
    margin: 0 .5rem;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.nav a:hover,
.nav a:focus { border-color: var(--accent); }

.actions { display: flex; gap: .5rem; }


/* =========================================================
   COMMON UI ELEMENTS
   --------------------------------------------------------- */
.btn {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #000;
    padding: .5rem .9rem;
    border-radius: .6rem;
    cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--accent); }

input, textarea, select {
    width: 100%;
    padding: .6rem;
    border-radius: .6rem;
    border: 1px solid color-mix(in oklab, var(--muted) 40%, transparent);
    background: var(--surface);
    color: var(--text);
}
input:focus, textarea:focus, select:focus, .btn:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

dialog {
    border: none;
    background: var(--surface);
    color: var(--text);
    border-radius: 1rem;
    padding: 1rem;
}

/* Utility / helpers */
.caret { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hp { position: absolute; left: -9999px; } /* honeypot */

.sr-only {
    position: absolute;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}


/* =========================================================
   CARDS, GRID, CHIPS
   --------------------------------------------------------- */
.card {
    border: 1px solid color-mix(in oklab, var(--muted) 35%, transparent);
    background: var(--surface);
    border-radius: 1rem;
    padding: 1rem;
}

.grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.chip {
    border: 1px solid color-mix(in oklab, var(--muted) 35%, transparent);
    padding: .2rem .5rem;
    border-radius: 999px;
    display: inline-block;
    margin: .15rem;
}

/* Project list: one column centered with a comfy width */
#projects .grid {
    display: grid;
    grid-template-columns: minmax(320px, 720px);
    justify-content: center;
    gap: 1.25rem;
}
/* Tighter gap between Projects and GitHub */
#projects.section { padding-bottom: 1.5rem; }           /* less bottom padding on Projects */
#projects.section + #github.section { padding-top: 1rem; } /* less top padding on GitHub */

/* ensure the GitHub grid has no extra top gap */
#github .gh-compact { margin-top: 0; }

/* (you likely already have this; keep it so GitHub cards stay centered at one-per-row) */
#github .grid {
    grid-template-columns: minmax(320px, 720px);
    justify-content: center;
}


/* =========================================================
   AVATARS & MEDIA
   --------------------------------------------------------- */
.avatar {
    border-radius: 50%;
    border: 1px solid color-mix(in oklab, var(--muted) 40%, transparent);
}

.project-img {
    display: block;
    width: 100%;
    max-height: 160px;
    object-fit: contain;
    background: color-mix(in oklab, var(--muted) 10%, transparent);
    border-radius: .6rem;
    margin-bottom: .5rem;
}

/* NOTE: This is used where a generic project hero image is shown */
.project-hero img { border-radius: 999px; }


/* =========================================================
   PROJECT MINI CARDS (list view)
   --------------------------------------------------------- */
.project-head {
    display: flex; align-items: center; gap: .75rem;
    margin-bottom: .25rem;
}
.project-title { margin: 0; }

.project-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 48px;
    border: 1px solid color-mix(in oklab, var(--muted) 35%, transparent);
    background: color-mix(in oklab, var(--muted) 10%, transparent);
}
@media (max-width: 480px) {
    .project-icon { width: 40px; height: 40px; flex-basis: 40px; }
}

/* Small metadata row under titles */
.project-meta {
    margin-top: .25rem;
    white-space: pre-line;
}
.project-meta em {
    color: var(--muted);
    font-style: italic;
    margin-right: .25rem;
}

.card.mini {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: 1rem;
}

.card.mini .mini-head {
    display: flex; align-items: center; gap: .75rem;
}

.card.mini .muted { color: var(--muted); margin: .15rem 0 0; }


/* =========================================================
   FOOTER
   --------------------------------------------------------- */
footer.footer {
    padding: 2rem 1rem;
    text-align: center;
    border-top: 1px solid color-mix(in oklab, var(--muted) 30%, transparent);
}


/* =========================================================
   PROJECT DETAILS PAGE (project.html)
   --------------------------------------------------------- */
.project-page .project-hero {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface);
    border: 1px solid color-mix(in oklab, var(--muted) 35%, transparent);
    border-radius: 1rem; padding: 1rem;
}

.project-page .logo {
    width: 56px; height: 56px; border-radius: 999px;
    object-fit: cover;
    border: 1px solid color-mix(in oklab, var(--muted) 35%, transparent);
}

.project-page .subtle { margin: .25rem 0 .5rem; font-size: 1rem; opacity: .85; }
.project-page .kv { margin-top: 1rem; }
.project-page .chips { display: flex; flex-wrap: wrap; gap: .4rem; }

.project-page pre {
    background: var(--surface);
    border-radius: .75rem; padding: 1rem; overflow: auto;
    border: 1px solid color-mix(in oklab, var(--muted) 35%, transparent);
}

.project-page .links { display: flex; gap: .5rem; }

.project-page .screens-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.project-page .screens-grid img {
    width: 100%;
    border-radius: .75rem;
    border: 1px solid color-mix(in oklab, var(--muted) 35%, transparent);
}

.project-page header.section{
    padding: var(--space-md) var(--space-xl);
    margin: var(--space-md) auto 0 !important;
}

.project-page main.section{
    padding-top: var(--space-lg);
    padding-bottom: var(--space-2xl);
}

.card.mini{
    display:flex;
    flex-direction:column;
    gap:.75rem;
}

/* Mini cards layout */
.card.mini{ padding:1rem; }

.card.mini .mini-left{
    display:flex;
    align-items:center;
    gap:.75rem;
    min-width:0;
}

.card.mini .mini-text{ min-width:0; }
.card.mini .mini-text .project-title{ margin:0; }
.card.mini .mini-text .muted{ margin:.15rem 0 0; }

/* Push Details to the far right of the same row */
.card.mini .mini-details{
    margin-left:auto;
}

/* Small circular logo (you already had this) */
.card.mini .mini-head .avatar{
    width:40px; height:40px;
    border-radius:50%;
    border:1px solid color-mix(in oklab, var(--muted) 35%, transparent);
    object-fit:cover;
}

/* Actions row on the right (GitHub + Details) */
.card.mini .mini-actions {
    margin-left: auto;
    display: flex;
    gap: .5rem;
}

/* Dark placeholder for repos that don't have a logo */
.avatar.placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid color-mix(in oklab, var(--muted) 35%, transparent);
    background: #0f1115;
    flex: 0 0 40px;
}

/* ---- Red "Private" button ---- */
.btn.warn {
    background: #ff5563;
    border-color: #ff5563;
    color: #000;
}
.btn.warn:hover,
.btn.warn:focus-visible {
    filter: brightness(1.05);
}

/* ---- Lightweight tooltip using data-tip ---- */
.btn[data-tip] { position: relative; }
.btn[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    color: var(--text);
    border: 1px solid color-mix(in oklab, var(--muted) 35%, transparent);
    padding: .45rem .6rem;
    border-radius: .5rem;
    white-space: normal;
    width: 260px;
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
    z-index: 10;
}
.btn[data-tip]:hover::after,
.btn[data-tip]:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.skill-row { margin: .5rem 0; }
.skill-row-head { display: flex; justify-content: space-between; align-items: baseline; }
.skill-name { font-weight: 500; }
.level-label { color: var(--muted); font-weight: 400; }
.skill-note { color: var(--muted); }

.level-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    height: 8px;
    margin-top: .35rem;
}
.level-bar .segment {
    border-radius: 999px;
    background: color-mix(in oklab, var(--muted) 25%, transparent);
}
.level-bar .segment.filled { background: var(--accent); }

.subhead{
    margin:.5rem 0 .25rem;
    color:var(--muted);
    font-weight:600;
}

ul.in-progress{
    margin-top:.25rem;
}

.badge{
    display: inline-block;
    margin-left: .4rem;
    padding: .1rem .5rem;
    border-radius: 999px;
    font-size: .76rem;
    line-height: 1.2;
    border: 1px solid color-mix(in oklab, var(--muted) 45%, transparent);
    color: var(--muted);
    background: transparent;
    vertical-align: middle;
}

.badge.inprogress{
    border-color: #ff6a3d;
    color: #ff6a3d;
}

#contact form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 1100px;
    margin-inline: auto;
}

#contact form label { display: flex; flex-direction: column; }

#contact form label:nth-of-type(3) {
    grid-column: 1 / -1;
}

#contact form .btn { justify-self: start; }
#contactStatus { align-self: center; margin-left: .5rem; }
#contactStatus.ok  { color: #22c55e; }
#contactStatus.err { color: #ff5563; }

@media (max-width: 640px) {
    #contact form { grid-template-columns: 1fr; }
}

#contact .contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

#contact .contact-grid .field {
    display: flex;
    flex-direction: column;
}

#contact input,
#contact textarea {
    width: 100%;
}

#contact .contact-grid .message {
    grid-column: 1 / -1;
}

#contact .contact-grid .actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: .75rem;
}

#contact .contact-meta {
    margin-top: .75rem;
}

@media (max-width: 860px) {
    #contact .contact-grid {
        grid-template-columns: 1fr;
    }
    #contact .contact-grid .message,
    #contact .contact-grid .actions {
        grid-column: 1;
    }
}

.projects-list{
    display:grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.card.mini{ width:100%; }

.mini-actions{
    display:flex;
    align-items:center;
    gap:.5rem;
}

.badge.production{
    color:#22c55e;
    border-color: #22c55e66;
    background: #22c55e1f;
}

.badge.exercise{
    color: var(--accent);
    border-color: color-mix(in oklab, var(--accent) 45%, transparent);
    background: color-mix(in oklab, var(--accent) 12%, transparent);
}

.badge.beta{
    color:#a78bfa;
    border-color:#a78bfa66;
    background:#a78bfa14;
}

.byline.hacker{ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.byline.hacker .name{ position:relative; }

.byline.hacker .name::before,
.byline.hacker .name::after{
    content: attr(data-text);
    position:absolute; left:0; top:0; opacity:.55; pointer-events:none;
    clip-path: inset(0 0 50% 0);
    transition: transform .08s ease;
}
.byline.hacker .name::before{ text-shadow:-1px 0 var(--accent); clip-path: inset(0 0 48% 0); }
.byline.hacker .name::after{  text-shadow: 1px 0 #ff6a3d;  clip-path: inset(52% 0 0 0); }

.byline.hacker .name:hover::before{ transform: translate(-1px,-0.5px); }
.byline.hacker .name:hover::after{  transform: translate( 1px, 0.5px); }

@media (prefers-reduced-motion: reduce){
    .byline.hacker .name::before,
    .byline.hacker .name::after{ display:none; }
}


/* End of styles.css */

/* =========================================================
   WORLD-CLASS DESIGN SYSTEM - Digital Soul Portfolio
   ========================================================= */

:root {
    --bg: #fafbfc;
    --surface: #ffffff;
    --surface-hover: #f6f8fa;
    --text: #1a1f2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #dbeafe;
    --border: #e5e7eb;
    --border-hover: #d1d5db;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --duration-fast: 150ms;
    --duration-base: 250ms;
    --duration-slow: 350ms;
    --ease-out: cubic-bezier(0.16,1,0.3,1);
    --ease-in-out: cubic-bezier(0.65,0,0.35,1);
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    color-scheme: light dark;
}

[data-theme="dark"] {
    --bg: #0a0e1a;
    --surface: #141824;
    --surface-hover: #1a1f2e;
    --text: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --accent-light: #1e3a8a;
    --border: #1f2937;
    --border-hover: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -2px rgba(0,0,0,0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.6), 0 10px 10px -5px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a0e1a;
        --surface: #141824;
        --surface-hover: #1a1f2e;
        --text: #f9fafb;
        --text-secondary: #9ca3af;
        --text-muted: #6b7280;
        --accent: #60a5fa;
        --accent-hover: #3b82f6;
        --accent-light: #1e3a8a;
        --border: #1f2937;
        --border-hover: #374151;
        --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.3);
        --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -2px rgba(0,0,0,0.3);
        --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.6), 0 10px 10px -5px rgba(0,0,0,0.4);
    }
}

*,*::before,*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html,body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,h2,h3,h4,h5,h6 {
    margin: 0;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p { margin: 0 0 var(--space-md); }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover { color: var(--accent-hover); }

code,pre,.tagline,.chip {
    font-family: 'SF Mono','Monaco','Inconsolata',monospace;
}

.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999;
}

.skip-link:focus {
    left: var(--space-md);
    top: var(--space-md);
    background: var(--accent);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .caret { animation: none; }
}

.section {
    padding: var(--space-3xl) var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .section {
        padding: var(--space-2xl) var(--space-md);
    }
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    background: rgba(255,255,255,0.8);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    transition: all var(--duration-base) var(--ease-out);
}

[data-theme="dark"] .header {
    background: rgba(20,24,36,0.8);
}

.brand {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nav {
    display: flex;
    gap: var(--space-sm);
}

.nav a {
    position: relative;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-out);
}

.nav a:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: var(--accent);
    border-radius: var(--radius-full);
    transition: transform var(--duration-base) var(--ease-out);
}

.nav a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

@media (max-width: 768px) {
    .header { padding: var(--space-md); }
    .nav { gap: 0.25rem; }
    .nav a { padding: var(--space-sm); font-size: 0.875rem; }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    white-space: nowrap;
    user-select: none;
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn:not(.ghost):not(.warn) {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.btn:not(.ghost):not(.warn):hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn:not(.ghost):not(.warn):active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn.ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn.ghost:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--border-hover);
}

.btn.warn {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.btn.warn:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: var(--shadow-md);
}

button[aria-label] {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    cursor: pointer;
    font-size: 1.125rem;
    transition: all var(--duration-fast) var(--ease-out);
}

button[aria-label]:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

input,textarea,select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-out);
}

input:hover,textarea:hover,select:hover {
    border-color: var(--border-hover);
}

input:focus,textarea:focus,select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-base) var(--ease-out);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.card h3 {
    margin-bottom: var(--space-md);
}

.grid {
    display: grid;
    gap: var(--space-xl);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-3xl) var(--space-xl) var(--space-2xl);
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0;
}

.tagline {
    font-size: 1rem;
    color: var(--text-muted);
}

.caret {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.cta {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.125rem; }
    .cta {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--border);
    box-shadow: var(--shadow-lg);
    object-fit: cover;
    transition: all var(--duration-base) var(--ease-out);
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

#about h2, #skills h2, #projects h2, #github h2, #exp h2, #contact h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
    position: relative;
}

#about h2::after, #skills h2::after, #projects h2::after, #github h2::after, #exp h2::after, #contact h2::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: var(--radius-full);
}

#about > p {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--space-2xl);
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    max-width: 900px;
    margin: 0 auto;
}

.card.mini {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-xl);
}

.mini-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.mini-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    min-width: 0;
}

.mini-text {
    flex: 1;
    min-width: 0;
}

.mini-text h3 {
    margin: 0 0 var(--space-xs);
    font-size: 1.25rem;
}

.mini-text .muted, .muted {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.mini-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    align-items: center;
}

.project-icon, .avatar.placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--surface-hover);
    flex-shrink: 0;
}

.avatar.placeholder {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
}

@media (max-width: 768px) {
    .mini-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .mini-actions {
        width: 100%;
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    border: 1px solid;
}

.badge.production {
    background: rgba(16,185,129,0.1);
    border-color: rgba(16,185,129,0.3);
    color: var(--success);
}

.badge.beta {
    background: rgba(168,85,247,0.1);
    border-color: rgba(168,85,247,0.3);
    color: #a855f7;
}

.badge.exercise {
    background: rgba(37,99,235,0.1);
    border-color: rgba(37,99,235,0.3);
    color: var(--accent);
}

.badge.inprogress {
    background: rgba(245,158,11,0.1);
    border-color: rgba(245,158,11,0.3);
    color: var(--warning);
}

.skill-row {
    margin-bottom: var(--space-lg);
}

.skill-row-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-sm);
}

.skill-name {
    font-weight: 500;
    font-size: 0.9375rem;
}

.level-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.skill-note {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.level-bar {
    display: flex;
    gap: 4px;
    height: 6px;
    margin-top: var(--space-sm);
}

.level-bar .segment {
    flex: 1;
    background: var(--surface-hover);
    border-radius: var(--radius-full);
    transition: all var(--duration-base) var(--ease-out);
}

.level-bar .segment.filled {
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    box-shadow: 0 0 8px rgba(37,99,235,0.3);
}

[data-theme="dark"] .level-bar .segment.filled {
    box-shadow: 0 0 8px rgba(96,165,250,0.3);
}

#contact form {
    max-width: 700px;
    margin: 0 auto;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.contact-grid .field {
    display: flex;
    flex-direction: column;
}

.contact-grid .message {
    grid-column: 1 / -1;
}

.contact-grid .actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

#contactStatus {
    font-size: 0.9375rem;
}

#contactStatus.ok {
    color: var(--success);
}

#contactStatus.err {
    color: var(--error);
}

.contact-meta {
    text-align: center;
    margin-top: var(--space-2xl);
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.contact-meta a {
    font-weight: 500;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .contact-grid .message, .contact-grid .actions {
        grid-column: 1;
    }
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    margin: 0.25rem;
    transition: all var(--duration-fast) var(--ease-out);
}

.chip:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.footer {
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.project-page .project-hero {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
}

.project-page .logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.project-page .hero-text h1 {
    font-size: 2rem;
    margin-bottom: var(--space-xs);
}

.project-page .subtle {
    margin: var(--space-xl) 0 var(--space-md);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.project-page .kv {
    margin-top: var(--space-2xl);
}

.project-page .chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.project-page pre {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    overflow: auto;
    border: 1px solid var(--border);
    margin-top: var(--space-md);
}

.project-page .screens-grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-top: var(--space-md);
}

.project-page .screens-grid img {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-base) var(--ease-out);
}

.project-page .screens-grid img:hover {
    box-shadow: var(--shadow-md);
}

.btn[data-tip] {
    position: relative;
}

.btn[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    white-space: normal;
    width: 260px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease;
    z-index: 10;
    font-size: 0.875rem;
    font-weight: 400;
}

.btn[data-tip]:hover::after, .btn[data-tip]:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.byline {
    margin-top: var(--space-sm);
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.byline.hacker .name {
    position: relative;
    color: var(--text);
    font-weight: 500;
}

.byline.hacker .name::before, .byline.hacker .name::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0.6;
    pointer-events: none;
    clip-path: inset(0 0 50% 0);
    transition: transform 0.08s ease;
}

.byline.hacker .name::before {
    text-shadow: -1px 0 var(--accent);
    clip-path: inset(0 0 48% 0);
}

.byline.hacker .name::after {
    text-shadow: 1px 0 var(--warning);
    clip-path: inset(52% 0 0 0);
}

.byline.hacker .name:hover::before {
    transform: translate(-1px, -0.5px);
}

.byline.hacker .name:hover::after {
    transform: translate(1px, 0.5px);
}

@media (prefers-reduced-motion: reduce) {
    .byline.hacker .name::before, .byline.hacker .name::after {
        display: none;
    }
}

dialog {
    border: none;
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

dialog::backdrop {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    justify-content: flex-end;
}

.subhead {
    margin: var(--space-md) 0 var(--space-sm);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9375rem;
}

ul.in-progress {
    margin-top: var(--space-sm);
}

.project-title {
    margin: 0;
    font-size: 1.25rem;
}

.project-img {
    display: block;
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    background: var(--surface-hover);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    border: 1px solid var(--border);
}
#github .grid {
    grid-template-columns: minmax(320px, 720px);
    justify-content: center;
}

/* Tighter spacing between Projects and GitHub sections */
#projects.section {
    padding-bottom: 1.5rem;
}

#projects.section + #github.section {
    padding-top: 1rem;
}

#github .gh-compact {
    margin-top: 0;
}

/* Project metadata */
.project-head {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.project-meta {
    margin-top: var(--space-sm);
    white-space: pre-line;
}

.project-meta em {
    color: var(--text-muted);
    font-style: italic;
    margin-right: var(--space-sm);
}

/* Lists styling */
ul, ol {
    padding-left: var(--space-xl);
    margin: var(--space-md) 0;
}

li {
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

/* Code blocks */
code {
    background: var(--surface-hover);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
}

pre code {
    background: none;
    padding: 0;
}

@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    .hero h1 { font-size: 2rem; }
}

@media print {
    .header, .footer, .btn, .actions { display: none; }
    .section { padding: 1rem; }
    * { background: white !important; color: black !important; }
}

:root{
    --font-latin: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-mk: "Segoe UI", "Noto Sans", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

html[lang="mk"] #exp { font-family: var(--font-mk); }

html[lang="mk"] #exp .keep-latin,
html[lang="mk"] #exp .keep-latin * { font-family: var(--font-latin); }
