/* ==========================================================================
   Components: buttons, language switch, portrait, experience, expertise,
   capability tags, contact hub.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   Text never sits on bright green: #57BE65 cannot reach 4.5:1 with white or
   with the brand's dark text. Primary uses the dark green as its surface.
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.625rem 1.375rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease), transform var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn .icon {
  transition: transform var(--ease);
}

.btn--primary {
  background: var(--ink);
  color: #fff;
}

.btn--primary:hover {
  background: var(--ink-deep);
}

.btn--primary:hover .icon--nudge {
  transform: translateX(2px);
}

.btn--secondary {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn--secondary:hover {
  background: var(--tint);
}

.btn--secondary:hover .icon--nudge {
  transform: translateY(2px);
}

.btn-row {
  display: grid;
  gap: 0.75rem;
}

/* On a phone only the primary action is a box; the secondary one is a quiet
   text link so the two do not compete. */
@media (max-width: 29.99rem) {
  .btn-row .btn--secondary {
    min-height: 2.75rem;
    border-color: transparent;
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 0.3em;
  }
}

@media (min-width: 30rem) {
  .btn-row {
    display: flex;
    flex-wrap: wrap;
  }
}

/* --------------------------------------------------------------------------
   Language switch
   -------------------------------------------------------------------------- */

.lang-switch ul {
  display: flex;
}

.lang-switch a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  transition: background-color var(--ease);
}

