/* ============================================================
   Leonardo AF // dev — Single Page Portfolio
   ============================================================ */

:root {
  --bg: #0a0e1a;
  --bg-2: #0f1424;
  --panel: rgba(17, 22, 38, 0.72);
  --panel-border: rgba(120, 180, 255, 0.12);
  --text: #d8e1f0;
  --text-dim: #8a93a8;
  --accent: #5eead4;        /* teal */
  --accent-2: #818cf8;      /* indigo */
  --accent-3: #f472b6;      /* pink */
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
  --shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6),
            0 0 0 1px rgba(120, 180, 255, 0.06);
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse at top, #131a2e 0%, var(--bg) 55%, #05070d 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Background layers
   ============================================================ */

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 180, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 180, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.9), transparent 75%);
  pointer-events: none;
  z-index: 0;
}

#matrix {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   Layout
   ============================================================ */

.container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
}

/* ============================================================
   Terminal card
   ============================================================ */

.terminal {
  width: 100%;
  max-width: 640px;
  background: var(--panel);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.7s ease both;
}

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

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
  border-bottom: 1px solid var(--panel-border);
}

.terminal__dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot--red    { background: var(--red); }
.dot--yellow { background: var(--yellow); }
.dot--green  { background: var(--green); box-shadow: 0 0 12px rgba(52, 211, 153, 0.6); }

.dot--inline {
  width: 8px;
  height: 8px;
  vertical-align: middle;
  margin-right: 6px;
}

.terminal__title {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-dim);
  flex: 1;
  text-align: center;
  user-select: none;
}

.terminal__spacer {
  width: 52px; /* mirror dots width */
}

.terminal__body {
  padding: 28px 28px 24px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
}

/* ============================================================
   Profile section
   ============================================================ */

.profile {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.profile__avatar {
  position: relative;
  flex-shrink: 0;
}

.profile__avatar img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--bg-2), var(--bg-2)) padding-box,
    linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3)) border-box;
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.08),
              0 8px 30px rgba(94, 234, 212, 0.2);
}

.profile__status {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: var(--green);
  border: 2px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.15); opacity: 0.85; }
}

.profile__meta {
  flex: 1;
  min-width: 0;
}

.name {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 6px 0 4px;
}

.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.role {
  color: var(--text-dim);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.bracket {
  color: var(--accent);
  opacity: 0.7;
}

#typed {
  color: var(--accent);
}

.caret {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  to { visibility: hidden; }
}

/* ============================================================
   Command lines
   ============================================================ */

.line {
  color: var(--text-dim);
  font-size: 13px;
  margin: 14px 0 6px;
}

.prompt {
  color: var(--accent);
  margin-right: 6px;
  user-select: none;
}

.cmd {
  color: var(--text);
}

/* ============================================================
   Bio
   ============================================================ */

.bio {
  margin-bottom: 22px;
}

.bio__text {
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.65;
  padding: 4px 0 0;
  max-width: 56ch;
}

/* ============================================================
   Links
   ============================================================ */

.links__grid {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: transform 0.2s ease,
              background 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.08), rgba(129, 140, 248, 0.08));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.link:hover,
.link:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(94, 234, 212, 0.35);
  box-shadow: 0 12px 30px -12px rgba(94, 234, 212, 0.35);
  outline: none;
}

.link:hover::before,
.link:focus-visible::before {
  opacity: 1;
}

.link__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--accent);
  position: relative;
  z-index: 1;
}

.link__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.link__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.link__handle {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link__arrow {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  transition: transform 0.25s ease;
  position: relative;
  z-index: 1;
}

.link:hover .link__arrow,
.link:focus-visible .link__arrow {
  transform: translateX(4px);
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

.footer__text {
  color: var(--text-dim);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
}

#clock {
  color: var(--accent);
  margin-left: 4px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 540px) {
  .terminal__body { padding: 22px 20px 20px; }
  .profile        { flex-direction: column; text-align: center; gap: 14px; }
  .role           { justify-content: center; }
  .link           { padding: 12px 14px; gap: 12px; }
  .profile__avatar img { width: 84px; height: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  #matrix { display: none; }
}
