.theme-pencil {
  --pcn-ink: var(--accent);
  --pcn-white: #fff;
  --pcn-line: color-mix(in srgb, var(--pcn-ink) 22%, transparent);
  color: var(--pcn-ink);
}

.theme-pencil .pcn-page,
.theme-pencil .pcn-page * { box-sizing: border-box; }

.theme-pencil .pcn-page {
  min-height: 100vh;
  padding: clamp(18px, 3vw, 48px);
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 18%, rgba(255,255,255,.16), transparent 25%),
    radial-gradient(circle at 84% 78%, rgba(255,255,255,.12), transparent 28%);
}

.theme-pencil .pcn-shell {
  position: relative;
  width: min(100%, 1500px);
  min-height: calc(100vh - clamp(36px, 6vw, 96px));
  margin: 0 auto;
  padding: 0 clamp(38px, 5vw, 80px) 54px;
  background: rgba(255,255,255,.035);
}

.theme-pencil .pcn-header {
  min-height: 145px;
  display: block;
  align-items: start;
}

.theme-pencil .pcn-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  align-self: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  width: 100%;
}

.theme-pencil .pcn-nav button {
  min-width: 120px;
  min-height: 126px;
  border: 0;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  color: var(--pcn-ink);
  font: 800 15px/1.15 var(--body-font, sans-serif);
  background: transparent;
  transition: background .2s ease, transform .2s ease;
}
.theme-pencil .pcn-nav button i { font-size: 28px; }
.theme-pencil .pcn-nav button:hover { transform: translateY(3px); background: rgba(255,255,255,.26); }
.theme-pencil .pcn-nav button.is-active { background: var(--pcn-white); }

.theme-pencil .pcn-stage {
  min-width: 0;
  min-height: 690px;
}
.theme-pencil .portfolio-tabs-ready .pcn-panel:not(.is-active) { display: none; }
.theme-pencil .portfolio-tabs-ready .pcn-panel.is-active { animation: pcn-enter .32s ease both; }

@keyframes pcn-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.theme-pencil .pcn-panel { min-height: 690px; padding: clamp(30px, 4vw, 66px) clamp(10px, 3vw, 38px); }
.theme-pencil .pcn-profile-grid { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.1fr); align-items: center; gap: clamp(50px, 8vw, 120px); }

.theme-pencil .pcn-portrait-wrap {
  position: relative;
  min-height: 610px;
  display: grid;
  place-items: center;
}
.theme-pencil .pcn-portrait-frame {
  position: absolute;
  inset: 20px 9% 8px;
  border: 10px solid var(--pcn-white);
}
.theme-pencil .pcn-portrait {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  aspect-ratio: .78;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 16px solid var(--pcn-white);
  border-radius: 48% 52% 46% 54% / 38% 44% 56% 62%;
  color: var(--pcn-white);
  font: 700 clamp(100px, 13vw, 190px)/1 var(--heading-font, sans-serif);
  background: color-mix(in srgb, var(--pcn-ink) 80%, transparent);
  box-shadow: 0 18px 0 rgba(0,0,0,.04);
}
.theme-pencil .pcn-portrait::before,
.theme-pencil .pcn-portrait::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--pcn-white);
}
.theme-pencil .pcn-portrait::before { left: -18%; top: 22%; }
.theme-pencil .pcn-portrait::after { right: -18%; bottom: 18%; }
.theme-pencil .pcn-portrait img { width: 100%; height: 100%; object-fit: cover; }

.theme-pencil .pcn-profile-copy { max-width: 670px; }
.theme-pencil .pcn-overline { margin: 0 0 8px; font-size: 13px; font-weight: 900; letter-spacing: .28em; text-transform: uppercase; }
.theme-pencil .pcn-profile-copy h1 { margin: 0; color: var(--pcn-ink); font-size: clamp(54px, 6vw, 88px); line-height: .96; letter-spacing: .015em; text-transform: uppercase; }
.theme-pencil .pcn-profile-copy > h2 { margin: 13px 0 25px; color: var(--pcn-ink); font-size: clamp(17px, 2vw, 23px); font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }

