/* ==========================================================================
   Components: split layouts, media frames, cards, lists, steps, partners,
   sidebar, contact info and the contact form
   ========================================================================== */

/* ----- Split layouts ----------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5.5rem);
}

.split--reverse > :first-child {
  order: 2;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }

  .split--reverse > :first-child {
    order: 0;
  }
}

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--center .eyebrow {
  justify-content: center;
}

.lead {
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.6;
}

.lead strong {
  color: var(--navy-900);
}

/* ----- Media frames ------------------------------------------------------ */

.media-frame {
  position: relative;
  isolation: isolate;
  margin: 0;
}

.media-frame::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -16px;
  bottom: -16px;
  width: 72%;
  height: 72%;
  border: 3px solid var(--gold);
  border-radius: var(--radius);
}

.media-frame--left::before {
  right: auto;
  left: -16px;
}

.media-frame > img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  object-fit: cover;
}

.media-frame__inset {
  position: absolute;
  left: -9%;
  bottom: -9%;
  width: 46%;
  overflow: hidden;
  border: 6px solid var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.media-frame__inset img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.media-frame:hover .media-frame__inset img {
  transform: scale(1.06);
}

.zoom {
  overflow: hidden;
  border-radius: var(--radius);
}

.zoom img {
  transition: transform 0.9s var(--ease);
}

.zoom:hover img {
  transform: scale(1.05);
}

@media (max-width: 900px) {
  .media-frame {
    margin-bottom: 2.5rem;
  }

  .media-frame__inset {
    left: -3%;
  }
}

/* ----- Cards ------------------------------------------------------------- */

.card-grid {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.75rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
}

.card-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
}

.card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 2.6vw, 2.1rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
    border-color 0.4s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(242, 194, 48, 0.8);
  box-shadow: var(--shadow-md);
}

.card:hover::before {
  transform: scaleX(1);
}

.card__icon {
  display: grid;
  flex: none; /* never let a flex parent squeeze the icon box (Contact info cards) */
  width: 56px;
  height: 56px;
  margin-bottom: 1.25rem;
  place-items: center;
  background: var(--primary);
  border-radius: 14px;
  color: var(--gold);
  transition: transform 0.4s var(--ease), background-color 0.4s var(--ease);
}

.card__icon .icon {
  width: 1.7rem;
  height: 1.7rem;
}

.card:hover .card__icon {
  background: var(--navy-900);
  transform: rotate(-6deg) scale(1.06);
}

.card :is(h3, h4) {
  margin-bottom: 0.65rem;
}

.card p {
  color: var(--text);
}

.card .check-list {
  margin-top: 1rem;
}

.card--dark {
  background: var(--primary);
  border-color: transparent;
  color: rgba(255, 255, 255, 0.88);
}

.card--dark :is(h3, h4) {
  color: var(--white);
}

/* ----- Lists ------------------------------------------------------------- */

.check-list {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.check-list .icon {
  width: 1.45rem;
  height: 1.45rem;
  margin-top: 0.12rem;
  padding: 0.22rem;
  background: var(--gold);
  border-radius: 50%;
  color: var(--navy-900);
  stroke-width: 2.6;
}

.check-list--cols {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 0.8rem 2rem;
}

.check-list--big li {
  font-family: var(--font-head);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy-900);
}

/* Features (icon + title + text) */
.feature-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.feature__icon {
  display: grid;
  width: 52px;
  height: 52px;
  flex: none;
  place-items: center;
  background: var(--gold-soft);
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  color: var(--primary);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

.feature:hover .feature__icon {
  background: var(--primary);
  color: var(--gold);
}

.feature :is(h3, h4) {
  margin-bottom: 0.3rem;
  font-size: 1.2rem;
}

.feature p {
  margin: 0;
  font-size: 0.98rem;
}

/* A feature with a title but no description: centre the title on the icon */
.feature--title-only {
  align-items: center;
}

.feature--title-only :is(h3, h4) {
  margin: 0;
}

/* ----- Link list (institutes) ------------------------------------------- */

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--navy-900);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.link-grid a .icon {
  width: 1em;
  height: 1em;
  color: var(--primary);
  transition: transform 0.3s var(--ease);
}

.link-grid a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  transform: translateY(-3px);
}

.link-grid a:hover .icon {
  color: var(--gold);
  transform: translate(3px, -3px);
}

