:root {
  --paper: #fbf7ed;
  --cream: #f7ecd3;
  --ink: #111111;
  --muted: #4b4943;
  --rule: #8d8980;
  --gold: #b99b36;
  --olive: #6e7357;
  --font-main: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 8%, rgba(205, 178, 104, 0.22), transparent 22rem),
    linear-gradient(120deg, #d8cfb7, #f8f6ef 38%, #d0c0a2);
  color: var(--ink);
  font-family: var(--font-main);
  line-height: 1.45;
  padding: 28px;
}

button,
textarea {
  font: inherit;
}

.resume-page {
  position: relative;
  display: grid;
  grid-template-columns: 35% 65%;
  max-width: 1120px;
  min-height: 1500px;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 38% 93%, rgba(158, 124, 52, 0.33), transparent 18rem),
    radial-gradient(circle at 96% 98%, rgba(85, 91, 65, 0.28), transparent 18rem),
    linear-gradient(90deg, var(--cream) 0 35%, var(--paper) 35% 100%);
  border: 1px solid rgba(75, 69, 50, 0.2);
  box-shadow: 0 26px 60px rgba(34, 28, 15, 0.22);
}

.resume-page::before,
.resume-page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.resume-page::before {
  opacity: 0.45;
  background:
    radial-gradient(circle at 18% 38%, rgba(163, 111, 42, 0.16), transparent 4rem),
    radial-gradient(circle at 49% 7%, rgba(163, 111, 42, 0.13), transparent 5rem),
    radial-gradient(circle at 68% 78%, rgba(163, 111, 42, 0.12), transparent 5rem),
    repeating-linear-gradient(0deg, rgba(55, 45, 28, 0.025) 0 1px, transparent 1px 5px);
  mix-blend-mode: multiply;
}

.resume-page::after {
  inset: auto 0 0;
  height: 210px;
  background:
    radial-gradient(ellipse at 12% 100%, rgba(48, 52, 39, 0.45), transparent 34%),
    radial-gradient(ellipse at 88% 100%, rgba(69, 74, 51, 0.42), transparent 28%),
    linear-gradient(0deg, rgba(118, 101, 57, 0.5), transparent);
}

.profile-panel,
.content-panel {
  position: relative;
  z-index: 1;
}

.profile-panel {
  padding: 54px 44px 260px;
}

.content-panel {
  padding: 92px 58px 260px;
}

.avatar-form {
  position: relative;
}

.avatar-form input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.portrait {
  position: relative;
  display: block;
  width: min(250px, 78%);
  aspect-ratio: 1;
  margin: 0 auto 28px;
  border: 8px solid #25282c;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 44%, #f8d492 0 21%, transparent 22%),
    linear-gradient(150deg, #e4b24f 0 40%, #272727 41% 62%, #d49b33 63%);
  box-shadow: 0 10px 28px rgba(53, 40, 15, 0.2);
  cursor: pointer;
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-glow {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.38), transparent 68%);
}

.monkey-face {
  position: absolute;
  inset: 16% 20% 14%;
  border-radius: 48% 48% 44% 44%;
  background: linear-gradient(#d99d49 0 28%, #f3cf99 29% 100%);
}

.hat-mark {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-main);
  font-size: 34px;
  font-weight: 700;
}

.eye,
.nose,
.mouth {
  position: absolute;
  display: block;
  background: #201915;
}

