/*Team*/

/* Page shell, <main>, wrapper width, title, lead and focus ring come from base.css */

.team-wrap {
    --pad: clamp(1rem, 2.5vw, 2rem);
}

.team-head,
.team-foot {
    margin-inline: calc(-1 * var(--pad));
    padding-inline: var(--pad);
}

/*header*/

.team-head {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: clamp(2.25rem, 4.5vw, 3.5rem);   /* ruimte boven de teams */
    border-bottom: 1px solid var(--line-on-dark);
}

.team-head h1 { margin: 0; }
.team-head p { max-width: none; }   /* volle breedte */

/*grid*/
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    row-gap: 0;

    margin: 0 calc(-1 * var(--pad));
    padding: 0;
    list-style: none;
}

.team-item {
    position: relative;
    display: grid;
    grid-row: span 4;
    grid-template-rows: subgrid;
    padding: clamp(1.75rem, 3.5vw, 2.5rem) var(--pad) clamp(2rem, 4vw, 2.75rem);   /* meer lucht in elk team */
    border-left: 1px solid var(--line-on-dark);
}
.team-item:nth-child(3n + 1) { border-left-color: transparent; }
.team-item:nth-child(n + 4) { border-top: 1px solid var(--line-on-dark); }

@property --t { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
@property --b { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

.team-item::before {
    content: "";
    position: absolute;
    inset: -1px 0 -1px 0;
    pointer-events: none;
    background:
            linear-gradient(var(--koraal), var(--koraal)) left top    / max(1.5rem, var(--t)) 2px no-repeat,
            linear-gradient(var(--koraal), var(--koraal)) left bottom / var(--b) 2px no-repeat;
    transition: --t 0.3s var(--ease-soft), --b 0.3s var(--ease-soft);
}
.team-item:hover::before {
    --t: 100%;
    --b: 100%;
    transition: --t 0.5s var(--ease-soft), --b 0.5s var(--ease-soft) 0.08s;
}

.team-item h2 {
    margin: 0;
    font-family: var(--sans);
    font-size: clamp(1.25rem, 1.9vw, 1rem);   /* max is smaller than min, so this is always 1.25rem */
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    transition: transform 0.35s var(--ease-soft);
}
.team-item:hover h2 { transform: translateX(4px); }

.team-item p {
    margin: 1.1rem 0 0;
    padding-top: 0.95rem;
    border-top: 1px dashed var(--line-on-dark);
    font-family: var(--sans);
    font-size: 1.02rem;
    line-height: 1.5;
    color: var(--cream-dim);
}

.team-item ul {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.85rem 0 0;
    padding: 0 0 0 1.1rem;
    list-style: none;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--cream);
    overflow-wrap: break-word;
}

/* dashed line: coral sweep in step with the card border */
.team-item p { position: relative; }

.team-item p::before {
    content: "";
    position: absolute;
    top: -1px;              /* sits exactly on the border-top */
    left: 0;
    right: 0;
    border-top: 1px dashed var(--rem-teal-mid);
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.3s var(--ease-soft);
    pointer-events: none;
}

.team-item:hover p::before {
    clip-path: inset(0 0 0 0);
    transition: clip-path 0.5s var(--ease-soft) 0.04s;
}

/*rem logo*/
.team-item li {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}
.team-item li::before {
    content: "";
    flex: none;
    width: 0.45em;
    height: 0.6em;
    background: var(--koraal);
    clip-path: polygon(0 0, 45% 0, 100% 50%, 45% 100%, 0 100%, 55% 50%);
    transform: translateY(0.05em);
}

@supports not (grid-template-rows: subgrid) {
    .team-item { display: flex; flex-direction: column; }
    .team-item ul { margin-top: auto; }
}
/*onderregel*/

.team-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding-top: clamp(2.25rem, 4.5vw, 3.5rem);   /* ruimte onder de teams */
    border-top: 1px solid var(--line-on-dark);
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--cream-dim);
}
.team-foot p { margin: 0; }

/* .team-foot a: base.css (pill sweep) */

@media (max-width: 860px) {
    .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .team-item:nth-child(3n + 1) { border-left-color: var(--line-on-dark); }
    .team-item:nth-child(2n + 1) { border-left-color: transparent; }
    .team-item:nth-child(n + 3) { border-top: 1px solid var(--line-on-dark); }
}

@media (max-width: 520px) {
    .team-grid { grid-template-columns: 1fr; }
    .team-item,
    .team-item:nth-child(3n + 1),
    .team-item:nth-child(2n + 1) { border-left-color: transparent; }
    .team-item:nth-child(n + 2) { border-top: 1px solid var(--line-on-dark); }
}

@media (prefers-reduced-motion: reduce) {
    .team-main *, .team-main *::before { transition: none !important; }
}

.team-item p { transition: color 0.3s var(--ease-soft); }
.team-item:hover p { color: var(--cream); }

/*Spotlight*/
.team-item {
    isolation: isolate;
    transition: opacity 0.35s var(--ease-soft);
}
@media (hover: hover) {
    .team-grid:has(.team-item:hover) .team-item:not(:hover) { opacity: 0.45; }
}

.team-item::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(120, 179, 189, 0.16), transparent 70%);
    opacity: 0;
    transition: opacity 0.35s var(--ease-soft);
    pointer-events: none;
}
.team-item:hover::after { opacity: 1; }

