/* Vortx Portfolio — Redesigned */
/* Credit: @Vortx */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

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

:root {
  --white: #ffffff;
  --white-60: rgba(255,255,255,0.6);
  --white-30: rgba(255,255,255,0.3);
  --white-10: rgba(255,255,255,0.1);
  --white-06: rgba(255,255,255,0.06);
  --accent: #7fffb0;
  --accent-dim: rgba(127,255,176,0.15);
  --glass: rgba(10,12,10,0.45);
  --glass-border: rgba(255,255,255,0.12);
  --card-hover: rgba(255,255,255,0.08);
  --radius-card: 18px;
  --radius-sm: 10px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--white);
  min-height: 100dvh;
  overflow-x: hidden;
  background: #070a07;
}

/* ─── Background ────────────────────────────────────────── */
.bg-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: saturate(0.7) brightness(0.55);
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(4,8,4,0.35) 0%,
    rgba(4,8,4,0.1) 30%,
    rgba(4,8,4,0.4) 70%,
    rgba(4,8,4,0.85) 100%
  );
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.65) 100%);
}

/* ─── Page Wrapper ──────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 48px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Topbar ────────────────────────────────────────────── */
.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  margin-bottom: 8px;
}

.topbar-left {
  display: flex;
  align-items: center;
}

.topbar-tag {
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(127,255,176,0.25);
  padding: 5px 12px;
  border-radius: 50px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--white-60);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px 7px 10px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  background: var(--white-06);
  backdrop-filter: blur(10px);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.back-btn:hover {
  color: var(--white);
  background: var(--white-10);
  border-color: var(--white-30);
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--white-06);
  border: 1px solid var(--glass-border);
  color: var(--white-60);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 16px 7px 12px;
  border-radius: 50px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.share-btn:hover {
  color: var(--white);
  background: var(--white-10);
  border-color: var(--white-30);
}

/* ─── Hero ──────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 36px;
  animation: fadeUp 0.6s ease both;
}

.hero--compact {
  padding: 8px 0 28px;
}

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

/* Avatar */
.avatar-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
}

.avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(var(--accent), #00c4ff, #7b2fff, var(--accent));
  animation: spin 4s linear infinite;
  opacity: 0.8;
}

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

.avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #070a07;
  display: block;
}

.avatar-glow {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(127,255,176,0.18) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

/* Text */
.handle {
  font-family: 'Syne', sans-serif;
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 6px;
  text-align: center;
}

.tagline {
  font-size: 14px;
  font-weight: 300;
  color: var(--white-60);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  text-align: center;
}

.credit {
  font-size: 14px;
  color: var(--white-30);
  text-align: center;
}

.heart {
  color: #ff4f6b;
}

.credit-name {
  text-decoration: none;
  font-weight: 500;
  background: linear-gradient(135deg, #7fffb0, #00c4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Links / Nav ───────────────────────────────────────── */
.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-decoration: none;
  color: var(--white);
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  animation: fadeUp 0.5s ease both;
  cursor: pointer;
}

/* Staggered animation for cards */
.link-card:nth-child(1) { animation-delay: 0.05s; }
.link-card:nth-child(2) { animation-delay: 0.10s; }
.link-card:nth-child(3) { animation-delay: 0.15s; }
.link-card:nth-child(4) { animation-delay: 0.20s; }
.link-card:nth-child(5) { animation-delay: 0.25s; }
.link-card:nth-child(6) { animation-delay: 0.30s; }

.link-card:hover {
  background: var(--card-hover);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}

.link-card:active {
  transform: scale(0.98);
}

.link-card--featured {
  border-color: rgba(127,255,176,0.22);
  background: linear-gradient(135deg, rgba(127,255,176,0.07), rgba(10,12,10,0.5));
}

.link-card--featured:hover {
  border-color: rgba(127,255,176,0.4);
  box-shadow: 0 8px 30px rgba(127,255,176,0.12);
}

/* Link Icon */
.link-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--white-10);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--white-60);
  transition: background var(--transition);
}

.link-card:hover .link-icon {
  background: var(--white-10);
  color: var(--white);
}

.link-icon svg {
  width: 20px;
  height: 20px;
}

.link-icon--emoji {
  font-size: 22px;
  color: inherit;
  border: none;
}

