:root {
    --portfolio-accent: var(--site-primary);
    --portfolio-ink: #282828;
    --portfolio-muted: #77736f;
    --portfolio-surface: #ffffff;
    --portfolio-soft: #f5f3ef;
    --portfolio-line: rgba(40, 40, 40, .1);
}

html.theme-dark {
    --portfolio-ink: #f5f2ee;
    --portfolio-muted: #aaa39c;
    --portfolio-surface: #202020;
    --portfolio-soft: #181818;
    --portfolio-line: rgba(255, 255, 255, .1);
}

.elementor-8403 { color: var(--portfolio-ink); background: var(--portfolio-surface); }
.elementor-8403 .elementor-element-2f094d14 { padding: 70px 0 110px !important; }
.elementor-8403 .elementor-element-2f094d14 > .e-con-inner { max-width: 1300px !important; }
.portfolio-redesign-root { width: 100%; }

/* The saved WordPress archive still contains its legacy sidebar and sorter.
   The redesigned archive owns filtering, so give it the full content width. */
body.post-type-archive-portfolio main.container > aside,
body.post-type-archive-portfolio main.container > .lg\:col-span-3 > .archive-sorting-box {
  display: none !important;
}

body.post-type-archive-portfolio main.container > .lg\:col-span-3 {
  grid-column: 1 / -1 !important;
  width: 100%;
}

/* This archive is taller than one mobile viewport; the global reveal observer's
   20% threshold can never be reached for the whole wrapper. Cards reveal alone. */
body.post-type-archive-portfolio main.container > .lg\:col-span-3.scroll-reveal {
  opacity: 1 !important;
  transform: none !important;
}

.portfolio-archive-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 34px; }
.portfolio-breadcrumb { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: var(--portfolio-muted); font-size: 12px; }
.portfolio-breadcrumb strong { color: var(--portfolio-accent); }
.portfolio-archive-head h1 { margin: 0; color: var(--portfolio-ink); font-family: inherit; font-size: clamp(38px, 5vw, 66px); line-height: 1.15; }
.portfolio-archive-head h1 span { color: var(--portfolio-accent); }
.portfolio-archive-head > p { max-width: 430px; margin: 0; color: var(--portfolio-muted); font-size: 13px; line-height: 1.9; }

.portfolio-filterbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 24px; padding: 10px 16px; border: 1px solid var(--portfolio-line); border-radius: 16px; background: var(--portfolio-soft); }
.portfolio-filter-controls { display: flex; align-items: center; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.portfolio-filter-controls::-webkit-scrollbar { display: none; }
.portfolio-filter-controls > span { flex: 0 0 auto; margin-left: 7px; color: var(--portfolio-muted); font-size: 12px; }
.portfolio-filter-controls button, .portfolio-filter-controls a { flex: 0 0 auto; padding: 8px 14px; border: 0; border-radius: 9px; color: var(--portfolio-muted); background: var(--portfolio-surface); font-family: inherit; font-size: 12px; cursor: pointer; transition: .25s ease; }
.portfolio-filter-controls button:hover, .portfolio-filter-controls button.active, .portfolio-filter-controls a:hover, .portfolio-filter-controls a.active { color: #fff; background: var(--portfolio-accent); }
.portfolio-result-count { flex: 0 0 auto; color: var(--portfolio-muted); font-size: 12px; }
.portfolio-result-count strong { margin-left: 4px; color: var(--portfolio-accent); font-size: 18px; }

.company-portfolio-grid.portfolio-project-grid { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 12px !important; }
.portfolio-project-card { min-width: 0; }
.portfolio-project-card[hidden] { display: none; }
.portfolio-project-card > a { position: relative; min-height: 365px; display: flex; align-items: flex-end; overflow: hidden; border-radius: 24px; isolation: isolate; box-shadow: 0 15px 38px rgba(37, 26, 22, .12); }
.portfolio-project-card img { position: absolute; z-index: -3; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1), filter .5s ease; }
.portfolio-project-card > a::before { content: ""; position: absolute; z-index: -2; inset: 0; background: linear-gradient(180deg, rgba(31, 23, 20, .08) 0%, rgba(64, 30, 20, .12) 32%, rgba(219, 69, 39, .86) 100%); transition: background .45s ease; }
.portfolio-project-card > a::after { content: ""; position: absolute; z-index: -1; inset: auto 0 0; height: 47%; background: linear-gradient(180deg, transparent, rgba(16, 13, 12, .72)); }
.portfolio-project-card:hover img { transform: scale(1.075); filter: saturate(1.1); }
.portfolio-project-card:hover > a::before { background: linear-gradient(180deg, rgba(31, 23, 20, .02), rgba(239, 90, 60, .74)); }
.portfolio-card-content { width: 100%; padding: 24px 18px 17px; color: #fff; }
.portfolio-card-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.portfolio-card-top h2 { margin: 0; color: #fff; font-family: inherit; font-size: 18px; line-height: 1.6; text-shadow: 0 3px 14px rgba(0,0,0,.24); }
.portfolio-card-arrow { flex: 0 0 auto; width: 43px; height: 43px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--portfolio-accent); font-size: 20px; transition: transform .35s ease, background .35s ease; }
.portfolio-project-card:hover .portfolio-card-arrow { transform: translateX(-5px) rotate(-10deg); color: var(--portfolio-accent); background: #fff; }
.portfolio-card-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 11px 13px; border: 1px solid rgba(255,255,255,.17); border-radius: 12px; background: rgba(255,255,255,.14); backdrop-filter: blur(12px); }
.portfolio-card-meta span { min-width: 0; display: grid; gap: 2px; }
.portfolio-card-meta small { color: rgba(255,255,255,.68); font-size: 9px; white-space: nowrap; }
.portfolio-card-meta strong { overflow: hidden; color: #fff; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.portfolio-card-index { position: absolute; top: 17px; left: 18px; color: rgba(255,255,255,.7); font-family: Arial, sans-serif; font-size: 12px; letter-spacing: 1px; }

.portfolio-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 38px; }
.portfolio-pagination button, .portfolio-pagination a { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--portfolio-line); border-radius: 50%; color: var(--portfolio-ink); background: var(--portfolio-surface); font-family: inherit; cursor: pointer; }
.portfolio-pagination button.active, .portfolio-pagination button:hover, .portfolio-pagination a.active, .portfolio-pagination a:hover { border-color: var(--portfolio-accent); color: #fff; background: var(--portfolio-accent); }
.portfolio-pagination button:disabled { opacity: .35; pointer-events: none; }

.portfolio-project-card.portfolio-reveal { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .65s ease, transform .8s cubic-bezier(.22,1,.36,1); }
.portfolio-project-card.portfolio-reveal.in { opacity: 1; transform: translate3d(0,0,0); }

@media (max-width: 1024px) {
    .elementor-8403 .elementor-element-2f094d14 { padding-inline: 20px !important; }
    .company-portfolio-grid.portfolio-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 700px) {
    .elementor-8403 .elementor-element-2f094d14 { padding: 45px 14px 75px !important; }
    .portfolio-archive-head { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
    .portfolio-archive-head > p { font-size: 12px; }
    .portfolio-filterbar { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px; }
    .portfolio-result-count { padding-inline: 5px; }
    .company-portfolio-grid.portfolio-project-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
    .portfolio-project-card > a { min-height: 350px; }
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-project-card.portfolio-reveal { opacity: 1; transform: none; transition: none; }
}