.lang-switch li:first-child a {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.lang-switch li:last-child a {
  margin-left: -1px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.lang-switch a:hover {
  background: var(--tint);
}

.lang-switch a[aria-current] {
  position: relative;
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Portrait
   The ratio and fallback colour reserve the space before the image arrives.
   -------------------------------------------------------------------------- */

.portrait {
  position: relative;
  aspect-ratio: 3 / 4;
  width: 100%;
  background: var(--tint);
  border-radius: var(--radius-lg);
}

.portrait img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

@media (min-width: 46rem) {
  .portrait {
    max-width: 26rem;
    margin-left: auto;
    margin-right: 1rem;
  }

  /* A quiet offset block adds depth without a shadow. */
  .portrait::before {
    content: "";
    position: absolute;
    inset: 1rem -1rem -1rem 1rem;
    background: var(--green-soft);
    border-radius: inherit;
  }
}

/* --------------------------------------------------------------------------
   Experience
   A plain list: company, role and period, separated by hairlines. Embreo is
   larger than NEVTIK, and that is the only difference between the rows.
   -------------------------------------------------------------------------- */

.role {
  display: grid;
  gap: 0.75rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line-strong);
}

.role:last-child {
  border-bottom: 1px solid var(--line-strong);
}

.role h3 {
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.role__title {
  margin-top: 0.375rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.role__period {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.5;
  color: var(--accent-text);
}

.role--featured {
  padding-block: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
}

.role--featured h3 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
}

.role--featured .role__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
}

@media (min-width: 40rem) {
  .role {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    column-gap: 1.5rem;
  }

  .role__period {
    text-align: right;
    white-space: nowrap;
  }
}

/* --------------------------------------------------------------------------
   Where a simple system helps
   Three situation cards. Each opens with how the situation feels in a client's
   own words, then the question that starts the work.
   -------------------------------------------------------------------------- */

.cases {
  display: grid;
  gap: 1rem;
}

.case {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background-color var(--ease), border-color var(--ease);
}

/* The whole card opens the detail dialog. The button carries the label and an
   invisible layer stretches its click area over the card. It only appears once
   JavaScript has confirmed <dialog> works, so no dead control is ever shown. */
.case__more {
  display: none;
  align-items: center;
  align-self: flex-start;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.case__more::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.case__more .icon {
  width: 1.125rem;
  height: 1.125rem;
  transition: transform var(--ease);
}

.has-modal .case__more {
  display: inline-flex;
}

.has-modal .case:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.has-modal .case:hover .case__more .icon {
  transform: translateX(2px);
}

/* Focus ring goes around the whole card, not just the small label. */
.case__more:focus-visible {
  outline: none;
}

.case:has(.case__more:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.case__title {
  font-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.case__label {
  margin-top: 1.25rem;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent-text);
}

.case__feel {
  margin-top: 0.375rem;
  color: var(--ink-muted);
}

.case__label--ask {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.case__ask {
  margin-top: 0.375rem;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 550;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

@media (min-width: 60rem) {
  .cases {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .case {
    padding: 1.75rem;
  }
}

/* Side by side, the three cards share one set of rows, so the icons, titles,
   labels, divider lines and questions all line up across cards whatever the
   text length. Without subgrid support the cards simply stack their content. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 60rem) {
    .cases {
      column-gap: 1.25rem;
      row-gap: 0;
    }

    .case {
      display: grid;
      grid-row: span 7;
      grid-template-rows: subgrid;
      align-content: start;
    }
  }
}

/* --------------------------------------------------------------------------
   Detail dialog
   Native <dialog>: focus is trapped, Esc closes it, and the page behind is
   inert. Page scrolling is locked while one is open.
   -------------------------------------------------------------------------- */

html:has(dialog[open]) {
  overflow: hidden;
}

.modal {
  width: min(56rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px -24px rgb(24 75 45 / 0.35);
}

.modal::backdrop {
  background: rgb(24 75 45 / 0.45);
}

.modal[open],
.modal[open]::backdrop {
  animation: modal-in 180ms ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
  }
}

.modal__body {
  --modal-pad: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  padding: var(--modal-pad);
}

/* Stays at the top while the content scrolls, so the close button is always
   within reach, including on a phone. */
.modal__top {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: calc(-1 * var(--modal-pad)) calc(-1 * var(--modal-pad)) 0.5rem;
  padding: var(--modal-pad) var(--modal-pad) 0.5rem;
  background: var(--surface);
}

.modal__badge {
  padding: 0.125rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  background: var(--tint);
  border-radius: 0.375rem;
}

.modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: -0.5rem -0.5rem -0.25rem 0;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease);
}

.modal__close:hover {
  background: var(--tint);
  border-color: var(--line-strong);
}

.modal__title {
  font-size: var(--text-xl);
  line-height: 1.2;
}

.modal__note {
  max-width: 44rem;
  margin-top: 0.75rem;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* Before / after diagram. Plain HTML lists, so it reads fine in a screen reader.
   Rows stack on narrow dialogs and run left to right once there is room. */
.modal__body {
  container-type: inline-size;
}

.flowmap {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.flowmap__label {
  margin-bottom: 0.5rem;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-muted);
}

.flowmap__row--after .flowmap__label {
  color: var(--accent-text);
}

.flowmap__chain {
  display: grid;
  gap: 1.75rem;
}

.flowmap__node {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.125rem;
  padding: 0.75rem 0.875rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.flowmap__row--after .flowmap__node {
  background: var(--tint);
}

.flowmap__node strong {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
}

.flowmap__node span {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ink-muted);
}

/* Manual work, drawn with a dashed edge. */
.flowmap__node--manual {
  border-style: dashed;
  border-color: var(--ink-muted);
}

/* The step the system now does. Written with the row selector so it wins over
   the tinted background that every node in the After row gets. */
.flowmap__row--after .flowmap__node--key {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.flowmap__row--after .flowmap__node--key span {
  color: #d3e8d1;
}

/* Arrow between nodes: a decorative mask, so nothing extra is read aloud. */
.flowmap__node + .flowmap__node::before {
  content: "";
  position: absolute;
  top: -1.5rem;
  left: 50%;
  width: 1.125rem;
  height: 1.125rem;
  margin-left: -0.5625rem;
  background: var(--accent-text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: rotate(90deg);
}

/* Side by side only when each of the four boxes gets a comfortable width. */
@container (min-width: 46rem) {
  .flowmap {
    gap: 1.75rem;
  }

  .flowmap__chain {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 2.25rem;
  }

  .flowmap__node {
    gap: 0.25rem;
    padding: 1rem 1.125rem;
  }

  .flowmap__node strong {
    font-size: var(--text-base);
  }

  .flowmap__node span {
    font-size: var(--text-sm);
  }

  .flowmap__node + .flowmap__node::before {
    top: 50%;
    left: -1.6875rem;
    margin: -0.5625rem 0 0;
    transform: none;
  }
}

.modal__steps {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
  counter-reset: step;
}

.modal__steps > li {
  position: relative;
  padding: 1.125rem 0 0 2.5rem;
  border-top: 1px solid var(--line);
  counter-increment: step;
}

.modal__steps > li::before {
  content: counter(step);
  position: absolute;
  top: 1.125rem;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  background: var(--tint);
  border-radius: 50%;
}

.modal__steps h4 {
  font-size: var(--text-base);
  line-height: 1.4;
}

.modal__steps p,
.modal__steps ul {
  max-width: 42rem;
}

.modal__steps p {
  margin-top: 0.25rem;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--ink-muted);
}

.modal__steps ul {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--ink-muted);
}

.modal__steps ul li {
  position: relative;
  padding: 0 0 0 1.125rem;
  border: 0;
}

.modal__steps ul li::before {
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 0.5rem;
  height: 2px;
  background: var(--green);
  border-radius: 0;
  content: "";
}

/* --------------------------------------------------------------------------
   How I approach the work
   Sits under the expertise cards, inside the same section. A five-step flow:
   stacked with a downward arrow between steps on narrow screens, a single row
   with sideways arrows once there is room.
   -------------------------------------------------------------------------- */

.subsection {
  margin-top: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  padding-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  border-top: 1px solid var(--line-strong);
}

.subsection__head {
  max-width: 38rem;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.subsection__title {
  font-size: var(--text-2xl);
}

.flow {
  display: grid;
  gap: 0;
}

.flow__step {
  display: grid;
  gap: 0.375rem;
  padding-top: 1.125rem;
  border-top: 1px solid var(--line-strong);
}

.flow__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-lg);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.flow__step p {
  max-width: 36rem;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--ink-muted);
}

.flow__arrow,
.flow__loop {
  color: var(--accent-text);
}

/* Narrow: the arrow closes each step and points down to the next. */
.flow__arrow {
  margin-block: 0.75rem 1.125rem;
  transform: rotate(90deg);
}

.flow__step:last-child {
  padding-bottom: 0.25rem;
}

/* One row of five steps needs about 195px per column, so it only applies
   from 1280px. Titles stay on a single line at this size. */
@media (min-width: 80rem) {
  .flow {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 2.5rem;
  }

  .flow__step {
    position: relative;
    align-content: start;
  }

  .flow__title {
    font-size: 1rem;
    white-space: nowrap;
  }

  .flow__arrow {
    position: absolute;
    top: 1.25rem;
    right: -1.875rem;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Expertise
   -------------------------------------------------------------------------- */

.statement {
  max-width: 54rem;
  margin-bottom: clamp(2.5rem, 2rem + 2.5vw, 4.5rem);
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 550;
  line-height: 1.14;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.statement__mark {
  background-image: linear-gradient(var(--green-soft), var(--green-soft));
  background-repeat: no-repeat;
  background-size: 100% 0.32em;
  background-position: 0 92%;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.expertise-grid {
  display: grid;
  gap: 1rem;
}

.expertise-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--ease);
}

.expertise-card:hover {
  border-color: var(--line-strong);
}

.expertise-card__icon,
.case__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  color: var(--ink);
  background: var(--tint);
  border-radius: var(--radius-sm);
  transition: transform var(--ease);
}

.expertise-card:hover .expertise-card__icon {
  transform: translateY(-2px);
}

/* Number on the left, icon on the right. The list is ordered, so the number is
   decorative for screen readers (aria-hidden) and the order is already announced. */
.expertise-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.expertise-card__top .expertise-card__icon {
  margin-bottom: 0;
}

.expertise-card__num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.expertise-card h3 {
  font-size: var(--text-lg);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.expertise-card p {
  margin-top: 0.625rem;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--ink-muted);
}

@media (min-width: 40rem) {
  .expertise-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* --------------------------------------------------------------------------
   Technical capabilities
   -------------------------------------------------------------------------- */

.tech-group {
  display: grid;
  gap: 0.75rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
}

.tech-group:last-child {
  padding-bottom: 0;
}

.tech-group h3 {
  font-size: var(--text-base);
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.75rem 0.5rem;
}

/* Each tag is a link to the tool's official site. The visible box stays
   compact; ::after enlarges the hit area to roughly 44px without overlap. */
.tags a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem 0.25rem 0.625rem;
  font-size: var(--text-sm);
  line-height: 1.5;
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  transition: background-color var(--ease), border-color var(--ease);
}

.tags a::after {
  content: "";
  position: absolute;
  inset: -0.4375rem -0.125rem;
}

.tags a:hover {
  background: var(--tint);
  border-color: var(--line-strong);
}

.tech-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
}

@media (min-width: 40rem) {
  .tech-group {
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: 1.5rem;
  }

  .tech-group h3 {
    padding-top: 0.25rem;
  }
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about__text {
  max-width: 44rem;
  font-size: var(--text-xl);
  line-height: 1.5;
}

@media (min-width: 60rem) {
  .about__text {
    padding-top: 0.25rem;
  }
}

/* --------------------------------------------------------------------------
   Contact hub
   -------------------------------------------------------------------------- */

.contact {
  padding-bottom: clamp(1rem, 2vw, 2rem);
  scroll-margin-top: var(--header-h);
}

.contact__panel {
  display: grid;
  gap: clamp(1.75rem, 1.25rem + 2vw, 3rem);
  padding: clamp(1.25rem, 0.75rem + 3.5vw, 4rem);
  background: var(--green-soft);
  border-radius: var(--radius-lg);
}

.contact__panel h2 {
  font-size: var(--text-3xl);
}

.contact__copy {
  margin-top: 1rem;
  max-width: 28rem;
  font-size: var(--text-lg);
  line-height: 1.55;
}

.contact__channels {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.contact-email {
  padding: clamp(1.125rem, 1rem + 0.8vw, 1.75rem);
  background: var(--surface);
  border-radius: var(--radius);
}

.contact-email__label {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.contact-email__address {
  display: block;
  margin-block: 0.375rem 1.125rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.625rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-height: 3.75rem;
  padding: 0.75rem 1.125rem;
  text-decoration: none;
  background: var(--surface);
  border-radius: var(--radius);
  transition: background-color var(--ease);
}

.contact-link:hover {
  background: var(--bg);
}

.contact-link__text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.contact-link__name {
  display: block;
  font-weight: 600;
}

.contact-link__hint {
  display: block;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.contact-link .icon--arrow {
  transition: transform var(--ease);
}

.contact-link:hover .icon--arrow {
  transform: translate(2px, -2px);
}

@media (min-width: 60rem) {
  .contact__panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2.5rem, 5vw, 5rem);
  }
}

/* ==========================================================================
   Motion
   Everything here is decoration. Entrance animations only run when the user
   has not asked for reduced motion, and scroll reveals are switched on by
   main.js (html.motion), so without JS the page is simply fully visible.
   ========================================================================== */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
}

@keyframes float {
  to {
    transform: translateY(-0.5rem);
  }
}

@keyframes drift {
  to {
    transform: translate(2.5rem, 1.5rem) scale(1.15);
  }
}

@keyframes slide-block {
  from {
    transform: translate(-1rem, -1rem);
    opacity: 0;
  }
}

@keyframes progress {
  to {
    transform: scaleX(1);
  }
}

/* Hover lift: a little depth that responds to the pointer. */
.expertise-card,
.has-modal .case {
  transition:
    border-color var(--ease),
    background-color var(--ease),
    transform 260ms cubic-bezier(0.2, 0.7, 0.3, 1),
    box-shadow 260ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.expertise-card:hover,
.has-modal .case:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 32px -20px rgb(24 75 45 / 0.35);
}

.btn {
  transition:
    background-color var(--ease),
    border-color var(--ease),
    transform var(--ease),
    box-shadow var(--ease);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgb(24 75 45 / 0.55);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.tags a {
  transition:
    background-color var(--ease),
    border-color var(--ease),
    transform var(--ease);
}

.tags a:hover {
  transform: translateY(-2px);
}

.role h3 {
  transition: transform 260ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.role:hover h3 {
  transform: translateX(0.5rem);
}

.contact-email,
.contact-link {
  transition:
    background-color var(--ease),
    transform 260ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.contact-link:hover {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: no-preference) {
  /* Scroll progress line along the bottom of the header (where supported). */
  @supports (animation-timeline: scroll()) {
    .site-header::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: -1px;
      height: 3px;
      background: var(--green);
      transform: scaleX(0);
      transform-origin: left;
      animation: progress linear both;
      animation-timeline: scroll(root block);
      pointer-events: none;
    }
  }

  /* Hero: soft green shapes drift slowly behind the content. */
  .hero {
    position: relative;
    isolation: isolate;
    overflow-x: clip;
  }

  .hero::before,
  .hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    animation: drift 14s ease-in-out infinite alternate;
  }

  .hero::before {
    top: -6rem;
    right: -8rem;
    width: 28rem;
    height: 28rem;
    background: radial-gradient(closest-side, rgb(172 223 172 / 0.55), transparent);
  }

  .hero::after {
    bottom: -4rem;
    left: -8rem;
    width: 22rem;
    height: 22rem;
    background: radial-gradient(closest-side, rgb(87 190 101 / 0.18), transparent);
    animation-duration: 18s;
    animation-direction: alternate-reverse;
  }

  /* Hero entrance: each piece rises in turn. */
  .hero__name,
  .hero h1,
  .hero__meta,
  .hero__intro,
  .hero__more,
  .hero__actions {
    animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  }

  .hero__name { animation-delay: 0.05s; }
  .hero h1 { animation-delay: 0.15s; }
  .hero__meta { animation-delay: 0.3s; }
  .hero__intro { animation-delay: 0.42s; }
  .hero__more { animation-delay: 0.52s; }
  .hero__actions { animation-delay: 0.64s; }

  .hero__portrait {
    animation:
      rise 0.9s 0.2s cubic-bezier(0.2, 0.7, 0.3, 1) backwards,
      float 6s 1.2s ease-in-out infinite alternate;
  }

  @media (min-width: 46rem) {
    .portrait::before {
      animation: slide-block 1s 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
    }
  }

  /* Scroll reveal. main.js tags elements with .reveal and a stagger delay,
     then adds .is-in as they enter the viewport. Only opacity is hidden
     here; the transform lives in the animation, so hover effects stay free. */
  .motion .reveal:not(.is-in) {
    opacity: 0;
  }

  .motion .reveal.is-in {
    animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) var(--d, 0ms) backwards;
  }

  /* The highlight under the key phrase draws itself in. */
  .statement__mark {
    transition: background-size 0.9s 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
  }

  .motion .statement:not(.is-in) .statement__mark {
    background-size: 0% 0.32em;
  }
}

/* ==========================================================================
   Contact panel, accent version
   A deep green panel with soft rings and a dot grid. The email card stays
   white so the main action is the brightest thing in the section.
   ========================================================================== */

.contact__panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(45% 70% at 8% 105%, rgb(120 215 120 / 0.55), transparent 70%),
    radial-gradient(35% 55% at 62% 0%, rgb(87 190 101 / 0.4), transparent 70%),
    linear-gradient(120deg, #1e7a3c 0%, #165a30 45%, var(--ink-deep) 100%);
}

/* Dot grid, fading out toward the lower left. */
.contact__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgb(200 240 200 / 0.4) 1.5px, transparent 1.5px);
  background-size: 1.5rem 1.5rem;
  -webkit-mask-image: linear-gradient(200deg, #000 0%, transparent 55%);
  mask-image: linear-gradient(200deg, #000 0%, transparent 55%);
}

/* Concentric halo in the top right corner. */
.contact__panel::after {
  content: "";
  position: absolute;
  top: -7rem;
  right: -7rem;
  z-index: -1;
  width: 20rem;
  height: 20rem;
  background: radial-gradient(closest-side, rgb(172 223 172 / 0.6), rgb(87 190 101 / 0.15) 70%, transparent);
  border: 2px solid rgb(172 223 172 / 0.6);
  border-radius: 50%;
  box-shadow:
    0 0 0 2.5rem rgb(172 223 172 / 0.12),
    0 0 0 5rem rgb(172 223 172 / 0.08),
    0 0 0 7.5rem rgb(172 223 172 / 0.05);
  pointer-events: none;
}

.contact__panel h2 {
  color: #fff;
}

/* Soft diagonal band of light across the panel. */
.contact__channels::before {
  content: "";
  position: absolute;
  inset: -50% -20%;
  z-index: -1;
  background: linear-gradient(115deg, transparent 40%, rgb(172 223 172 / 0.12) 40% 55%, transparent 55%);
  pointer-events: none;
}

/* A short green bar above the heading marks the section. */
.contact__panel h2::before {
  content: "";
  display: block;
  width: 3rem;
  height: 0.375rem;
  margin-bottom: 1.25rem;
  background: var(--green);
  border-radius: 999px;
}

.contact__copy {
  color: #d3e8d1;
}

.contact-email {
  color: var(--ink);
  box-shadow: 0 24px 40px -24px rgb(0 0 0 / 0.55);
}

/* Secondary links become quiet glass rows on the dark panel. */
.contact-link {
  color: #fff;
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(172 223 172 / 0.3);
  backdrop-filter: blur(4px);
}

.contact-link:hover {
  color: var(--ink);
  background: var(--green-soft);
  border-color: var(--green-soft);
}

.contact-link__hint {
  color: #c4dfc2;
  transition: color var(--ease);
}

.contact-link:hover .contact-link__hint {
  color: var(--ink-muted);
}

.contact-link:focus-visible,
.contact-email :focus-visible {
  outline-color: var(--green-soft);
}

.contact-email :focus-visible {
  outline-color: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .contact__panel::after {
    animation: halo 8s ease-in-out infinite alternate;
  }
}

@keyframes halo {
  to {
    transform: scale(1.12);
  }
}

/* ==========================================================================
   Experience accordion
   A native <details>: works without JavaScript, keyboard accessible, and
   collapsed by default.
   ========================================================================== */

.role--expandable {
  display: block;
  padding: 0;
}

.role__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "head chev"
    "period period";
  align-items: center;
  gap: 0.75rem 1rem;
  padding-block: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  cursor: pointer;
  list-style: none;
}

.role__summary::-webkit-details-marker {
  display: none;
}

.role__summary > div { grid-area: head; }
.role__summary .role__period { grid-area: period; }
.role__summary .role__chev { grid-area: chev; }

.role__chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition:
    background-color var(--ease),
    border-color var(--ease),
    transform 300ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.role__summary:hover .role__chev {
  background: var(--tint);
}

.role__details[open] .role__chev {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  transform: rotate(180deg);
}

.role__points {
  display: grid;
  gap: 0.875rem;
  max-width: 42rem;
  padding-bottom: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  color: var(--ink-muted);
  line-height: 1.6;
}

.role__points li {
  position: relative;
  padding-left: 1.5rem;
}

.role__points li::before {
  content: "";
  position: absolute;
  top: 0.8em;
  left: 0;
  width: 0.75rem;
  height: 2px;
  background: var(--green);
  border-radius: 1px;
}

@media (min-width: 40rem) {
  .role__summary {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "head period chev";
    column-gap: 1.5rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .role__details[open] .role__points li {
    animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  }

  .role__details[open] .role__points li:nth-child(2) { animation-delay: 80ms; }
  .role__details[open] .role__points li:nth-child(3) { animation-delay: 160ms; }

  /* Smooth height where the browser supports animating <details>. */
  @supports (interpolate-size: allow-keywords) {
    .role__details {
      interpolate-size: allow-keywords;
    }

    .role__details::details-content {
      block-size: 0;
      overflow: clip;
      transition:
        block-size 350ms cubic-bezier(0.2, 0.7, 0.3, 1),
        content-visibility 350ms allow-discrete;
    }

    .role__details[open]::details-content {
      block-size: auto;
    }
  }
}
