:root {
  --bg: #f4f6f8;
  --surface: #fff;
  --ink: #0f1b2d;
  --muted: #51607a;
  --line: #d8dee8;
  --accent: #0b6bcb;
  --accent-ink: #fff;
  --soft: #e6f0fb;
  --ok: #15803d;
  --code: #0f1b2d;
  --code-ink: #cfe3ff;
  --key: #7cc4ff;
  --str: #9be6b4;
  --num: #ffcf7a;
  --ff: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --surface: #121c2f;
    --ink: #e8eef9;
    --muted: #9aa9c4;
    --line: #24324d;
    --accent: #5aa9ff;
    --accent-ink: #06121f;
    --soft: #14263f;
    --ok: #4ade80;
    --code: #08101d;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #121c2f;
  --ink: #e8eef9;
  --muted: #9aa9c4;
  --line: #24324d;
  --accent: #5aa9ff;
  --accent-ink: #06121f;
  --soft: #14263f;
  --ok: #4ade80;
  --code: #08101d;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
body {
  font-family: var(--ff);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.0625rem;
}
a {
  color: var(--accent);
}
img {
  max-width: 100%;
  display: block;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
section {
  padding: 5rem 0;
}
h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.lead {
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 2.5rem;
}
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip:focus {
  left: 0;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
.brand {
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.1rem;
}
.links {
  display: flex;
  gap: 1.6rem;
  align-items: center;
  list-style: none;
}
.links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}
.links a:hover,
.links a.on {
  color: var(--ink);
  border-color: var(--accent);
}
.icon-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
  font-size: 1.05rem;
}
.icon-btn:hover {
  background: var(--soft);
}
#burger {
  display: none;
}

#hero {
  padding: 4.5rem 0 4rem;
}
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0.3rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 1.4rem;
}
.dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.role {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0.9rem 0 1.2rem;
  min-height: 2.2rem;
}
.caret {
  animation: blink 0.8s step-end infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.pitch {
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 1.8rem;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
}
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  padding: 0.8rem 1.4rem;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.15s,
    background 0.15s;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn.p {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.s {
  background: transparent;
  color: var(--ink);
}
.socials {
  display: flex;
  gap: 1.2rem;
  font-weight: 600;
}
.socials a {
  color: var(--muted);
  text-decoration: none;
}
.socials a:hover {
  color: var(--accent);
}

.api {
  background: var(--code);
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--code-ink);
  box-shadow: 0 20px 50px -25px rgba(11, 27, 45, 0.6);
  animation: rise 0.7s ease-out both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
.api-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.78rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.api-bar b {
  color: #4ade80;
  font-weight: 500;
}
.api pre {
  padding: 1rem 1.2rem;
  overflow-x: auto;
  line-height: 1.7;
}
.k {
  color: var(--key);
}
.s {
  color: var(--str);
}
.n {
  color: var(--num);
}

.about {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
}
.photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 4rem;
  font-weight: 800;
  color: var(--accent);
}
.about p + p {
  margin-top: 1rem;
}
.tl {
  margin-top: 2rem;
  border-left: 2px solid var(--line);
  padding-left: 1.4rem;
  display: grid;
  gap: 1.4rem;
}
.tl > div {
  position: relative;
}
.tl > div::before {
  content: "";
  position: absolute;
  left: -1.85rem;
  top: 0.5rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
}
.tl h3 {
  font-size: 1.02rem;
}
.tl p {
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.6rem;
}
.card h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

/* experience */
.exp {
  display: grid;
  gap: 1.2rem;
}
.exp .top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: 0.8rem;
}
.exp .top h3 {
  margin: 0;
}
.when {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  background: var(--soft);
  padding: 0.2rem 0.7rem;
  border-radius: 6px;
}
.org {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.8rem;
}
ul.pts {
  margin-left: 1.2rem;
  color: var(--muted);
  display: grid;
  gap: 0.4rem;
  font-size: 0.98rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin-top: 1rem;
}
.chips li {
  font-family: var(--mono);
  font-size: 0.76rem;
  background: var(--soft);
  color: var(--accent);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
}

/* skills */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.skills .chips {
  margin-top: 0;
}
.skills .chips li {
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
}

/* projects */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.proj {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.proj:hover,
.proj:focus-within {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 18px 40px -18px rgba(11, 107, 203, 0.5);
}
.thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}
.thumb .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  background: linear-gradient(135deg, var(--soft), var(--surface));
}
.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.proj:hover .thumb img {
  transform: scale(1.07);
}
.proj-b {
  padding: 1.3rem 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
}
.proj h3 {
  font-size: 1.2rem;
  margin: 0;
}
.proj p {
  color: var(--muted);
  font-size: 0.97rem;
}
.proj .chips {
  margin-top: auto;
  padding-top: 0.3rem;
}
.plinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.btn.sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
/* skills hover */
.skills .card {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.skills .card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 14px 34px -18px rgba(11, 107, 203, 0.5);
}
.skills .card:hover h3 {
  color: var(--accent);
}
.skills .chips li {
  transition:
    background 0.25s,
    color 0.25s;
}
.skills .card:hover .chips li {
  background: var(--accent);
  color: var(--accent-ink);
}
.contact {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
}
.clist {
  list-style: none;
  display: grid;
  gap: 1rem;
}
.clist span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}
.clist a {
  font-weight: 700;
  word-break: break-all;
}
label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
input,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
}
textarea {
  min-height: 130px;
  resize: vertical;
}
.note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.8rem;
}
footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 860px) {
  .hero,
  .about,
  .contact {
    grid-template-columns: 1fr;
  }
  .about .photo {
    max-width: 220px;
  }
  .projects {
    grid-template-columns: 1fr;
  }
  #burger {
    display: inline-block;
  }
  .links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1rem;
  }
  .links.open {
    display: flex;
  }
  .links li {
    width: 100%;
  }
  .links a {
    display: block;
    padding: 0.7rem 0;
  }
  section {
    padding: 3.5rem 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
