/* ==========================================================================
   Ignacio Rivera Portfolio — Main terminal interface
   ========================================================================== */

:root {
  --bg: #070b12;
  --panel: #0d1420;
  --panel-2: #0a111b;
  --cyan: #6ff7ff;
  --cyan-strong: #d9fdff;
  --muted: #67b8c2;
  --line: #173845;
  --accent: #8c7bff;
  --text: #deeff8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

a {
  color: inherit;
}

.terminal-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(35, 217, 255, 0.14), transparent 26%),
    radial-gradient(circle at 82% 70%, rgba(140, 123, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #0a0f18 0%, #060a11 100%);
}

.terminal-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.01) 0,
      rgba(255, 255, 255, 0.01) 1px,
      rgba(0, 0, 0, 0.025) 2px,
      rgba(0, 0, 0, 0.025) 4px
    );
  opacity: 0.18;
}

.terminal-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 21;
  pointer-events: none;
  box-shadow:
    inset 0 0 90px rgba(0, 0, 0, 0.42),
    inset 0 0 34px rgba(35, 217, 255, 0.04);
}

.terminal-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: clamp(28px, 4vw, 58px);
  animation: subtle-flicker 14s infinite;
}

.system-header {
  position: absolute;
  top: clamp(28px, 4vw, 58px);
  left: clamp(28px, 4vw, 58px);
  display: grid;
  gap: 2px;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.system-header strong {
  color: var(--cyan);
  font-weight: 500;
}

.profile-panel {
  border-bottom: none;
  position: absolute;
  left: clamp(28px, 4vw, 58px);
  top: 24%;
  width: min(54vw, 820px);
}

.profile-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: clamp(13px, 1vw, 16px);
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(35, 217, 255, 0.55);
  flex: 0 0 auto;
}

.profile-lines {
  display: grid;
  gap: 3px;
}

.profile-line {
  min-height: 1.35em;
  font-size: clamp(22px, 2vw, 34px);
  line-height: 1.34;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--cyan);
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(35, 217, 255, 0.12);
}


.identity {
  position: absolute;
  left: clamp(28px, 4vw, 58px);
  bottom: clamp(82px, 7vw, 108px);
  width: min(50vw, 760px);
}

.identity-tag {
  margin-bottom: 10px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.16em;
}

.name {
  margin: 0;
  min-height: 1em;
  font-family: "Orbitron", "IBM Plex Mono", monospace;
  font-size: clamp(52px, 6.2vw, 110px);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cyan-strong);
  text-shadow:
    0 0 10px rgba(35, 217, 255, 0.16),
    0 0 28px rgba(140, 123, 255, 0.1);
}

.identity-role {
  margin-top: 14px;
  color: var(--cyan);
  font-size: clamp(13px, 1.15vw, 17px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.identity-meta {
  margin-top: 9px;
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.professional-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  z-index: 4;
}

.terminal-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 0;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid rgba(111, 247, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(111, 247, 255, 0.055), rgba(140, 123, 255, 0.025)),
    rgba(8, 15, 24, 0.7);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.015),
    0 8px 22px rgba(0, 0, 0, 0.14);
  font-size: 11px;
  line-height: 1.15;
  letter-spacing: 0.11em;
  color: #b9eef3;
  text-decoration: none;
  text-transform: uppercase;
  white-space: normal;
  text-align: center;
  overflow: hidden;
  overflow-wrap: anywhere;
  transition:
    color 0.16s linear,
    transform 0.16s linear,
    border-color 0.16s linear,
    background 0.16s linear,
    box-shadow 0.16s linear;
}

.terminal-link::before {
  content: ">";
  flex: 0 0 auto;
  margin-right: 8px;
  color: var(--cyan);
  opacity: 1;
}

.terminal-link:hover,
.terminal-link:focus-visible {
  color: #ffffff;
  border-color: rgba(111, 247, 255, 0.58);
  background:
    linear-gradient(180deg, rgba(111, 247, 255, 0.11), rgba(140, 123, 255, 0.055)),
    rgba(8, 15, 24, 0.88);
  box-shadow:
    0 0 0 1px rgba(111, 247, 255, 0.08),
    0 0 24px rgba(35, 217, 255, 0.08);
  transform: translateY(-2px);
  outline: none;
}