.theme-pencil .pcn-facts { margin: 0; display: grid; gap: 11px; }
.theme-pencil .pcn-facts > div { display: grid; grid-template-columns: minmax(130px, auto) 1fr; align-items: center; gap: 15px; }
.theme-pencil .pcn-facts dt { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.theme-pencil .pcn-facts dt i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--pcn-white); }
.theme-pencil .pcn-facts dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.theme-pencil .pcn-facts a { color: inherit; text-decoration: none; }

.theme-pencil .pcn-objective { margin-top: 27px; }
.theme-pencil .pcn-objective h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 12px; color: var(--pcn-ink); font-size: 25px; }
.theme-pencil .pcn-objective h3 i { width: 22px; height: 22px; background: var(--pcn-white); }
.theme-pencil .pcn-objective p { margin: 0; font-size: 15px; line-height: 1.75; }

.theme-pencil .pcn-panel-title { display: flex; align-items: center; gap: 28px; margin-bottom: 38px; }
.theme-pencil .pcn-panel-title span { color: var(--pcn-ink); font: 700 clamp(42px, 5vw, 70px)/1 var(--heading-font, sans-serif); text-transform: uppercase; }
.theme-pencil .pcn-panel-title i { width: min(280px, 30%); height: 6px; background: var(--pcn-ink); }

.theme-pencil .pcn-resume-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 60px; }
.theme-pencil .pcn-resume-column { display: flex; flex-direction: column; gap: 36px; }
.theme-pencil .pcn-resume-column > section > h2 { margin: 0 0 20px; display: flex; align-items: center; gap: 15px; color: var(--pcn-ink); font-size: clamp(23px, 2.3vw, 34px); }
.theme-pencil .pcn-resume-column > section > h2 > i { width: 50px; height: 50px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--pcn-white); }

.theme-pencil .pcn-timeline { margin-left: 24px; padding-left: 43px; border-left: 3px solid var(--pcn-white); }
.theme-pencil .pcn-timeline article { position: relative; padding: 0 0 28px; }
.theme-pencil .pcn-timeline article::before { content: ""; position: absolute; left: -53px; top: 4px; width: 17px; height: 17px; border-radius: 50%; background: var(--pcn-white); }
.theme-pencil .pcn-timeline time { position: absolute; right: 0; top: 0; font-size: 13px; font-weight: 900; }
.theme-pencil .pcn-timeline h3 { max-width: calc(100% - 115px); margin: 0; color: var(--pcn-ink); font-size: 18px; }
.theme-pencil .pcn-timeline p { margin: 4px 0 0; font-weight: 700; }
.theme-pencil .pcn-timeline ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }

.theme-pencil .pcn-skill-bars { display: grid; gap: 16px; }
.theme-pencil .pcn-skill-bars article > div { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 7px; font-weight: 900; }
.theme-pencil .pcn-skill-bars article > i { display: block; height: 12px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--pcn-ink) 82%, transparent); }
.theme-pencil .pcn-skill-bars article > i em { display: block; height: 100%; border-radius: inherit; background: var(--pcn-white); }
.theme-pencil .pcn-skill-bars p { margin: 5px 0 0; font-size: 12px; }
.theme-pencil .pcn-certificates { display: grid; gap: 16px; padding-left: 28px; border-left: 3px solid var(--pcn-white); }
.theme-pencil .pcn-certificates article { position: relative; }
.theme-pencil .pcn-certificates article::before { content: ""; position: absolute; left: -37px; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--pcn-white); }
.theme-pencil .pcn-certificates article > div { display: flex; justify-content: space-between; gap: 15px; }
.theme-pencil .pcn-certificates h3 { margin: 0; color: var(--pcn-ink); font-size: 17px; }
.theme-pencil .pcn-certificates p { margin: 3px 0 0; }
.theme-pencil .pcn-certificates time { font-size: 12px; font-weight: 900; }
.theme-pencil .pcn-languages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.theme-pencil .pcn-languages article { min-height: 92px; padding: 18px; border-left: 3px solid var(--pcn-white); }
.theme-pencil .pcn-languages b { display: block; margin-bottom: 14px; }
.theme-pencil .pcn-languages span { display: flex; gap: 5px; }

