/* ═══════════════════════════════════════════════════════════════════════
   CLOSING SECTIONS (Home, Work, About)
   1. The CV strip: a centred two-line headline, the second line muted and
      stepped in to the right, with the "View my CV" pill underneath.
   2. Contact: the last section before the footer. Three channels side by
      side, each a centred label over its link.
   Loaded after style.css, which holds the base .contact-strip rules and
   the CV focus state (the waving sheet behind the headline).
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. CV strip, centred ─────────────────────────────────────────── */
.contact-strip--centred {
  padding-block: clamp(6rem, 11vw, 10rem) clamp(7rem, 13.5vw, 12.5rem);
}

.contact-strip--centred .contact-strip__inner {
  justify-content: center;
  align-items: center;
}

.contact-strip--centred .contact-strip__left {
  flex: none;
  max-width: 100%;
  align-items: center;
  gap: clamp(2rem, 3vw, 2.75rem);
}

.contact-strip--centred .contact-strip__headline {
  max-width: none;
  font-size: clamp(1.375rem, 6vw, 3rem);
  line-height: 1.12;
  text-align: left;
}

.contact-strip__line {
  display: block;
}

.contact-strip__line--quiet {
  padding-left: 1.9em;
  color: rgba(255, 255, 255, 0.45);
}

.contact-strip--centred .contact-strip__btn-wrap {
  margin-top: 0;
  justify-content: center;
}

/* ── 2. Contact ───────────────────────────────────────────────────── */
.contact-end {
  position: relative;
  z-index: 2;
  width: 100%;
  background-color: #111110; /* the page colour */
  color: #ffffff;
  padding-block: 0 clamp(2.5rem, 4vw, 3.5rem);
  scroll-margin-top: calc(var(--nav-height) + 16px);
}

.contact-end__inner {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.contact-end .contact-strip__links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 2rem);
}

.contact-end .contact-strip__link,
.contact-end .contact-strip__link:first-child {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 20px 0 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
}

.contact-end .contact-strip__link:hover {
  border-top-color: rgba(255, 255, 255, 0.3);
}

.contact-end .contact-strip__link:focus-visible {
  outline: 2px solid #f0ab3c;
  outline-offset: 6px;
  border-radius: 4px;
}

.contact-end .contact-strip__link-label {
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.5);
}

.contact-end .contact-strip__link-value {
  max-width: 100%;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.005em;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .contact-strip__line--quiet {
    padding-left: 1.2em;
  }

  .contact-end .contact-strip__links {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .contact-end .contact-strip__link,
  .contact-end .contact-strip__link:first-child {
    padding: 18px 0 20px 0;
  }

  .contact-end .contact-strip__link:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* ── 3. Paper plane on the Email channel (contact-plane.js) ───────────
   The "sky" is a zero-height layer sitting exactly on the line above
   "Email"; the plane, its trail and the landing ripple are placed in it. */
.contact-plane-sky {
  position: absolute;
  left: 0;
  top: -1px;
  width: 100%;
  height: 0;
  pointer-events: none;
}

.contact-plane {
  position: absolute;
  left: -9px;
  top: -9px;
  width: 18px;
  height: 18px;
  color: #ffffff;
  opacity: 0;
  will-change: transform;
}

.contact-plane.is-flying {
  opacity: 1;
}

.contact-plane svg {
  display: block;
  width: 100%;
  height: 100%;
}

.contact-plane-trail {
  position: absolute;
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background-color: #ffffff;
  animation: contact-plane-trail 0.55s ease-out forwards;
}

@keyframes contact-plane-trail {
  from { opacity: 0.7; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.2) translateY(4px); }
}

/* Landing: a short bright stretch of the line spreads out and fades */
.contact-plane-plop {
  position: absolute;
  top: 0;
  width: 72px;
  height: 1px;
  margin-left: -36px;
  background: linear-gradient(to right, transparent, #ffffff, transparent);
  opacity: 0;
  transform: scaleX(0.1);
}

.contact-plane-plop.is-on {
  animation: contact-plane-plop 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes contact-plane-plop {
  0%   { opacity: 1; transform: scaleX(0.1); }
  100% { opacity: 0; transform: scaleX(1.6); }
}

/* ── LinkedIn and Behance moments ─────────────────────────────────────
   A small window standing on the line; whatever plays in it starts below
   the line (hidden) and rises into view, so it seems to come out of it. */
.contact-flourish {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 120px;
  height: 72px;
  margin-left: -60px;
  overflow: hidden;
  color: #ffffff;
}

.contact-flourish__riser {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  transform: translateY(26px);
}

.contact-flourish__riser svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* LinkedIn: connect, then connected */
.contact-flourish--connect.is-playing .contact-flourish__riser {
  animation: contact-rise 1.9s cubic-bezier(0.3, 0, 0.2, 1) both;
}

@keyframes contact-rise {
  0%   { transform: translateY(26px); }
  16%  { transform: translateY(-20px); }
  23%  { transform: translateY(-15px); }
  80%  { transform: translateY(-15px); }
  100% { transform: translateY(26px); }
}

.contact-flourish__plus {
  transform-box: fill-box;
  transform-origin: center;
}

.contact-flourish__tick {
  stroke-dasharray: 9;
  stroke-dashoffset: 9;
}

.contact-flourish--connect.is-playing .contact-flourish__plus {
  animation: contact-plus 1.9s ease both;
}

.contact-flourish--connect.is-playing .contact-flourish__tick {
  animation: contact-tick 1.9s ease both;
}

@keyframes contact-plus {
  0%, 36% { opacity: 1; transform: rotate(0deg) scale(1); }
  48%     { opacity: 0; transform: rotate(90deg) scale(0.4); }
  100%    { opacity: 0; transform: rotate(90deg) scale(0.4); }
}

@keyframes contact-tick {
  0%, 44% { stroke-dashoffset: 9; }
  60%     { stroke-dashoffset: 0; }
  100%    { stroke-dashoffset: 0; }
}

/* Behance: three frames rise, fan out, gather, and drop back */
.contact-flourish--work .contact-flourish__riser {
  width: 16px;
  height: 20px;
  margin-left: -8px;
  transform: none;
}

.contact-flourish--work i {
  position: absolute;
  inset: 0;
  border: 1.5px solid #ffffff;
  border-radius: 3px;
  background-color: #111110;
  transform: translateY(26px);
  transform-origin: 50% 100%;
}

.contact-flourish--work i:nth-child(1) { --fx: -19px; --fr: -16deg; --fy: -13px; }
.contact-flourish--work i:nth-child(2) { --fx: 19px;  --fr: 16deg;  --fy: -13px; }
.contact-flourish--work i:nth-child(3) { --fx: 0px;   --fr: 0deg;   --fy: -19px; }

.contact-flourish--work.is-playing i {
  animation: contact-fan 1.9s cubic-bezier(0.3, 0, 0.2, 1) both;
}

@keyframes contact-fan {
  0%   { transform: translate(0, 26px) rotate(0deg); }
  16%  { transform: translate(0, -18px) rotate(0deg); }
  24%  { transform: translate(0, -14px) rotate(0deg); }
  44%  { transform: translate(var(--fx), var(--fy)) rotate(var(--fr)); }
  70%  { transform: translate(var(--fx), var(--fy)) rotate(var(--fr)); }
  84%  { transform: translate(0, -14px) rotate(0deg); }
  100% { transform: translate(0, 26px) rotate(0deg); }
}