.eye {
  top: 43%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.eye.left {
  left: 31%;
}

.eye.right {
  right: 31%;
}

.nose {
  top: 54%;
  left: 50%;
  width: 12px;
  height: 8px;
  border-radius: 50%;
  transform: translateX(-50%);
}

.mouth {
  left: 50%;
  bottom: 24%;
  width: 36px;
  height: 3px;
  border-radius: 999px;
  transform: translateX(-50%);
}

.avatar-action {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 4;
  width: max-content;
  max-width: 82%;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.84);
  color: #fffdf7;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.portrait:hover .avatar-action,
.portrait:focus .avatar-action {
  opacity: 1;
  transform: translate(-50%, 0);
}

.avatar-position-button {
  position: absolute;
  left: 50%;
  bottom: -8px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 30px;
  border: 1px solid rgba(28, 24, 17, 0.18);
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 253, 247, 0.96);
  color: #141414;
  box-shadow: 0 8px 22px rgba(32, 26, 12, 0.16);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.avatar-form:hover .avatar-position-button,
.avatar-form:focus-within .avatar-position-button {
  opacity: 1;
  transform: translate(-50%, 0);
}

.identity {
  text-align: center;
  text-transform: uppercase;
}

.identity h1,
.main-section h2,
.side-section h2,
.timeline-item h3 {
  margin: 0;
  font-family: var(--font-main);
  font-weight: 700;
  letter-spacing: 0;
}

.identity h1 {
  font-size: clamp(28px, 3.1vw, 38px);
  line-height: 1.1;
}

.identity p {
  margin: 2px 0 0;
  font-size: 21px;
  color: #272522;
}

.brush-line {
  width: 220px;
  max-width: 76%;
  height: 12px;
  margin: 26px auto 24px;
  background:
    linear-gradient(90deg, transparent, var(--gold), #202020, var(--gold), transparent);
  filter: blur(0.2px);
}

.contact {
  margin: 0 0 70px;
  font-style: normal;
  color: var(--muted);
  font-size: 17px;
}

.contact p {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 15px 0;
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  color: #44443d;
  font-size: 18px;
}

.side-section {
  margin-top: 52px;
}

.side-section h2,
.main-section h2 {
  position: relative;
  margin-bottom: 22px;
  padding-bottom: 10px;
  text-transform: uppercase;
  font-size: clamp(24px, 2.7vw, 34px);
  line-height: 1.1;
}

.side-section h2::after,
.main-section h2::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--rule);
}

.side-section p,
.side-section li,
.timeline-item p,
.timeline-item li,
.achievements li {
  font-size: clamp(16px, 1.9vw, 22px);
}

.side-section p {
  margin: 6px 0;
}

ul {
  margin: 0;
  padding-left: 24px;
}

.skill {
  margin: 22px 0;
}

.skill span {
  display: block;
  margin-bottom: 12px;
  font-size: clamp(16px, 1.8vw, 21px);
}

