:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #585858;
  --line: #d8d8d8;
  --blue: #111111;
  --red: #3f3f3f;
  --yellow: #777777;
  --green: #bcbcbc;
  --shadow-soft: 0 10px 24px rgba(17, 17, 17, 0.1), 0 2px 7px rgba(17, 17, 17, 0.07);
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(226, 226, 222, 0.54)),
    radial-gradient(circle at 12% 18%, rgba(17, 17, 17, 0.045), transparent 25%),
    radial-gradient(circle at 86% 24%, rgba(17, 17, 17, 0.035), transparent 26%),
    radial-gradient(circle at 62% 88%, rgba(17, 17, 17, 0.04), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, "Google Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 46px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 66px;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  transition: transform 180ms ease;
}

.logo:hover {
  transform: translateY(-2px);
}

.logo-image {
  display: block;
  width: clamp(132px, 17vw, 160px);
  max-width: 100%;
  height: auto;
}

.contact-button,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font-weight: 720;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease, border-color 220ms ease;
}

.contact-button {
  justify-self: end;
  min-height: 52px;
  padding: 0 28px;
  font-size: 1.04rem;
}

.contact-button:hover,
.back-link:hover {
  border-color: rgba(17, 17, 17, 0.35);
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.14), 0 4px 12px rgba(17, 17, 17, 0.08);
  transform: translateY(-3px);
}

.header-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 30px;
  max-width: 940px;
  margin: 44px auto 18px;
}

.avatar {
  position: relative;
  display: block;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  padding: 5px;
  background: #111111;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.avatar::before {
  position: absolute;
  inset: 5px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #fff url("profile.png") center 34% / cover no-repeat;
  box-sizing: border-box;
  content: "";
  filter: grayscale(1) contrast(1.05);
  z-index: 1;
}

.avatar::after {
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 56%);
  content: "";
  pointer-events: none;
  z-index: 2;
}

.avatar img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  border: 4px solid #fff;
  border-radius: inherit;
  filter: grayscale(1) contrast(1.05);
  object-fit: cover;
  object-position: center 34%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  font-weight: 780;
  letter-spacing: 0;
  line-height: 0.96;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.header-copy p {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.18rem);
}

.article-shell {
  max-width: 760px;
  margin: 54px auto 70px;
  border: 1px solid rgba(216, 216, 216, 0.95);
  border-radius: 28px;
  padding: clamp(26px, 5vw, 48px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.back-link {
  min-height: 42px;
  margin-bottom: 28px;
  padding: 0 16px;
  color: var(--ink);
  font-size: 0.92rem;
}

.article-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(245, 245, 245, 0.72);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 740;
}

.article-meta::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  content: "";
}

.article-shell h2 {
  margin-bottom: 24px;
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 3.35rem);
  font-weight: 780;
  letter-spacing: 0;
  line-height: 1.02;
  text-wrap: balance;
}

.article-body {
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.1rem);
}

.article-body h3 {
  margin: 34px 0 10px;
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1.2;
}

.article-body p {
  margin-bottom: 18px;
}

.article-body code {
  border: 1px solid rgba(216, 216, 216, 0.95);
  border-radius: 7px;
  padding: 0.08rem 0.32rem;
  background: rgba(247, 247, 245, 0.92);
  color: var(--ink);
  font-size: 0.92em;
}

.article-body ol {
  margin: 0 0 22px;
  padding-left: 1.35rem;
  color: var(--muted);
}

.article-body li {
  margin-bottom: 8px;
}

.article-body a {
  color: var(--ink);
  font-weight: 720;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.artifact-link {
  margin: 30px 0;
  border: 1px solid rgba(216, 216, 216, 0.95);
  border-radius: 22px;
  padding: clamp(20px, 4vw, 28px);
  background:
    linear-gradient(135deg, rgba(17, 17, 17, 0.06), transparent 40%),
    rgba(247, 247, 245, 0.9);
}

.artifact-link h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
  color: var(--muted);
  font-size: 0.94rem;
}

@media (max-width: 680px) {
  .page {
    width: min(var(--max), calc(100% - 28px));
    padding-top: 18px;
  }

  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 14px;
  }

  .logo,
  .contact-button {
    justify-self: center;
  }

  .logo-image {
    width: 124px;
  }

  .contact-button {
    min-height: 48px;
    padding: 0 18px;
    font-size: 0.98rem;
  }

  .header-profile {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 22px;
    max-width: 330px;
    margin-top: 34px;
    text-align: center;
  }

  .avatar {
    width: 118px;
    height: 118px;
  }

  h1 {
    font-size: clamp(2rem, 7.2vw, 2.45rem);
    line-height: 1.04;
  }

  .article-shell {
    margin-top: 40px;
  }

  .footer {
    flex-direction: column;
  }
}
