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

:root {
  --primary: #4F5D4A;
  --primary-dark: #2E372F;
  --primary-light: #E8ECE7;
  --secondary: #C8CFC7;
  --text: #1F1F1F;
  --text-light: #5A5A5A;
  --bg: #F5F5F3;
  --white: #ffffff;
  --shadow: 0 4px 24px rgba(47, 55, 47, 0.06);
  --shadow-lg: 0 12px 40px rgba(47, 55, 47, 0.12);
  --radius: 16px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ══════════════════════════════════
   ENTRANCE ANIMATIONS
   ══════════════════════════════════ */

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

.sidebar {
  animation: fadeInUp 0.6s ease both;
}

.content {
  animation: fadeInUp 0.6s ease 0.15s both;
}

.sidebar h1 { animation: fadeInUp 0.5s ease 0.2s both; }
.sidebar .title { animation: fadeInUp 0.5s ease 0.3s both; }
.sidebar .summary { animation: fadeInUp 0.5s ease 0.4s both; }
.sidebar .tags { animation: fadeInUp 0.5s ease 0.5s both; }
.sidebar .social-links { animation: fadeInUp 0.5s ease 0.6s both; }

/* ══════════════════════════════════
   HOMEPAGE — Split Layout
   ══════════════════════════════════ */

.layout {
  display: flex;
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem;
  gap: 2.5rem;
  align-items: stretch;
}

/* ── Sidebar ── */
.sidebar {
  width: 340px;
  flex-shrink: 0;
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  display: flex;
  align-items: flex-start;
}

.sidebar-content {
  position: sticky;
  top: 2.5rem;
}

.sidebar h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.sidebar .title {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.sidebar .summary {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 2rem;
  font-weight: 400;
}

.tags {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tag {
  display: block;
  text-align: center;
  background: var(--primary-dark);
  color: var(--white);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ── Social Links ── */
.social-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.social-link:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

.social-link svg {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px;
  max-height: 18px;
}

/* ── Copy Toast ── */
.copy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  animation: overlayFade 1.4s ease forwards;
}

.copy-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: var(--white);
  color: var(--primary-dark);
  padding: 2rem 3rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  animation: toastPop 1.4s ease forwards;
}

.copy-toast .toast-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.copy-toast .toast-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--white);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-toast .toast-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.copy-toast .toast-sub {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 400;
}

@keyframes overlayFade {
  0% { opacity: 0; }
  12% { opacity: 1; }
  65% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes toastPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  65% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.95); }
}

.copy-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--primary-light);
  background: var(--bg);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  padding: 0;
  outline: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.copy-btn:hover {
  background: var(--primary-dark);
  color: var(--white);
  border-color: var(--primary-dark);
}

button.social-link {
  border: none;
  outline: none;
  cursor: pointer;
  padding: 0;
}

/* ── Content Panel ── */
.content {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--primary-light);
  padding-bottom: 0;
}

.tab {
  background: none;
  border: none;
  padding: 0.6rem 1.1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--primary-dark);
}

.tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary-dark);
  font-weight: 600;
}

/* ── Tab Panels ── */
.tab-panel {
  display: none;
  flex: 1;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tab-panel h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 1.25rem;
}

.tab-panel p {
  color: var(--text-light);
  font-size: 0.92rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* ── Contact Items ── */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--primary-light);
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.contact-item:hover {
  background: var(--bg);
  border-color: var(--secondary);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 6px 20px rgba(47, 55, 47, 0.08);
}

.contact-item .contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-item .contact-icon.linkedin {
  background: #e8f4fd;
}

.contact-item .contact-icon.email {
  background: var(--primary-light);
}

.contact-item .contact-icon svg {
  width: 22px;
  height: 22px;
}

.contact-item strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 2px;
}

.contact-item span {
  font-size: 0.82rem;
  color: var(--text-light);
}

/* ── CV Actions ── */
.cv-actions {
  display: flex;
  gap: 0.75rem;
}

.cv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  background: var(--primary-dark);
  color: var(--white);
  border: 1.5px solid var(--primary-dark);
  z-index: 0;
  transition: color 0.35s ease, transform 0.2s, box-shadow 0.2s;
}

.cv-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(47, 55, 47, 0.15);
}

.cv-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary);
  z-index: -1;
  transition: left 0.35s ease;
}

.cv-btn:hover::before {
  left: 0;
}

.cv-btn-outline {
  background: transparent;
  color: var(--primary-dark);
}

.cv-btn-outline::before {
  background: var(--primary-dark);
}

.cv-btn-outline:hover {
  color: var(--white);
}

/* ── App Icon Image ── */
.app-icon-img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  flex-shrink: 0;
  object-fit: cover;
}

/* ── App Item ── */
.app-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--primary-light);
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.app-item:hover {
  background: var(--bg);
  border-color: var(--secondary);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 6px 20px rgba(47, 55, 47, 0.08);
}

.app-item .app-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.app-item .app-info {
  flex: 1;
}