.theme-pencil .pcn-service-grid,
.theme-pencil .pcn-project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.theme-pencil .pcn-service-grid article { position: relative; min-height: 245px; padding: 30px; border: 4px solid var(--pcn-ink); background: rgba(255,255,255,.1); }
.theme-pencil .pcn-service-grid article:nth-child(even) { background: var(--pcn-white); }
.theme-pencil .pcn-service-grid article > span { position: absolute; right: 20px; top: 15px; font: 700 40px/1 var(--heading-font, sans-serif); opacity: .28; }
.theme-pencil .pcn-service-grid article > i { font-size: 42px; }
.theme-pencil .pcn-service-grid h3 { margin: 33px 0 10px; color: var(--pcn-ink); font-size: 22px; }
.theme-pencil .pcn-service-grid p { margin: 0; line-height: 1.65; }

.theme-pencil .pcn-project-grid article { min-width: 0; display: grid; grid-template-rows: 145px 1fr; border: 4px solid var(--pcn-ink); background: var(--pcn-white); }
.theme-pencil .pcn-project-mark { padding: 22px; display: flex; align-items: flex-end; justify-content: space-between; background: var(--pcn-ink); color: var(--pcn-white); }
.theme-pencil .pcn-project-mark b { font: 700 54px/1 var(--heading-font, sans-serif); }
.theme-pencil .pcn-project-mark i { font-size: 38px; }
.theme-pencil .pcn-project-grid article > div:last-child { padding: 24px; }
.theme-pencil .pcn-project-grid article > div:last-child > span,
.theme-pencil .pcn-project-grid time { font-size: 12px; font-weight: 800; }
.theme-pencil .pcn-project-grid time { float: right; }
.theme-pencil .pcn-project-grid h3 { margin: 12px 0; color: var(--pcn-ink); font-size: 22px; }
.theme-pencil .pcn-project-grid ul { padding-left: 18px; line-height: 1.6; }
.theme-pencil .pcn-project-grid a { display: inline-flex; align-items: center; gap: 8px; color: var(--pcn-ink); font-weight: 900; }

.theme-pencil .pcn-contact-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(35px, 6vw, 90px); align-items: start; }
.theme-pencil .pcn-contact-tag { display: inline-block; padding: 8px 12px; color: var(--pcn-white); font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; background: var(--pcn-ink); }
.theme-pencil .pcn-contact-layout h2 { margin: 20px 0 12px; color: var(--pcn-ink); font-size: clamp(36px, 5vw, 65px); line-height: 1.05; }
.theme-pencil .pcn-contact-layout > div > p { line-height: 1.7; }
.theme-pencil .pcn-contact-form { display: grid; gap: 22px; padding: clamp(24px, 4vw, 48px); border: 4px solid var(--pcn-ink); background: var(--pcn-white); }
.theme-pencil .pcn-contact-form .pc-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.theme-pencil .pcn-contact-form label { display: grid; gap: 7px; color: var(--pcn-ink); font-weight: 900; }
.theme-pencil .pcn-contact-form input,
.theme-pencil .pcn-contact-form textarea { width: 100%; border: 0; border-bottom: 3px solid var(--pcn-ink); border-radius: 0; padding: 12px 4px; color: var(--pcn-ink); font: inherit; background: transparent; outline: 0; }
.theme-pencil .pcn-contact-form button { min-height: 52px; border: 0; cursor: pointer; color: var(--pcn-white); font: 900 15px/1 var(--body-font, sans-serif); background: var(--pcn-ink); }

.theme-pencil .pcn-social-rail {
  position: absolute;
  left: -42px;
  top: 36%;
  z-index: 3;
  display: grid;
  gap: 12px;
}
.theme-pencil .pcn-social-rail a { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: var(--pcn-white); background: var(--pcn-ink); text-decoration: none; transition: transform .2s ease; }
.theme-pencil .pcn-social-rail a:hover { transform: translateX(4px); }

