:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #162033;
  --muted: #5b667a;
  --border: #dbe3ef;
  --accent: #1d4ed8;
  --accent-soft: #e8f0ff;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Noto Sans", sans-serif;
  line-height: 1.65;
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 260px);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #eef2f7;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.page {
  width: min(1040px, calc(100vw - 32px));
  margin: 28px auto 48px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 28px;
  align-items: center;
  padding: 30px 34px;
  margin-bottom: 18px;
}

.hero-main {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.08;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 600;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 16px;
  font-size: 14px;
}

.portrait {
  margin: 0;
  justify-self: end;
}

.portrait img {
  display: block;
  width: 118px;
  height: 158px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.section {
  padding: 24px 28px;
  margin-bottom: 18px;
}

.section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 1.3;
}

.section h2::before {
  content: "";
  width: 6px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
}

.section p {
  margin: 0 0 10px;
}

.section p:last-child {
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.item:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.item:last-child {
  padding-bottom: 0;
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.item-head strong {
  font-size: 16px;
}

.item-head span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.compact {
  padding-bottom: 8px;
}

ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

li {
  margin: 5px 0;
}

.skills {
  display: grid;
  gap: 6px;
}

.muted {
  color: var(--muted);
}

@media (max-width: 760px) {
  .page {
    width: calc(100vw - 20px);
    margin: 12px auto 28px;
  }

  .hero,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .hero,
  .section {
    padding: 22px 18px;
  }

  .contact {
    justify-content: flex-start;
  }

  .portrait {
    justify-self: start;
  }

  .portrait img {
    width: 96px;
    height: 128px;
  }

  .item-head {
    display: grid;
    gap: 4px;
  }

  .item-head span {
    white-space: normal;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .page {
    width: 100%;
    margin: 0;
  }

  .card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .hero,
  .section {
    padding: 12px 0;
    margin-bottom: 8px;
  }

  .section h2 {
    margin-bottom: 8px;
  }

  .item {
    padding: 9px 0;
  }

  a {
    color: var(--text);
  }
}