.team-item li::before { transition: transform 0.3s var(--ease-soft); }
.team-item:hover li::before { transform: translate(3px, 0.05em); }
.team-item:hover li:nth-child(2)::before { transition-delay: 0.04s; }
.team-item:hover li:nth-child(3)::before { transition-delay: 0.08s; }

/* Page load and scroll reveal: animations.css (data-rv attributes in the HTML) */
@media (prefers-reduced-motion: reduce) {
    .team-grid:has(.team-item:hover) .team-item:not(:hover) { opacity: 1; }
}

/*icons*/
.team-item {
    --icon-size: clamp(2.5rem, 4vw, 2.75rem);
    --item-pad-top: clamp(1.75rem, 3.5vw, 2.5rem);   /* same as the top padding of .team-item */
}

.team-icon {
    --icon-stroke: 1.5;
    --inset: calc(var(--icon-size) * 0.125);   /* the glyph sits at 3 to 21 of 24 */
    position: absolute;
    /* optical: the glyph's top and right edges line up with the h2 top and the padding edge */
    top: calc(var(--item-pad-top) - var(--inset));
    right: calc(var(--pad) - var(--inset));
    width: var(--icon-size);
    height: var(--icon-size);
    color: color-mix(in srgb, var(--cream) 58%, var(--rem-bg));
    transition: color 0.35s var(--ease-soft);
}

.team-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;   /* room for the tilt and lift */
}

.team-item:hover .team-icon {
    color: var(--koraal);
    --icon-fill: 0.22;
    --icon-on: 1;
}

/* long team names never run under the icon */
.team-item h2 { padding-right: calc(var(--icon-size) + 0.75rem); }

@media (prefers-reduced-motion: reduce) {
    .team-item:hover .team-icon { --icon-on: 0; }   /* keep the fill, skip the movement */
}

/*headcount*/
.team-people {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.9rem;
    border-radius: 999px;
}

.team-person {
    --s: 2rem;
    position: relative;
    display: grid;
    place-items: center;
    width: var(--s);
    height: var(--s);
    margin-left: -0.5rem;
    border: 1px solid var(--line-on-dark);
    border-radius: 50%;
    background-color: var(--rem-bg);
    color: var(--cream-dim);
    font: 500 0.72rem/1 var(--sans);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    transition:
            margin 0.4s var(--ease-soft),
            background-color 0.25s var(--ease-soft),
            border-color 0.25s var(--ease-soft),
            color 0.25s var(--ease-soft);
}

.team-person:first-child { margin-left: 0; }

/* card hover: the stack fans open */
.team-item:hover .team-person:not(:first-child),
.team-people:focus-visible .team-person:not(:first-child) { margin-left: 0.3rem; }
.team-item:hover .team-person {
    background-color: transparent;   /* lets the spotlight through once they no longer overlap */
    border-color: rgba(244, 240, 234, 0.5);
    color: var(--cream);
}
/* circle hover: coral invert (needs .team-item to beat the card hover rule) */
.team-item .team-person:hover {
    background-color: var(--koraal);
    border-color: var(--koraal);
    color: var(--cream);
}

/* circle hover: first name */
.team-person:hover { border-color: var(--koraal); color: var(--koraal); }
.team-person::after {
    content: attr(data-name);
    position: absolute;
    bottom: calc(100% + 0.45rem);
    left: 50%;
    padding: 0.3em 0.6em;
    border-radius: 0.25rem;
    background: var(--cream);
    color: var(--rem-bg);
    font: 500 0.72rem/1 var(--sans);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 0.25rem);
    transition: opacity 0.2s ease, transform 0.25s var(--ease-soft);
}
.team-person:hover::after { opacity: 1; transform: translate(-50%, 0); }

/* tap or tab: write out all names (works on touch screens) */
.team-people::after {
    content: attr(data-names);
    display: none;
    flex-basis: 100%;
    margin-top: 0.6rem;
    font: 400 0.82rem/1.4 var(--sans);
    color: var(--cream-dim);
}
.team-people:focus .team-person:not(:first-child) { margin-left: 0.3rem; }
.team-people:focus::after { display: block; }
.team-people:focus { outline: none; }
.team-people:focus-visible { outline: 3px solid var(--koraal); outline-offset: 4px; }

/*!* Teamfoto als zaklamp: alleen zichtbaar in de lichtvlek rond de muis *!*/
/*.team-photo {*/
/*    position: absolute;*/
/*    inset: 0;*/
/*    z-index: -2;*/
/*    width: 100%;*/
/*    height: 100%;*/
/*    object-fit: cover;*/
/*    filter: grayscale(1) contrast(1.1);*/
/*    mix-blend-mode: luminosity;*/
/*    opacity: 0;*/
/*    -webkit-mask-image: radial-gradient(170px circle at var(--mx, 50%) var(--my, 0%), #000 0%, rgba(0, 0, 0, 0.45) 50%, transparent 100%);*/
/*    mask-image: radial-gradient(170px circle at var(--mx, 50%) var(--my, 0%), #000 0%, rgba(0, 0, 0, 0.45) 50%, transparent 100%);*/
/*    transition: opacity 0.5s var(--ease-soft);*/
/*    pointer-events: none;*/
/*}*/
/*.team-item:hover .team-photo { opacity: 0.5; }*/

/*!* Touchscreens: geen muis, dus geen zaklamp en geen foto *!*/
/*@media (hover: none) {*/
/*    .team-photo { display: none; }*/
/*}*/

/*@media (prefers-reduced-motion: reduce) {*/
/*    .team-photo { transition: none; }*/
/*}*/