* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --paper: #faf8f3;
  --ink: #2a2016;
  --ink2: #4a3c28;
  --accent: #c0392b;
  --accent2: #e67e22;
  --muted: #7a6a52;
  --border: #8b7355;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Caveat", cursive;
  position: relative;
  margin: 0;
  padding: 0;
}

body::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 115, 85, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 115, 85, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

.head-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  position: relative;
  z-index: 10;
}

.back-btn a {
  font-family: "Caveat", cursive;
  color: var(--accent);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
}

.back-btn a:hover {
  text-decoration: underline;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch select {
  font-family: "Caveat", cursive;
  font-size: 18px;
  font-weight: 700;
  background: var(--paper);
  border: 2px solid var(--border);
  padding: 5px 10px;
  border-radius: 2px;
  color: var(--ink);
}

.theme-toggle {
  font-family: "Caveat", cursive;
  font-size: 20px;
  background: var(--paper);
  border: 2px solid var(--border);
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 2px;
}

.cvr {
  position: relative;
}

.cvi {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.cv-hdr {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  margin-bottom: 28px;
  align-items: start;
}

.av-box {
  width: 150px;
  height: 170px;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.av-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.av-canvas {
  position: absolute;
  top: -8px;
  left: -8px;
  pointer-events: none;
  z-index: 2;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 4px 12px;
  letter-spacing: 1px;
  margin-bottom: 8px;
  transform: rotate(-0.5deg);
}

.my-name {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.my-name canvas {
  position: absolute;
  bottom: -6px;
  left: 0;
  pointer-events: none;
}

.my-bio {
  font-size: 20px;
  color: var(--ink2);
  line-height: 1.55;
  border-left: 3px solid var(--accent2);
  padding-left: 14px;
  margin-bottom: 16px;
  max-width: 560px;
}

.contacts {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ci {
  font-size: 20px;
  color: var(--ink2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ci svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.contacts-linl {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent2);
}

.contacts-linl:hover {
  color: var(--accent);
}

.dlbtn {
  display: inline-block;
  font-family: "Caveat", cursive;
  font-size: 20px;
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 20px;
  text-decoration: none;
  letter-spacing: 1px;
  transform: rotate(0.3deg);
  transition: transform 0.1s;
}

.dlbtn:hover {
  transform: rotate(-0.3deg);
}

.sec {
  margin-bottom: 28px;
}

.sh {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sh svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent);
  stroke-width: 2.2;
  fill: none;
  flex-shrink: 0;
}

.shline {
  flex: 1;
  height: 20px;
  position: relative;
}

.shline canvas {
  position: absolute;
  top: 0;
  left: 0;
}

.pcard {
  position: relative;
  margin-bottom: 22px;
  padding: 42px 20px 20px 20px;
  overflow: visible;
  background: var(--paper);
}

/* Dark theme styles */
[data-theme="dark"] {
  --paper: #1e1e1e;
  --ink: #f0f0f0;
  --ink2: #d0d0d0;
  --accent: #ff6b6b;
  --accent2: #ffb347;
  --muted: #a0a0a0;
  --border: #666;
}

[data-theme="dark"] .pcard {
  background: rgba(30, 30, 30, 0.9);
}

.pcard-frame,
.gear-lg,
.gear-sm {
  background: transparent !important;
  /* display: none !important; */
}

.sketch-border {
  border: 2px solid var(--ink);
  padding: 4px 12px;
  display: inline-block;
  clip-path: polygon(1% 2%,
      /* верхній лівий */
      98% 0%,
      /* верхній правий */
      100% 96%,
      /* нижній правий */
      0% 100%
      /* нижній лівий */
    );
}

#lang-switch {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 4px 10px;
  font-family: "Caveat", cursive;
  font-size: 18px;
  clip-path: polygon(1% 2%,
      /* верхній лівий */
      99% 0%,
      /* верхній правий */
      100% 94%,
      /* нижній правий */
      3% 98%
      /* нижній лівий */
    );
}

.pill.sketch-pill {
  border: 2px solid var(--accent);
  padding: 4px 12px;
  display: inline-block;
  clip-path: polygon(6% 3%,
      28% 0%,
      92% 0%,
      100% 18%,
      96% 98%,
      90% 100%,
      2% 96%,
      0% 80%);
}

canvas {
  background: transparent !important;
}

.pcard canvas {
  background: transparent;
}

.pcard {
  background: transparent !important;
}

.pcard::before,
.pcard::after {
  background: transparent !important;
}

.pcard {
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, .7);
}


.pcard-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.gear-lg {
  position: absolute;
  bottom: -16px;
  left: -16px;
  width: 48px;
  height: 48px;
  pointer-events: none;
  z-index: 3;
  opacity: 0.22;
}

.gear-sm {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  pointer-events: none;
  z-index: 3;
  opacity: 0.18;
}

.pcard>*:not(.pcard-frame):not(.gear-lg):not(.gear-sm):not(.plabel) {
  position: relative;
  z-index: 1;
}

.plabel {
  position: absolute;
  top: 10px;
  left: 14px;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 1px;
  z-index: 2;
}

.ptitle {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.pco {
  font-size: 20px;
  color: var(--accent);
  font-weight: 700;
}

.pmeta {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 10px;
  border-bottom: 1px dashed rgba(139, 115, 85, 0.4);
  padding-bottom: 8px;
}

.prl {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink2);
  margin: 8px 0 4px;
  text-decoration: underline;
  text-decoration-color: var(--accent2);
}

.pdesc {
  font-size: 20px;
  color: var(--ink2);
  line-height: 1.5;
  margin-bottom: 8px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.pill {
  background: rgba(192, 57, 43, 0.08);
  color: var(--accent);
  font-size: 18px;
  padding: 4px 12px;
  font-weight: 700;
  border: 1px solid rgba(192, 57, 43, 0.25);
  font-family: "Caveat", cursive;
}

.links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.lbtn {
  font-family: "Caveat", cursive;
  font-size: 18px;
  font-weight: 700;
  background: transparent;
  border: 2px solid var(--ink);
  color: var(--ink);
  padding: 4px 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.1s;
}

.lbtn:hover {
  background: var(--ink);
  color: #fff;
}

.lbtn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.edu-item {
  padding: 10px 0 10px 16px;
  border-left: 3px solid var(--accent2);
  margin-bottom: 14px;
}

.edu-name {
  font-size: 24px;
  font-weight: 700;
}

.edu-course {
  font-size: 20px;
  color: var(--ink2);
}

.edu-meta {
  font-size: 18px;
  color: var(--muted);
}

.skg {
  margin-bottom: 14px;
}

.skg-t {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.ski {
  font-size: 20px;
  color: var(--ink2);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 3px;
}

.ski::before {
  content: "→";
  color: var(--accent2);
  font-weight: 700;
  flex-shrink: 0;
}

.langs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.lchip {
  font-size: 20px;
  font-weight: 700;
  padding: 6px 16px;
  border: 2px solid var(--border);
  color: var(--ink2);
  font-family: "Caveat", cursive;
}

.hidden {
  display: none !important;
}

/* Homepage gallery card hover effects */
#portfolio-it img,
#portfolio-print img {
  filter: blur(4px);
  transition: filter 0.3s ease;
}

#portfolio-it:hover img,
#portfolio-print:hover img {
  filter: blur(0);
}

/* Printing resume pill styles */
.pills .job-posicion {
  display: inline-block;
  margin: 4px;
  padding: 4px 12px;
  border: 2px dashed var(--ink);
  border-radius: 16px;
  font-size: 14px;
  font-family: "Caveat", cursive;
  background: var(--paper);
}

/* Printing resume list styles */
.pcard ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.pcard ul .job-posicion {
  padding-left: 24px;
  margin: 8px 0;
  position: relative;
}

.pcard ul .job-posicion::before {
  content: "→";
  position: absolute;
  left: 4px;
  top: 0;
  color: var(--accent);
}

@media (max-width: 768px) {
  .cv-hdr {
    grid-template-columns: 1fr;
  }

  .two {
    grid-template-columns: 1fr;
  }

  .head-container {
    flex-direction: column;
    gap: 10px;
  }
}