.right-column {
  position: absolute;
  right: clamp(28px, 4vw, 58px);
  top: 50%;
  transform: translateY(-50%);
  width: min(35vw, 570px);
}

.projects-panel {
  position: relative;
  width: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    linear-gradient(180deg, rgba(35, 217, 255, 0.02), rgba(140, 123, 255, 0.02)),
    var(--panel-2);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.terminal-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  opacity: 0.72;
}

.terminal-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4f5f63;
}

.projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.projects-list {
  border-top: 1px solid var(--line);
}

.project {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition:
    padding-left 0.14s steps(2, end),
    background-color 0.14s linear;
}

.project:hover,
.project:focus-visible {
  padding-left: 10px;
  outline: none;
  background:
    linear-gradient(90deg, rgba(35, 217, 255, 0.06), rgba(140, 123, 255, 0.04));
}

.project-index {
  padding-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.project-title {
  margin: 0;
  min-height: 1.25em;
  font-size: clamp(20px, 1.7vw, 30px);
  line-height: 1.18;
  font-weight: 600;
  color: var(--cyan-strong);
  letter-spacing: 0.01em;
}

.project-sub {
  margin: 8px 0 0;
  min-height: 1.5em;
  font-size: 10px;
  line-height: 1.7;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.projects-foot {
  margin-top: 16px;
  text-align: right;
  color: #3a7079;
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* The underscore is only visible on active typewriter lines. */
.type-line {
  position: relative;
  white-space: pre-wrap;
}

.type-line::after {
  content: "";
  display: inline-block;
  width: 0;
  overflow: hidden;
}

.type-line.cursor-active::after {
  content: "_";
  width: auto;
  margin-left: 0.03ch;
  position: relative;
  top: 0.22em;
  line-height: 1;
  color: currentColor;
  text-shadow:
    0 0 8px rgba(35, 217, 255, 0.28),
    0 0 18px rgba(140, 123, 255, 0.14);
  animation: cursor-blink 1.35s steps(1, end) infinite;
}

.terminal-screen.is-clearing .wipe-target {
  opacity: 0;
  transition: opacity 0.15s steps(2, end);
}


.terminal-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  max-width: min(90vw, 620px);
  transform: translate(-50%, 20px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 17, 27, 0.96);
  color: var(--cyan);
  font-size: 11px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.terminal-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes cursor-blink {
  0%,
  47% { opacity: 1; }
  48%,
  100% { opacity: 0; }
}

@keyframes subtle-flicker {
  0%,
  100% { opacity: 1; }
  44% { opacity: 1; }
  44.2% { opacity: 0.988; }
  44.4% { opacity: 1; }
  78% { opacity: 1; }
  78.15% { opacity: 0.993; }
  78.3% { opacity: 1; }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .terminal-screen {
    display: grid;
    gap: 58px;
    min-height: 100svh;
    padding: 24px 22px 34px;
  }

  .system-header,
  .profile-panel,
  .identity,
  .right-column {
    position: relative;
    inset: auto;
    transform: none;
    width: 100%;
  }

  .system-header {
    order: 1;
  }

  .profile-panel {
  border-bottom: none;
    order: 2;
  }

  .identity {
    order: 3;
  }

  .right-column {
    order: 4;
  }

  .professional-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 16px;
    padding: 0;
  }
}

@media (max-width: 620px) {
  .terminal-screen {
    gap: 42px;
    padding: 20px 16px 30px;
  }

  .profile-line {
    font-size: clamp(18px, 5.8vw, 26px);
  }

  .name {
    font-size: clamp(42px, 14vw, 68px);
  }

  .right-column {
    width: 100%;
  }

  .projects-panel {
    padding: 18px 16px;
  }

  .professional-links {
    grid-template-columns: 1fr;
  }

  .terminal-link {
    justify-content: flex-start;
    min-height: 46px;
    padding-inline: 14px;
  }
}

@media (orientation: landscape) and (max-height: 700px) {
  body {
    overflow: auto;
  }

  .terminal-screen {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    grid-template-areas:
      "system projects"
      "profile projects"
      "identity projects";
    gap: 22px 34px;
    min-height: 100vh;
    padding: 20px 24px 28px;
  }

  .system-header,
  .profile-panel,
  .identity,
  .right-column {
    position: relative;
    inset: auto;
    transform: none;
    width: 100%;
  }

  .system-header {
    grid-area: system;
  }

  .profile-panel {
    grid-area: profile;
  }

  .identity {
    grid-area: identity;
  }

  .right-column {
    grid-area: projects;
    align-self: start;
  }

  .profile-line {
    font-size: clamp(18px, 2.4vw, 27px);
  }

  .name {
    font-size: clamp(44px, 6.6vw, 76px);
  }

  .projects-panel {
    padding: 16px;
  }

  .project {
    padding: 14px 0;
  }

  .professional-links {
    grid-template-columns: 1fr;
    margin-top: 10px;
  }

  .terminal-link {
    min-height: 38px;
    padding: 9px 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .terminal-screen,
  .type-line.cursor-active::after {
    animation: none;
  }

  * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}


.terminal-link--contact {
  position: relative;
  overflow: hidden;
  border-color: rgba(111, 247, 255, 0.62);
  background:
    linear-gradient(135deg, rgba(35, 217, 255, 0.16), rgba(140, 123, 255, 0.14)),
    rgba(8, 15, 24, 0.86);
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(111, 247, 255, 0.08),
    0 0 28px rgba(35, 217, 255, 0.10),
    inset 0 0 22px rgba(111, 247, 255, 0.035);
}

.terminal-link--contact::after {
  content: "↗";
  margin-left: 8px;
  color: var(--cyan);
  font-size: 12px;
}

.terminal-link--contact:hover,
.terminal-link--contact:focus-visible {
  border-color: rgba(111, 247, 255, 0.9);
  background:
    linear-gradient(135deg, rgba(35, 217, 255, 0.24), rgba(140, 123, 255, 0.18)),
    rgba(8, 15, 24, 0.96);
  box-shadow:
    0 0 0 1px rgba(111, 247, 255, 0.13),
    0 0 36px rgba(35, 217, 255, 0.16),
    inset 0 0 24px rgba(111, 247, 255, 0.05);
}

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


.language-switch {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid rgba(111, 247, 255, 0.22);
  border-radius: 8px;
  background: rgba(7, 11, 18, 0.78);
  backdrop-filter: blur(10px);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lang-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
}

.lang-button:hover,
.lang-button:focus-visible {
  color: var(--cyan-strong);
  outline: none;
}

.lang-button.is-active {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(111, 247, 255, 0.28);
}

@media (max-width: 640px) {
  .language-switch {
    top: 12px;
    right: 12px;
  }
}


/* ==========================================================================
   Theme controls
   ========================================================================== */

:root {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="light"] body,
html[data-theme="light"] .terminal-shell,
html[data-theme="light"] .projects-page,
html[data-theme="light"] .contact-page {
  --bg: #eef4f6;
  --panel: #ffffff;
  --panel-2: #f6fafb;
  --cyan: #006f7b;
  --cyan-strong: #07343b;
  --muted: #4f7177;
  --line: #b8cdd1;
  --accent: #5c54d6;
  --text: #13272b;
}

html[data-theme="light"] .terminal-shell,
html[data-theme="light"] .projects-page,
html[data-theme="light"] .contact-page {
  background:
    radial-gradient(circle at 18% 18%, rgba(0, 111, 123, 0.08), transparent 28%),
    radial-gradient(circle at 82% 74%, rgba(92, 84, 214, 0.07), transparent 30%),
    linear-gradient(180deg, #f7fbfc 0%, #edf4f6 100%);
}

html[data-theme="light"] .terminal-shell::before,
html[data-theme="light"] .projects-page::before,
html[data-theme="light"] .contact-page::before {
  opacity: 0.06;
}

html[data-theme="light"] .terminal-shell::after {
  box-shadow:
    inset 0 0 80px rgba(0, 35, 42, 0.06),
    inset 0 0 28px rgba(0, 111, 123, 0.03);
}

html[data-theme="light"] .projects-panel,
html[data-theme="light"] .contact-form-panel,
html[data-theme="light"] .project-screen,
html[data-theme="light"] .contact-card,
html[data-theme="light"] .terminal-link,
html[data-theme="light"] .language-switch,
html[data-theme="light"] .theme-switch {
  background: rgba(255, 255, 255, 0.84);
}

html[data-theme="light"] .project-summary,
html[data-theme="light"] .info-block p,
html[data-theme="light"] .intro-copy,
html[data-theme="light"] .contact-card-value,
html[data-theme="light"] .form-field input,
html[data-theme="light"] .form-field textarea {
  color: #29454b;
}

html[data-theme="light"] .form-field input,
html[data-theme="light"] .form-field textarea {
  background: #ffffff;
}

html[data-theme="light"] .image-placeholder {
  background:
    linear-gradient(rgba(0, 111, 123, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 111, 123, 0.035) 1px, transparent 1px),
    #f7fbfc;
  background-size: 34px 34px;
}

.theme-switch {
  position: fixed;
  top: 18px;
  right: 112px;
  z-index: 100;
}

.theme-button {
  min-height: 32px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(111, 247, 255, 0.22);
  border-radius: 8px;
  background: rgba(7, 11, 18, 0.78);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.theme-button:hover,
.theme-button:focus-visible {
  color: var(--cyan-strong);
  border-color: rgba(111, 247, 255, 0.52);
  outline: none;
}

.theme-icon {
  color: var(--cyan);
  font-size: 12px;
}

html[data-theme="light"] .theme-button {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 111, 123, 0.24);
  color: #4f7177;
}

@media (max-width: 700px) {
  .theme-switch {
    top: 12px;
    right: 98px;
  }

  .theme-label {
    display: none;
  }

  .theme-button {
    width: 34px;
    min-width: 34px;
    justify-content: center;
    padding-inline: 0;
  }
}

.terminal-link--about {
  border-color: rgba(111, 247, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(111, 247, 255, 0.075), rgba(140, 123, 255, 0.025)),
    rgba(8, 15, 24, 0.72);
}

html[data-theme="light"] .terminal-link--about {
  background:
    linear-gradient(180deg, rgba(0, 111, 123, 0.065), rgba(92, 84, 214, 0.025)),
    rgba(255, 255, 255, 0.82);
}


html[data-theme="light"] .terminal-link,
html[data-theme="light"] .about-action,
html[data-theme="light"] .action-link,
html[data-theme="light"] .copy-button,
html[data-theme="light"] .send-button,
html[data-theme="light"] .theme-button,
html[data-theme="light"] .lang-button,
html[data-theme="light"] .back-link {
  color: #17383e;
}

html[data-theme="light"] .terminal-link::before,
html[data-theme="light"] .theme-icon,
html[data-theme="light"] .lang-button.is-active,
html[data-theme="light"] .about-action--primary,
html[data-theme="light"] .action-link {
  color: #005f69;
}

html[data-theme="light"] .terminal-link:hover,
html[data-theme="light"] .terminal-link:focus-visible,
html[data-theme="light"] .about-action:hover,
html[data-theme="light"] .about-action:focus-visible,
html[data-theme="light"] .action-link:hover,
html[data-theme="light"] .action-link:focus-visible,
html[data-theme="light"] .copy-button:hover,
html[data-theme="light"] .copy-button:focus-visible,
html[data-theme="light"] .theme-button:hover,
html[data-theme="light"] .theme-button:focus-visible,
html[data-theme="light"] .lang-button:hover,
html[data-theme="light"] .lang-button:focus-visible {
  color: #072f35;
}


/* Lower-priority CTAs sit on a second row for clearer hierarchy. */
.terminal-link--about,
.terminal-link--contact {
  margin-top: 8px;
}

.terminal-link--about {
  grid-column: 2;
}

.terminal-link--contact {
  grid-column: 3;
}

/* Keep the icon inside the contact button rather than extending its box. */
.terminal-link--contact::after {
  flex: 0 0 auto;
  margin-left: 7px;
}


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

  .terminal-link--about,
  .terminal-link--contact {
    grid-column: auto;
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  .professional-links {
    grid-template-columns: 1fr;
  }

  .terminal-link {
    justify-content: flex-start;
    text-align: left;
    min-height: 46px;
    padding: 12px 14px;
  }

  .terminal-link--about,
  .terminal-link--contact {
    margin-top: 2px;
  }
}


/* Actions integrated inside the projects panel */
.projects-panel {
  display: flex;
  flex-direction: column;
}

.projects-panel .professional-links {
  width: 100%;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(111, 247, 255, 0.16);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.projects-panel .terminal-link {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 11px 12px;
  justify-content: center;
  overflow: hidden;
}

.projects-panel .terminal-link--about,
.projects-panel .terminal-link--contact {
  margin-top: 0;
}

html[data-theme="light"] .projects-panel .professional-links {
  border-top-color: rgba(0, 95, 105, 0.18);
}

@media (max-width: 980px) {
  .projects-panel .professional-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .projects-panel .professional-links {
    grid-template-columns: 1fr;
  }

  .projects-panel .terminal-link {
    justify-content: flex-start;
    text-align: left;
  }
}


/* ==========================================================================
   v38 — Primary CTAs + right-side professional tab
   ========================================================================== */

/* Keep only About + Contact inside the project panel. */
.projects-panel .professional-links--primary {
  width: 100%;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(111, 247, 255, 0.16);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Reset legacy positioning from earlier versions. */
.projects-panel .professional-links--primary .terminal-link--about,
.projects-panel .professional-links--primary .terminal-link--contact {
  grid-column: auto;
  margin-top: 0;
}

/* New CTA language: less "utility button", more clear action. */
.projects-panel .professional-links--primary .terminal-link {
  min-width: 0;
  min-height: 52px;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
  white-space: normal;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.projects-panel .professional-links--primary .terminal-link::before {
  content: none;
}

.projects-panel .terminal-link--about {
  border-color: rgba(111, 247, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(111, 247, 255, 0.08), rgba(140, 123, 255, 0.035)),
    rgba(8, 15, 24, 0.74);
  color: #d7fbff;
}

.projects-panel .terminal-link--about::after {
  content: "01";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.projects-panel .terminal-link--contact {
  border-color: rgba(111, 247, 255, 0.68);
  background:
    linear-gradient(135deg, rgba(35, 217, 255, 0.22), rgba(140, 123, 255, 0.14)),
    rgba(8, 15, 24, 0.88);
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(111, 247, 255, 0.05),
    0 0 24px rgba(35, 217, 255, 0.10);
}

.projects-panel .terminal-link--contact::after {
  content: "↗";
  flex: 0 0 auto;
  margin-left: 0;
  color: var(--cyan);
  font-size: 13px;
}

.projects-panel .professional-links--primary .terminal-link:hover,
.projects-panel .professional-links--primary .terminal-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(111, 247, 255, 0.9);
  box-shadow:
    0 0 0 1px rgba(111, 247, 255, 0.06),
    0 10px 24px rgba(0, 0, 0, 0.18),
    0 0 28px rgba(35, 217, 255, 0.11);
}

/* Light mode */
html[data-theme="light"] .social-tab {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 95, 105, 0.18);
  box-shadow: -8px 16px 34px rgba(26, 64, 70, 0.10);
}

html[data-theme="light"] .social-tab__link {
  color: #274e55;
  border-bottom-color: rgba(0, 95, 105, 0.12);
}

html[data-theme="light"] .social-tab__link:hover,
html[data-theme="light"] .social-tab__link:focus-visible {
  color: #004f58;
  background: rgba(0, 95, 105, 0.06);
}

html[data-theme="light"] .social-tab__label {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 95, 105, 0.16);
  color: #153f46;
}

html[data-theme="light"] .projects-panel .terminal-link--about {
  color: #183e45;
  background:
    linear-gradient(135deg, rgba(0, 111, 123, 0.07), rgba(92, 84, 214, 0.025)),
    rgba(255, 255, 255, 0.84);
}

html[data-theme="light"] .projects-panel .terminal-link--contact {
  color: #0b3036;
  border-color: rgba(0, 95, 105, 0.46);
  background:
    linear-gradient(135deg, rgba(0, 111, 123, 0.12), rgba(92, 84, 214, 0.07)),
    rgba(255, 255, 255, 0.92);
}

/* Responsive */
@media (max-width: 980px) {
  .social-tab {
    top: auto;
    right: 14px;
    bottom: 14px;
    transform: none;
    flex-direction: row;
    border-right: 1px solid rgba(111, 247, 255, 0.16);
    border-radius: 10px;
    overflow: hidden;
  }

  .social-tab__link,
  .social-tab__link:hover,
  .social-tab__link:focus-visible {
    width: 44px;
    height: 44px;
    border-bottom: 0;
    border-right: 1px solid rgba(111, 247, 255, 0.10);
    border-radius: 0;
    box-shadow: none;
  }

  .social-tab__link:last-child {
    border-right: 0;
  }

  .social-tab__short {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .social-tab__label {
    display: none;
  }
}

@media (max-width: 620px) {
  .projects-panel .professional-links--primary {
    grid-template-columns: 1fr;
  }

  .projects-panel .professional-links--primary .terminal-link {
    min-height: 50px;
  }

  .social-tab {
    right: 10px;
    bottom: 10px;
  }

  .social-tab__link {
    width: 42px;
    height: 42px;
  }
}





/* ==========================================================================
   Global top-right controls: professional links + theme + language
   ========================================================================== */

.global-links {
  position: fixed;
  top: 18px;
  right: 202px;
  z-index: 101;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.global-link {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(111, 247, 255, 0.22);
  border-radius: 8px;
  background: rgba(7, 11, 18, 0.78);
  backdrop-filter: blur(10px);
  color: var(--muted);
  text-decoration: none;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition:
    color 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.global-link:hover,
.global-link:focus-visible {
  color: var(--cyan-strong);
  border-color: rgba(111, 247, 255, 0.52);
  background: rgba(111, 247, 255, 0.07);
  transform: translateY(-1px);
  outline: none;
}

html[data-theme="light"] .global-link {
  color: #23474e;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 95, 105, 0.22);
}

html[data-theme="light"] .global-link:hover,
html[data-theme="light"] .global-link:focus-visible {
  color: #06373e;
  border-color: rgba(0, 95, 105, 0.46);
  background: rgba(0, 95, 105, 0.055);
}

@media (max-width: 760px) {
  .global-links {
    top: 12px;
    right: 174px;
    gap: 4px;
  }

  .global-link {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 560px) {
  .global-links {
    position: static;
    margin-left: auto;
    margin-bottom: 8px;
  }
}


@media (max-width: 560px) {
  .global-links {
    position: fixed;
    top: 12px;
    left: 12px;
    right: auto;
    margin: 0;
  }
}


/* Refined external-link icon buttons */
.global-link {
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.015),
    0 8px 20px rgba(0,0,0,0.12);
}

.global-link__icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.global-link__icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.global-link:hover .global-link__icon,
.global-link:focus-visible .global-link__icon {
  transform: scale(1.05);
}

.global-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 16px rgba(111,247,255,0.05);
  pointer-events: none;
}

html[data-theme="light"] .global-link::after {
  box-shadow: inset 0 0 14px rgba(0,95,105,0.035);
}


/* ==========================================================================
   2026-10 light-mode contrast + CV control
   ========================================================================== */
html[data-theme="light"] .system-header,
html[data-theme="light"] .profile-heading,
html[data-theme="light"] .identity-tag,
html[data-theme="light"] .identity-meta,
html[data-theme="light"] .projects-foot,
html[data-theme="light"] .project-index,
html[data-theme="light"] .project-sub {
  color: #35575d;
}

html[data-theme="light"] .profile-line,
html[data-theme="light"] .identity-role,
html[data-theme="light"] .project-title {
  color: #064f59;
  text-shadow: none;
}

html[data-theme="light"] .projects-panel .professional-links--primary .terminal-link {
  color: #f7fbfc;
  border-color: #0b5059;
  background: #0b5059;
}

html[data-theme="light"] .projects-panel .professional-links--primary .terminal-link:hover,
html[data-theme="light"] .projects-panel .professional-links--primary .terminal-link:focus-visible {
  color: #ffffff;
  border-color: #073a42;
  background: #073a42;
}

html[data-theme="light"] .projects-panel .terminal-link--about::after,
html[data-theme="light"] .projects-panel .terminal-link--contact::after {
  color: #dff9fc;
}


/* Visible CV download control */
.global-link--cv {
  width: auto;
  min-width: 58px;
  padding-inline: 9px;
  gap: 6px;
}
.global-link--cv .global-link__icon {
  width: 14px;
  height: 14px;
}
.global-link__label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .08em;
}
@media (max-width: 560px) {
  .global-link--cv { min-width: 52px; padding-inline: 7px; }
}
