/* Brand, language, and contact refinements. Loaded after global.css. */

img.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, #2d5d8c 78%, white 22%);
  border-radius: 13px;
  background: #2d5d8c;
  box-shadow: 0 10px 30px rgba(18, 57, 92, .34);
}

html[dir='rtl'] .eyebrow {
  font-family: var(--font-sans);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

html[dir='rtl'] .project-topline span:last-child,
html[dir='rtl'] .private-label,
html[dir='rtl'] .contact-response-note {
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
}

.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(340px, .97fr);
  gap: clamp(34px, 6vw, 80px);
  align-items: center;
  background:
    radial-gradient(circle at 86% 10%, rgba(108, 190, 239, .34), transparent 31%),
    linear-gradient(135deg, #173e64 0%, #285d8b 52%, #214f78 100%);
  box-shadow: 0 32px 90px rgba(17, 61, 96, .28);
}

.contact-card::before {
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .07), transparent 38%),
    repeating-linear-gradient(90deg, transparent 0 72px, rgba(255, 255, 255, .018) 73px);
}

.contact-intro {
  position: relative;
  z-index: 2;
}

.contact-card .contact-intro > p:not(.eyebrow, .contact-response-note) {
  max-width: 680px;
  margin: 25px 0 0;
  color: rgba(255, 255, 255, .76);
  font-size: .96rem;
  line-height: 1.95;
}

.contact-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.contact-response-note {
  margin: 22px 0 0;
  color: rgba(255, 255, 255, .58);
  font-family: var(--font-mono);
  font-size: .68rem;
}

.contact-channels {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
}

.contact-channel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 17px;
  background: rgba(255, 255, 255, .07);
  color: #fff;
  backdrop-filter: blur(14px);
  transition: transform .22s ease, border-color .22s ease, background .22s ease;
}

.contact-channel:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
}

.contact-channel-icon {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 13px;
  background: rgba(8, 29, 49, .28);
}

.contact-channel-icon svg {
  width: 21px;
  height: 21px;
}

.contact-channel-icon.linkedin span {
  font-family: Arial, sans-serif;
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: -.04em;
}

.contact-channel-copy {
  min-width: 0;
}

.contact-channel-copy strong {
  display: block;
  font-size: .84rem;
  font-weight: 700;
}

.contact-channel-copy small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: rgba(255, 255, 255, .58);
  font-family: var(--font-mono);
  font-size: .61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-channel-arrow {
  color: rgba(255, 255, 255, .58);
  font-family: var(--font-mono);
  transition: transform .2s ease, color .2s ease;
}

.contact-channel:hover .contact-channel-arrow {
  color: #fff;
  transform: translate(3px, -3px);
}

html[dir='rtl'] .contact-channel:hover .contact-channel-arrow {
  transform: translate(-3px, -3px);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.footer-brand > img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(18, 57, 92, .24);
}

.footer-brand p {
  margin-top: 4px;
}

/* Header controls use lightweight Lucide-compatible SVG paths without an icon runtime. */
.language-menu {
  position: relative;
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  min-width: 76px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: color .2s, border-color .2s, background .2s;
}

.language-trigger:hover,
.language-menu.open .language-trigger {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.language-trigger > svg:first-child {
  width: 16px;
  height: 16px;
}

.language-chevron {
  width: 13px;
  height: 13px;
  transition: transform .2s ease;
}

.language-menu.open .language-chevron {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  z-index: 80;
  inset-block-start: calc(100% + 9px);
  inset-inline-end: 0;
  width: 176px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px) scale(.98);
  transform-origin: top right;
  backdrop-filter: blur(18px) saturate(150%);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

html[dir='rtl'] .language-dropdown {
  transform-origin: top left;
}

.language-menu.open .language-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.language-dropdown button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: start;
  cursor: pointer;
}

.language-dropdown button:hover {
  background: var(--surface-hover);
}

.language-dropdown button > span {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.language-dropdown b {
  min-width: 23px;
  font-family: var(--font-mono);
  font-size: .72rem;
}

.language-dropdown small {
  color: var(--muted);
  font-size: .75rem;
}

.language-check {
  width: 15px;
  height: 15px;
  color: var(--accent-2);
}

.command-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.command-button svg,
.theme-toggle svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

/* GitHub-style contribution tiles inside the hero terminal. */
.code-map {
  --heat-0: #161b22;
  --heat-1: #0e4429;
  --heat-2: #006d32;
  --heat-3: #26a641;
  --heat-4: #39d353;
  height: 132px;
  padding: 10px 12px 9px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-solid) 84%, black 16%);
}

html[data-theme='light'] .code-map {
  --heat-0: #ebedf0;
  --heat-1: #9be9a8;
  --heat-2: #40c463;
  --heat-3: #30a14e;
  --heat-4: #216e39;
  background: rgba(255, 255, 255, .66);
}

.code-map::before,
.code-map::after {
  display: none;
}

.contribution-head,
.contribution-legend {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-2);
  direction: ltr;
  font-family: var(--font-mono);
  font-size: .52rem;
  line-height: 1;
}

.code-map .contribution-head span,
.code-map .contribution-legend span {
  position: static;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  opacity: 1;
}

.contribution-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  height: 76px;
  margin: 7px 0 6px;
  direction: ltr;
}

.code-map .contribution-cell,
.contribution-legend i {
  position: static;
  display: block;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 2px;
  background: var(--heat-0);
  opacity: 1;
}

.code-map .contribution-cell[data-level='1'],
.contribution-legend i[data-level='1'] { background: var(--heat-1); }
.code-map .contribution-cell[data-level='2'],
.contribution-legend i[data-level='2'] { background: var(--heat-2); }
.code-map .contribution-cell[data-level='3'],
.contribution-legend i[data-level='3'] { background: var(--heat-3); }
.code-map .contribution-cell[data-level='4'],
.contribution-legend i[data-level='4'] { background: var(--heat-4); }

.contribution-legend {
  justify-content: flex-end;
  gap: 3px;
}

.contribution-legend i {
  width: 8px;
  height: 8px;
}

html.locale-switching body {
  opacity: .72;
}

body {
  transition: opacity .12s ease;
}

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

  .contact-channels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  img.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .language-trigger {
    min-width: 68px;
    padding-inline: 8px;
  }

  .language-dropdown {
    width: 164px;
  }

  .contact-primary-actions .button {
    width: 100%;
  }

  .contact-channels {
    grid-template-columns: 1fr;
  }

  .contact-channel {
    min-height: 72px;
  }

  .code-map {
    inset-inline: 16px;
    height: 124px;
  }

  .contribution-grid {
    gap: 2px;
    height: 70px;
  }
}

@media (max-width: 430px) {
  html[dir='rtl'] .eyebrow {
    font-size: .76rem;
  }

  .footer-brand > img {
    width: 38px;
    height: 38px;
  }

  .language-trigger {
    min-width: 61px;
    gap: 5px;
  }

  .language-trigger > svg:first-child {
    width: 15px;
    height: 15px;
  }

  .language-chevron {
    display: none;
  }
}