/* Platform-specific icon colors */
.link-card[data-platform="facebook"] .link-icon { color: #4f98e8; }
.link-card[data-platform="instagram"] .link-icon { color: #e060a0; }
.link-card[data-platform="twitter"] .link-icon   { color: #9db8c0; }
.link-card[data-platform="github"] .link-icon    { color: #ccc; }
.link-card[data-platform="projects"] .link-icon  { color: var(--accent); }
.link-card[data-platform="qr"] .link-icon        { color: #80cfff; }
.link-card[data-platform="player"] .link-icon    { color: #ff8080; }
.link-card[data-platform="tmkoc"] .link-icon     { color: #ffc060; }

/* Link text (for other.html descriptions) */
.link-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.link-desc {
  font-size: 12px;
  font-weight: 300;
  color: var(--white-30);
  letter-spacing: 0.01em;
}

/* Link Label */
.link-label {
  flex: 1;
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Link arrow */
.link-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--white-06);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white-30);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.link-card:hover .link-arrow {
  background: var(--white-10);
  color: var(--white-60);
  transform: translate(1px, -1px);
}

/* ─── Footer ────────────────────────────────────────────── */
.footer {
  margin-top: 36px;
  font-size: 12px;
  color: var(--white-30);
  letter-spacing: 0.06em;
}

/* ─── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(20, 28, 20, 0.9);
  border: 1px solid rgba(127,255,176,0.35);
  color: var(--accent);
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 10px 22px;
  border-radius: 50px;
  backdrop-filter: blur(16px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9999;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .page-wrapper {
    padding: 0 16px 40px;
  }

  .handle {
    font-size: 22px;
  }

  .link-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .link-label {
    font-size: 14px;
  }

  .link-card {
    padding: 12px 14px;
    gap: 12px;
  }
}

@media (max-width: 360px) {
  .link-arrow { display: none; }
}

/* Touch devices: disable hover lift */
@media (hover: none) {
  .link-card:hover {
    transform: none;
    box-shadow: none;
  }
  .link-card:active {
    background: var(--card-hover);
    transform: scale(0.97);
  }
}

/* Reduced motion */
@prefers-reduced-motion: reduce {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Contact Form Widget ───────────────────────────────── */

.cf-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* ── Trigger Button ── */
.cf-trigger {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(8, 12, 8, 0.75);
  border: 1px solid rgba(127, 255, 176, 0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.5),
    0 0 0 1px rgba(127,255,176,0.08),
    0 0 22px rgba(127,255,176,0.1);
  color: #7fffb0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
  flex-shrink: 0;
}

.cf-trigger:hover {
  transform: translateY(-2px);
  border-color: rgba(127,255,176,0.6);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.55),
    0 0 0 1px rgba(127,255,176,0.15),
    0 0 30px rgba(127,255,176,0.18);
}

.cf-trigger:active {
  transform: scale(0.95);
}

/* Icon swap on open */
.cf-icon-mail,
.cf-icon-close {
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

.cf-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

.cf-wrap.is-open .cf-icon-mail {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

.cf-wrap.is-open .cf-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ── Panel ── */
.cf-panel {
  width: 320px;
  background: rgba(7, 11, 7, 0.88);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow:
    0 28px 70px rgba(0,0,0,0.75),
    0 0 0 1px rgba(127,255,176,0.05),
    inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
  /* closed state */
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition:
    opacity 0.25s cubic-bezier(0.4,0,0.2,1),
    transform 0.25s cubic-bezier(0.34,1.2,0.64,1);
}

.cf-wrap.is-open .cf-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Accent top line */
.cf-panel::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(127,255,176,0.45) 50%, transparent 100%);
}

.cf-panel-inner {
  padding: 20px;
}

/* ── Header ── */
.cf-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.cf-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(127,255,176,0.1);
  border: 1px solid rgba(127,255,176,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7fffb0;
  flex-shrink: 0;
}

.cf-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}

.cf-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  margin: 0;
  font-weight: 300;
}

/* ── Form Layout ── */
/* display is controlled by JS inline style (flex or none) */
.cf-form {
  flex-direction: column;
  gap: 8px;
}

.cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cf-field {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ── Inputs ── */
.cf-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  width: 100%;
}

.cf-input::placeholder {
  color: rgba(255,255,255,0.22);
}

.cf-input:hover {
  border-color: rgba(255,255,255,0.18);
}

.cf-input:focus {
  background: rgba(255,255,255,0.07);
  border-color: rgba(127,255,176,0.5);
  box-shadow: 0 0 0 3px rgba(127,255,176,0.08);
}

.cf-input.has-error {
  border-color: rgba(255, 75, 75, 0.6);
  box-shadow: 0 0 0 3px rgba(255,75,75,0.07);
}

.cf-textarea {
  resize: none;
  min-height: 78px;
  line-height: 1.5;
}

/* Error label — display toggled by JS inline style */
.cf-field-err {
  font-size: 10px;
  color: rgba(255, 100, 100, 0.85);
  margin-top: 4px;
  padding-left: 2px;
  display: none;
  font-weight: 500;
}

/* ── Submit Button ── */
.cf-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(127,255,176,0.15), rgba(0,196,255,0.1));
  border: 1px solid rgba(127,255,176,0.35);
  color: #7fffb0;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.18s ease,
    box-shadow 0.22s ease;
  margin-top: 2px;
  position: relative;
  overflow: hidden;
}

.cf-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(127,255,176,0.25), rgba(0,196,255,0.18));
  border-color: rgba(127,255,176,0.6);
  box-shadow: 0 4px 20px rgba(127,255,176,0.15);
  transform: translateY(-1px);
}

.cf-submit:active:not(:disabled) {
  transform: scale(0.98);
}

.cf-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.cf-submit-arrow {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.cf-submit:hover:not(:disabled) .cf-submit-arrow {
  transform: translateX(3px);
}

/* Spinner */
.cf-submit-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(127,255,176,0.2);
  border-top-color: #7fffb0;
  border-radius: 50%;
  animation: cf-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.cf-submit.is-loading .cf-submit-text { opacity: 0.5; }
.cf-submit.is-loading .cf-submit-spinner { display: block; }
.cf-submit.is-loading .cf-submit-arrow { display: none; }

@keyframes cf-spin {
  to { transform: rotate(360deg); }
}

/* ── Success / Error States ── */
.cf-state {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 8px 4px;
  gap: 10px;
  /* display controlled by JS inline style */
}

.cf-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cf-state-icon--success {
  background: rgba(127,255,176,0.12);
  border: 1px solid rgba(127,255,176,0.3);
  color: #7fffb0;
}

.cf-state-icon--error {
  background: rgba(255,80,80,0.1);
  border: 1px solid rgba(255,80,80,0.3);
  color: #ff6060;
}

.cf-state-title {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.cf-state-msg {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  margin: 0;
  line-height: 1.5;
}

.cf-state-btn {
  margin-top: 6px;
  padding: 8px 20px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cf-state-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.22);
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .cf-wrap {
    bottom: 18px;
    right: 16px;
  }

  .cf-panel {
    width: calc(100vw - 32px);
  }

  .cf-row {
    grid-template-columns: 1fr;
  }
}