/* ----- Steps ------------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 2rem 1.6rem 1.8rem;
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transition: transform 0.4s var(--ease);
}

.step:hover {
  transform: translateY(-8px);
}

.step__num {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--gold);
  font-family: var(--font-head);
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1;
  -webkit-text-stroke: 1.5px var(--navy-900);
  paint-order: stroke fill;
}

.step :is(h2, h3, h4) {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.step p {
  margin: 0;
  font-size: 0.98rem;
}

@media (max-width: 1000px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* Continuous horizontal marquee. js/main.js adds .is-marquee and a second,
   aria-hidden copy of the cards so the loop is seamless. Without JavaScript,
   or with "reduce motion", the cards stay in the static grid above. */
/* Default (no JavaScript, or "reduce motion"): the static grid, kept to the
   page width. */
.steps-marquee {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

/* The marquee LAYOUT is applied by CSS as soon as the page paints (the <html>
   element already has .js), so nothing moves when js/main.js later appends the
   aria-hidden copies and adds .is-marquee, which only starts the animation. */
@media (prefers-reduced-motion: no-preference) {
  .js .steps-marquee {
    width: auto;
    margin-inline: 0;
    overflow: hidden;
    padding-block: 1.75rem;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  }

  .js .steps-marquee .steps {
    display: flex;
    width: max-content;
    gap: 0;
  }

  .js .steps-marquee .step {
    flex: 0 0 clamp(17rem, 26vw, 22rem);
    margin-right: clamp(1rem, 2vw, 1.5rem);
  }

  .js .steps-marquee.is-marquee .steps {
    animation: steps-marquee 36s linear infinite;
    will-change: transform;
  }

  .js .steps-marquee.is-marquee:hover .steps,
  .js .steps-marquee.is-marquee:focus-within .steps {
    animation-play-state: paused;
  }
}

@keyframes steps-marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ----- Partners ---------------------------------------------------------- */

.partners__panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  min-height: 100%;
  padding: clamp(2rem, 4vw, 3.25rem);
  background: var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.partners__panel img {
  width: auto;
  object-fit: contain;
  transition: transform 0.4s var(--ease);
}

.partners__panel img:hover {
  transform: scale(1.08);
}

.logo--round {
  height: clamp(84px, 10vw, 118px);
}

.logo--tall {
  height: clamp(100px, 12vw, 140px);
}

.logo--wide {
  height: clamp(42px, 5vw, 60px);
}

/* ----- Sidebar layout (inner pages) ------------------------------------- */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21.5rem;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

.content-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 1.5rem;
  display: grid;
  gap: 1.5rem;
}

.side-card {
  padding: 1.75rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.side-card :is(h3, h4) {
  margin-bottom: 1.1rem;
  font-size: 1.25rem;
}

.side-card .check-list {
  gap: 0.65rem;
  font-size: 1rem;
}

.side-card--dark {
  background: var(--primary);
  border-color: var(--primary);
  border-top-color: var(--gold);
  color: rgba(255, 255, 255, 0.9);
}

.side-card--dark :is(h3, h4) {
  color: var(--white);
}

/* Card that is itself a link (Free Online Assessment) */
.side-card--link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.side-card--link h3 {
  margin: 0;
}

.side-card--link .icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--gold);
  transition: transform 0.35s var(--ease);
}

.side-card--link:hover {
  color: var(--white);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.side-card--link:hover .icon {
  transform: translateX(5px);
}

.side-card .btn {
  width: 100%;
  margin-top: 1.25rem;
}

/* A sidebar taller than the window would hide its last card while stuck. */
@media (max-height: 940px) {
  .sidebar {
    position: static;
  }
}

@media (max-width: 1000px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  }
}

/* Article blocks on inner pages */
.stack {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.25rem);
}

.article-block {
  padding-left: 1.5rem;
  border-left: 4px solid var(--gold);
}

.article-block :is(h3, h4) {
  margin-bottom: 0.7rem;
}

.article-hero {
  aspect-ratio: 16 / 8;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sub-list-title {
  margin: 1.25rem 0 0.6rem;
  color: var(--navy-900);
  font-family: var(--font-head);
  font-weight: 700;
}

.term-list {
  display: grid;
  gap: 1rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.term-list li {
  padding: 1.1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
}

.term-list strong {
  color: var(--navy-900);
}

/* ----- Contact info + form ---------------------------------------------- */

.info-grid {
  display: grid;
  /* wide enough that the email address always fits beside its icon */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.info-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  height: 100%;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease);
}

/* Phones: slightly tighter cards so the email address stays on one line;
   on very narrow phones the icon sits above the text. */
@media (max-width: 480px) {
  .info-card {
    gap: 0.75rem;
    padding: 1rem;
  }

  .info-card p,
  .info-card a {
    font-size: 0.95rem;
  }
}

@media (max-width: 380px) {
  .info-card {
    flex-direction: column;
    gap: 0.6rem;
  }
}

.info-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}