.theme-pencil .pcn-actions { position: absolute; left: -42px; right: -42px; bottom: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.theme-pencil .pcn-actions a,
.theme-pencil .pcn-actions button { min-width: 74px; border: 0; display: grid; justify-items: center; gap: 5px; pointer-events: auto; cursor: pointer; color: var(--pcn-ink); font: 900 12px/1 var(--body-font, sans-serif); text-decoration: none; background: transparent; }
.theme-pencil .pcn-actions i { font-size: 26px; }
.theme-pencil .pcn-footer { padding-top: 20px; text-align: center; font-size: 11px; }
.theme-pencil .pcn-footer a { color: var(--pcn-ink); font-weight: 900; }
.theme-pencil .pcn-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.theme-pencil :is(a, button, input, textarea):focus-visible { outline: 4px solid var(--pcn-white); outline-offset: 4px; }
.theme-pencil.layout-grid .pcn-service-grid,
.theme-pencil.layout-grid .pcn-project-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.theme-pencil.layout-timeline .pcn-project-grid { grid-template-columns: 1fr; }
.theme-pencil.layout-timeline .pcn-project-grid article { grid-template-columns: 180px 1fr; grid-template-rows: auto; }

.design-card-preview .theme-pencil .pcn-page { min-height: 100%; padding: 8px; }
.design-card-preview .theme-pencil .pcn-shell { min-height: 100%; padding: 0 12px 12px; }
.design-card-preview .theme-pencil .pcn-header { min-height: 44px; }
.design-card-preview .theme-pencil .pcn-nav { grid-auto-columns: minmax(30px, 1fr); }
.design-card-preview .theme-pencil .pcn-nav button { min-width: 30px; min-height: 40px; padding: 3px; gap: 2px; font-size: 3px; }
.design-card-preview .theme-pencil .pcn-nav button i { font-size: 7px; }
.design-card-preview .theme-pencil .pcn-panel { min-height: 120px; padding: 8px 4px; }
.design-card-preview .theme-pencil .pcn-stage { min-height: 120px; }
.design-card-preview .theme-pencil .pcn-profile-grid { grid-template-columns: 45% 1fr; gap: 12px; }
.design-card-preview .theme-pencil .pcn-portrait-wrap { min-height: 120px; }
.design-card-preview .theme-pencil .pcn-portrait-frame { border-width: 3px; }
.design-card-preview .theme-pencil .pcn-portrait { width: 90%; border-width: 4px; font-size: 36px; }
.design-card-preview .theme-pencil .pcn-overline { font-size: 3px; }
.design-card-preview .theme-pencil .pcn-profile-copy h1 { font-size: 16px; }
.design-card-preview .theme-pencil .pcn-profile-copy > h2 { margin: 3px 0; font-size: 4px; }
.design-card-preview .theme-pencil .pcn-facts { gap: 2px; }
.design-card-preview .theme-pencil .pcn-facts > div { grid-template-columns: 35px 1fr; gap: 2px; font-size: 3px; }
.design-card-preview .theme-pencil .pcn-facts dt { gap: 2px; }
.design-card-preview .theme-pencil .pcn-facts dt i { width: 10px; height: 10px; font-size: 4px; }
.design-card-preview .theme-pencil .pcn-objective { margin-top: 4px; }
.design-card-preview .theme-pencil .pcn-objective h3 { margin-bottom: 2px; gap: 3px; font-size: 6px; }
.design-card-preview .theme-pencil .pcn-objective h3 i { width: 5px; height: 5px; }
.design-card-preview .theme-pencil .pcn-objective p { font-size: 3px; }
.design-card-preview .theme-pencil .pcn-social-rail,
.design-card-preview .theme-pencil .pcn-actions,
.design-card-preview .theme-pencil .pcn-footer { display: none; }

@media (max-width: 1180px) {
  .theme-pencil .pcn-shell { padding-inline: 35px; }
  .theme-pencil .pcn-nav { grid-auto-columns: minmax(105px, 1fr); }
  .theme-pencil .pcn-profile-grid { grid-template-columns: minmax(270px, .85fr) minmax(360px, 1.15fr); gap: 50px; }
  .theme-pencil .pcn-social-rail { left: -20px; }
  .theme-pencil .pcn-actions { left: -20px; right: -20px; }
  .theme-pencil .pcn-service-grid,
  .theme-pencil .pcn-project-grid,
  .theme-pencil.layout-grid .pcn-service-grid,
  .theme-pencil.layout-grid .pcn-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .theme-pencil .pcn-page { padding: 14px; }
  .theme-pencil .pcn-shell { padding-inline: 18px; }
  .theme-pencil .pcn-header { min-height: auto; }
  .theme-pencil .pcn-nav { grid-auto-columns: minmax(96px, 1fr); position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--pcn-white) 12%, transparent); }
  .theme-pencil .pcn-nav button { min-width: 96px; min-height: 88px; }
  .theme-pencil .pcn-profile-grid { grid-template-columns: 1fr; gap: 32px; }
  .theme-pencil .pcn-portrait-wrap { min-height: 500px; }
  .theme-pencil .pcn-portrait { max-width: 420px; }
  .theme-pencil .pcn-profile-copy { max-width: none; }
  .theme-pencil .pcn-resume-grid,
  .theme-pencil .pcn-contact-layout { grid-template-columns: 1fr; }
  .theme-pencil .pcn-social-rail { position: static; display: flex; justify-content: center; flex-wrap: wrap; padding: 16px 0 0; }
  .theme-pencil .pcn-actions { position: static; margin-top: 25px; }
}

