/* ======================================================
   PORTO — Monochrome Portfolio
   Design System & Stylesheet
   ====================================================== */

/* --- Theme Variables --- */
[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-secondary: #111111;
  --fg: #e8e8e8;
  --fg-secondary: #888888;
  --fg-muted: #555555;
  --border: #222222;
  --card-bg: #111111;
  --card-hover: #181818;
  --nav-bg: rgba(10, 10, 10, 0.88);
  --badge-bg: #222222;
  --badge-fg: #aaaaaa;
  --btn-bg: #e8e8e8;
  --btn-fg: #0a0a0a;
  --btn-outline-border: #444444;
  --btn-outline-fg: #e8e8e8;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-secondary: #f7f7f7;
  --fg: #111111;
  --fg-secondary: #555555;
  --fg-muted: #999999;
  --border: #e0e0e0;
  --card-bg: #ffffff;
  --card-hover: #fafafa;
  --nav-bg: rgba(255, 255, 255, 0.88);
  --badge-bg: #f0f0f0;
  --badge-fg: #555555;
  --btn-bg: #111111;
  --btn-fg: #ffffff;
  --btn-outline-border: #cccccc;
  --btn-outline-fg: #111111;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background-color: var(--bg);
  transition: background-color 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--fg);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.7;
}

img {
  display: block;
  max-width: 100%;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 88px 0;
}

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.nav-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-dot {
  color: var(--fg-muted);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
  margin-left: auto;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.nav-link:hover {
  background: var(--bg-secondary);
  opacity: 1;
}

.nav-link.active {
  background: var(--bg-secondary);
  opacity: 1;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
  flex-shrink: 0;
}

/* Theme Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.3s ease;
}

.theme-toggle:hover {
  background: var(--bg-secondary);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-icon {
  display: inline-block;
  transition: transform 0.4s ease;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  padding: 10px;
  transition: background 0.2s ease;
}

.hamburger:hover {
  background: var(--bg-secondary);
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Hero --- */
.hero-section {
  padding-top: 120px;
  padding-bottom: 88px;
}

.hero-grid {
  display: flex;
  align-items: center;
  gap: 56px;
}

.hero-avatar {
  flex-shrink: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
}

.hero-avatar img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  opacity: 1;
  transition: border-color 0.35s ease, filter 0.4s ease, transform 0.4s ease;
  will-change: transform;
}

.hero-avatar img:hover {
  transform: scale(1.08);
  filter: brightness(1.05);
}

.hero-greeting {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.hero-name {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 8px;
}

.hero-title {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--fg-secondary);
  margin-bottom: 20px;
}

.hero-bio {
  font-size: 0.975rem;
  color: var(--fg-secondary);
  max-width: 440px;
  line-height: 1.7;
  margin-bottom: 28px;
}

.hero-cta {
  display: flex;
  gap: 12px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--btn-outline-border);
  color: var(--btn-outline-fg);
}

.btn-outline:hover {
  background: var(--bg-secondary);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--btn-outline-border);
  color: var(--btn-outline-fg);
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-sm:hover {
  background: var(--bg-secondary);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

/* --- Section Titles --- */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--fg-secondary);
  margin-bottom: 40px;
}

.subsection-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--fg-muted);
  margin-bottom: 16px;
  margin-top: 40px;
}

.subsection-title:first-of-type {
  margin-top: 0;
}

/* --- Cards --- */
.cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

/* Hide cards beyond the 5th when not expanded */
.cards:not(.expanded) .card:nth-child(n+6) {
  display: none;
}

.view-more-btn {
  margin-top: 16px;
  text-align: center;
}

.view-more-btn button {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--fg);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.35s ease, transform 0.2s ease;
}

.view-more-btn button:hover {
  background: var(--card-hover);
  transform: translateY(-1px);
}

.view-more-btn button:active {
  transform: translateY(0);
}

.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  transition: background 0.2s ease, border-color 0.35s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.card:hover {
  background: var(--card-hover);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.card-header::-webkit-details-marker {
  display: none;
}

.card-header::marker {
  display: none;
  content: '';
}

.card-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.card-role {
  font-size: 0.82rem;
  color: var(--fg-secondary);
  margin-top: 2px;
}

.card-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.card-chevron::before {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--fg-muted);
  border-bottom: 2px solid var(--fg-muted);
  transform: rotate(-45deg);
  transition: transform 0.3s ease, border-color 0.35s ease;
}

details[open]>.card-header .card-chevron::before {
  transform: rotate(45deg);
}

.card-body {
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
}

details[open]>.card-body {
  max-height: none;
  opacity: 1;
}

.card-body-inner {
  padding: 0 20px 20px 84px;
  font-size: 0.9rem;
  color: var(--fg-secondary);
  line-height: 1.65;
}

.card-body-inner p + p {
  margin-top: 12px;
}

.card-history .card-body-inner {
  padding-left: 20px;
}

.card-date {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-date-inline {
  font-size: 0.78rem;
  color: var(--fg-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Tabs --- */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  background: var(--bg-secondary);
  width: fit-content;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.tab-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.tab-btn:hover {
  color: var(--fg);
}

.tab-btn.active {
  background: var(--card-bg);
  color: var(--fg);
  box-shadow: var(--shadow);
}

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

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

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

/* --- Badges --- */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge--completed {
  background: var(--fg);
  color: var(--bg);
}

.badge--in-progress {
  background: transparent;
  border: 1.5px solid var(--fg);
  color: var(--fg);
}

.badge--under-dev {
  background: var(--badge-bg);
  color: var(--badge-fg);
  border: 1.5px solid var(--border);
}

.badge--on-hold {
  background: transparent;
  border: 1.5px dashed var(--fg-muted);
  color: var(--fg-muted);
}

.badge--canceled {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--fg-muted);
  text-decoration: line-through;
}

/* --- Contacts --- */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.contact-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: border-color 0.35s ease;
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-muted);
  display: block;
  margin-bottom: 2px;
}

.contact-list li a,
.contact-list li span:not(.contact-icon):not(.contact-label) {
  font-size: 0.9rem;
}

.contact-cta {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  background: var(--bg-secondary);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.contact-cta h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.contact-cta p {
  font-size: 0.9rem;
  color: var(--fg-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  transition: border-color 0.35s ease;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.footer-contact {
  color: var(--fg-muted);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero-section {
    padding-top: 96px;
  }

  .hero-grid {
    flex-direction: column;
    text-align: center;
    gap: 32px;
  }

  .hero-avatar img {
    width: 160px;
    height: 160px;
  }

  .hero-name {
    font-size: 2.25rem;
  }

  .hero-bio {
    max-width: 100%;
  }

  .hero-cta {
    justify-content: center;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px;
    gap: 2px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding: 10px 14px;
  }

  .hamburger {
    display: flex;
  }

  .nav-actions {
    margin-left: auto;
  }

  .contacts-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .card-body-inner {
    padding-left: 20px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 64px 0;
  }

  .container {
    padding: 0 16px;
  }

  .hero-name {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

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

  .card-thumb {
    width: 40px;
    height: 40px;
  }

  .card-info h3 {
    font-size: 0.88rem;
  }

  .btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .badge {
    font-size: 0.65rem;
    padding: 2px 8px;
  }

  .card-date-inline {
    display: none;
  }
}