:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --text: #14213d;
  --muted: #56627a;
  --accent: #2f5bea;
  --line: #d3d9e6;
}

:root[data-theme="dark"] {
  --bg: #0f1522;
  --surface: #172033;
  --text: #e8ecf5;
  --muted: #9aa6bf;
  --accent: #8fb0ff;
  --line: #2a3550;
}

* {
  box-sizing: border-box; 
}

html {
  scroll-behavior: smooth; scroll-padding-top: 4.5rem; 
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.05rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { 
  color: var(--accent); 
}
:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px; 
}

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
  padding: .8rem 1.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.logo {
  color: var(--text); font-weight: 800; text-decoration: none; 
}
nav {
  display: flex; gap: 1.2rem; align-items: center; 
}
nav a {
  color: var(--text); text-decoration: none; 
}

nav a:hover {
  color: var(--accent); 
}
#theme {
  font: inherit; font-size: .9rem; cursor: pointer;
  padding: .25rem .8rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}

main, footer {
  max-width: 46rem; margin: 0 auto; padding: 0 1.5rem; 
}
section {
  padding: 3.5rem 0 1rem; 
}
h1, h2, h3 {
  line-height: 1.1; margin: 0 0 1rem; letter-spacing: -0.02em; 
}
h2 {
  font-size: 1.8rem; 
}
h3 {
  font-size: 1.15rem; margin-bottom: .4rem; 
}

.hero {
  padding-top: 5rem; 
}
.hello {
  margin: 0; color: var(--muted); 
}
h1 {
  font-size: clamp(3rem, 12vw, 6rem); font-weight: 900; margin-bottom: .5rem; }
.role {
  font-size: 1.5rem; margin: 0 0 2rem; 
}
#typed {
  color: var(--accent); font-weight: 700; 
}
.cursor {
  display: inline-block; width: 2px; height: 1.1em; margin-left: 3px;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; } 
}
.btn {
  display: inline-block; padding: .7rem 1.4rem; border-radius: 8px;
  background: var(--accent); color: var(--bg); font-weight: 700; text-decoration: none;
}
.btn:hover {
  filter: brightness(1.1); 
}

.skills, .links {
  list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; 
}
.skills li {
  padding: .2rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); 
}
.links {
  gap: 1.5rem; 
}

.grid { 
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); 
}
article {
  padding: 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; 
}
article p {
  color: var(--muted); margin: 0 0 .8rem; 
}

footer {
  padding-top: 3rem; padding-bottom: 2rem; color: var(--muted); font-size: .9rem; 
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto; 
  }
  .cursor {
    animation: none; 
  }
}

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