@media (max-width: 600px) {
  .theme-pencil .pcn-page { padding: 8px; }
  .theme-pencil .pcn-shell { padding-inline: 8px; }
  .theme-pencil .pcn-nav { grid-auto-columns: 84px; }
  .theme-pencil .pcn-nav button { min-width: 84px; min-height: 78px; padding: 10px 6px; font-size: 11px; }
  .theme-pencil .pcn-nav button i { font-size: 21px; }
  .theme-pencil .pcn-panel { min-height: auto; padding: 30px 8px; }
  .theme-pencil .pcn-stage { min-height: auto; }
  .theme-pencil .pcn-portrait-wrap { min-height: 390px; }
  .theme-pencil .pcn-portrait { max-width: 310px; border-width: 10px; }
  .theme-pencil .pcn-portrait-frame { border-width: 6px; }
  .theme-pencil .pcn-profile-copy h1 { font-size: 50px; }
  .theme-pencil .pcn-profile-copy > h2 { font-size: 15px; letter-spacing: .1em; }
  .theme-pencil .pcn-facts > div { grid-template-columns: 1fr; gap: 4px; }
  .theme-pencil .pcn-facts dd { padding-left: 48px; }
  .theme-pencil .pcn-panel-title span { font-size: 43px; }
  .theme-pencil .pcn-panel-title i { flex: 1; }
  .theme-pencil .pcn-timeline time { position: static; display: block; margin-bottom: 5px; }
  .theme-pencil .pcn-timeline h3 { max-width: none; }
  .theme-pencil .pcn-languages,
  .theme-pencil .pcn-service-grid,
  .theme-pencil .pcn-project-grid,
  .theme-pencil.layout-grid .pcn-service-grid,
  .theme-pencil.layout-grid .pcn-project-grid,
  .theme-pencil .pcn-contact-form .pc-form-row { grid-template-columns: 1fr; }
  .theme-pencil.layout-timeline .pcn-project-grid article { grid-template-columns: 1fr; }
  .theme-pencil .pcn-actions { gap: 22px; }
}

@media print {
  .theme-pencil .pcn-page { padding: 0; }
  .theme-pencil .pcn-header,
  .theme-pencil .pcn-social-rail,
  .theme-pencil .pcn-actions,
  .theme-pencil .pcn-footer { display: none !important; }
  .theme-pencil .pcn-shell { width: 100%; min-height: auto; padding: 0; }
  .theme-pencil .pcn-panel { break-inside: avoid; min-height: auto; }
  .theme-pencil .portfolio-tabs-ready .pcn-panel { display: block !important; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-pencil *,
  .theme-pencil *::before,
  .theme-pencil *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
