/* Base reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji"; line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { padding: 0; margin: 0; list-style: none; }

/* Color system */
:root {
  --bg: #ffffff;
  --text: #0f172a; /* slate-900 */
  --muted: #475569; /* slate-600 */
  --card: #f8fafc; /* slate-50 */
  --border: #e2e8f0; /* slate-200 */
  --accent: #0ea5e9; /* sky-500 */
  --accent-contrast: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --text: #e5e7eb; /* gray-200 */
    --muted: #a1a1aa; /* zinc-400 */
    --card: #0f172a; /* slate-900 */
    --border: #1f2937; /* gray-800 */
    --accent: #38bdf8; /* sky-400 */
    --accent-contrast: #0b1220;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.35);
  }
}

/* Explicit theme override via [data-theme] (placed AFTER media block to win) */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --card: #f8fafc;
  --border: #e2e8f0;
  --accent: #0ea5e9;
  --accent-contrast: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.1);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #a1a1aa;
  --card: #0f172a;
  --border: #1f2937;
  --accent: #38bdf8;
  --accent-contrast: #0b1220;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.35);
}

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

/* Layout */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus { left: 1rem; top: 1rem; width: auto; height: auto; background: var(--card); color: var(--text); padding: .5rem .75rem; border-radius: .5rem; box-shadow: var(--shadow); }

.site-header {
  position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(180%) blur(8px);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav { max-width: 1000px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; }
.brand { font-weight: 700; letter-spacing: .2px; }
.nav-menu { display: flex; gap: .75rem; align-items: center; }
.nav-menu a { padding: .5rem .6rem; border-radius: .45rem; color: var(--muted); transition: color .2s ease, background-color .2s ease; }
.nav-menu a:hover { background: var(--card); color: var(--text); }

.nav-toggle { display: none; background: transparent; border: 0; padding: .25rem; cursor: pointer; }
.nav-toggle .bar { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: transform .2s ease, opacity .2s ease; }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-menu { position: absolute; right: 1rem; top: 56px; background: var(--bg); border: 1px solid var(--border); border-radius: .75rem; box-shadow: var(--shadow); padding: .5rem; display: none; flex-direction: column; align-items: stretch; min-width: 180px; }
  .nav-menu.open { display: flex; }
  .nav-menu a, .theme-toggle { padding: .6rem .75rem; }
}

.hero { padding: 3.5rem 1rem 2rem; }
.hero-content { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; }
.avatar { width: 200px; height: 200px; border-radius: 50%; border: 2px solid var(--border); background: var(--card); object-fit: cover; object-position: center; }
.name { margin: 0; font-size: clamp(1.75rem, 3vw + 1rem, 2.75rem); font-weight: 800; letter-spacing: .2px; line-height: 1.15; }
.name::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: .4rem; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.tagline { margin: .3rem 0 0; color: var(--muted); max-width: 60ch; }
.cf-stats { grid-column: 1 / -1; display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; color: var(--muted); }
.cf-stats .label { color: var(--muted); margin-right: .35rem; }
.cf-stats .value { color: var(--text); font-weight: 600; }