.skill i {
  --score: 7;
  display: block;
  width: 100%;
  height: 15px;
  background:
    radial-gradient(circle, #151515 0 6px, transparent 7px) left center / 10% 100% repeat-x,
    radial-gradient(circle, #d9d5cd 0 6px, transparent 7px) left center / 10% 100% repeat-x;
  mask: linear-gradient(90deg, #000 calc(var(--score) * 10%), rgba(0, 0, 0, 0.22) 0);
}

.main-section + .main-section {
  margin-top: 54px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 22px;
  margin-top: 44px;
}

.badge {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 14px;
  margin-top: 4px;
  background: #fffdf7;
  border: 2px solid #9ca99d;
  color: var(--olive);
  font-size: 14px;
  font-weight: 700;
}

.badge.horse {
  border-color: var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 38px;
}

.badge.gap {
  color: #fff4cf;
  border-color: #8e7350;
  background:
    linear-gradient(rgba(37, 27, 17, 0.12), rgba(37, 27, 17, 0.25)),
    radial-gradient(circle at 50% 30%, #c99748, #6f4425 70%);
}

.item-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.timeline-item h3 {
  text-transform: uppercase;
  font-size: clamp(26px, 3.1vw, 38px);
  line-height: 1.08;
}

.item-heading p {
  margin: 2px 0 0;
}

.meta {
  min-width: 146px;
  text-align: right;
}

.meta strong {
  display: block;
  margin-top: 3px;
  font-weight: 700;
}

.timeline-item li + li,
.achievements li + li {
  margin-top: 6px;
}

.hero-silhouette {
  position: absolute;
  z-index: 2;
  left: 300px;
  bottom: 42px;
  width: 140px;
  height: 230px;
  transform: rotate(-4deg);
}

.warrior {
  position: absolute;
  left: 40px;
  bottom: 22px;
  width: 58px;
  height: 118px;
  background: linear-gradient(#24221d, #12110f);
  clip-path: polygon(42% 0, 62% 9%, 66% 26%, 88% 42%, 72% 50%, 84% 100%, 55% 86%, 42% 100%, 24% 86%, 5% 100%, 20% 49%, 2% 40%, 30% 25%, 34% 9%);
  box-shadow: 0 14px 28px rgba(25, 22, 15, 0.35);
}

.staff {
  position: absolute;
  left: 10px;
  bottom: 86px;
  width: 136px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #413018, #dd9f27, #352713);
  transform: rotate(-27deg);
}

.editable-wrap {
  position: relative;
}

.edit-button {
  position: absolute;
  top: -18px;
  right: 0;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 28px;
  border: 1px solid rgba(28, 24, 17, 0.18);
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 253, 247, 0.96);
  color: #141414;
  box-shadow: 0 8px 22px rgba(32, 26, 12, 0.16);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.editable-wrap:hover > .edit-button,
.editable-wrap:focus-within > .edit-button {
  opacity: 1;
  transform: translateY(0);
}

.identity .edit-button {
  top: -28px;
  right: 14px;
}

.identity .edit-alias,
.meta .edit-duration {
  top: auto;
  right: 0;
  bottom: -28px;
}

.contact .edit-button,
.side-section p .edit-button,
.item-heading p .edit-button {
  top: -22px;
}

.editor-modal {
  width: min(560px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.editor-modal::backdrop {
  background: rgba(17, 15, 12, 0.44);
  backdrop-filter: blur(2px);
}

.editor-box {
  padding: 24px;
  background: #fffdf7;
  border: 1px solid rgba(64, 52, 25, 0.22);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(21, 17, 11, 0.35);
}

.editor-box h2 {
  margin: 0 0 6px;
  font-family: var(--font-main);
  font-size: 24px;
}

.editor-box p {
  min-height: 20px;
  margin: 0 0 12px;
  color: var(--muted);
}

.editor-box textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid #bfb8aa;
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fbf7ed;
  font-size: 16px;
  line-height: 1.5;
}

.avatar-preview {
  width: 210px;
  aspect-ratio: 1;
  margin: 4px auto 22px;
  overflow: hidden;
  border: 7px solid #25282c;
  border-radius: 50%;
  background: #ebe4d5;
  box-shadow: 0 10px 26px rgba(34, 28, 15, 0.18);
}

.avatar-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.range-field {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  color: var(--muted);
  font-weight: 700;
}

.range-field input {
  width: 100%;
  accent-color: #141414;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.ghost-button,
.save-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 700;
}

.ghost-button {
  background: #ebe4d5;
  color: #312c21;
}

.save-button {
  background: #141414;
  color: #fffdf7;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  padding: 11px 16px;
  border-radius: 999px;
  background: #141414;
  color: #fffdf7;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  body {
    padding: 16px;
  }

  .resume-page {
    grid-template-columns: 1fr;
    min-height: 0;
    background:
      radial-gradient(circle at 84% 98%, rgba(85, 91, 65, 0.25), transparent 18rem),
      linear-gradient(180deg, var(--cream) 0 43%, var(--paper) 43% 100%);
  }

  .profile-panel,
  .content-panel {
    padding-left: 26px;
    padding-right: 26px;
  }

  .profile-panel {
    padding-top: 36px;
    padding-bottom: 32px;
  }

  .content-panel {
    padding-top: 32px;
    padding-bottom: 230px;
  }

  .contact {
    margin-bottom: 36px;
  }

  .side-section {
    margin-top: 34px;
  }

  .item-heading {
    flex-direction: column;
    gap: 10px;
  }

  .meta {
    min-width: 0;
    text-align: left;
  }

  .hero-silhouette {
    left: 34%;
    bottom: 34px;
    transform: scale(0.85) rotate(-4deg);
  }
}

@media (max-width: 560px) {
  body {
    padding: 0;
  }

  .resume-page {
    border: 0;
  }

  .timeline-item {
    grid-template-columns: 50px 1fr;
    gap: 14px;
  }

  .badge {
    width: 50px;
    height: 50px;
    font-size: 11px;
  }

  .badge.horse {
    font-size: 30px;
  }
}