.info-card .card__icon {
  width: 46px;
  height: 46px;
  margin: 0;
  border-radius: 12px;
}

.info-card .card__icon .icon {
  width: 1.35rem;
  height: 1.35rem;
}

.info-card .info-label {
  margin: 0 0 0.2rem;
  color: var(--primary);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.info-card p,
.info-card a {
  margin: 0;
  color: var(--navy-900);
  font-weight: 700;
  overflow-wrap: break-word; /* only breaks a word when it truly cannot fit */
  text-decoration: none;
}

.info-card a {
  display: inline-block;
  padding-block: 0.6rem; /* larger tap area on phones; the negative margin keeps the layout */
  margin-block: -0.6rem;
}

.info-card .info-note {
  margin-top: 0.25rem;
  color: var(--text);
  font-weight: 400;
}

.info-card a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

.social--dark a {
  border-color: var(--line);
  color: var(--primary);
}

.form-card {
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 5px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.form-card > h3 {
  margin-bottom: 1.5rem;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.25rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--navy-900);
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field .req {
  color: var(--danger);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--bg-soft);
  border: 1.5px solid transparent;
  border-bottom-color: rgba(38, 49, 115, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.field input,
.field select {
  height: 3.3rem;
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  background: var(--white);
  border-color: rgba(38, 49, 115, 0.35);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(242, 194, 48, 0.4);
}

.field [aria-invalid="true"] {
  background: #fdf1f0;
  border-color: var(--danger);
}

.field__error {
  min-height: 1.2em;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}

.form-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.btn .spinner {
  display: none;
  width: 1.1em;
  height: 1.1em;
  border: 2.5px solid rgba(20, 29, 79, 0.25);
  border-top-color: var(--navy-900);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn.is-loading .spinner {
  display: inline-block;
}

.btn.is-loading .icon {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-status {
  display: none;
  gap: 0.9rem;
  align-items: flex-start;
  margin-top: 1.25rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-sm);
  border-left: 5px solid;
  font-weight: 600;
}

.form-status.is-visible {
  display: flex;
  animation: status-in 0.45s var(--ease) both;
}

.form-status .icon {
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.1rem;
}

.form-status--success {
  background: #eef7ee;
  border-color: #2e7d32;
  color: #1b5e20;
}

.form-status--error {
  background: #fdf1f0;
  border-color: var(--danger);
  color: #8c1d18;
}

.form-status p {
  margin: 0;
}

.form-status a {
  color: inherit;
  font-weight: 800;
}

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

.map-embed {
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  line-height: 0;
}

.map-embed iframe {
  width: 100%;
  height: clamp(300px, 42vw, 460px);
  border: 0;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Service cards (Taxation): subtle staggered reveal + refined hover.
   Scoped with .service-cards so other pages keep their current behaviour.
   ========================================================================== */

/* Stagger: second column follows the first by a beat. Each card also waits
   for its own scroll position, so rows reveal one after another. */
.service-cards > .card:nth-child(even) {
  --d: 0s;
}

/* Layout: stacked by default (phones). Two equal columns on desktop (when the
   page has its side-by-side sidebar) and on tablets (when the sidebar drops
   below). A lone last card is centred under the pair so the grid stays
   balanced. In between (narrow desktop windows) the cards stay stacked. */
.service-cards {
  --cards-gap: clamp(1rem, 2.4vw, 1.75rem);
  grid-template-columns: minmax(0, 1fr);
  gap: var(--cards-gap);
}

@media (min-width: 641px) and (max-width: 1000px), (min-width: 1081px) {
  .service-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-cards > .card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - var(--cards-gap)) / 2);
  }

  /* second column follows the first by a beat */
  .service-cards > .card:nth-child(even) {
    --d: 0.12s;
  }
}

.js .service-cards > .card[data-reveal] {
  translate: 0 22px;
  /* reveal properties carry the delay; hover properties never do */
  transition: opacity 0.75s var(--ease) var(--d, 0s),
    translate 0.8s var(--ease) var(--d, 0s), transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.js .service-cards > .card[data-reveal].is-visible {
  translate: 0 0;
}

/* Icon settles in just after its card (tiny scale, no large movement). */
.js .service-cards > .card[data-reveal] .card__icon {
  opacity: 0;
  scale: 0.88;
  transition: opacity 0.6s var(--ease) calc(var(--d, 0s) + 0.18s),
    scale 0.6s var(--ease) calc(var(--d, 0s) + 0.18s),
    transform 0.4s var(--ease), background-color 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

.js .service-cards > .card[data-reveal].is-visible .card__icon {
  opacity: 1;
  scale: 1;
}

/* Heading + text follow a moment later for a layered feel. */
.js .service-cards > .card[data-reveal] :is(h3, h4, p) {
  opacity: 0;
  translate: 0 8px;
  transition: opacity 0.6s var(--ease) calc(var(--d, 0s) + 0.26s),
    translate 0.6s var(--ease) calc(var(--d, 0s) + 0.26s);
}

.js .service-cards > .card[data-reveal].is-visible :is(h3, h4, p) {
  opacity: 1;
  translate: 0 0;
}

/* Hover: soft gold-border highlight + small icon animation (pointer devices). */
@media (hover: hover) {
  .service-cards > .card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold), 0 0 0 6px rgba(242, 194, 48, 0.16),
      var(--shadow-md);
  }

  .service-cards > .card:hover .card__icon {
    background: var(--navy-900);
    box-shadow: 0 0 0 4px rgba(242, 194, 48, 0.3);
    transform: translateY(-2px) rotate(-5deg);
  }

  .service-cards > .card .card__icon .icon {
    transition: transform 0.45s var(--ease);
  }

  .service-cards > .card:hover .card__icon .icon {
    transform: scale(1.1);
  }
}

/* Single-column layout: cards arrive one by one, so no sideways stagger delay. */
@media (prefers-reduced-motion: reduce) {
  .js .service-cards > .card[data-reveal],
  .js .service-cards > .card[data-reveal] .card__icon,
  .js .service-cards > .card[data-reveal] :is(h3, h4, p) {
    opacity: 1;
    translate: none;
    scale: none;
    transition: none;
  }
}

/* Taxation service cards: content centred (icon, heading and text). */
.service-cards > .card {
  text-align: center;
}

.service-cards > .card .card__icon {
  margin-inline: auto;
}

/* ==========================================================================
   Team page: short intro, then one horizontal card per member, stacked
   (photo left, details right; photo above details on phones)
   ========================================================================== */

.team-intro h1 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 1.3rem + 2.4vw, 3rem);
}

