/* ====== Fixed Theme Variables and Layout ====== */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-muted: #fafafa;
  --text: #1a1b1e;
  --text-muted: #505565;
  --accent: #275efe;
  --link: var(--accent);
  --card: #ffffff;
  --border: #e8e8ef;
  --shadow: 0 10px 30px rgba(0,0,0,.06);
  --radius: 16px;
  --content-max: 72ch; /* narrower for wider internal margins */
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-muted: #0f172a;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #93c5fd;
  --link: var(--accent);
  --card: #0f172a;
  --border: #1f2937;
  --shadow: 0 10px 30px rgba(0,0,0,.4);
}

/* Base */
html, body { background: var(--bg); color: var(--text); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* Container width + padding */
.container { max-width: var(--content-max); margin-inline: auto; padding-inline: clamp(20px, 6vw, 64px); }

/* Header & nav */
header {
  position: sticky; top: 0; z-index: 1000;
  backdrop-filter: saturate(120%) blur(8px);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding-block: 10px; }
.brand { font-weight: 700; }
.site-nav { display: flex; gap: clamp(.5rem, 2vw, 1.2rem); justify-self: center; }
.site-nav a { padding: 6px 8px; border-radius: 8px; }
.site-nav a[aria-current="page"] { background: var(--bg-muted); }
.icon-button {
  appearance: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .6rem;
  padding: .45rem .6rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

/* Hero / avatar */
.hero { display: grid; grid-template-columns: auto 1fr; gap: clamp(16px, 4vw, 28px); align-items: center; }

/* Cards and text */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(16px, 3vw, 24px); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
.muted { color: var(--text-muted); }

/* Skip link */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { left: 8px; top: 8px; width: auto; height: auto; padding: 8px 10px; background: var(--bg-muted); border-radius: 10px; }

/* Mobile nav (overrides old CSS that hid nav) */
#nav-toggle { display: none; }
@media (max-width: 720px) {
  .nav { grid-template-columns: auto auto 1fr auto; }
  #nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav { display: none; position: absolute; top: 100%; left: 1rem; right: 1rem; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: .75rem; box-shadow: var(--shadow); overflow: hidden; }
  .site-nav.open { display: flex !important; }
  .site-nav a { display: block; padding: .875rem 1rem; }
}

/* Original CSS below */
/* ====== Theme Variables ====== */
--card: #15151b;
--border: #262631;
--link: var(--accent);
--shadow: 0 10px 30px rgba(0,0,0,.25);
--radius: 16px;
--content-max: 900px;
}
[data-theme="light"] {
--bg: #ffffff;
--bg-muted: #fafafa;
--text: #1a1b1e;
--text-muted: #505565;
--accent: #275efe;
--card: #ffffff;
--border: #e8e8ef;
--link: var(--accent);
--shadow: 0 10px 30px rgba(0,0,0,.06);
}


/* ====== Resets ====== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
margin: 0;
font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
color: var(--text);
background: radial-gradient(1200px 800px at 100% -20%, rgba(39, 94, 254, .08), transparent 50%), var(--bg);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
scroll-behavior: smooth;
}


/* ====== Layout ====== */
.container { max-width: var(--content-max); margin: 0 auto; padding: 24px; }
header {
position: sticky; top: 0; z-index: 5;
backdrop-filter: saturate(120%) blur(8px);
background: color-mix(in oklab, var(--bg) 90%, transparent);
border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 12px 24px; }
.brand { font-weight: 700; letter-spacing: .2px; }
nav a { color: var(--text-muted); text-decoration: none; padding: 8px 10px; border-radius: 10px; }
nav a:hover, nav a:focus { color: var(--text); background: var(--bg-muted); outline: none; }


.theme-picker { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
select.theme-select { background: transparent; color: var(--text); border: none; outline: none; }


.hero { display: grid; gap: 24px; grid-template-columns: 140px 1fr; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-top: 24px; }
.avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
section { margin-top: 48px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }


h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 1.4rem; }
p { margin: 0 0 12px; color: var(--text); }
.muted { color: var(--text-muted); }
ul { margin: 8px 0 0 18px; }
.footer { margin: 64px 0 24px; color: var(--text-muted); font-size: .95rem; text-align: center; }


.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { left: 8px; top: 8px; width: auto; height: auto; padding: 8px 10px; background: var(--bg-muted); border-radius: 10px; }


@media (max-width: 640px) {
.hero { grid-template-columns: 1fr; text-align: center; }
.hero .avatar { margin: 0 auto; }
nav { display: none; }
}


/* ====== Final overrides (ensure these win) ====== */
.avatar { width: clamp(160px, 24vw, 240px); aspect-ratio: 1 / 1; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
@media (max-width: 720px) { nav.site-nav.open { display: flex !important; } }
