:root {
  --bg: #fafafa;
  --fg: #09090b;
  --muted-fg: #475569;
  --card: #ffffff;
  --border: #e4e4e7;
  /* --hero: #2f4f4f; */
  --hero: #4A617C;
  --hero-fg: #ffffff;
  --accent: #2563eb;
  --accent-fg: #ffffff;
  --track: #e2e8f0;
  --shadow: 0 1px 2px rgba(9, 9, 11, .06), 0 4px 16px rgba(9, 9, 11, .06);
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 80px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101514;
    --fg: #f1f5f4;
    --muted-fg: #a8b5b3;
    --card: #182120;
    --border: #2a3736;
    --hero: #1f3333;
    --accent: #6ea0ff;
    --accent-fg: #0a0f1f;
    --track: #2a3736;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: "Quicksand", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-fg);
  padding: 10px 16px; border-radius: 6px; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: min(100% - 32px, 960px); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--hero) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 16px; }
.brand { color: #fff; text-decoration: none; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; font-size: 1.05rem; }
.brand b { font-weight: 700; }
.brand small { font-size: .6em; opacity: .75; margin-inline: .2em; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a {
  color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 10px 12px; border-radius: 6px; min-height: 44px; display: inline-flex; align-items: center;
  transition: background-color .2s var(--ease);
}
.site-nav a:hover, .site-nav a[aria-current="true"] { background: rgba(255, 255, 255, .14); }

/* Hero */
.hero {
  position: relative; text-align: center; color: var(--hero-fg);
  background-color: var(--hero);
  background-image: url("i/pattern.svg");
  background-size: 240px 240px;
  padding: var(--s6) 0 calc(var(--s6) + 16px);
}
.avatar {
  width: 128px; height: 128px; border-radius: 50%; margin: 0 auto var(--s3);
  border: 6px solid rgba(255, 255, 255, .25); object-fit: cover; background: #cfe0e0;
}
.hero h1 { margin: 0 0 var(--s2); font-size: clamp(2.75rem, 8vw, 4.5rem); font-weight: 300; line-height: 1.1; }
.hero h1 b { font-weight: 700; }
.hero p { margin: 0 auto; max-width: 34ch; font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 400; line-height: 1.5; text-wrap: balance; }
.hero p b { font-weight: 700; }

/* Sections */
section.block { padding: var(--s6) 0; }
section.block.alt { background: color-mix(in srgb, var(--fg) 4%, var(--bg)); }
.block h2 { margin: 0 0 var(--s4); font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 700; text-align: center; text-wrap: balance; }
.lead { max-width: 62ch; margin-inline: auto; }

/* About */
.steps { list-style: none; margin: 0 auto; padding: 0; max-width: 62ch; display: grid; gap: var(--s4); }
.steps h3 { margin: 0 0 var(--s1); font-size: 1.35rem; font-weight: 700; }
.steps p { margin: 0; color: var(--muted-fg); }

/* Skills */
.skills { list-style: none; margin: 0 auto; padding: 0; max-width: 640px; display: grid; gap: var(--s3); }
.skill-top { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 6px; }
.skill-top span:last-child { color: var(--muted-fg); font-weight: 500; }
.bar { height: 12px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: 99px; transform-origin: left; }
.js .bar i { transform: scaleX(0); transition: transform .8s var(--ease); }
.js .in .bar i { transform: scaleX(1); }

/* Projects */
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  display: flex; flex-direction: column; height: 100%;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
a.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(9,9,11,.08), 0 10px 28px rgba(9,9,11,.12); }
.card-img { display: grid; place-items: center; aspect-ratio: 16 / 9; background: color-mix(in srgb, var(--fg) 6%, var(--card)); }
.card-img img { width: 84px; height: 84px; border-radius: 20px; object-fit: contain; }
.card-body { padding: var(--s3); display: grid; gap: 6px; }
.tag { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-fg); }
.card h3 { margin: 0; font-size: 1.25rem; }
.card p { margin: 0; color: var(--muted-fg); font-size: .98rem; line-height: 1.5; }
.card .more { margin-top: 6px; color: var(--accent); font-weight: 700; font-size: .95rem; }

/* Contact */
.contact { text-align: center; }
.contact p { max-width: 52ch; margin: 0 auto var(--s4); color: var(--muted-fg); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px;
  padding: 0 40px; border-radius: 99px; background: var(--accent); color: var(--accent-fg);
  font: inherit; font-weight: 700; font-size: 1.2rem; text-decoration: none;
  transition: transform .2s var(--ease), filter .2s var(--ease);
}
.btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.socials { display: flex; justify-content: center; gap: var(--s1); margin-top: var(--s4); flex-wrap: wrap; }
.socials a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; font-weight: 700; text-decoration: none; border: 1px solid var(--border); border-radius: 99px; color: var(--fg); background: var(--card); }
.socials a:hover { border-color: var(--accent); color: var(--accent); }

footer.site-footer { background: var(--hero); color: rgba(255, 255, 255, .8); text-align: center; padding: var(--s4) 0; font-size: .95rem; }
footer.site-footer a { color: #fff; }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 560px) {
  .site-header .wrap { flex-direction: column; padding: 8px 0; }
  .site-nav { justify-content: center; }
  .site-nav a { padding: 8px 10px; font-size: .9rem; }
  section.block { padding: var(--s5) 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .bar i { transform: none; }
}

/* Blog */
.page-hero { position: relative; text-align: center; color: var(--hero-fg); background-color: var(--hero); background-image: url("i/pattern.svg"); background-size: 240px 240px; padding: var(--s5) 0; }
.page-hero h1 { margin: 0 0 var(--s1); font-size: clamp(2.25rem, 6vw, 3.25rem); font-weight: 700; line-height: 1.15; }
.page-hero p { margin: 0 auto; max-width: 46ch; font-size: 1.15rem; text-wrap: balance; }
.posts { list-style: none; margin: 0 auto; padding: 0; max-width: 720px; display: grid; gap: var(--s2); }
.post { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s3); min-height: 44px; }
.post-text { display: grid; gap: 4px; }
.post h2 { margin: 0; font-size: 1.2rem; text-align: left; line-height: 1.3; }
.post .arrow { flex: none; color: var(--accent); font-size: 1.4rem; font-weight: 700; transition: transform .2s var(--ease); }
a.post:hover .arrow { transform: translateX(4px); }
.card.post { flex-direction: row; height: auto; }
.block .post h2 { text-align: left; margin: 0; }

/* Skill groups */
.skills-intro { text-align: center; color: var(--muted-fg); margin: calc(var(--s2) * -1) auto var(--s4); }
.skill-groups { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.skill-group { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: var(--s3); box-shadow: var(--shadow); }
.skill-group h3 { margin: 0 0 var(--s2); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-fg); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 14px; border-radius: 99px; font-size: .95rem; font-weight: 600; line-height: 1.4; background: color-mix(in srgb, var(--accent) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--card)); }