@media (max-width: 720px) {
  .hero-content { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

.section { padding: 2rem 1rem; }
.section > h2 { max-width: 1000px; margin: 0 auto 1rem; font-size: 1.25rem; letter-spacing: .2px; }

.grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--border); border-radius: .9rem; padding: 1rem; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; display: flex; flex-direction: column; min-height: 360px; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,.08); border-color: color-mix(in oklab, var(--border), var(--accent) 30%); }
.card h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.card p { margin: 0 0 .85rem; color: var(--muted); flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.card-actions { display: flex; gap: .5rem; margin-top: auto; }

/* Project logos */
.card-logo { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.card-logo img { width: 56px; height: 56px; object-fit: contain; border-radius: .5rem; background: var(--card); border: 1px solid var(--border); }
.card-logo .emoji { font-size: 2rem; line-height: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.btn { display: inline-block; background: var(--accent); color: var(--accent-contrast); padding: .45rem .75rem; border-radius: .6rem; font-weight: 600; border: 1px solid transparent; transition: background-color .15s ease, filter .15s ease; }
.btn:hover { filter: brightness(0.95); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--card); }
.btn.disabled { background: color-mix(in oklab, var(--accent), var(--bg) 60%); cursor: not-allowed; filter: grayscale(0.2); }
.btn.disabled:hover { filter: none; }

.list { max-width: 1000px; margin: 0 auto; display: grid; gap: .75rem; }
.item { background: var(--card); border: 1px solid var(--border); border-radius: .9rem; padding: 1rem; transition: background-color .2s ease, border-color .2s ease; }
.item:hover { border-color: color-mix(in oklab, var(--border), var(--accent) 30%); }
.item-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.item h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.item .time { color: var(--muted); font-size: .95rem; }
.item p { margin: 0; color: var(--muted); }

.chips { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: .6rem; }
.chips li { padding: .5rem; border-radius: 1rem; background: var(--card); border: 1px solid var(--border); color: var(--text); display: flex; align-items: center; justify-content: center; height: 62px; box-shadow: var(--shadow); }
.chips li img { width: 31px; height: 31px; object-fit: contain; display: block; }
/* Flask icon theming: black on light, white on dark */
.flask-icon { filter:brightness(1) invert(0); padding: 2px; border-radius: 6px; }
html[data-theme="dark"] .flask-icon { filter: brightness(0) invert(1); }

/* .socials { max-width: 1000px; margin: .5rem auto 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.socials a { color: var(--muted); padding: .4rem .6rem; border-radius: .5rem; }
.socials a:hover { background: var(--card); color: var(--text); } */

/* ... existing CSS ... */

/* Contact Section */
.contact-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
}

.contact-info p:first-of-type {
    max-width: 45ch;
    color: var(--muted);
    margin-bottom: 1rem;
}

.socials-list {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: .9rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.socials {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.socials {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.socials li a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
    border-radius: .6rem;
    transition: background-color .2s ease;
    background-repeat: no-repeat; /* This is the key fix */
    background-size: 20px 20px;
    background-position: 10px center;
    padding-left: 36px;
}

.socials li a:hover {
    transform: translateY(-2px) scale(1.02);
}

.socials li:nth-child(1) a { /* GitHub */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0c-2.73-1.83-3.91-1.18-4.09-1.07A5.07 5.07 0 0 0 4 4.77a5.44 5.44 0 0 0 1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22'%3E%3C/path%3E%3C/svg%3E");
}

.socials li:nth-child(2) a { /* LinkedIn */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z'%3E%3C/path%3E%3Crect x='2' y='9' width='4' height='12'%3E%3C/rect%3E%3Ccircle cx='4' cy='4' r='2'%3E%3C/circle%3E%3C/svg%3E");
}

.socials li:nth-child(3) a { /* Twitter */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1a10.66 10.66 0 0 1-9-4 4.48 4.48 0 0 0 1.05 5.61A4.48 4.48 0 0 1 2 11.23v.5a4.48 4.48 0 0 0 3.56 4.36c-.19.04-.39.07-.59.07-.12 0-.24-.01-.36-.02a4.48 4.48 0 0 0 4.2 3.12 8.95 8.95 0 0 1-5.6 1.94c-.45 0-.89-.02-1.33-.09a12.69 12.69 0 0 0 6.84 2c8.2 0 12.67-6.83 12.67-12.67V10a9 9 0 0 0 2.3-2.61z'%3E%3C/path%3E%3C/svg%3E");
}

.socials li:nth-child(4) a { /* Codeforces */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='10' width='4' height='11' rx='1' ry='1'%3E%3C/rect%3E%3Crect x='10' y='3' width='4' height='18' rx='1' ry='1'%3E%3C/rect%3E%3Crect x='17' y='8' width='4' height='13' rx='1' ry='1'%3E%3C/rect%3E%3C/svg%3E");
    /* Keep padding-left: 36px to align with other icons */
    padding-left: 36px;
}


/* Dark mode icon colors */
html[data-theme="dark"] .socials li:nth-child(1) a {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0c-2.73-1.83-3.91-1.18-4.09-1.07A5.07 5.07 0 0 0 4 4.77a5.44 5.44 0 0 0 1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22'%3E%3C/path%3E%3C/svg%3E");
}
html[data-theme="dark"] .socials li:nth-child(2) a {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z'%3E%3C/path%3E%3Crect x='2' y='9' width='4' height='12'%3E%3C/rect%3E%3Ccircle cx='4' cy='4' r='2'%3E%3C/circle%3E%3C/svg%3E");
}
html[data-theme="dark"] .socials li:nth-child(3) a {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1a10.66 10.66 0 0 1-9-4 4.48 4.48 0 0 0 1.05 5.61A4.48 4.48 0 0 1 2 11.23v.5a4.48 4.48 0 0 0 3.56 4.36c-.19.04-.39.07-.59.07-.12 0-.24-.01-.36-.02a4.48 4.48 0 0 0 4.2 3.12 8.95 8.95 0 0 1-5.6 1.94c-.45 0-.89-.02-1.33-.09a12.69 12.69 0 0 0 6.84 2c8.2 0 12.67-6.83 12.67-12.67V10a9 9 0 0 0 2.3-2.61z'%3E%3C/path%3E%3C/svg%3E");
}

/* ... existing CSS ... */


.link { color: var(--accent); text-underline-offset: 3px; }
.link:hover { text-decoration: underline; }

.site-footer { border-top: 1px solid var(--border); padding: 1.25rem 1rem 2rem; color: var(--muted); display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap; }
.to-top { color: var(--muted); padding: .3rem .5rem; border-radius: .5rem; }
.to-top:hover { background: var(--card); color: var(--text); }

.theme-toggle { background: var(--card); border: 1px solid var(--border); color: var(--text); border-radius: .6rem; padding: .35rem .6rem; cursor: pointer; transition: background-color .2s ease, border-color .2s ease, transform .2s ease; }
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle[aria-pressed="true"] { border-color: color-mix(in oklab, var(--border), var(--accent) 60%); }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .theme-toggle, .nav-toggle .bar { transition: none; }
}