.team-intro .lead {
  margin-inline: auto;
}

.team-list {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  max-width: 56rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.team-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 17.5rem) minmax(0, 1fr);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
    border-color 0.4s var(--ease);
}

.team-card__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg);
}

.team-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.9s var(--ease);
}

/* gold line grows across the foot of the photo on hover */
.team-card__photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.team-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
}

.team-card__name {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.9rem);
  line-height: 1.2;
}

.team-card__role {
  position: relative;
  margin: 0 0 1.3rem;
  padding-bottom: 1rem;
  color: var(--primary);
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.team-card__role::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.6rem;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
}

.team-card__quals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.team-card__quals li {
  padding: 0.4rem 0.95rem;
  background: var(--gold-soft);
  border: 1px solid rgba(242, 194, 48, 0.6);
  border-radius: 999px;
  color: var(--navy-900);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Reveal: the shared fade-up, with hover transitions kept intact. */
.js .team-card[data-reveal] {
  transition: opacity 0.8s var(--ease), translate 0.8s var(--ease),
    transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
    border-color 0.4s var(--ease);
}

@media (hover: hover) {
  .team-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold), 0 0 0 6px rgba(242, 194, 48, 0.16),
      var(--shadow-md);
  }

  .team-card:hover .team-card__photo img {
    transform: scale(1.04);
  }

  .team-card:hover .team-card__photo::after {
    transform: scaleX(1);
  }
}

/* Phones: photo on top, details centred beneath. */
@media (max-width: 640px) {
  .team-card {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .team-card__body {
    align-items: center;
  }

  .team-card__role::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .team-card__quals {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .team-card[data-reveal] {
    transition: none;
  }
}
