*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #080b10;
  --bg2: #0d1117;
  --bg3: #111820;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(0, 212, 255, 0.25);
  --cyan: #00d4ff;
  --green: #00ff88;
  --red: #e82020;
  --purple: #bb66ff;
  --pink: #e1306c;
  --text: #e8edf2;
  --text-muted: #5a6a7a;
  --mono: 'Space Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}

html { background: var(--bg); }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 3rem 0 4rem;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#torch {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,255,0.07) 0%, rgba(0,180,255,0.03) 35%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: left 0.12s ease, top 0.12s ease;
}

/* Layout */

.wrapper {
  position: relative;
  z-index: 1;
  margin: 0 2rem;
  padding-top: 48px;
  animation: fadeUp 0.6s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 460px;
  margin: 0 auto 2rem;
}

/* Lang toggle */

.lang-toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.lang-btn.active {
  background: var(--bg3);
  color: var(--cyan);
  border-color: rgba(0,212,255,0.2);
}

/* Avatar */

.avatar-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid var(--border-hover);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 212, 255, 0.7);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.avatar-wrap:hover .avatar-pulse-ring {
  animation: avatarRipple var(--ring-dur, 3.8s) ease-out infinite;
}

.avatar-wrap:hover .avatar-pulse-ring.r2 {
  animation-delay: calc(var(--ring-dur, 3.8s) * 0.25);
}

.avatar-wrap:hover .avatar-pulse-ring.r3 {
  animation-delay: calc(var(--ring-dur, 3.8s) * 0.5);
}

.avatar-wrap:hover .avatar-pulse-ring.r4 {
  animation-delay: calc(var(--ring-dur, 3.8s) * 0.75);
}

.sonar-dot {
  position: fixed;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.95);
  box-shadow: 0 0 5px rgba(0, 212, 255, 0.7), 0 0 10px rgba(0, 212, 255, 0.3);
  pointer-events: none;
  z-index: 100;
  transform: translate(-50%, -50%) scale(0);
  animation: sonarBlip 3.6s ease-out forwards;
}

@keyframes sonarBlip {
  0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0); }
  8%   { opacity: 1;   transform: translate(-50%, -50%) scale(1); }
  25%  { opacity: 0.7; }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(0.6); }
}

@keyframes avatarRipple {
  0%   { transform: scale(1);   opacity: 0.6; }
  30%  { transform: scale(2);   opacity: 0.1; }
  100% { transform: scale(4.2); opacity: 0; }
}

.avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(0,212,255,0.4);
}

.avatar-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px dashed rgba(0,212,255,0.2);
  animation: spin 14s linear infinite reverse;
}

.avatar-ring::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(0,212,255,0.15);
  animation: pulse 3s ease-in-out infinite;
}

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

@keyframes pulse {
  0%, 100% { opacity: 0.1;  transform: scale(0.92); box-shadow: 0 0 0px rgba(0,212,255,0); }
  50%       { opacity: 1;   transform: scale(1.12); box-shadow: 0 0 14px rgba(0,212,255,0.5); }
}

/* Profile text */

.name {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

.name span { color: var(--cyan); }

.bio {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  max-width: 320px;
}

.bio-interests {
  display: block;
  margin-top: 0.75rem;
  font-size: 12px;
  line-height: 1.9;
}

.tesla-driver {
  color: var(--cyan);
  font-size: 14px;
  font-weight: 500;
}

/* Links grid */

.section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-left: 1px;
}

.links-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.links-col {
  display: flex;
  flex-direction: column;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 760px) {
  .links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .links-col {
    display: flex;
    flex-direction: column;
    background: rgba(13, 17, 23, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(8px);
    animation: colFadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .links-col:nth-child(1) { animation-delay: 0.2s; }
  .links-col:nth-child(2) { animation-delay: 0.4s; }
  .links-col:nth-child(3) { animation-delay: 0.6s; }

  .links-col .links {
    flex: 1;
  }
}

@keyframes colFadeUp {
  from { opacity: 0; transform: translateY(48px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Link buttons */

.link-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.link-btn:hover  { transform: translateY(-1px); }
.link-btn:active { transform: scale(0.99); }

.link-btn.cyan:hover   { border-color: rgba(0,212,255,0.4);   background: rgba(0,212,255,0.04); }
.link-btn.green:hover  { border-color: rgba(0,255,136,0.35);  background: rgba(0,255,136,0.04); }
.link-btn.red:hover    { border-color: rgba(232,32,32,0.4);   background: rgba(232,32,32,0.04); }
.link-btn.purple:hover { border-color: rgba(187,102,255,0.4); background: rgba(187,102,255,0.04); }
.link-btn.white:hover  { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.03); }
.link-btn.pink:hover   { border-color: rgba(225,48,108,0.4);  background: rgba(225,48,108,0.04); }

.link-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.link-btn.cyan   .link-icon { background: rgba(0,212,255,0.1);    color: var(--cyan); }
.link-btn.green  .link-icon { background: rgba(0,255,136,0.1);    color: var(--green); }
.link-btn.red    .link-icon { background: rgba(232,32,32,0.1);    color: var(--red); }
.link-btn.purple .link-icon { background: rgba(187,102,255,0.1);  color: var(--purple); }
.link-btn.white  .link-icon { background: rgba(255,255,255,0.07); color: var(--text); }
.link-btn.pink   .link-icon { background: rgba(225,48,108,0.1);   color: var(--pink); }

.link-text { flex: 1; min-width: 0; }

.link-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.link-arrow {
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
}

.link-btn:hover        .link-arrow { transform: translateX(2px); }
.link-btn.cyan:hover   .link-arrow { color: var(--cyan); }
.link-btn.green:hover  .link-arrow { color: var(--green); }
.link-btn.red:hover    .link-arrow { color: var(--red); }
.link-btn.purple:hover .link-arrow { color: var(--purple); }
.link-btn.pink:hover   .link-arrow { color: var(--pink); }

/* Sysclock */

#sysclock {
  position: fixed;
  bottom: 1.6rem;
  left: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
  z-index: 10;
  opacity: 0.35;
}

#clock-time {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--cyan);
  letter-spacing: 1.5px;
}

#clock-unix {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Footer */

.footer {
  margin-top: 2.5rem;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  opacity: 0.5;
  text-align: center;
}

@media (max-width: 759px) {
  #sysclock, #torch { display: none; }
}

/* i18n */

:root[data-lang="fr"] [data-en] { display: none; }
:root[data-lang="en"] [data-fr] { display: none; }
:root:not([data-lang]) [data-en] { display: none; }