.app-item .app-info strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.app-item .app-info span {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ── Store Badges ── */
.store-badges {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: #000;
  border: 1px solid #333;
  border-radius: 8px;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.badge-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.badge-icon {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
}

.badge-label {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.badge-label small {
  font-size: 0.48rem;
  color: #ccc;
  letter-spacing: 0.3px;
  font-weight: 400;
}

.badge-label strong {
  font-size: 0.8rem;
  color: #fff;
  font-weight: 600;
}

/* ══════════════════════════════════
   SUB-PAGES (about, contact, cv, apps)
   ══════════════════════════════════ */

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(245, 245, 243, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 0 2.5rem;
  height: 64px;
  display: flex;
  align-items: center;
}

.navbar-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-dark);
  transition: color 0.3s ease;
}

.navbar-back:hover {
  color: var(--primary);
}

.navbar-back .back-arrow {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.navbar-back:hover .back-arrow {
  transform: translateX(-3px);
}

/* ── Page Header ── */
.page-header {
  padding: 130px 2rem 60px;
  text-align: center;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 50%, #5E6E58 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}

.page-header h1 {
  position: relative;
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  z-index: 1;
}

.page-header p {
  position: relative;
  opacity: 0.8;
  font-size: 1.05rem;
  font-weight: 300;
  z-index: 1;
}

/* ── Content Section (sub-pages) ── */
.content-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 3.5rem 2rem 5rem;
  flex: 1;
}

.content-section p {
  color: var(--text-light);
  margin-bottom: 1.25rem;
  line-height: 1.9;
  font-size: 1.05rem;
}

/* ── Sub-page contact cards ── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.contact-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.25rem 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.contact-card .contact-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.contact-card .contact-icon.linkedin {
  background: #e8f4fd;
}

.contact-card .contact-icon.email {
  background: var(--primary-light);
}

.contact-card .contact-icon svg {
  width: 28px;
  height: 28px;
}

.contact-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.4rem;
}

.contact-card .contact-value {
  color: var(--text-light);
  font-size: 0.88rem;
}

/* ── Sub-page app cards ── */
.apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.app-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.app-card .app-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.app-card .app-info { flex: 1; }

.app-card .app-info h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.4rem;
}

.app-card .app-info p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0;
}

.app-card .app-arrow {
  font-size: 1.2rem;
  color: var(--secondary);
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
}

.app-card:hover .app-arrow {
  transform: translateX(4px);
  color: var(--primary);
}

/* ── Footer (sub-pages) ── */
.footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
  font-weight: 300;
}

/* ══════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════ */

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
    min-height: auto;
  }

  .sidebar {
    width: 100%;
    padding: 2rem 1.75rem;
    text-align: center;
  }

  .sidebar-content {
    position: static;
  }

  .sidebar .summary {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }

  .tags {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .sidebar h1 {
    font-size: 1.6rem;
  }

  .content {
    padding: 1.75rem;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }

  .store-badges {
    flex-wrap: wrap;
  }

  .cv-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 110px 1.5rem 50px;
  }

  .page-header h1 {
    font-size: 1.8rem;
  }

  .content-section {
    padding: 2.5rem 1.5rem 3.5rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .app-card {
    padding: 1.5rem;
    gap: 1rem;
  }

  .app-card .app-icon {
    width: 60px;
    height: 60px;
  }
}

/* ── Small phones ── */
@media (max-width: 600px) {
  .layout {
    padding: 1rem;
    gap: 1rem;
  }

  .sidebar {
    padding: 1.75rem 1.25rem;
  }

  .sidebar h1 {
    font-size: 1.4rem;
  }

  .sidebar .title {
    font-size: 0.85rem;
  }

  .sidebar .summary {
    font-size: 0.82rem;
    margin-bottom: 1.5rem;
  }

  .tag {
    font-size: 0.7rem;
    padding: 5px 12px;
  }

  .social-link {
    width: 36px;
    height: 36px;
  }

  .social-link svg {
    width: 16px !important;
    height: 16px !important;
  }

  .content {
    padding: 1.25rem;
  }

  .tab {
    font-size: 0.75rem;
    padding: 0.45rem 0.6rem;
  }

  .tab-panel h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .tab-panel p {
    font-size: 0.85rem;
    line-height: 1.7;
  }

  .contact-item {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .contact-item .contact-icon {
    width: 38px;
    height: 38px;
  }

  .contact-item .contact-icon svg {
    width: 18px;
    height: 18px;
  }

  .contact-item strong {
    font-size: 0.82rem;
  }

  .contact-item span {
    font-size: 0.75rem;
  }

  .cv-actions {
    flex-direction: column;
  }

  .cv-btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.85rem;
    justify-content: center;
  }

  .app-item {
    padding: 1rem;
    gap: 1rem;
  }

  .app-icon-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .app-item .app-info strong {
    font-size: 0.88rem;
  }

  .app-item .app-info span {
    font-size: 0.78rem;
  }

  .badge-btn {
    padding: 6px 12px;
  }

  .badge-label strong {
    font-size: 0.72rem;
  }

  .badge-label small {
    font-size: 0.42rem;
  }

  .copy-toast {
    padding: 1.5rem 2rem;
    width: calc(100% - 3rem);
    max-width: 300px;
  }

  .copy-toast .toast-icon {
    width: 40px;
    height: 40px;
  }

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

  .copy-toast .toast-title {
    font-size: 1rem;
  }

  .copy-toast .toast-sub {
    font-size: 0.72rem;
  }
}

/* ── Extra small phones ── */
@media (max-width: 380px) {
  .layout {
    padding: 0.75rem;
  }

  .sidebar {
    padding: 1.5rem 1rem;
  }

  .sidebar h1 {
    font-size: 1.25rem;
  }

  .content {
    padding: 1rem;
  }

  .tabs {
    gap: 0;
  }

  .tab {
    font-size: 0.7rem;
    padding: 0.4rem 0.5rem;
  }

  .store-badges {
    flex-direction: column;
  }

  .badge-btn {
    justify-content: center;
  }
}
