/* ═══════════════════════════════════════════
   LUISFERPALO — Portfolio Stylesheet
   Ultra-minimalist · Cargo-inspired
   ═══════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --white:        #ffffff;
  --white-60:     rgba(255,255,255,0.60);
  --white-30:     rgba(255,255,255,0.28);
  --white-10:     rgba(255,255,255,0.10);
  --black:        #000000;
  --tag-bg:       rgba(255,255,255,0.13);
  --tag-border:   rgba(255,255,255,0.22);
  --tag-hover:    rgba(255,255,255,0.24);
  --radius-pill:  100px;
  --radius-sm:    6px;
  --font-mono:    'DM Mono', monospace;
  --font-sans:    'DM Sans', sans-serif;
  --transition-fade: 1000ms cubic-bezier(0.4, 0, 0.2, 1);
  --panel-delay-l: 0.15s;
  --panel-delay-c: 0.05s;
  --panel-delay-r: 0.25s;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  background: #1a1a1a;
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* ── Background Layers ── */
.bg-layer {
  position: fixed;
  inset: -60px;           /* overshoot to hide blur edges */
  background-size: cover;
  background-position: center;
  filter: blur(50px) saturate(1.4) brightness(0.55);
  transition: opacity var(--transition-fade);
  will-change: opacity;
  z-index: 0;
}

#bg-a { opacity: 1; }
#bg-b { opacity: 0; }

/* ── Layout ── */
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: 100dvh;
  align-items: center;
  width: 100%;
  height: 100dvh;
  padding: 0 3vw;
  gap: 0;
}

/* ── Panels ── */
.panel {
  display: flex;
  align-items: center;
  height: 100%;
  opacity: 0;
  transform: translateY(18px);
  animation: panelIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.panel--left  { justify-content: flex-start; animation-delay: var(--panel-delay-l); }
.panel--center{ justify-content: center;     animation-delay: var(--panel-delay-c); grid-column: 2; }
.panel--right { justify-content: flex-end;   animation-delay: var(--panel-delay-r); }

@keyframes panelIn {
  to { opacity: 1; transform: translateY(0); }
}

.panel__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.panel__inner--right {
  align-items: flex-end;
}

/* ── Tag Groups ── */
.tag-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.tag-group--alt {
  padding-left: 2px;
}

.tag-connector {
  font-family: var(--font-sans);
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 200;
  letter-spacing: 0.04em;
  color: var(--white-60);
  white-space: nowrap;
}

/* ── Tags / Pills ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px 5px 14px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.05vw, 13px);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--white);
  white-space: nowrap;
  text-decoration: none;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease,
    color 0.22s ease;
  cursor: default;
}

.tag--name   { font-weight: 400; letter-spacing: 0.01em; }
.tag--alias  { font-weight: 400; color: var(--white); font-size: clamp(10px, 0.95vw, 12px); }
.tag--full   { font-weight: 400; }

.tag--contact {
  cursor: pointer;
  color: var(--white);
  font-size: clamp(10px, 0.95vw, 12px);
}

.tag--contact:hover {
  background: var(--tag-hover);
  border-color: rgba(255,255,255,0.42);
  color: var(--white);
  transform: translateX(-3px);
}

.contact-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.panel--left .tag:hover {
  transform: translateX(3px);
}

/* ── Center Image Frame ── */
.image-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-wrap {
  position: relative;
  width: clamp(220px, 28vw, 440px);
  aspect-ratio: 3 / 4;
  border-radius: 3px;
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.40),
    0 0 0 1px rgba(255,255,255,0.08);
}

/* ── Crossfade image slots ── */
.img-slot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity var(--transition-fade);
  will-change: opacity;
}

.img-a { opacity: 1; z-index: 1; }
.img-b { opacity: 0; z-index: 2; }


/* ══════════════════════════════════════
   RESPONSIVE — Mobile First
   ══════════════════════════════════════ */

@media (max-width: 768px) {
  html, body {
    overflow: auto;
    height: auto;
  }

  body {
    min-height: 100dvh;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    min-height: 100dvh;
    padding: 48px 24px 56px;
    gap: 32px;
    justify-items: center;
    align-items: start;
  }

  .panel {
    height: auto;
    width: 100%;
    justify-content: center;
    animation-delay: 0s !important;
  }

  .panel--left  { order: 2; }
  .panel--center{ order: 1; grid-column: 1; }
  .panel--right { order: 3; }

  .panel__inner,
  .panel__inner--right {
    align-items: center;
    width: 100%;
  }

  .tag-group {
    justify-content: center;
    flex-wrap: wrap;
  }

  .contact-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .image-wrap {
    width: min(76vw, 320px);
  }

  .tag--contact:hover {
    transform: none;
  }

  .panel--left .tag:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  .image-wrap {
    width: 85vw;
  }

  .layout {
    padding: 36px 20px 48px;
    gap: 28px;
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .panel { animation: none; opacity: 1; transform: none; }
  .bg-layer, .img-slot { transition: none; }
}
